diff --git a/soul-admin/dist/assets/index-Cnf4LXuY.css b/soul-admin/dist/assets/index-Cnf4LXuY.css deleted file mode 100644 index 5ca8f3a4..00000000 --- a/soul-admin/dist/assets/index-Cnf4LXuY.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-auto{margin-inline:auto}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[70vh\]{height:70vh}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[200px\]{max-height:200px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#38bdac\]\/50{color:#38bdac80}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400)50%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400)50%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/assets/index-V947pMyG.js b/soul-admin/dist/assets/index-V947pMyG.js deleted file mode 100644 index 1a1279b6..00000000 --- a/soul-admin/dist/assets/index-V947pMyG.js +++ /dev/null @@ -1,495 +0,0 @@ -function cv(s,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(s,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 d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&o(h)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Nx(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var hd={exports:{}},al={},fd={exports:{}},Ye={};/** - * @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 um;function dv(){if(um)return Ye;um=1;var s=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"),d=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,S={};function b(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}b.prototype.isReactComponent={},b.prototype.setState=function(M,O){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,O,"setState")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=b.prototype;function E(M,O,F){this.props=M,this.context=O,this.refs=S,this.updater=F||P}var j=E.prototype=new N;j.constructor=E,T(j,b.prototype),j.isPureReactComponent=!0;var R=Array.isArray,B=Object.prototype.hasOwnProperty,U={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function L(M,O,F){var X,H={},ue=null,K=null;if(O!=null)for(X in O.ref!==void 0&&(K=O.ref),O.key!==void 0&&(ue=""+O.key),O)B.call(O,X)&&!k.hasOwnProperty(X)&&(H[X]=O[X]);var ye=arguments.length-2;if(ye===1)H.children=F;else if(1>>1,O=A[M];if(0>>1;Mc(H,W))uec(K,H)?(A[M]=K,A[ue]=W,M=ue):(A[M]=H,A[X]=W,M=X);else if(uec(K,W))A[M]=K,A[ue]=W,M=ue;else break e}}return ne}function c(A,ne){var W=A.sortIndex-ne.sortIndex;return W!==0?W:A.id-ne.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();s.unstable_now=function(){return h.now()-m}}var p=[],y=[],g=1,v=null,C=3,P=!1,T=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,N=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 j(A){for(var ne=l(y);ne!==null;){if(ne.callback===null)o(y);else if(ne.startTime<=A)o(y),ne.sortIndex=ne.expirationTime,a(p,ne);else break;ne=l(y)}}function R(A){if(S=!1,j(A),!T)if(l(p)!==null)T=!0,ce(B);else{var ne=l(y);ne!==null&&re(R,ne.startTime-A)}}function B(A,ne){T=!1,S&&(S=!1,N(L),L=-1),P=!0;var W=C;try{for(j(ne),v=l(p);v!==null&&(!(v.expirationTime>ne)||A&&!le());){var M=v.callback;if(typeof M=="function"){v.callback=null,C=v.priorityLevel;var O=M(v.expirationTime<=ne);ne=s.unstable_now(),typeof O=="function"?v.callback=O:v===l(p)&&o(p),j(ne)}else o(p);v=l(p)}if(v!==null)var F=!0;else{var X=l(y);X!==null&&re(R,X.startTime-ne),F=!1}return F}finally{v=null,C=W,P=!1}}var U=!1,k=null,L=-1,_=5,se=-1;function le(){return!(s.unstable_now()-se<_)}function ie(){if(k!==null){var A=s.unstable_now();se=A;var ne=!0;try{ne=k(!0,A)}finally{ne?ee():(U=!1,k=null)}}else U=!1}var ee;if(typeof E=="function")ee=function(){E(ie)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,Q=G.port2;G.port1.onmessage=ie,ee=function(){Q.postMessage(null)}}else ee=function(){b(ie,0)};function ce(A){k=A,U||(U=!0,ee())}function re(A,ne){L=b(function(){A(s.unstable_now())},ne)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(A){A.callback=null},s.unstable_continueExecution=function(){T||P||(T=!0,ce(B))},s.unstable_forceFrameRate=function(A){0>A||125M?(A.sortIndex=W,a(y,A),l(p)===null&&A===l(y)&&(S?(N(L),L=-1):S=!0,re(R,W-M))):(A.sortIndex=O,a(p,A),T||P||(T=!0,ce(B))),A},s.unstable_shouldYield=le,s.unstable_wrapCallback=function(A){var ne=C;return function(){var W=C;C=ne;try{return A.apply(this,arguments)}finally{C=W}}}})(pd)),pd}var pm;function mv(){return pm||(pm=1,xd.exports=fv()),xd.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 gm;function xv(){if(gm)return lr;gm=1;var s=au(),a=mv();function l(t){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},v={};function C(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,r,n,i){if(n!==null&&n.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function T(t,r,n,i){if(r===null||typeof r>"u"||P(t,r,n,i))return!0;if(i)return!1;if(n!==null)switch(n.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 S(t,r,n,i,u,x,w){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=r,this.sanitizeURL=x,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new S(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var r=t[0];b[r]=new S(r,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new S(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new S(t,2,!1,t,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(t){b[t]=new S(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new S(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new S(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new S(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new S(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(t){return t[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(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var r=t.replace(N,E);b[r]=new S(r,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,r,n,i){var u=b.hasOwnProperty(r)?b[r]:null;(u!==null?u.type!==0:i||!(2I||u[w]!==x[I]){var $=` -`+u[w].replace(" at new "," at ");return t.displayName&&$.includes("")&&($=$.replace("",t.displayName)),$}while(1<=w&&0<=I);break}}}finally{F=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?O(t):""}function H(t){switch(t.tag){case 5:return O(t.type);case 16:return O("Lazy");case 13:return O("Suspense");case 19:return O("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function ue(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case U:return"Portal";case _:return"Profiler";case L:return"StrictMode";case ee:return"Suspense";case G:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case le:return(t.displayName||"Context")+".Consumer";case se:return(t._context.displayName||"Context")+".Provider";case ie:var r=t.render;return t=t.displayName,t||(t=r.displayName||r.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return r=t.displayName||null,r!==null?r:ue(t.type)||"Memo";case ce:r=t._payload,t=t._init;try{return ue(t(r))}catch{}}return null}function K(t){var r=t.type;switch(t.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 t=r.render,t=t.displayName||t.name||"",r.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(r);case 8:return r===L?"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(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ge(t){var r=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function D(t){var r=ge(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,r),i=""+t[r];if(!t.hasOwnProperty(r)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,r,{configurable:!0,get:function(){return u.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,r,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[r]}}}}function fe(t){t._valueTracker||(t._valueTracker=D(t))}function Se(t){if(!t)return!1;var r=t._valueTracker;if(!r)return!0;var n=r.getValue(),i="";return t&&(i=ge(t)?t.checked?"true":"false":t.value),t=i,t!==n?(r.setValue(t),!0):!1}function ze(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function We(t,r){var n=r.checked;return W({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function qe(t,r){var n=r.defaultValue==null?"":r.defaultValue,i=r.checked!=null?r.checked:r.defaultChecked;n=ye(r.value!=null?r.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function Ze(t,r){r=r.checked,r!=null&&j(t,"checked",r,!1)}function st(t,r){Ze(t,r);var n=ye(r.value),i=r.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}r.hasOwnProperty("value")?nt(t,r.type,n):r.hasOwnProperty("defaultValue")&&nt(t,r.type,ye(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(t.defaultChecked=!!r.defaultChecked)}function ft(t,r,n){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=""+t._wrapperState.initialValue,n||r===t.value||(t.value=r),t.defaultValue=r}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function nt(t,r,n){(r!=="number"||ze(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Vt=Array.isArray;function Fr(t,r,n,i){if(t=t.options,r){r={};for(var u=0;u"+r.valueOf().toString()+"",r=Qe.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;r.firstChild;)t.appendChild(r.firstChild)}});function dr(t,r){if(r){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=r;return}}t.textContent=r}var zr={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},Ro=["Webkit","ms","Moz","O"];Object.keys(zr).forEach(function(t){Ro.forEach(function(r){r=r+t.charAt(0).toUpperCase()+t.substring(1),zr[r]=zr[t]})});function Nl(t,r,n){return r==null||typeof r=="boolean"||r===""?"":n||typeof r!="number"||r===0||zr.hasOwnProperty(t)&&zr[t]?(""+r).trim():r+"px"}function ga(t,r){t=t.style;for(var n in r)if(r.hasOwnProperty(n)){var i=n.indexOf("--")===0,u=Nl(n,r[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var Io=W({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 ya(t,r){if(r){if(Io[t]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(l(137,t));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 va(t,r){if(t.indexOf("-")===-1)return typeof r.is=="string";switch(t){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 ja=null;function ba(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Na=null,ys=null,vs=null;function wl(t){if(t=Wa(t)){if(typeof Na!="function")throw Error(l(280));var r=t.stateNode;r&&(r=ql(r),Na(t.stateNode,t.type,r))}}function Sl(t){ys?vs?vs.push(t):vs=[t]:ys=t}function Cl(){if(ys){var t=ys,r=vs;if(vs=ys=null,wl(t),r)for(t=0;t>>=0,t===0?32:31-(C0(t)/k0|0)|0}var _l=64,Ml=4194304;function ka(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Al(t,r){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,x=t.pingedLanes,w=n&268435455;if(w!==0){var I=w&~u;I!==0?i=ka(I):(x&=w,x!==0&&(i=ka(x)))}else w=n&~u,w!==0?i=ka(w):x!==0&&(i=ka(x));if(i===0)return 0;if(r!==0&&r!==i&&(r&u)===0&&(u=i&-i,x=r&-r,u>=x||u===16&&(x&4194240)!==0))return r;if((i&4)!==0&&(i|=n&16),r=t.entangledLanes,r!==0)for(t=t.entanglements,r&=i;0n;n++)r.push(t);return r}function Ea(t,r,n){t.pendingLanes|=r,r!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,r=31-kr(r),t[r]=n}function R0(t,r){var n=t.pendingLanes&~r;t.pendingLanes=r,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=r,t.mutableReadLanes&=r,t.entangledLanes&=r,r=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Da),sh=" ",nh=!1;function ah(t,r){switch(t){case"keyup":return ny.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Rn=!1;function ly(t,r){switch(t){case"compositionend":return lh(r);case"keypress":return r.which!==32?null:(nh=!0,sh);case"textInput":return t=r.data,t===sh&&nh?null:t;default:return null}}function iy(t,r){if(Rn)return t==="compositionend"||!Ko&&ah(t,r)?(t=Xu(),zl=$o=ks=null,Rn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1=r)return{node:n,offset:r-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fh(n)}}function xh(t,r){return t&&r?t===r?!0:t&&t.nodeType===3?!1:r&&r.nodeType===3?xh(t,r.parentNode):"contains"in t?t.contains(r):t.compareDocumentPosition?!!(t.compareDocumentPosition(r)&16):!1:!1}function ph(){for(var t=window,r=ze();r instanceof t.HTMLIFrameElement;){try{var n=typeof r.contentWindow.location.href=="string"}catch{n=!1}if(n)t=r.contentWindow;else break;r=ze(t.document)}return r}function Qo(t){var r=t&&t.nodeName&&t.nodeName.toLowerCase();return r&&(r==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||r==="textarea"||t.contentEditable==="true")}function py(t){var r=ph(),n=t.focusedElem,i=t.selectionRange;if(r!==n&&n&&n.ownerDocument&&xh(n.ownerDocument.documentElement,n)){if(i!==null&&Qo(n)){if(r=i.start,t=i.end,t===void 0&&(t=r),"selectionStart"in n)n.selectionStart=r,n.selectionEnd=Math.min(t,n.value.length);else if(t=(r=n.ownerDocument||document)&&r.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=mh(n,x);var w=mh(n,i);u&&w&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==w.node||t.focusOffset!==w.offset)&&(r=r.createRange(),r.setStart(u.node,u.offset),t.removeAllRanges(),x>i?(t.addRange(r),t.extend(w.node,w.offset)):(r.setEnd(w.node,w.offset),t.addRange(r)))}}for(r=[],t=n;t=t.parentNode;)t.nodeType===1&&r.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,In=null,qo=null,za=null,Xo=!1;function gh(t,r,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xo||In==null||In!==ze(i)||(i=In,"selectionStart"in i&&Qo(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}),za&&Fa(za,i)||(za=i,i=Yl(qo,"onSelect"),0Ln||(t.current=cc[Ln],cc[Ln]=null,Ln--)}function lt(t,r){Ln++,cc[Ln]=t.current,t.current=r}var Rs={},Wt=Ts(Rs),tr=Ts(!1),an=Rs;function On(t,r){var n=t.type.contextTypes;if(!n)return Rs;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===r)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=r[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=r,t.__reactInternalMemoizedMaskedChildContext=u),u}function rr(t){return t=t.childContextTypes,t!=null}function Xl(){ct(tr),ct(Wt)}function _h(t,r,n){if(Wt.current!==Rs)throw Error(l(168));lt(Wt,r),lt(tr,n)}function Mh(t,r,n){var i=t.stateNode;if(r=r.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in r))throw Error(l(108,K(t)||"Unknown",u));return W({},n,i)}function Jl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Rs,an=Wt.current,lt(Wt,t),lt(tr,tr.current),!0}function Ah(t,r,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Mh(t,r,an),i.__reactInternalMemoizedMergedChildContext=t,ct(tr),ct(Wt),lt(Wt,t)):ct(tr),lt(tr,n)}var es=null,Zl=!1,dc=!1;function Dh(t){es===null?es=[t]:es.push(t)}function Py(t){Zl=!0,Dh(t)}function Is(){if(!dc&&es!==null){dc=!0;var t=0,r=rt;try{var n=es;for(rt=1;t>=w,u-=w,ts=1<<32-kr(r)+u|n<Le?(Ot=De,De=null):Ot=De.sibling;var Je=he(Y,De,q[Le],ve);if(Je===null){De===null&&(De=Ot);break}t&&De&&Je.alternate===null&&r(Y,De),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je,De=Ot}if(Le===q.length)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;LeLe?(Ot=De,De=null):Ot=De.sibling;var $s=he(Y,De,Je.value,ve);if($s===null){De===null&&(De=Ot);break}t&&De&&$s.alternate===null&&r(Y,De),V=x($s,V,Le),Ae===null?Me=$s:Ae.sibling=$s,Ae=$s,De=Ot}if(Je.done)return n(Y,De),ut&&on(Y,Le),Me;if(De===null){for(;!Je.done;Le++,Je=q.next())Je=xe(Y,Je.value,ve),Je!==null&&(V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return ut&&on(Y,Le),Me}for(De=i(Y,De);!Je.done;Le++,Je=q.next())Je=Ce(De,Y,Le,Je.value,ve),Je!==null&&(t&&Je.alternate!==null&&De.delete(Je.key===null?Le:Je.key),V=x(Je,V,Le),Ae===null?Me=Je:Ae.sibling=Je,Ae=Je);return t&&De.forEach(function(ov){return r(Y,ov)}),ut&&on(Y,Le),Me}function bt(Y,V,q,ve){if(typeof q=="object"&&q!==null&&q.type===k&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case B:e:{for(var Me=q.key,Ae=V;Ae!==null;){if(Ae.key===Me){if(Me=q.type,Me===k){if(Ae.tag===7){n(Y,Ae.sibling),V=u(Ae,q.props.children),V.return=Y,Y=V;break e}}else if(Ae.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===ce&&Bh(Me)===Ae.type){n(Y,Ae.sibling),V=u(Ae,q.props),V.ref=Ha(Y,Ae,q),V.return=Y,Y=V;break e}n(Y,Ae);break}else r(Y,Ae);Ae=Ae.sibling}q.type===k?(V=pn(q.props.children,Y.mode,ve,q.key),V.return=Y,Y=V):(ve=Ei(q.type,q.key,q.props,null,Y.mode,ve),ve.ref=Ha(Y,V,q),ve.return=Y,Y=ve)}return w(Y);case U:e:{for(Ae=q.key;V!==null;){if(V.key===Ae)if(V.tag===4&&V.stateNode.containerInfo===q.containerInfo&&V.stateNode.implementation===q.implementation){n(Y,V.sibling),V=u(V,q.children||[]),V.return=Y,Y=V;break e}else{n(Y,V);break}else r(Y,V);V=V.sibling}V=id(q,Y.mode,ve),V.return=Y,Y=V}return w(Y);case ce:return Ae=q._init,bt(Y,V,Ae(q._payload),ve)}if(Vt(q))return Te(Y,V,q,ve);if(ne(q))return _e(Y,V,q,ve);si(Y,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,V!==null&&V.tag===6?(n(Y,V.sibling),V=u(V,q),V.return=Y,Y=V):(n(Y,V),V=ld(q,Y.mode,ve),V.return=Y,Y=V),w(Y)):n(Y,V)}return bt}var Bn=Uh(!0),Vh=Uh(!1),ni=Ts(null),ai=null,Un=null,pc=null;function gc(){pc=Un=ai=null}function yc(t){var r=ni.current;ct(ni),t._currentValue=r}function vc(t,r,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&r)!==r?(t.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),t===n)break;t=t.return}}function Vn(t,r){ai=t,pc=Un=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&r)!==0&&(sr=!0),t.firstContext=null)}function jr(t){var r=t._currentValue;if(pc!==t)if(t={context:t,memoizedValue:r,next:null},Un===null){if(ai===null)throw Error(l(308));Un=t,ai.dependencies={lanes:0,firstContext:t}}else Un=Un.next=t;return r}var cn=null;function jc(t){cn===null?cn=[t]:cn.push(t)}function Wh(t,r,n,i){var u=r.interleaved;return u===null?(n.next=n,jc(r)):(n.next=u.next,u.next=n),r.interleaved=n,ss(t,i)}function ss(t,r){t.lanes|=r;var n=t.alternate;for(n!==null&&(n.lanes|=r),n=t,t=t.return;t!==null;)t.childLanes|=r,n=t.alternate,n!==null&&(n.childLanes|=r),n=t,t=t.return;return n.tag===3?n.stateNode:null}var _s=!1;function bc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Hh(t,r){t=t.updateQueue,r.updateQueue===t&&(r.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ns(t,r){return{eventTime:t,lane:r,tag:0,payload:null,callback:null,next:null}}function Ms(t,r,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Xe&2)!==0){var u=i.pending;return u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r,ss(t,n)}return u=i.interleaved,u===null?(r.next=r,jc(i)):(r.next=u.next,u.next=r),i.interleaved=r,ss(t,n)}function li(t,r,n){if(r=r.updateQueue,r!==null&&(r=r.shared,(n&4194240)!==0)){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}function Kh(t,r){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var w={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?u=x=w:x=x.next=w,n=n.next}while(n!==null);x===null?u=x=r:x=x.next=r}else u=x=r;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=r:t.next=r,n.lastBaseUpdate=r}function ii(t,r,n,i){var u=t.updateQueue;_s=!1;var x=u.firstBaseUpdate,w=u.lastBaseUpdate,I=u.shared.pending;if(I!==null){u.shared.pending=null;var $=I,J=$.next;$.next=null,w===null?x=J:w.next=J,w=$;var me=t.alternate;me!==null&&(me=me.updateQueue,I=me.lastBaseUpdate,I!==w&&(I===null?me.firstBaseUpdate=J:I.next=J,me.lastBaseUpdate=$))}if(x!==null){var xe=u.baseState;w=0,me=J=$=null,I=x;do{var he=I.lane,Ce=I.eventTime;if((i&he)===he){me!==null&&(me=me.next={eventTime:Ce,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Te=t,_e=I;switch(he=r,Ce=n,_e.tag){case 1:if(Te=_e.payload,typeof Te=="function"){xe=Te.call(Ce,xe,he);break e}xe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=_e.payload,he=typeof Te=="function"?Te.call(Ce,xe,he):Te,he==null)break e;xe=W({},xe,he);break e;case 2:_s=!0}}I.callback!==null&&I.lane!==0&&(t.flags|=64,he=u.effects,he===null?u.effects=[I]:he.push(I))}else Ce={eventTime:Ce,lane:he,tag:I.tag,payload:I.payload,callback:I.callback,next:null},me===null?(J=me=Ce,$=xe):me=me.next=Ce,w|=he;if(I=I.next,I===null){if(I=u.shared.pending,I===null)break;he=I,I=he.next,he.next=null,u.lastBaseUpdate=he,u.shared.pending=null}}while(!0);if(me===null&&($=xe),u.baseState=$,u.firstBaseUpdate=J,u.lastBaseUpdate=me,r=u.shared.interleaved,r!==null){u=r;do w|=u.lane,u=u.next;while(u!==r)}else x===null&&(u.shared.lanes=0);hn|=w,t.lanes=w,t.memoizedState=xe}}function Yh(t,r,n){if(t=r.effects,r.effects=null,t!==null)for(r=0;rn?n:4,t(!0);var i=kc.transition;kc.transition={};try{t(!1),r()}finally{rt=n,kc.transition=i}}function ff(){return br().memoizedState}function _y(t,r,n){var i=Os(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},mf(t))xf(r,n);else if(n=Wh(t,r,n,i),n!==null){var u=Jt();_r(n,t,i,u),pf(n,r,i)}}function My(t,r,n){var i=Os(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(mf(t))xf(r,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var w=r.lastRenderedState,I=x(w,n);if(u.hasEagerState=!0,u.eagerState=I,Er(I,w)){var $=r.interleaved;$===null?(u.next=u,jc(r)):(u.next=$.next,$.next=u),r.interleaved=u;return}}catch{}finally{}n=Wh(t,r,u,i),n!==null&&(u=Jt(),_r(n,t,i,u),pf(n,r,i))}}function mf(t){var r=t.alternate;return t===pt||r!==null&&r===pt}function xf(t,r){Qa=di=!0;var n=t.pending;n===null?r.next=r:(r.next=n.next,n.next=r),t.pending=r}function pf(t,r,n){if((n&4194240)!==0){var i=r.lanes;i&=t.pendingLanes,n|=i,r.lanes=n,Do(t,n)}}var fi={readContext:jr,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},Ay={readContext:jr,useCallback:function(t,r){return Vr().memoizedState=[t,r===void 0?null:r],t},useContext:jr,useEffect:nf,useImperativeHandle:function(t,r,n){return n=n!=null?n.concat([t]):null,ui(4194308,4,of.bind(null,r,t),n)},useLayoutEffect:function(t,r){return ui(4194308,4,t,r)},useInsertionEffect:function(t,r){return ui(4,2,t,r)},useMemo:function(t,r){var n=Vr();return r=r===void 0?null:r,t=t(),n.memoizedState=[t,r],t},useReducer:function(t,r,n){var i=Vr();return r=n!==void 0?n(r):r,i.memoizedState=i.baseState=r,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:r},i.queue=t,t=t.dispatch=_y.bind(null,pt,t),[i.memoizedState,t]},useRef:function(t){var r=Vr();return t={current:t},r.memoizedState=t},useState:rf,useDebugValue:Mc,useDeferredValue:function(t){return Vr().memoizedState=t},useTransition:function(){var t=rf(!1),r=t[0];return t=Iy.bind(null,t[1]),Vr().memoizedState=t,[r,t]},useMutableSource:function(){},useSyncExternalStore:function(t,r,n){var i=pt,u=Vr();if(ut){if(n===void 0)throw Error(l(407));n=n()}else{if(n=r(),Lt===null)throw Error(l(349));(un&30)!==0||Xh(i,r,n)}u.memoizedState=n;var x={value:n,getSnapshot:r};return u.queue=x,nf(Zh.bind(null,i,x,t),[t]),i.flags|=2048,Ja(9,Jh.bind(null,i,x,n,r),void 0,null),n},useId:function(){var t=Vr(),r=Lt.identifierPrefix;if(ut){var n=rs,i=ts;n=(i&~(1<<32-kr(i)-1)).toString(32)+n,r=":"+r+"R"+n,n=qa++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=w.createElement(n,{is:i.is}):(t=w.createElement(n),n==="select"&&(w=t,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):t=w.createElementNS(t,n),t[Br]=r,t[Va]=i,Lf(t,r,!1,!1),r.stateNode=t;e:{switch(w=va(n,i),n){case"dialog":ot("cancel",t),ot("close",t),u=i;break;case"iframe":case"object":case"embed":ot("load",t),u=i;break;case"video":case"audio":for(u=0;u<$a.length;u++)ot($a[u],t);u=i;break;case"source":ot("error",t),u=i;break;case"img":case"image":case"link":ot("error",t),ot("load",t),u=i;break;case"details":ot("toggle",t),u=i;break;case"input":qe(t,i),u=We(t,i),ot("invalid",t);break;case"option":u=i;break;case"select":t._wrapperState={wasMultiple:!!i.multiple},u=W({},i,{value:void 0}),ot("invalid",t);break;case"textarea":xs(t,i),u=Xr(t,i),ot("invalid",t);break;default:u=i}ya(n,u),I=u;for(x in I)if(I.hasOwnProperty(x)){var $=I[x];x==="style"?ga(t,$):x==="dangerouslySetInnerHTML"?($=$?$.__html:void 0,$!=null&&Tt(t,$)):x==="children"?typeof $=="string"?(n!=="textarea"||$!=="")&&dr(t,$):typeof $=="number"&&dr(t,""+$):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(c.hasOwnProperty(x)?$!=null&&x==="onScroll"&&ot("scroll",t):$!=null&&j(t,x,$,w))}switch(n){case"input":fe(t),ft(t,i,!1);break;case"textarea":fe(t),$t(t);break;case"option":i.value!=null&&t.setAttribute("value",""+ye(i.value));break;case"select":t.multiple=!!i.multiple,x=i.value,x!=null?Fr(t,!!i.multiple,x,!1):i.defaultValue!=null&&Fr(t,!!i.multiple,i.defaultValue,!0);break;default:typeof u.onClick=="function"&&(t.onclick=Ql)}switch(n){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 Kt(r),null;case 6:if(t&&r.stateNode!=null)Ff(t,r,t.memoizedProps,i);else{if(typeof i!="string"&&r.stateNode===null)throw Error(l(166));if(n=dn(Ga.current),dn(Ur.current),ri(r)){if(i=r.stateNode,n=r.memoizedProps,i[Br]=r,(x=i.nodeValue!==n)&&(t=hr,t!==null))switch(t.tag){case 3:Gl(i.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Gl(i.nodeValue,n,(t.mode&1)!==0)}x&&(r.flags|=4)}else i=(n.nodeType===9?n:n.ownerDocument).createTextNode(i),i[Br]=r,r.stateNode=i}return Kt(r),null;case 13:if(ct(xt),i=r.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ut&&fr!==null&&(r.mode&1)!==0&&(r.flags&128)===0)$h(),$n(),r.flags|=98560,x=!1;else if(x=ri(r),i!==null&&i.dehydrated!==null){if(t===null){if(!x)throw Error(l(318));if(x=r.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(l(317));x[Br]=r}else $n(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Kt(r),x=!1}else Pr!==null&&(td(Pr),Pr=null),x=!0;if(!x)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=n,r):(i=i!==null,i!==(t!==null&&t.memoizedState!==null)&&i&&(r.child.flags|=8192,(r.mode&1)!==0&&(t===null||(xt.current&1)!==0?_t===0&&(_t=3):nd())),r.updateQueue!==null&&(r.flags|=4),Kt(r),null);case 4:return Wn(),Wc(t,r),t===null&&Ba(r.stateNode.containerInfo),Kt(r),null;case 10:return yc(r.type._context),Kt(r),null;case 17:return rr(r.type)&&Xl(),Kt(r),null;case 19:if(ct(xt),x=r.memoizedState,x===null)return Kt(r),null;if(i=(r.flags&128)!==0,w=x.rendering,w===null)if(i)Za(x,!1);else{if(_t!==0||t!==null&&(t.flags&128)!==0)for(t=r.child;t!==null;){if(w=oi(t),w!==null){for(r.flags|=128,Za(x,!1),i=w.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),r.subtreeFlags=0,i=n,n=r.child;n!==null;)x=n,t=i,x.flags&=14680066,w=x.alternate,w===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=w.childLanes,x.lanes=w.lanes,x.child=w.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=w.memoizedProps,x.memoizedState=w.memoizedState,x.updateQueue=w.updateQueue,x.type=w.type,t=w.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return lt(xt,xt.current&1|2),r.child}t=t.sibling}x.tail!==null&&jt()>Gn&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304)}else{if(!i)if(t=oi(w),t!==null){if(r.flags|=128,i=!0,n=t.updateQueue,n!==null&&(r.updateQueue=n,r.flags|=4),Za(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!ut)return Kt(r),null}else 2*jt()-x.renderingStartTime>Gn&&n!==1073741824&&(r.flags|=128,i=!0,Za(x,!1),r.lanes=4194304);x.isBackwards?(w.sibling=r.child,r.child=w):(n=x.last,n!==null?n.sibling=w:r.child=w,x.last=w)}return x.tail!==null?(r=x.tail,x.rendering=r,x.tail=r.sibling,x.renderingStartTime=jt(),r.sibling=null,n=xt.current,lt(xt,i?n&1|2:n&1),r):(Kt(r),null);case 22:case 23:return sd(),i=r.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(r.flags|=8192),i&&(r.mode&1)!==0?(mr&1073741824)!==0&&(Kt(r),r.subtreeFlags&6&&(r.flags|=8192)):Kt(r),null;case 24:return null;case 25:return null}throw Error(l(156,r.tag))}function Uy(t,r){switch(hc(r),r.tag){case 1:return rr(r.type)&&Xl(),t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 3:return Wn(),ct(tr),ct(Wt),Cc(),t=r.flags,(t&65536)!==0&&(t&128)===0?(r.flags=t&-65537|128,r):null;case 5:return wc(r),null;case 13:if(ct(xt),t=r.memoizedState,t!==null&&t.dehydrated!==null){if(r.alternate===null)throw Error(l(340));$n()}return t=r.flags,t&65536?(r.flags=t&-65537|128,r):null;case 19:return ct(xt),null;case 4:return Wn(),null;case 10:return yc(r.type._context),null;case 22:case 23:return sd(),null;case 24:return null;default:return null}}var gi=!1,Yt=!1,Vy=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Kn(t,r){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){gt(t,r,i)}else n.current=null}function Hc(t,r,n){try{n()}catch(i){gt(t,r,i)}}var zf=!1;function Wy(t,r){if(sc=Ol,t=ph(),Qo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var w=0,I=-1,$=-1,J=0,me=0,xe=t,he=null;t:for(;;){for(var Ce;xe!==n||u!==0&&xe.nodeType!==3||(I=w+u),xe!==x||i!==0&&xe.nodeType!==3||($=w+i),xe.nodeType===3&&(w+=xe.nodeValue.length),(Ce=xe.firstChild)!==null;)he=xe,xe=Ce;for(;;){if(xe===t)break t;if(he===n&&++J===u&&(I=w),he===x&&++me===i&&($=w),(Ce=xe.nextSibling)!==null)break;xe=he,he=xe.parentNode}xe=Ce}n=I===-1||$===-1?null:{start:I,end:$}}else n=null}n=n||{start:0,end:0}}else n=null;for(nc={focusedElem:t,selectionRange:n},Ol=!1,Pe=r;Pe!==null;)if(r=Pe,t=r.child,(r.subtreeFlags&1028)!==0&&t!==null)t.return=r,Pe=t;else for(;Pe!==null;){r=Pe;try{var Te=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var _e=Te.memoizedProps,bt=Te.memoizedState,Y=r.stateNode,V=Y.getSnapshotBeforeUpdate(r.elementType===r.type?_e:Tr(r.type,_e),bt);Y.__reactInternalSnapshotBeforeUpdate=V}break;case 3:var q=r.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(ve){gt(r,r.return,ve)}if(t=r.sibling,t!==null){t.return=r.return,Pe=t;break}Pe=r.return}return Te=zf,zf=!1,Te}function el(t,r,n){var i=r.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Hc(r,n,x)}u=u.next}while(u!==i)}}function yi(t,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var n=r=r.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==r)}}function Kc(t){var r=t.ref;if(r!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof r=="function"?r(t):r.current=t}}function $f(t){var r=t.alternate;r!==null&&(t.alternate=null,$f(r)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(r=t.stateNode,r!==null&&(delete r[Br],delete r[Va],delete r[oc],delete r[ky],delete r[Ey])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Bf(t){return t.tag===5||t.tag===3||t.tag===4}function Uf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Bf(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Yc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.nodeType===8?n.parentNode.insertBefore(t,r):n.insertBefore(t,r):(n.nodeType===8?(r=n.parentNode,r.insertBefore(t,n)):(r=n,r.appendChild(t)),n=n._reactRootContainer,n!=null||r.onclick!==null||(r.onclick=Ql));else if(i!==4&&(t=t.child,t!==null))for(Yc(t,r,n),t=t.sibling;t!==null;)Yc(t,r,n),t=t.sibling}function Gc(t,r,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,r?n.insertBefore(t,r):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(Gc(t,r,n),t=t.sibling;t!==null;)Gc(t,r,n),t=t.sibling}var Bt=null,Rr=!1;function As(t,r,n){for(n=n.child;n!==null;)Vf(t,r,n),n=n.sibling}function Vf(t,r,n){if($r&&typeof $r.onCommitFiberUnmount=="function")try{$r.onCommitFiberUnmount(Il,n)}catch{}switch(n.tag){case 5:Yt||Kn(n,r);case 6:var i=Bt,u=Rr;Bt=null,As(t,r,n),Bt=i,Rr=u,Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Bt.removeChild(n.stateNode));break;case 18:Bt!==null&&(Rr?(t=Bt,n=n.stateNode,t.nodeType===8?ic(t.parentNode,n):t.nodeType===1&&ic(t,n),_a(t)):ic(Bt,n.stateNode));break;case 4:i=Bt,u=Rr,Bt=n.stateNode.containerInfo,Rr=!0,As(t,r,n),Bt=i,Rr=u;break;case 0:case 11:case 14:case 15:if(!Yt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var x=u,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&Hc(n,r,w),u=u.next}while(u!==i)}As(t,r,n);break;case 1:if(!Yt&&(Kn(n,r),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(I){gt(n,r,I)}As(t,r,n);break;case 21:As(t,r,n);break;case 22:n.mode&1?(Yt=(i=Yt)||n.memoizedState!==null,As(t,r,n),Yt=i):As(t,r,n);break;default:As(t,r,n)}}function Wf(t){var r=t.updateQueue;if(r!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Vy),r.forEach(function(i){var u=Zy.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Ir(t,r){var n=r.deletions;if(n!==null)for(var i=0;iu&&(u=w),i&=~x}if(i=u,i=jt()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Ky(i/1960))-i,10t?16:t,Ls===null)var i=!1;else{if(t=Ls,Ls=null,wi=0,(Xe&6)!==0)throw Error(l(331));var u=Xe;for(Xe|=4,Pe=t.current;Pe!==null;){var x=Pe,w=x.child;if((Pe.flags&16)!==0){var I=x.deletions;if(I!==null){for(var $=0;$jt()-Xc?mn(t,0):qc|=n),ar(t,r)}function sm(t,r){r===0&&((t.mode&1)===0?r=1:(r=Ml,Ml<<=1,(Ml&130023424)===0&&(Ml=4194304)));var n=Jt();t=ss(t,r),t!==null&&(Ea(t,r,n),ar(t,n))}function Jy(t){var r=t.memoizedState,n=0;r!==null&&(n=r.retryLane),sm(t,n)}function Zy(t,r){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(r),sm(t,n)}var nm;nm=function(t,r,n){if(t!==null)if(t.memoizedProps!==r.pendingProps||tr.current)sr=!0;else{if((t.lanes&n)===0&&(r.flags&128)===0)return sr=!1,$y(t,r,n);sr=(t.flags&131072)!==0}else sr=!1,ut&&(r.flags&1048576)!==0&&Lh(r,ti,r.index);switch(r.lanes=0,r.tag){case 2:var i=r.type;pi(t,r),t=r.pendingProps;var u=On(r,Wt.current);Vn(r,n),u=Pc(null,r,i,t,u,n);var x=Tc();return r.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,rr(i)?(x=!0,Jl(r)):x=!1,r.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,bc(r),u.updater=mi,r.stateNode=u,u._reactInternals=r,Dc(r,i,t,n),r=zc(null,r,i,!0,x,n)):(r.tag=0,ut&&x&&uc(r),Xt(null,r,u,n),r=r.child),r;case 16:i=r.elementType;e:{switch(pi(t,r),t=r.pendingProps,u=i._init,i=u(i._payload),r.type=i,u=r.tag=tv(i),t=Tr(i,t),u){case 0:r=Fc(null,r,i,t,n);break e;case 1:r=Rf(null,r,i,t,n);break e;case 11:r=Cf(null,r,i,t,n);break e;case 14:r=kf(null,r,i,Tr(i.type,t),n);break e}throw Error(l(306,i,""))}return r;case 0:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Fc(t,r,i,u,n);case 1:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Rf(t,r,i,u,n);case 3:e:{if(If(r),t===null)throw Error(l(387));i=r.pendingProps,x=r.memoizedState,u=x.element,Hh(t,r),ii(r,i,null,n);var w=r.memoizedState;if(i=w.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){u=Hn(Error(l(423)),r),r=_f(t,r,i,n,u);break e}else if(i!==u){u=Hn(Error(l(424)),r),r=_f(t,r,i,n,u);break e}else for(fr=Ps(r.stateNode.containerInfo.firstChild),hr=r,ut=!0,Pr=null,n=Vh(r,null,i,n),r.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),i===u){r=as(t,r,n);break e}Xt(t,r,i,n)}r=r.child}return r;case 5:return Gh(r),t===null&&mc(r),i=r.type,u=r.pendingProps,x=t!==null?t.memoizedProps:null,w=u.children,ac(i,u)?w=null:x!==null&&ac(i,x)&&(r.flags|=32),Tf(t,r),Xt(t,r,w,n),r.child;case 6:return t===null&&mc(r),null;case 13:return Mf(t,r,n);case 4:return Nc(r,r.stateNode.containerInfo),i=r.pendingProps,t===null?r.child=Bn(r,null,i,n):Xt(t,r,i,n),r.child;case 11:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),Cf(t,r,i,u,n);case 7:return Xt(t,r,r.pendingProps,n),r.child;case 8:return Xt(t,r,r.pendingProps.children,n),r.child;case 12:return Xt(t,r,r.pendingProps.children,n),r.child;case 10:e:{if(i=r.type._context,u=r.pendingProps,x=r.memoizedProps,w=u.value,lt(ni,i._currentValue),i._currentValue=w,x!==null)if(Er(x.value,w)){if(x.children===u.children&&!tr.current){r=as(t,r,n);break e}}else for(x=r.child,x!==null&&(x.return=r);x!==null;){var I=x.dependencies;if(I!==null){w=x.child;for(var $=I.firstContext;$!==null;){if($.context===i){if(x.tag===1){$=ns(-1,n&-n),$.tag=2;var J=x.updateQueue;if(J!==null){J=J.shared;var me=J.pending;me===null?$.next=$:($.next=me.next,me.next=$),J.pending=$}}x.lanes|=n,$=x.alternate,$!==null&&($.lanes|=n),vc(x.return,n,r),I.lanes|=n;break}$=$.next}}else if(x.tag===10)w=x.type===r.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(l(341));w.lanes|=n,I=w.alternate,I!==null&&(I.lanes|=n),vc(w,n,r),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===r){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}Xt(t,r,u.children,n),r=r.child}return r;case 9:return u=r.type,i=r.pendingProps.children,Vn(r,n),u=jr(u),i=i(u),r.flags|=1,Xt(t,r,i,n),r.child;case 14:return i=r.type,u=Tr(i,r.pendingProps),u=Tr(i.type,u),kf(t,r,i,u,n);case 15:return Ef(t,r,r.type,r.pendingProps,n);case 17:return i=r.type,u=r.pendingProps,u=r.elementType===i?u:Tr(i,u),pi(t,r),r.tag=1,rr(i)?(t=!0,Jl(r)):t=!1,Vn(r,n),yf(r,i,u),Dc(r,i,u,n),zc(null,r,i,!0,t,n);case 19:return Df(t,r,n);case 22:return Pf(t,r,n)}throw Error(l(156,r.tag))};function am(t,r){return Ca(t,r)}function ev(t,r,n,i){this.tag=t,this.key=n,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 wr(t,r,n,i){return new ev(t,r,n,i)}function ad(t){return t=t.prototype,!(!t||!t.isReactComponent)}function tv(t){if(typeof t=="function")return ad(t)?1:0;if(t!=null){if(t=t.$$typeof,t===ie)return 11;if(t===Q)return 14}return 2}function zs(t,r){var n=t.alternate;return n===null?(n=wr(t.tag,r,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=r,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,r=t.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ei(t,r,n,i,u,x){var w=2;if(i=t,typeof t=="function")ad(t)&&(w=1);else if(typeof t=="string")w=5;else e:switch(t){case k:return pn(n.children,u,x,r);case L:w=8,u|=8;break;case _:return t=wr(12,n,r,u|2),t.elementType=_,t.lanes=x,t;case ee:return t=wr(13,n,r,u),t.elementType=ee,t.lanes=x,t;case G:return t=wr(19,n,r,u),t.elementType=G,t.lanes=x,t;case re:return Pi(n,u,x,r);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case se:w=10;break e;case le:w=9;break e;case ie:w=11;break e;case Q:w=14;break e;case ce:w=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return r=wr(w,n,r,u),r.elementType=t,r.type=i,r.lanes=x,r}function pn(t,r,n,i){return t=wr(7,t,i,r),t.lanes=n,t}function Pi(t,r,n,i){return t=wr(22,t,i,r),t.elementType=re,t.lanes=n,t.stateNode={isHidden:!1},t}function ld(t,r,n){return t=wr(6,t,null,r),t.lanes=n,t}function id(t,r,n){return r=wr(4,t.children!==null?t.children:[],t.key,r),r.lanes=n,r.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},r}function rv(t,r,n,i,u){this.tag=r,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ao(0),this.expirationTimes=Ao(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ao(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function od(t,r,n,i,u,x,w,I,$){return t=new rv(t,r,n,I,$),r===1?(r=1,x===!0&&(r|=8)):r=0,x=wr(3,null,null,r),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bc(x),t}function sv(t,r,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(a){console.error(a)}}return s(),md.exports=xv(),md.exports}var vm;function pv(){if(vm)return Di;vm=1;var s=wx();return Di.createRoot=s.createRoot,Di.hydrateRoot=s.hydrateRoot,Di}var gv=pv(),gl=wx();const yv=Nx(gl);/** - * @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 hl(){return hl=Object.assign?Object.assign.bind():function(s){for(var a=1;a"u")throw new Error(a)}function lu(s,a){if(!s){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jv(){return Math.random().toString(36).substr(2,8)}function bm(s,a){return{usr:s.state,key:s.key,idx:a}}function Dd(s,a,l,o){return l===void 0&&(l=null),hl({pathname:typeof s=="string"?s:s.pathname,search:"",hash:""},typeof a=="string"?oa(a):a,{state:l,key:a&&a.key||o||jv()})}function Qi(s){let{pathname:a="/",search:l="",hash:o=""}=s;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function oa(s){let a={};if(s){let l=s.indexOf("#");l>=0&&(a.hash=s.substr(l),s=s.substr(0,l));let o=s.indexOf("?");o>=0&&(a.search=s.substr(o),s=s.substr(0,o)),s&&(a.pathname=s)}return a}function bv(s,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,h=c.history,m=Hs.Pop,p=null,y=g();y==null&&(y=0,h.replaceState(hl({},h.state,{idx:y}),""));function g(){return(h.state||{idx:null}).idx}function v(){m=Hs.Pop;let b=g(),N=b==null?null:b-y;y=b,p&&p({action:m,location:S.location,delta:N})}function C(b,N){m=Hs.Push;let E=Dd(S.location,b,N);y=g()+1;let j=bm(E,y),R=S.createHref(E);try{h.pushState(j,"",R)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;c.location.assign(R)}d&&p&&p({action:m,location:S.location,delta:1})}function P(b,N){m=Hs.Replace;let E=Dd(S.location,b,N);y=g();let j=bm(E,y),R=S.createHref(E);h.replaceState(j,"",R),d&&p&&p({action:m,location:S.location,delta:0})}function T(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:Qi(b);return E=E.replace(/ $/,"%20"),kt(N,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,N)}let S={get action(){return m},get location(){return s(c,h)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(jm,v),p=b,()=>{c.removeEventListener(jm,v),p=null}},createHref(b){return a(c,b)},createURL:T,encodeLocation(b){let N=T(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:P,go(b){return h.go(b)}};return S}var Nm;(function(s){s.data="data",s.deferred="deferred",s.redirect="redirect",s.error="error"})(Nm||(Nm={}));function Nv(s,a,l){return l===void 0&&(l="/"),wv(s,a,l)}function wv(s,a,l,o){let c=typeof a=="string"?oa(a):a,d=iu(c.pathname||"/",l);if(d==null)return null;let h=Sx(s);Sv(h);let m=null;for(let p=0;m==null&&p{let p={relativePath:m===void 0?d.path||"":m,caseSensitive:d.caseSensitive===!0,childrenIndex:h,route:d};p.relativePath.startsWith("/")&&(kt(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let y=Ks([o,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(kt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Sx(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Iv(y,d.index),routesMeta:g})};return s.forEach((d,h)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.includes("?")))c(d,h);else for(let p of Cx(d.path))c(d,h,p)}),a}function Cx(s){let a=s.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let h=Cx(o.join("/")),m=[];return m.push(...h.map(p=>p===""?d:[d,p].join("/"))),c&&m.push(...h),m.map(p=>s.startsWith("/")&&p===""?"/":p)}function Sv(s){s.sort((a,l)=>a.score!==l.score?l.score-a.score:_v(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Cv=/^:[\w-]+$/,kv=3,Ev=2,Pv=1,Tv=10,Rv=-2,wm=s=>s==="*";function Iv(s,a){let l=s.split("/"),o=l.length;return l.some(wm)&&(o+=Rv),a&&(o+=Ev),l.filter(c=>!wm(c)).reduce((c,d)=>c+(Cv.test(d)?kv:d===""?Pv:Tv),o)}function _v(s,a){return s.length===a.length&&s.slice(0,-1).every((o,c)=>o===a[c])?s[s.length-1]-a[a.length-1]:0}function Mv(s,a,l){let{routesMeta:o}=s,c={},d="/",h=[];for(let m=0;m{let{paramName:C,isOptional:P}=g;if(C==="*"){let S=m[v]||"";h=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const T=m[v];return P&&!T?y[C]=void 0:y[C]=(T||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:h,pattern:s}}function Dv(s,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),lu(s==="*"||!s.endsWith("*")||s.endsWith("/*"),'Route path "'+s+'" will be treated as if it were '+('"'+s.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+s.replace(/\*$/,"/*")+'".'));let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p)=>(o.push({paramName:m,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function Lv(s){try{return s.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return lu(!1,'The URL path "'+s+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),s}}function iu(s,a){if(a==="/")return s;if(!s.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=s.charAt(l);return o&&o!=="/"?null:s.slice(l)||"/"}const Ov=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fv=s=>Ov.test(s);function zv(s,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof s=="string"?oa(s):s,d;if(l)if(Fv(l))d=l;else{if(l.includes("//")){let h=l;l=l.replace(/\/\/+/g,"/"),lu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+l))}l.startsWith("/")?d=Sm(l.substring(1),"/"):d=Sm(l,a)}else d=a;return{pathname:d,search:Uv(o),hash:Vv(c)}}function Sm(s,a){let l=a.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function gd(s,a,l,o){return"Cannot include a '"+s+"' 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 and the router will parse it for you.'}function $v(s){return s.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function ou(s,a){let l=$v(s);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function cu(s,a,l,o){o===void 0&&(o=!1);let c;typeof s=="string"?c=oa(s):(c=hl({},s),kt(!c.pathname||!c.pathname.includes("?"),gd("?","pathname","search",c)),kt(!c.pathname||!c.pathname.includes("#"),gd("#","pathname","hash",c)),kt(!c.search||!c.search.includes("#"),gd("#","search","hash",c)));let d=s===""||c.pathname==="",h=d?"/":c.pathname,m;if(h==null)m=l;else{let v=a.length-1;if(!o&&h.startsWith("..")){let C=h.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}m=v>=0?a[v]:"/"}let p=zv(c,m),y=h&&h!=="/"&&h.endsWith("/"),g=(d||h===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const Ks=s=>s.join("/").replace(/\/\/+/g,"/"),Bv=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Uv=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Vv=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s;function Wv(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}const kx=["post","put","patch","delete"];new Set(kx);const Hv=["get",...kx];new Set(Hv);/** - * 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 fl(){return fl=Object.assign?Object.assign.bind():function(s){for(var a=1;a{m.current=!0}),f.useCallback(function(y,g){if(g===void 0&&(g={}),!m.current)return;if(typeof y=="number"){o.go(y);return}let v=cu(y,JSON.parse(h),d,g.relative==="path");s==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Ks([a,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[a,o,h,d,s])}const Qv=f.createContext(null);function qv(s){let a=f.useContext(ms).outlet;return a&&f.createElement(Qv.Provider,{value:s},a)}function Tx(s,a){let{relative:l}=a===void 0?{}:a,{future:o}=f.useContext(Js),{matches:c}=f.useContext(ms),{pathname:d}=Zs(),h=JSON.stringify(ou(c,o.v7_relativeSplatPath));return f.useMemo(()=>cu(s,JSON.parse(h),d,l==="path"),[s,h,d,l])}function Xv(s,a){return Jv(s,a)}function Jv(s,a,l,o){ca()||kt(!1);let{navigator:c}=f.useContext(Js),{matches:d}=f.useContext(ms),h=d[d.length-1],m=h?h.params:{};h&&h.pathname;let p=h?h.pathnameBase:"/";h&&h.route;let y=Zs(),g;if(a){var v;let b=typeof a=="string"?oa(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||kt(!1),g=b}else g=y;let C=g.pathname||"/",P=C;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let T=Nv(s,{pathname:P}),S=sj(T&&T.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:Ks([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:Ks([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,o);return a&&S?f.createElement(ho.Provider,{value:{location:fl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Hs.Pop}},S):S}function Zv(){let s=ij(),a=Wv(s)?s.status+" "+s.statusText:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},a),l?f.createElement("pre",{style:c},l):null,null)}const ej=f.createElement(Zv,null);class tj extends f.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?f.createElement(ms.Provider,{value:this.props.routeContext},f.createElement(Ex.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rj(s){let{routeContext:a,match:l,children:o}=s,c=f.useContext(du);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),f.createElement(ms.Provider,{value:a},o)}function sj(s,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),s==null){var d;if(!l)return null;if(l.errors)s=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let h=s,m=(c=l)==null?void 0:c.errors;if(m!=null){let g=h.findIndex(v=>v.route.id&&(m==null?void 0:m[v.route.id])!==void 0);g>=0||kt(!1),h=h.slice(0,Math.min(h.length,g+1))}let p=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let g=0;g=0?h=h.slice(0,y+1):h=[h[0]];break}}}return h.reduceRight((g,v,C)=>{let P,T=!1,S=null,b=null;l&&(P=m&&v.route.id?m[v.route.id]:void 0,S=v.route.errorElement||ej,p&&(y<0&&C===0?(cj("route-fallback"),T=!0,b=null):y===C&&(T=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(h.slice(0,C+1)),E=()=>{let j;return P?j=S:T?j=b:v.route.Component?j=f.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,f.createElement(rj,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?f.createElement(tj,{location:l.location,revalidation:l.revalidation,component:S,error:P,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}var Rx=(function(s){return s.UseBlocker="useBlocker",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s})(Rx||{}),Ix=(function(s){return s.UseBlocker="useBlocker",s.UseLoaderData="useLoaderData",s.UseActionData="useActionData",s.UseRouteError="useRouteError",s.UseNavigation="useNavigation",s.UseRouteLoaderData="useRouteLoaderData",s.UseMatches="useMatches",s.UseRevalidator="useRevalidator",s.UseNavigateStable="useNavigate",s.UseRouteId="useRouteId",s})(Ix||{});function nj(s){let a=f.useContext(du);return a||kt(!1),a}function aj(s){let a=f.useContext(Kv);return a||kt(!1),a}function lj(s){let a=f.useContext(ms);return a||kt(!1),a}function _x(s){let a=lj(),l=a.matches[a.matches.length-1];return l.route.id||kt(!1),l.route.id}function ij(){var s;let a=f.useContext(Ex),l=aj(),o=_x();return a!==void 0?a:(s=l.errors)==null?void 0:s[o]}function oj(){let{router:s}=nj(Rx.UseNavigateStable),a=_x(Ix.UseNavigateStable),l=f.useRef(!1);return Px(()=>{l.current=!0}),f.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?s.navigate(c):s.navigate(c,fl({fromRouteId:a},d)))},[s,a])}const Cm={};function cj(s,a,l){Cm[s]||(Cm[s]=!0)}function dj(s,a){s==null||s.v7_startTransition,s==null||s.v7_relativeSplatPath}function yd(s){let{to:a,replace:l,state:o,relative:c}=s;ca()||kt(!1);let{future:d,static:h}=f.useContext(Js),{matches:m}=f.useContext(ms),{pathname:p}=Zs(),y=da(),g=cu(a,ou(m,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return f.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function uj(s){return qv(s.context)}function dt(s){kt(!1)}function hj(s){let{basename:a="/",children:l=null,location:o,navigationType:c=Hs.Pop,navigator:d,static:h=!1,future:m}=s;ca()&&kt(!1);let p=a.replace(/^\/*/,"/"),y=f.useMemo(()=>({basename:p,navigator:d,static:h,future:fl({v7_relativeSplatPath:!1},m)}),[p,m,d,h]);typeof o=="string"&&(o=oa(o));let{pathname:g="/",search:v="",hash:C="",state:P=null,key:T="default"}=o,S=f.useMemo(()=>{let b=iu(g,p);return b==null?null:{location:{pathname:b,search:v,hash:C,state:P,key:T},navigationType:c}},[p,g,v,C,P,T,c]);return S==null?null:f.createElement(Js.Provider,{value:y},f.createElement(ho.Provider,{children:l,value:S}))}function fj(s){let{children:a,location:l}=s;return Xv(Ld(a),l)}new Promise(()=>{});function Ld(s,a){a===void 0&&(a=[]);let l=[];return f.Children.forEach(s,(o,c)=>{if(!f.isValidElement(o))return;let d=[...a,c];if(o.type===f.Fragment){l.push.apply(l,Ld(o.props.children,d));return}o.type!==dt&&kt(!1),!o.props.index||!o.props.children||kt(!1);let h={id:o.props.id||d.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&&(h.children=Ld(o.props.children,d)),l.push(h)}),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 Od(){return Od=Object.assign?Object.assign.bind():function(s){for(var a=1;a=0)&&(l[c]=s[c]);return l}function xj(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function pj(s,a){return s.button===0&&(!a||a==="_self")&&!xj(s)}function Fd(s){return s===void 0&&(s=""),new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((a,l)=>{let o=s[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function gj(s,a){let l=Fd(s);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const yj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],vj="6";try{window.__reactRouterVersion=vj}catch{}const jj="startTransition",km=uo[jj];function bj(s){let{basename:a,children:l,future:o,window:c}=s,d=f.useRef();d.current==null&&(d.current=vv({window:c,v5Compat:!0}));let h=d.current,[m,p]=f.useState({action:h.action,location:h.location}),{v7_startTransition:y}=o||{},g=f.useCallback(v=>{y&&km?km(()=>p(v)):p(v)},[p,y]);return f.useLayoutEffect(()=>h.listen(g),[h,g]),f.useEffect(()=>dj(o),[o]),f.createElement(hj,{basename:a,children:l,location:m.location,navigationType:m.action,navigator:h,future:o})}const Nj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hi=f.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:h,state:m,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,C=mj(a,yj),{basename:P}=f.useContext(Js),T,S=!1;if(typeof y=="string"&&wj.test(y)&&(T=y,Nj))try{let j=new URL(window.location.href),R=y.startsWith("//")?new URL(j.protocol+y):new URL(y),B=iu(R.pathname,P);R.origin===j.origin&&B!=null?y=B+R.search+R.hash:S=!0}catch{}let b=Yv(y,{relative:c}),N=Sj(y,{replace:h,state:m,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||N(j)}return f.createElement("a",Od({},C,{href:T||b,onClick:S||d?o:E,ref:l,target:p}))});var Em;(function(s){s.UseScrollRestoration="useScrollRestoration",s.UseSubmit="useSubmit",s.UseSubmitFetcher="useSubmitFetcher",s.UseFetcher="useFetcher",s.useViewTransitionState="useViewTransitionState"})(Em||(Em={}));var Pm;(function(s){s.UseFetcher="useFetcher",s.UseFetchers="useFetchers",s.UseScrollRestoration="useScrollRestoration"})(Pm||(Pm={}));function Sj(s,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:h,viewTransition:m}=a===void 0?{}:a,p=da(),y=Zs(),g=Tx(s,{relative:h});return f.useCallback(v=>{if(pj(v,l)){v.preventDefault();let C=o!==void 0?o:Qi(y)===Qi(g);p(s,{replace:C,state:c,preventScrollReset:d,relative:h,viewTransition:m})}},[y,p,g,o,c,l,s,d,h,m])}function Cj(s){let a=f.useRef(Fd(s)),l=f.useRef(!1),o=Zs(),c=f.useMemo(()=>gj(o.search,l.current?null:a.current),[o.search]),d=da(),h=f.useCallback((m,p)=>{const y=Fd(typeof m=="function"?m(c):m);l.current=!0,d("?"+y,p)},[d,c]);return[c,h]}/** - * @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=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ej=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Tm=s=>{const a=Ej(s);return a.charAt(0).toUpperCase()+a.slice(1)},Mx=(...s)=>s.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Pj=s=>{for(const a in s)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 Tj={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 Rj=f.forwardRef(({color:s="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:h,...m},p)=>f.createElement("svg",{ref:p,...Tj,width:a,height:a,stroke:s,strokeWidth:o?Number(l)*24/Number(a):l,className:Mx("lucide",c),...!d&&!Pj(m)&&{"aria-hidden":"true"},...m},[...h.map(([y,g])=>f.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** - * @license lucide-react v0.562.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ke=(s,a)=>{const l=f.forwardRef(({className:o,...c},d)=>f.createElement(Rj,{ref:d,iconNode:a,className:Mx(`lucide-${kj(Tm(s))}`,`lucide-${s}`,o),...c}));return l.displayName=Tm(s),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 Ij=[["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"}]],Rm=ke("bitcoin",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 _j=[["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"}]],us=ke("book-open",_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 Mj=[["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"}]],qi=ke("calendar",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 Aj=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Dj=ke("chart-column",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 Lj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fo=ke("check",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=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ml=ke("chevron-down",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=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Vs=ke("chevron-right",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:"m18 15-6-6-6 6",key:"153udz"}]],Ax=ke("chevron-up",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=[["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"}]],Bj=ke("circle-alert",$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 Uj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Im=ke("circle-check-big",Uj);/** - * @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=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wj=ke("circle-check",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 Hj=[["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"}]],Dx=ke("circle-question-mark",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 Kj=[["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"}]],vd=ke("circle-user",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 Yj=[["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"}]],Lx=ke("circle-x",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 Gj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ox=ke("clock",Gj);/** - * @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",{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"}]],Fx=ke("copy",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 qj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],zd=ke("credit-card",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=[["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"}]],mo=ke("crown",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 Jj=[["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"}]],Xi=ke("dollar-sign",Jj);/** - * @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:"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"}]],eb=ke("download",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 tb=[["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"}]],Ji=ke("external-link",tb);/** - * @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 rb=[["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"}]],ds=ke("eye",rb);/** - * @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 sb=[["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"}]],nb=ke("file-text",sb);/** - * @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 ab=[["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"}]],lb=ke("funnel",ab);/** - * @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 ib=[["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"}]],ob=ke("gift",ib);/** - * @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 cb=[["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"}]],db=ke("git-merge",cb);/** - * @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 ub=[["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"}]],$d=ke("globe",ub);/** - * @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 hb=[["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"}]],zx=ke("graduation-cap",hb);/** - * @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 fb=[["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"}]],is=ke("grip-vertical",fb);/** - * @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 mb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],xb=ke("handshake",mb);/** - * @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 pb=[["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"}]],_m=ke("history",pb);/** - * @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 gb=[["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"}]],yb=ke("house",gb);/** - * @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 vb=[["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"}]],$x=ke("image",vb);/** - * @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 jb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Li=ke("info",jb);/** - * @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 bb=[["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"}]],Mm=ke("key",bb);/** - * @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 Nb=[["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"}]],wb=ke("layout-dashboard",Nb);/** - * @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 Sb=[["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"}]],Ys=ke("link-2",Sb);/** - * @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 Cb=[["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"}]],Am=ke("link",Cb);/** - * @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 kb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Eb=ke("list",kb);/** - * @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 Pb=[["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"}]],Tb=ke("lock",Pb);/** - * @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 Rb=[["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"}]],Ib=ke("log-out",Rb);/** - * @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 _b=[["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"}]],Mb=ke("map-pin",_b);/** - * @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 Ab=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Db=ke("menu",Ab);/** - * @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 Lb=[["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"}]],Ob=ke("message-circle",Lb);/** - * @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 Fb=[["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"}]],zb=ke("palette",Fb);/** - * @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 $b=[["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"}]],yt=ke("pen-line",$b);/** - * @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 Bb=[["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"}]],Ub=ke("percent",Bb);/** - * @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 Vb=[["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"}]],Wb=ke("phone",Vb);/** - * @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 Hb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],At=ke("plus",Hb);/** - * @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 Kb=[["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"}]],Dm=ke("qr-code",Kb);/** - * @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 Yb=[["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"}]],$e=ke("refresh-cw",Yb);/** - * @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 Gb=[["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"}]],zt=ke("save",Gb);/** - * @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 Qb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],yn=ke("search",Qb);/** - * @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 qb=[["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"}]],dl=ke("settings",qb);/** - * @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 Xb=[["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"}]],jd=ke("settings-2",Xb);/** - * @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 Jb=[["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"}]],uu=ke("shield-check",Jb);/** - * @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 Zb=[["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"}]],Bd=ke("shopping-bag",Zb);/** - * @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=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Ud=ke("smartphone",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 tN=[["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"}]],rN=ke("tag",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 sN=[["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"}]],Gt=ke("trash-2",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 nN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ul=ke("trending-up",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 aN=[["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"}]],Bx=ke("undo-2",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 lN=[["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"}]],Zi=ke("upload",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=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],oN=ke("user-check",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 cN=[["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"}]],Vd=ke("user-plus",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 dN=[["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"}]],ra=ke("user",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 uN=[["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"}]],Qt=ke("users",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 hN=[["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"}]],aa=ke("wallet",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 fN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sr=ke("x",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 mN=[["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"}]],eo=ke("zap",mN),hu="admin_token";function fu(){try{return localStorage.getItem(hu)}catch{return null}}function xN(s){try{localStorage.setItem(hu,s)}catch{}}function pN(){try{localStorage.removeItem(hu)}catch{}}const gN="https://soulapi.quwanzhi.com",yN=()=>{const s="https://soulapi.quwanzhi.com";return s.length>0?s.replace(/\/$/,""):gN};function la(s){const a=yN(),l=s.startsWith("/")?s:`/${s}`;return a?`${a}${l}`:l}async function xo(s,a={}){const{data:l,...o}=a,c=la(s),d=new Headers(o.headers),h=fu();h&&d.set("Authorization",`Bearer ${h}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const m=l!=null?JSON.stringify(l):o.body,p=await fetch(c,{...o,headers:d,body:m,credentials:"include"}),g=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${p.status}`);throw v.status=p.status,v.data=g,v}return g}function Fe(s,a){return xo(s,{...a,method:"GET"})}function Et(s,a,l){return xo(s,{...l,method:"POST",data:a})}function Nt(s,a,l){return xo(s,{...l,method:"PUT",data:a})}function vn(s,a){return xo(s,{...a,method:"DELETE"})}const vN=[{icon:wb,label:"数据概览",href:"/dashboard"},{icon:us,label:"内容管理",href:"/content"},{icon:Qt,label:"用户管理",href:"/users"}],Lm=[{icon:db,label:"找伙伴",href:"/find-partner"},{icon:mo,label:"VIP 角色",href:"/vip-roles"},{icon:zx,label:"导师管理",href:"/mentors"},{icon:aa,label:"推广中心",href:"/distribution"},{icon:zd,label:"推广设置",href:"/referral-settings"}];function jN(){const s=Zs(),a=da(),[l,o]=f.useState(!1),[c,d]=f.useState(!1),[h,m]=f.useState(!1);f.useEffect(()=>{o(!0)},[]),f.useEffect(()=>{Lm.some(g=>s.pathname===g.href)&&m(!0)},[s.pathname]),f.useEffect(()=>{if(!l)return;d(!1);let y=!1;return Fe("/api/admin").then(g=>{y||(g&&g.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const p=async()=>{pN();try{await Et("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[vN.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>m(!h),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:e.jsxs("span",{className:"flex items-center gap-3",children:[h?e.jsx(Ax,{className:"w-5 h-5"}):e.jsx(ml,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),h&&e.jsx("div",{className:"space-y-1 pl-4",children:Lm.map(y=>{const g=s.pathname===y.href;return e.jsxs(Hi,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Hi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${s.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(dl,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:p,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:[e.jsx(Ib,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(uj,{})})})]})}function Om(s,a){if(typeof s=="function")return s(a);s!=null&&(s.current=a)}function mu(...s){return a=>{let l=!1;const o=s.map(c=>{const d=Om(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...h}=o;Ux(d)&&typeof to=="function"&&(d=to(d._payload));const m=f.Children.toArray(d),p=m.find(CN);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}var Wx=Vx("Slot");function wN(s){const a=f.forwardRef((l,o)=>{let{children:c,...d}=l;if(Ux(c)&&typeof to=="function"&&(c=to(c._payload)),f.isValidElement(c)){const h=EN(c),m=kN(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var SN=Symbol("radix.slottable");function CN(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===SN}function kN(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function EN(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}function Hx(s){var a,l,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(a=0;atypeof s=="boolean"?`${s}`:s===0?"0":s,zm=Kx,Yx=(s,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return zm(s,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,h=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const C=Fm(g)||Fm(v);return c[y][C]}),m=l&&Object.entries(l).reduce((y,g)=>{let[v,C]=g;return C===void 0||(y[v]=C),y},{}),p=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,g)=>{let{class:v,className:C,...P}=g;return Object.entries(P).every(T=>{let[S,b]=T;return Array.isArray(b)?b.includes({...d,...m}[S]):{...d,...m}[S]===b})?[...y,v,C]:y},[]);return zm(s,h,p,l==null?void 0:l.class,l==null?void 0:l.className)},PN=(s,a)=>{const l=new Array(s.length+a.length);for(let o=0;o({classGroupId:s,validator:a}),Gx=(s=new Map,a=null,l)=>({nextPart:s,validators:a,classGroupId:l}),ro="-",$m=[],RN="arbitrary..",IN=s=>{const a=MN(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=s;return{getClassGroupId:h=>{if(h.startsWith("[")&&h.endsWith("]"))return _N(h);const m=h.split(ro),p=m[0]===""&&m.length>1?1:0;return Qx(m,p,a)},getConflictingClassGroupIds:(h,m)=>{if(m){const p=o[h],y=l[h];return p?y?PN(y,p):p:y||$m}return l[h]||$m}}},Qx=(s,a,l)=>{if(s.length-a===0)return l.classGroupId;const c=s[a],d=l.nextPart.get(c);if(d){const y=Qx(s,a+1,d);if(y)return y}const h=l.validators;if(h===null)return;const m=a===0?s.join(ro):s.slice(a).join(ro),p=h.length;for(let y=0;ys.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=s.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?RN+o:void 0})(),MN=s=>{const{theme:a,classGroups:l}=s;return AN(l,a)},AN=(s,a)=>{const l=Gx();for(const o in s){const c=s[o];xu(c,l,o,a)}return l},xu=(s,a,l,o)=>{const c=s.length;for(let d=0;d{if(typeof s=="string"){LN(s,a,l);return}if(typeof s=="function"){ON(s,a,l,o);return}FN(s,a,l,o)},LN=(s,a,l)=>{const o=s===""?a:qx(a,s);o.classGroupId=l},ON=(s,a,l,o)=>{if(zN(s)){xu(s(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(TN(l,s))},FN=(s,a,l,o)=>{const c=Object.entries(s),d=c.length;for(let h=0;h{let l=s;const o=a.split(ro),c=o.length;for(let d=0;d"isThemeGetter"in s&&s.isThemeGetter===!0,$N=s=>{if(s<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,h)=>{l[d]=h,a++,a>s&&(a=0,o=l,l=Object.create(null))};return{get(d){let h=l[d];if(h!==void 0)return h;if((h=o[d])!==void 0)return c(d,h),h},set(d,h){d in l?l[d]=h:c(d,h)}}},Wd="!",Bm=":",BN=[],Um=(s,a,l,o,c)=>({modifiers:s,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),UN=s=>{const{prefix:a,experimentalParseClassName:l}=s;let o=c=>{const d=[];let h=0,m=0,p=0,y;const g=c.length;for(let S=0;Sp?y-p:void 0;return Um(d,P,C,T)};if(a){const c=a+Bm,d=o;o=h=>h.startsWith(c)?d(h.slice(c.length)):Um(BN,!1,h,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},VN=s=>{const a=new Map;return s.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d0&&(c.sort(),o.push(...c),c=[]),o.push(h)):c.push(h)}return c.length>0&&(c.sort(),o.push(...c)),o}},WN=s=>({cache:$N(s.cacheSize),parseClassName:UN(s),sortModifiers:VN(s),...IN(s)}),HN=/\s+/,KN=(s,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,h=[],m=s.trim().split(HN);let p="";for(let y=m.length-1;y>=0;y-=1){const g=m[y],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:T,maybePostfixModifierPosition:S}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!S,N=o(b?T.substring(0,S):T);if(!N){if(!b){p=g+(p.length>0?" "+p:p);continue}if(N=o(T),!N){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?E+Wd:E,R=j+N;if(h.indexOf(R)>-1)continue;h.push(R);const B=c(N,b);for(let U=0;U0?" "+p:p)}return p},YN=(...s)=>{let a=0,l,o,c="";for(;a{if(typeof s=="string")return s;let a,l="";for(let o=0;o{let l,o,c,d;const h=p=>{const y=a.reduce((g,v)=>v(g),s());return l=WN(y),o=l.cache.get,c=l.cache.set,d=m,m(p)},m=p=>{const y=o(p);if(y)return y;const g=KN(p,l);return c(p,g),g};return d=h,(...p)=>d(YN(...p))},QN=[],Mt=s=>{const a=l=>l[s]||QN;return a.isThemeGetter=!0,a},Jx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Zx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qN=/^\d+\/\d+$/,XN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JN=/\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$/,ZN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ew=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qn=s=>qN.test(s),He=s=>!!s&&!Number.isNaN(Number(s)),Bs=s=>!!s&&Number.isInteger(Number(s)),bd=s=>s.endsWith("%")&&He(s.slice(0,-1)),os=s=>XN.test(s),rw=()=>!0,sw=s=>JN.test(s)&&!ZN.test(s),ep=()=>!1,nw=s=>ew.test(s),aw=s=>tw.test(s),lw=s=>!Re(s)&&!Ie(s),iw=s=>ua(s,sp,ep),Re=s=>Jx.test(s),gn=s=>ua(s,np,sw),Nd=s=>ua(s,hw,He),Vm=s=>ua(s,tp,ep),ow=s=>ua(s,rp,aw),Oi=s=>ua(s,ap,nw),Ie=s=>Zx.test(s),ll=s=>ha(s,np),cw=s=>ha(s,fw),Wm=s=>ha(s,tp),dw=s=>ha(s,sp),uw=s=>ha(s,rp),Fi=s=>ha(s,ap,!0),ua=(s,a,l)=>{const o=Jx.exec(s);return o?o[1]?a(o[1]):l(o[2]):!1},ha=(s,a,l=!1)=>{const o=Zx.exec(s);return o?o[1]?a(o[1]):l:!1},tp=s=>s==="position"||s==="percentage",rp=s=>s==="image"||s==="url",sp=s=>s==="length"||s==="size"||s==="bg-size",np=s=>s==="length",hw=s=>s==="number",fw=s=>s==="family-name",ap=s=>s==="shadow",mw=()=>{const s=Mt("color"),a=Mt("font"),l=Mt("text"),o=Mt("font-weight"),c=Mt("tracking"),d=Mt("leading"),h=Mt("breakpoint"),m=Mt("container"),p=Mt("spacing"),y=Mt("radius"),g=Mt("shadow"),v=Mt("inset-shadow"),C=Mt("text-shadow"),P=Mt("drop-shadow"),T=Mt("blur"),S=Mt("perspective"),b=Mt("aspect"),N=Mt("ease"),E=Mt("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...R(),Ie,Re],U=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],L=()=>[Ie,Re,p],_=()=>[qn,"full","auto",...L()],se=()=>[Bs,"none","subgrid",Ie,Re],le=()=>["auto",{span:["full",Bs,Ie,Re]},Bs,Ie,Re],ie=()=>[Bs,"auto",Ie,Re],ee=()=>["auto","min","max","fr",Ie,Re],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...L()],re=()=>[qn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],A=()=>[s,Ie,Re],ne=()=>[...R(),Wm,Vm,{position:[Ie,Re]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",dw,iw,{size:[Ie,Re]}],O=()=>[bd,ll,gn],F=()=>["","none","full",y,Ie,Re],X=()=>["",He,ll,gn],H=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[He,bd,Wm,Vm],ye=()=>["","none",T,Ie,Re],ge=()=>["none",He,Ie,Re],D=()=>["none",He,Ie,Re],fe=()=>[He,Ie,Re],Se=()=>[qn,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[os],breakpoint:[os],color:[rw],container:[os],"drop-shadow":[os],ease:["in","out","in-out"],font:[lw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[os],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[os],shadow:[os],spacing:["px",He],text:[os],"text-shadow":[os],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",qn,Re,Ie,b]}],container:["container"],columns:[{columns:[He,Re,Ie,m]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:B()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Bs,"auto",Ie,Re]}],basis:[{basis:[qn,"full","auto",m,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,qn,"auto","initial","none",Re]}],grow:[{grow:["",He,Ie,Re]}],shrink:[{shrink:["",He,Ie,Re]}],order:[{order:[Bs,"first","last","none",Ie,Re]}],"grid-cols":[{"grid-cols":se()}],"col-start-end":[{col:le()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":se()}],"row-start-end":[{row:le()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:re()}],w:[{w:[m,"screen",...re()]}],"min-w":[{"min-w":[m,"screen","none",...re()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[h]},...re()]}],h:[{h:["screen","lh",...re()]}],"min-h":[{"min-h":["screen","lh","none",...re()]}],"max-h":[{"max-h":["screen","lh",...re()]}],"font-size":[{text:["base",l,ll,gn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ie,Nd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",bd,Re]}],"font-family":[{font:[cw,Re,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,Ie,Re]}],"line-clamp":[{"line-clamp":[He,"none",Ie,Nd]}],leading:[{leading:[d,...L()]}],"list-image":[{"list-image":["none",Ie,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ie,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Ie,gn]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[He,"auto",Ie,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ie,Re]}],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",Ie,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Bs,Ie,Re],radial:["",Ie,Re],conic:[Bs,Ie,Re]},uw,ow]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Ie,Re]}],"outline-w":[{outline:["",He,ll,gn]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",g,Fi,Oi]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",v,Fi,Oi]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[He,gn]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",C,Fi,Oi]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[He,Ie,Re]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Ie,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ie,Re]}],filter:[{filter:["","none",Ie,Re]}],blur:[{blur:ye()}],brightness:[{brightness:[He,Ie,Re]}],contrast:[{contrast:[He,Ie,Re]}],"drop-shadow":[{"drop-shadow":["","none",P,Fi,Oi]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",He,Ie,Re]}],"hue-rotate":[{"hue-rotate":[He,Ie,Re]}],invert:[{invert:["",He,Ie,Re]}],saturate:[{saturate:[He,Ie,Re]}],sepia:[{sepia:["",He,Ie,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Ie,Re]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[He,Ie,Re]}],"backdrop-contrast":[{"backdrop-contrast":[He,Ie,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Ie,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Ie,Re]}],"backdrop-invert":[{"backdrop-invert":["",He,Ie,Re]}],"backdrop-opacity":[{"backdrop-opacity":[He,Ie,Re]}],"backdrop-saturate":[{"backdrop-saturate":[He,Ie,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Ie,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ie,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Ie,Re]}],ease:[{ease:["linear","initial",N,Ie,Re]}],delay:[{delay:[He,Ie,Re]}],animate:[{animate:["none",E,Ie,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ie,Re]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Ie,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"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",Ie,Re]}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ie,Re]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[He,ll,gn,Nd]}],stroke:[{stroke:["none",...A()]}],"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"]}},xw=GN(mw);function tt(...s){return xw(Kx(s))}const pw=Yx("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 Z({className:s,variant:a,size:l,asChild:o=!1,...c}){const d=o?Wx:"button";return e.jsx(d,{"data-slot":"button",className:tt(pw({variant:a,size:l,className:s})),...c})}function de({className:s,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:tt("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",s),...l})}function gw(){const s=da(),[a,l]=f.useState(""),[o,c]=f.useState(""),[d,h]=f.useState(""),[m,p]=f.useState(!1),y=async()=>{h(""),p(!0);try{const g=await Et("/api/admin",{username:a.trim(),password:o});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){xN(g.token),s("/dashboard",{replace:!0});return}h(g.error||"用户名或密码错误")}catch(g){const v=g;h(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.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:e.jsx(uu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ra,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Tb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(de,{type:"password",value:o,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(Z,{onClick:y,disabled:m,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:m?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Ne=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("rounded-xl border bg-card text-card-foreground shadow",s),...a}));Ne.displayName="Card";const Ue=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex flex-col space-y-1.5 p-6",s),...a}));Ue.displayName="CardHeader";const Ve=f.forwardRef(({className:s,...a},l)=>e.jsx("h3",{ref:l,className:tt("font-semibold leading-none tracking-tight",s),...a}));Ve.displayName="CardTitle";const ht=f.forwardRef(({className:s,...a},l)=>e.jsx("p",{ref:l,className:tt("text-sm text-muted-foreground",s),...a}));ht.displayName="CardDescription";const we=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("p-6 pt-0",s),...a}));we.displayName="CardContent";const yw=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{ref:l,className:tt("flex items-center p-6 pt-0",s),...a}));yw.displayName="CardFooter";function vw(){const s=da(),[a,l]=f.useState(!0),[o,c]=f.useState([]),[d,h]=f.useState([]),[m,p]=f.useState(0),[y,g]=f.useState(0),[v,C]=f.useState(0),[P,T]=f.useState(0),[S,b]=f.useState(null);async function N(){var B;l(!0),b(null);try{const U=await Fe("/api/admin/dashboard/overview");if(U!=null&&U.success){p(U.totalUsers??0),g(U.paidOrderCount??0),C(U.totalRevenue??0),T(U.conversionRate??0),h(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,k]=await Promise.all([Fe("/api/db/users?page=1&pageSize=10"),Fe("/api/orders?page=1&pageSize=20&status=paid")]),L=typeof(U==null?void 0:U.total)=="number"?U.total:((B=U==null?void 0:U.users)==null?void 0:B.length)??0,_=(k==null?void 0:k.orders)??[],se=typeof(k==null?void 0:k.total)=="number"?k.total:_.length,le=_.filter(Q=>Q.status==="paid"||Q.status==="completed"||Q.status==="success"),ie=le.reduce((Q,ce)=>Q+Number(ce.amount||0),0),ee=new Set(le.map(Q=>Q.userId).filter(Boolean)),G=L>0&&ee.size>0?ee.size/L*100:0;p(L),g(se),C(ie),T(G),h(_.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const k=U;(k==null?void 0:k.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(f.useEffect(()=>{N();const B=setInterval(N,3e4);return()=>clearInterval(B)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx($e,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const E=m,j=B=>{const U=B.productType||"",k=B.description||"";if(k){if(U==="section"&&k.includes("章节")){if(k.includes("-")){const L=k.split("-");if(L.length>=3)return{title:`第${L[1]}章 第${L[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:k,subtitle:"章节购买"}}return U==="fullbook"||k.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||k.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:k,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${B.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},R=[{title:"总用户数",value:E,icon:Qt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:ul,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Bd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:us,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),S&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:R.map((B,U)=>e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>B.link&&s(B.link),children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ve,{className:"text-sm font-medium text-gray-400",children:B.title}),e.jsx("div",{className:`p-2 rounded-lg ${B.bg}`,children:e.jsx(B.icon,{className:`w-4 h-4 ${B.color}`})})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:B.value}),e.jsx(Vs,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ve,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx($e,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(B=>{var se;const U=B.referrerId?o.find(le=>le.id===B.referrerId):void 0,k=B.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(B.referrerId?String(B.referrerId).slice(0,8):""),L=j(B),_=B.userNickname||((se=o.find(le=>le.id===B.userId))==null?void 0:se.nickname)||"匿名用户";return e.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:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[B.userAvatar?e.jsx("img",{src:B.userAvatar,alt:_,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:le=>{le.currentTarget.style.display="none";const ie=le.currentTarget.nextElementSibling;ie&&ie.classList.remove("hidden")}}):null,e.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 ${B.userAvatar?"hidden":""}`,children:_.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:_}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:L.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:L.subtitle}),e.jsx("span",{children:new Date(B.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),k&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",k]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(B.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:B.paymentMethod||"微信"})]})]},B.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Bd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"新注册用户"})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(B=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=B.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:B.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:B.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"})]},B.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const ir=f.forwardRef(({className:s,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:tt("w-full caption-bottom text-sm",s),...a})}));ir.displayName="Table";const or=f.forwardRef(({className:s,...a},l)=>e.jsx("thead",{ref:l,className:tt("[&_tr]:border-b",s),...a}));or.displayName="TableHeader";const cr=f.forwardRef(({className:s,...a},l)=>e.jsx("tbody",{ref:l,className:tt("[&_tr:last-child]:border-0",s),...a}));cr.displayName="TableBody";const Ge=f.forwardRef(({className:s,...a},l)=>e.jsx("tr",{ref:l,className:tt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...a}));Ge.displayName="TableRow";const je=f.forwardRef(({className:s,...a},l)=>e.jsx("th",{ref:l,className:tt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",s),...a}));je.displayName="TableHead";const pe=f.forwardRef(({className:s,...a},l)=>e.jsx("td",{ref:l,className:tt("p-4 align-middle [&:has([role=checkbox])]:pr-0",s),...a}));pe.displayName="TableCell";const jw=Yx("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Oe({className:s,variant:a,asChild:l=!1,...o}){const c=l?Wx:"span";return e.jsx(c,{className:tt(jw({variant:a}),s),...o})}function Be(s,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(s==null||s(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function bw(s,a){const l=f.createContext(a),o=d=>{const{children:h,...m}=d,p=f.useMemo(()=>m,Object.values(m));return e.jsx(l.Provider,{value:p,children:h})};o.displayName=s+"Provider";function c(d){const h=f.useContext(l);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[o,c]}function en(s,a=[]){let l=[];function o(d,h){const m=f.createContext(h),p=l.length;l=[...l,h];const y=v=>{var N;const{scope:C,children:P,...T}=v,S=((N=C==null?void 0:C[s])==null?void 0:N[p])||m,b=f.useMemo(()=>T,Object.values(T));return e.jsx(S.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,C){var S;const P=((S=C==null?void 0:C[s])==null?void 0:S[p])||m,T=f.useContext(P);if(T)return T;if(h!==void 0)return h;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(h=>f.createContext(h));return function(m){const p=(m==null?void 0:m[s])||d;return f.useMemo(()=>({[`__scope${s}`]:{...m,[s]:p}}),[m,p])}};return c.scopeName=s,[o,Nw(c,...a)]}function Nw(...s){const a=s[0];if(s.length===1)return a;const l=()=>{const o=s.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const h=o.reduce((m,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...m,...v}},{});return f.useMemo(()=>({[`__scope${a.scopeName}`]:h}),[h])}};return l.scopeName=a.scopeName,l}var qt=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},ww=uo[" useId ".trim().toString()]||(()=>{}),Sw=0;function Gs(s){const[a,l]=f.useState(ww());return qt(()=>{l(o=>o??String(Sw++))},[s]),a?`radix-${a}`:""}var Cw=uo[" useInsertionEffect ".trim().toString()]||qt;function bn({prop:s,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,h]=kw({defaultProp:a,onChange:l}),m=s!==void 0,p=m?s:c;{const g=f.useRef(s!==void 0);f.useEffect(()=>{const v=g.current;v!==m&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${m?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=m},[m,o])}const y=f.useCallback(g=>{var v;if(m){const C=Ew(g)?g(s):g;C!==s&&((v=h.current)==null||v.call(h,C))}else d(g)},[m,s,d,h]);return[p,y]}function kw({defaultProp:s,onChange:a}){const[l,o]=f.useState(s),c=f.useRef(l),d=f.useRef(a);return Cw(()=>{d.current=a},[a]),f.useEffect(()=>{var h;c.current!==l&&((h=d.current)==null||h.call(d,l),c.current=l)},[l,c]),[l,o,d]}function Ew(s){return typeof s=="function"}function xl(s){const a=Pw(s),l=f.forwardRef((o,c)=>{const{children:d,...h}=o,m=f.Children.toArray(d),p=m.find(Rw);if(p){const y=p.props.children,g=m.map(v=>v===p?f.Children.count(y)>1?f.Children.only(null):f.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...h,ref:c,children:f.isValidElement(y)?f.cloneElement(y,void 0,g):null})}return e.jsx(a,{...h,ref:c,children:d})});return l.displayName=`${s}.Slot`,l}function Pw(s){const a=f.forwardRef((l,o)=>{const{children:c,...d}=l;if(f.isValidElement(c)){const h=_w(c),m=Iw(d,c.props);return c.type!==f.Fragment&&(m.ref=o?mu(o,h):h),f.cloneElement(c,m)}return f.Children.count(c)>1?f.Children.only(null):null});return a.displayName=`${s}.SlotClone`,a}var Tw=Symbol("radix.slottable");function Rw(s){return f.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Tw}function Iw(s,a){const l={...a};for(const o in a){const c=s[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...m)=>{const p=d(...m);return c(...m),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...s,...l}}function _w(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ke=Mw.reduce((s,a)=>{const l=xl(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{});function Aw(s,a){s&&gl.flushSync(()=>s.dispatchEvent(a))}function Qs(s){const a=f.useRef(s);return f.useEffect(()=>{a.current=s}),f.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Dw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s);f.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 Lw="DismissableLayer",Hd="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Fw="dismissableLayer.focusOutside",Hm,lp=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=f.forwardRef((s,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:m,...p}=s,y=f.useContext(lp),[g,v]=f.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=f.useState({}),T=et(a,k=>v(k)),S=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(b),E=g?S.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,R=E>=N,B=Bw(k=>{const L=k.target,_=[...y.branches].some(se=>se.contains(L));!R||_||(c==null||c(k),h==null||h(k),k.defaultPrevented||m==null||m())},C),U=Uw(k=>{const L=k.target;[...y.branches].some(se=>se.contains(L))||(d==null||d(k),h==null||h(k),k.defaultPrevented||m==null||m())},C);return Dw(k=>{E===y.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&m&&(k.preventDefault(),m()))},C),f.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Hm=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Km(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=Hm)}},[g,C,l,y]),f.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Km())},[g,y]),f.useEffect(()=>{const k=()=>P({});return document.addEventListener(Hd,k),()=>document.removeEventListener(Hd,k)},[]),e.jsx(Ke.div,{...p,ref:T,style:{pointerEvents:j?R?"auto":"none":void 0,...s.style},onFocusCapture:Be(s.onFocusCapture,U.onFocusCapture),onBlurCapture:Be(s.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Be(s.onPointerDownCapture,B.onPointerDownCapture)})});pu.displayName=Lw;var zw="DismissableLayerBranch",$w=f.forwardRef((s,a)=>{const l=f.useContext(lp),o=f.useRef(null),c=et(a,o);return f.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(Ke.div,{...s,ref:c})});$w.displayName=zw;function Bw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1),c=f.useRef(()=>{});return f.useEffect(()=>{const d=m=>{if(m.target&&!o.current){let p=function(){ip(Ow,l,y,{discrete:!0})};const y={originalEvent:m};m.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);o.current=!1},h=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(h),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Uw(s,a=globalThis==null?void 0:globalThis.document){const l=Qs(s),o=f.useRef(!1);return f.useEffect(()=>{const c=d=>{d.target&&!o.current&&ip(Fw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Km(){const s=new CustomEvent(Hd);document.dispatchEvent(s)}function ip(s,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(s,a,{once:!0}),o?Aw(c,d):c.dispatchEvent(d)}var wd="focusScope.autoFocusOnMount",Sd="focusScope.autoFocusOnUnmount",Ym={bubbles:!1,cancelable:!0},Vw="FocusScope",gu=f.forwardRef((s,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...h}=s,[m,p]=f.useState(null),y=Qs(c),g=Qs(d),v=f.useRef(null),C=et(a,S=>p(S)),P=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(o){let S=function(j){if(P.paused||!m)return;const R=j.target;m.contains(R)?v.current=R:Ws(v.current,{select:!0})},b=function(j){if(P.paused||!m)return;const R=j.relatedTarget;R!==null&&(m.contains(R)||Ws(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const B of j)B.removedNodes.length>0&&Ws(m)};document.addEventListener("focusin",S),document.addEventListener("focusout",b);const E=new MutationObserver(N);return m&&E.observe(m,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",b),E.disconnect()}}},[o,m,P.paused]),f.useEffect(()=>{if(m){Qm.add(P);const S=document.activeElement;if(!m.contains(S)){const N=new CustomEvent(wd,Ym);m.addEventListener(wd,y),m.dispatchEvent(N),N.defaultPrevented||(Ww(Qw(op(m)),{select:!0}),document.activeElement===S&&Ws(m))}return()=>{m.removeEventListener(wd,y),setTimeout(()=>{const N=new CustomEvent(Sd,Ym);m.addEventListener(Sd,g),m.dispatchEvent(N),N.defaultPrevented||Ws(S??document.body,{select:!0}),m.removeEventListener(Sd,g),Qm.remove(P)},0)}}},[m,y,g,P]);const T=f.useCallback(S=>{if(!l&&!o||P.paused)return;const b=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(b&&N){const E=S.currentTarget,[j,R]=Hw(E);j&&R?!S.shiftKey&&N===R?(S.preventDefault(),l&&Ws(j,{select:!0})):S.shiftKey&&N===j&&(S.preventDefault(),l&&Ws(R,{select:!0})):N===E&&S.preventDefault()}},[l,o,P.paused]);return e.jsx(Ke.div,{tabIndex:-1,...h,ref:C,onKeyDown:T})});gu.displayName=Vw;function Ww(s,{select:a=!1}={}){const l=document.activeElement;for(const o of s)if(Ws(o,{select:a}),document.activeElement!==l)return}function Hw(s){const a=op(s),l=Gm(a,s),o=Gm(a.reverse(),s);return[l,o]}function op(s){const a=[],l=document.createTreeWalker(s,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 Gm(s,a){for(const l of s)if(!Kw(l,{upTo:a}))return l}function Kw(s,{upTo:a}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(a!==void 0&&s===a)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function Yw(s){return s instanceof HTMLInputElement&&"select"in s}function Ws(s,{select:a=!1}={}){if(s&&s.focus){const l=document.activeElement;s.focus({preventScroll:!0}),s!==l&&Yw(s)&&a&&s.select()}}var Qm=Gw();function Gw(){let s=[];return{add(a){const l=s[0];a!==l&&(l==null||l.pause()),s=qm(s,a),s.unshift(a)},remove(a){var l;s=qm(s,a),(l=s[0])==null||l.resume()}}}function qm(s,a){const l=[...s],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Qw(s){return s.filter(a=>a.tagName!=="A")}var qw="Portal",yu=f.forwardRef((s,a)=>{var m;const{container:l,...o}=s,[c,d]=f.useState(!1);qt(()=>d(!0),[]);const h=l||c&&((m=globalThis==null?void 0:globalThis.document)==null?void 0:m.body);return h?yv.createPortal(e.jsx(Ke.div,{...o,ref:a}),h):null});yu.displayName=qw;function Xw(s,a){return f.useReducer((l,o)=>a[l][o]??l,s)}var yl=s=>{const{present:a,children:l}=s,o=Jw(a),c=typeof l=="function"?l({present:o.isPresent}):f.Children.only(l),d=et(o.ref,Zw(c));return typeof l=="function"||o.isPresent?f.cloneElement(c,{ref:d}):null};yl.displayName="Presence";function Jw(s){const[a,l]=f.useState(),o=f.useRef(null),c=f.useRef(s),d=f.useRef("none"),h=s?"mounted":"unmounted",[m,p]=Xw(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const y=zi(o.current);d.current=m==="mounted"?y:"none"},[m]),qt(()=>{const y=o.current,g=c.current;if(g!==s){const C=d.current,P=zi(y);s?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,p]),qt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const S=zi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&S&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=P=>{P.target===a&&(d.current=zi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:f.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function zi(s){return(s==null?void 0:s.animationName)||"none"}function Zw(s){var o,c;let a=(o=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=(c=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}var Cd=0;function cp(){f.useEffect(()=>{const s=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",s[0]??Xm()),document.body.insertAdjacentElement("beforeend",s[1]??Xm()),Cd++,()=>{Cd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Cd--}},[])}function Xm(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var Kr=function(){return Kr=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return p1;var a=g1(s),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])}},v1=fp(),sa="data-scroll-locked",j1=function(s,a,l,o){var c=s.left,d=s.top,h=s.right,m=s.gap;return l===void 0&&(l="margin"),` - .`.concat(t1,` { - overflow: hidden `).concat(o,`; - padding-right: `).concat(m,"px ").concat(o,`; - } - body[`).concat(sa,`] { - overflow: hidden `).concat(o,`; - overscroll-behavior: contain; - `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` - padding-left: `.concat(c,`px; - padding-top: `).concat(d,`px; - padding-right: `).concat(h,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(m,"px ").concat(o,`; - `),l==="padding"&&"padding-right: ".concat(m,"px ").concat(o,";")].filter(Boolean).join(""),` - } - - .`).concat(Ki,` { - right: `).concat(m,"px ").concat(o,`; - } - - .`).concat(Yi,` { - margin-right: `).concat(m,"px ").concat(o,`; - } - - .`).concat(Ki," .").concat(Ki,` { - right: 0 `).concat(o,`; - } - - .`).concat(Yi," .").concat(Yi,` { - margin-right: 0 `).concat(o,`; - } - - body[`).concat(sa,`] { - `).concat(r1,": ").concat(m,`px; - } -`)},Zm=function(){var s=parseInt(document.body.getAttribute(sa)||"0",10);return isFinite(s)?s:0},b1=function(){f.useEffect(function(){return document.body.setAttribute(sa,(Zm()+1).toString()),function(){var s=Zm()-1;s<=0?document.body.removeAttribute(sa):document.body.setAttribute(sa,s.toString())}},[])},N1=function(s){var a=s.noRelative,l=s.noImportant,o=s.gapMode,c=o===void 0?"margin":o;b1();var d=f.useMemo(function(){return y1(c)},[c]);return f.createElement(v1,{styles:j1(d,!a,c,l?"":"!important")})},Kd=!1;if(typeof window<"u")try{var $i=Object.defineProperty({},"passive",{get:function(){return Kd=!0,!0}});window.addEventListener("test",$i,$i),window.removeEventListener("test",$i,$i)}catch{Kd=!1}var Xn=Kd?{passive:!1}:!1,w1=function(s){return s.tagName==="TEXTAREA"},mp=function(s,a){if(!(s instanceof Element))return!1;var l=window.getComputedStyle(s);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!w1(s)&&l[a]==="visible")},S1=function(s){return mp(s,"overflowY")},C1=function(s){return mp(s,"overflowX")},ex=function(s,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=xp(s,o);if(c){var d=pp(s,o),h=d[1],m=d[2];if(h>m)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},k1=function(s){var a=s.scrollTop,l=s.scrollHeight,o=s.clientHeight;return[a,l,o]},E1=function(s){var a=s.scrollLeft,l=s.scrollWidth,o=s.clientWidth;return[a,l,o]},xp=function(s,a){return s==="v"?S1(a):C1(a)},pp=function(s,a){return s==="v"?k1(a):E1(a)},P1=function(s,a){return s==="h"&&a==="rtl"?-1:1},T1=function(s,a,l,o,c){var d=P1(s,window.getComputedStyle(a).direction),h=d*o,m=l.target,p=a.contains(m),y=!1,g=h>0,v=0,C=0;do{if(!m)break;var P=pp(s,m),T=P[0],S=P[1],b=P[2],N=S-b-d*T;(T||N)&&xp(s,m)&&(v+=N,C+=T);var E=m.parentNode;m=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&m!==document.body||p&&(a.contains(m)||a===m));return(g&&Math.abs(v)<1||!g&&Math.abs(C)<1)&&(y=!0),y},Bi=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},tx=function(s){return[s.deltaX,s.deltaY]},rx=function(s){return s&&"current"in s?s.current:s},R1=function(s,a){return s[0]===a[0]&&s[1]===a[1]},I1=function(s){return` - .block-interactivity-`.concat(s,` {pointer-events: none;} - .allow-interactivity-`).concat(s,` {pointer-events: all;} -`)},_1=0,Jn=[];function M1(s){var a=f.useRef([]),l=f.useRef([0,0]),o=f.useRef(),c=f.useState(_1++)[0],d=f.useState(fp)[0],h=f.useRef(s);f.useEffect(function(){h.current=s},[s]),f.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(c));var S=e1([s.lockRef.current],(s.shards||[]).map(rx),!0).filter(Boolean);return S.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[s.inert,s.lockRef.current,s.shards]);var m=f.useCallback(function(S,b){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!h.current.allowPinchZoom;var N=Bi(S),E=l.current,j="deltaX"in S?S.deltaX:E[0]-N[0],R="deltaY"in S?S.deltaY:E[1]-N[1],B,U=S.target,k=Math.abs(j)>Math.abs(R)?"h":"v";if("touches"in S&&k==="h"&&U.type==="range")return!1;var L=window.getSelection(),_=L&&L.anchorNode,se=_?_===U||_.contains(U):!1;if(se)return!1;var le=ex(k,U);if(!le)return!0;if(le?B=k:(B=k==="v"?"h":"v",le=ex(k,U)),!le)return!1;if(!o.current&&"changedTouches"in S&&(j||R)&&(o.current=B),!B)return!0;var ie=o.current||B;return T1(ie,b,S,ie==="h"?j:R)},[]),p=f.useCallback(function(S){var b=S;if(!(!Jn.length||Jn[Jn.length-1]!==d)){var N="deltaY"in b?tx(b):Bi(b),E=a.current.filter(function(B){return B.name===b.type&&(B.target===b.target||b.target===B.shadowParent)&&R1(B.delta,N)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(h.current.shards||[]).map(rx).filter(Boolean).filter(function(B){return B.contains(b.target)}),R=j.length>0?m(b,j[0]):!h.current.noIsolation;R&&b.cancelable&&b.preventDefault()}}},[]),y=f.useCallback(function(S,b,N,E){var j={name:S,delta:b,target:N,should:E,shadowParent:A1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(R){return R!==j})},1)},[]),g=f.useCallback(function(S){l.current=Bi(S),o.current=void 0},[]),v=f.useCallback(function(S){y(S.type,tx(S),S.target,m(S,s.lockRef.current))},[]),C=f.useCallback(function(S){y(S.type,Bi(S),S.target,m(S,s.lockRef.current))},[]);f.useEffect(function(){return Jn.push(d),s.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",p,Xn),document.addEventListener("touchmove",p,Xn),document.addEventListener("touchstart",g,Xn),function(){Jn=Jn.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,Xn),document.removeEventListener("touchmove",p,Xn),document.removeEventListener("touchstart",g,Xn)}},[]);var P=s.removeScrollBar,T=s.inert;return f.createElement(f.Fragment,null,T?f.createElement(d,{styles:I1(c)}):null,P?f.createElement(N1,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function A1(s){for(var a=null;s!==null;)s instanceof ShadowRoot&&(a=s.host,s=s.host),s=s.parentNode;return a}const D1=c1(hp,M1);var vu=f.forwardRef(function(s,a){return f.createElement(po,Kr({},s,{ref:a,sideCar:D1}))});vu.classNames=po.classNames;var L1=function(s){if(typeof document>"u")return null;var a=Array.isArray(s)?s[0]:s;return a.ownerDocument.body},Zn=new WeakMap,Ui=new WeakMap,Vi={},Td=0,gp=function(s){return s&&(s.host||gp(s.parentNode))},O1=function(s,a){return a.map(function(l){if(s.contains(l))return l;var o=gp(l);return o&&s.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",s,". Doing nothing"),null)}).filter(function(l){return!!l})},F1=function(s,a,l,o){var c=O1(a,Array.isArray(s)?s:[s]);Vi[l]||(Vi[l]=new WeakMap);var d=Vi[l],h=[],m=new Set,p=new Set(c),y=function(v){!v||m.has(v)||(m.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(C){if(m.has(C))g(C);else try{var P=C.getAttribute(o),T=P!==null&&P!=="false",S=(Zn.get(C)||0)+1,b=(d.get(C)||0)+1;Zn.set(C,S),d.set(C,b),h.push(C),S===1&&T&&Ui.set(C,!0),b===1&&C.setAttribute(l,"true"),T||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return g(a),m.clear(),Td++,function(){h.forEach(function(v){var C=Zn.get(v)-1,P=d.get(v)-1;Zn.set(v,C),d.set(v,P),C||(Ui.has(v)||v.removeAttribute(o),Ui.delete(v)),P||v.removeAttribute(l)}),Td--,Td||(Zn=new WeakMap,Zn=new WeakMap,Ui=new WeakMap,Vi={})}},yp=function(s,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(s)?s:[s]),c=L1(s);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),F1(o,c,l,"aria-hidden")):function(){return null}},go="Dialog",[vp]=en(go),[z1,Or]=vp(go),jp=s=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:h=!0}=s,m=f.useRef(null),p=f.useRef(null),[y,g]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:go});return e.jsx(z1,{scope:a,triggerRef:m,contentRef:p,contentId:Gs(),titleId:Gs(),descriptionId:Gs(),open:y,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(v=>!v),[g]),modal:h,children:l})};jp.displayName=go;var bp="DialogTrigger",$1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bp,l),d=et(a,c.triggerRef);return e.jsx(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Nu(c.open),...o,ref:d,onClick:Be(s.onClick,c.onOpenToggle)})});$1.displayName=bp;var ju="DialogPortal",[B1,Np]=vp(ju,{forceMount:void 0}),wp=s=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=s,d=Or(ju,a);return e.jsx(B1,{scope:a,forceMount:l,children:f.Children.map(o,h=>e.jsx(yl,{present:l||d.open,children:e.jsx(yu,{asChild:!0,container:c,children:h})}))})};wp.displayName=ju;var so="DialogOverlay",Sp=f.forwardRef((s,a)=>{const l=Np(so,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(so,s.__scopeDialog);return d.modal?e.jsx(yl,{present:o||d.open,children:e.jsx(V1,{...c,ref:a})}):null});Sp.displayName=so;var U1=xl("DialogOverlay.RemoveScroll"),V1=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(so,l);return e.jsx(vu,{as:U1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(Ke.div,{"data-state":Nu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Nn="DialogContent",Cp=f.forwardRef((s,a)=>{const l=Np(Nn,s.__scopeDialog),{forceMount:o=l.forceMount,...c}=s,d=Or(Nn,s.__scopeDialog);return e.jsx(yl,{present:o||d.open,children:d.modal?e.jsx(W1,{...c,ref:a}):e.jsx(H1,{...c,ref:a})})});Cp.displayName=Nn;var W1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(null),c=et(a,l.contentRef,o);return f.useEffect(()=>{const d=o.current;if(d)return yp(d)},[]),e.jsx(kp,{...s,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Be(s.onCloseAutoFocus,d=>{var h;d.preventDefault(),(h=l.triggerRef.current)==null||h.focus()}),onPointerDownOutside:Be(s.onPointerDownOutside,d=>{const h=d.detail.originalEvent,m=h.button===0&&h.ctrlKey===!0;(h.button===2||m)&&d.preventDefault()}),onFocusOutside:Be(s.onFocusOutside,d=>d.preventDefault())})}),H1=f.forwardRef((s,a)=>{const l=Or(Nn,s.__scopeDialog),o=f.useRef(!1),c=f.useRef(!1);return e.jsx(kp,{...s,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var h,m;(h=s.onCloseAutoFocus)==null||h.call(s,d),d.defaultPrevented||(o.current||(m=l.triggerRef.current)==null||m.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=s.onInteractOutside)==null||p.call(s,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const h=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(h))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),kp=f.forwardRef((s,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...h}=s,m=Or(Nn,l),p=f.useRef(null),y=et(a,p);return cp(),e.jsxs(e.Fragment,{children:[e.jsx(gu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(pu,{role:"dialog",id:m.contentId,"aria-describedby":m.descriptionId,"aria-labelledby":m.titleId,"data-state":Nu(m.open),...h,ref:y,onDismiss:()=>m.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(K1,{titleId:m.titleId}),e.jsx(G1,{contentRef:p,descriptionId:m.descriptionId})]})]})}),bu="DialogTitle",Ep=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(bu,l);return e.jsx(Ke.h2,{id:c.titleId,...o,ref:a})});Ep.displayName=bu;var Pp="DialogDescription",Tp=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Pp,l);return e.jsx(Ke.p,{id:c.descriptionId,...o,ref:a})});Tp.displayName=Pp;var Rp="DialogClose",Ip=f.forwardRef((s,a)=>{const{__scopeDialog:l,...o}=s,c=Or(Rp,l);return e.jsx(Ke.button,{type:"button",...o,ref:a,onClick:Be(s.onClick,()=>c.onOpenChange(!1))})});Ip.displayName=Rp;function Nu(s){return s?"open":"closed"}var _p="DialogTitleWarning",[U4,Mp]=bw(_p,{contentName:Nn,titleName:bu,docsSlug:"dialog"}),K1=({titleId:s})=>{const a=Mp(_p),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 f.useEffect(()=>{s&&(document.getElementById(s)||console.error(l))},[l,s]),null},Y1="DialogDescriptionWarning",G1=({contentRef:s,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Mp(Y1).contentName}}.`;return f.useEffect(()=>{var d;const c=(d=s.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,s,a]),null},Q1=jp,q1=wp,X1=Sp,J1=Cp,Z1=Ep,e2=Tp,t2=Ip;function wt(s){return e.jsx(Q1,{"data-slot":"dialog",...s})}function r2(s){return e.jsx(q1,{...s})}const Ap=f.forwardRef(({className:s,...a},l)=>e.jsx(X1,{ref:l,className:tt("fixed inset-0 z-50 bg-black/50",s),...a}));Ap.displayName="DialogOverlay";const vt=f.forwardRef(({className:s,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(r2,{children:[e.jsx(Ap,{}),e.jsxs(J1,{ref:c,"aria-describedby":void 0,className:tt("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",s),...o,children:[a,l&&e.jsxs(t2,{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:[e.jsx(Sr,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));vt.displayName="DialogContent";function St({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col gap-2 text-center sm:text-left",s),...a})}function Ft({className:s,...a}){return e.jsx("div",{className:tt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",s),...a})}function Ct(s){return e.jsx(Z1,{className:"text-lg font-semibold leading-none",...s})}function s2(s){return e.jsx(e2,{className:"text-sm text-muted-foreground",...s})}function wu(s,a){const[l,o]=f.useState(s);return f.useEffect(()=>{const c=setTimeout(()=>o(s),a);return()=>clearTimeout(c)},[s,a]),l}function Ar({page:s,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:d,pageSizeOptions:h=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:o,onChange:m=>d(Number(m.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:h.map(m=>e.jsxs("option",{value:m,children:[m," 条/页"]},m))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:s<=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:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(s-1),disabled:s<=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:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[s," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(s+1),disabled:s>=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:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:s>=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 n2(){const[s,a]=f.useState([]),[l,o]=f.useState([]),[c,d]=f.useState(0),[h,m]=f.useState(0),[p,y]=f.useState(0),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(""),b=wu(T,300),[N,E]=f.useState("all"),[j,R]=f.useState(!0),[B,U]=f.useState(null),[k,L]=f.useState(null),[_,se]=f.useState(""),[le,ie]=f.useState(!1);async function ee(){R(!0),U(null);try{const W=N==="all"?"":N==="completed"?"completed":N,M=new URLSearchParams({page:String(g),pageSize:String(C),...W&&{status:W},...b&&{search:b}}),[O,F]=await Promise.all([Fe(`/api/orders?${M}`),Fe("/api/db/users?page=1&pageSize=500")]);O!=null&&O.success&&(a(O.orders||[]),d(O.total??0),m(O.totalRevenue??0),y(O.todayRevenue??0)),F!=null&&F.success&&F.users&&o(F.users)}catch(W){console.error("加载订单失败",W),U("加载订单失败,请检查网络后重试")}finally{R(!1)}}f.useEffect(()=>{v(1)},[b,N]),f.useEffect(()=>{ee()},[g,C,b,N]);const G=W=>{var M;return W.userNickname||((M=l.find(O=>O.id===W.userId))==null?void 0:M.nickname)||"匿名用户"},Q=W=>{var M;return((M=l.find(O=>O.id===W))==null?void 0:M.phone)||"-"},ce=W=>{const M=W.productType||W.type||"",O=W.description||"";if(O){if(M==="section"&&O.includes("章节")){if(O.includes("-")){const F=O.split("-");if(F.length>=3)return{name:`第${F[1]}章 第${F[2]}节`,type:"《一场Soul的创业实验》"}}return{name:O,type:"章节购买"}}return M==="fullbook"||O.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||O.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||O.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:O,type:"其他"}}return M==="section"?{name:`章节 ${W.productId||W.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},re=Math.ceil(c/C)||1;async function A(){var W;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){ie(!0),U(null);try{const M=await Nt("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:_||void 0});M!=null&&M.success?(L(null),se(""),ee()):U((M==null?void 0:M.error)||"退款失败")}catch(M){const O=M;U(((W=O==null?void 0:O.data)==null?void 0:W.error)||"退款失败,请检查网络后重试")}finally{ie(!1)}}}function ne(){if(s.length===0){alert("暂无数据可导出");return}const W=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=s.map(ue=>{const K=ce(ue);return[ue.orderSn||ue.id||"",G(ue),Q(ue.userId),K.name,Number(ue.amount||0).toFixed(2),ue.paymentMethod==="wechat"?"微信支付":ue.paymentMethod==="alipay"?"支付宝":ue.paymentMethod||"微信支付",ue.status==="refunded"?"已退款":ue.status==="paid"||ue.status==="completed"?"已完成":ue.status==="pending"||ue.status==="created"?"待支付":"已失败",ue.status==="refunded"&&ue.refundReason?ue.refundReason:"-",ue.referrerEarnings?Number(ue.referrerEarnings).toFixed(2):"-",ue.createdAt?new Date(ue.createdAt).toLocaleString("zh-CN"):""].join(",")}),O="\uFEFF"+[W.join(","),...M].join(` -`),F=new Blob([O],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(F),H=document.createElement("a");H.href=X,H.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,H.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[B&&e.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:[e.jsx("span",{children:B}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",s.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:ee,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",h.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:T,onChange:W=>S(W.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lb,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:W=>E(W.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(Z,{variant:"outline",onClick:ne,disabled:s.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(eb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"订单号"}),e.jsx(je,{className:"text-gray-400",children:"用户"}),e.jsx(je,{className:"text-gray-400",children:"商品"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"支付方式"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"退款原因"}),e.jsx(je,{className:"text-gray-400",children:"分销佣金"}),e.jsx(je,{className:"text-gray-400",children:"下单时间"}),e.jsx(je,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(W=>{const M=ce(W);return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(pe,{className:"font-mono text-xs text-gray-400",children:[(W.orderSn||W.id||"").slice(0,12),"..."]}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:G(W)}),e.jsx("p",{className:"text-gray-500 text-xs",children:Q(W.userId)})]})}),e.jsx(pe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(W.productType||W.type)==="vip"&&e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:M.type})]})}),e.jsxs(pe,{className:"text-[#38bdac] font-bold",children:["¥",Number(W.amount||0).toFixed(2)]}),e.jsx(pe,{className:"text-gray-300",children:W.paymentMethod==="wechat"?"微信支付":W.paymentMethod==="alipay"?"支付宝":W.paymentMethod||"微信支付"}),e.jsx(pe,{children:W.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):W.status==="paid"||W.status==="completed"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):W.status==="pending"||W.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(pe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:W.refundReason,children:W.status==="refunded"&&W.refundReason?W.refundReason:"-"}),e.jsx(pe,{className:"text-[#FFD700]",children:W.referrerEarnings?`¥${Number(W.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(pe,{className:"text-gray-400 text-sm",children:new Date(W.createdAt).toLocaleString("zh-CN")}),e.jsx(pe,{children:(W.status==="paid"||W.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{L(W),se("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},W.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Ar,{page:g,totalPages:re,total:c,pageSize:C,onPageChange:v,onPageSizeChange:W=>{P(W),v(1)}})]})})}),e.jsx(wt,{open:!!k,onOpenChange:W=>!W&&L(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:_,onChange:W=>se(W.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>L(null),disabled:le,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:A,disabled:le,children:le?"退款中...":"确认退款"})]})]})})]})}var a2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=a2.reduce((s,a)=>{const l=Vx(`Primitive.${a}`),o=f.forwardRef((c,d)=>{const{asChild:h,...m}=c,p=h?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...m,ref:d})});return o.displayName=`Primitive.${a}`,{...s,[a]:o}},{}),i2="Label",Dp=f.forwardRef((s,a)=>e.jsx(l2.label,{...s,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=s.onMouseDown)==null||c.call(s,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Dp.displayName=i2;var Lp=Dp;const te=f.forwardRef(({className:s,...a},l)=>e.jsx(Lp,{ref:l,className:tt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",s),...a}));te.displayName=Lp.displayName;function Su(s){const a=f.useRef({value:s,previous:s});return f.useMemo(()=>(a.current.value!==s&&(a.current.previous=a.current.value,a.current.value=s),a.current.previous),[s])}function Cu(s){const[a,l]=f.useState(void 0);return qt(()=>{if(s){l({width:s.offsetWidth,height:s.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let h,m;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;h=y.inlineSize,m=y.blockSize}else h=s.offsetWidth,m=s.offsetHeight;l({width:h,height:m})});return o.observe(s,{box:"border-box"}),()=>o.unobserve(s)}else l(void 0)},[s]),a}var yo="Switch",[o2]=en(yo),[c2,d2]=o2(yo),Op=f.forwardRef((s,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:h,disabled:m,value:p="on",onCheckedChange:y,form:g,...v}=s,[C,P]=f.useState(null),T=et(a,j=>P(j)),S=f.useRef(!1),b=C?g||!!C.closest("form"):!0,[N,E]=bn({prop:c,defaultProp:d??!1,onChange:y,caller:yo});return e.jsxs(c2,{scope:l,checked:N,disabled:m,children:[e.jsx(Ke.button,{type:"button",role:"switch","aria-checked":N,"aria-required":h,"data-state":Bp(N),"data-disabled":m?"":void 0,disabled:m,value:p,...v,ref:T,onClick:Be(s.onClick,j=>{E(R=>!R),b&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),b&&e.jsx($p,{control:C,bubbles:!S.current,name:o,value:p,checked:N,required:h,disabled:m,form:g,style:{transform:"translateX(-100%)"}})]})});Op.displayName=yo;var Fp="SwitchThumb",zp=f.forwardRef((s,a)=>{const{__scopeSwitch:l,...o}=s,c=d2(Fp,l);return e.jsx(Ke.span,{"data-state":Bp(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});zp.displayName=Fp;var u2="SwitchBubbleInput",$p=f.forwardRef(({__scopeSwitch:s,control:a,checked:l,bubbles:o=!0,...c},d)=>{const h=f.useRef(null),m=et(h,d),p=Su(l),y=Cu(a);return f.useEffect(()=>{const g=h.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const T=new Event("click",{bubbles:o});P.call(g,l),g.dispatchEvent(T)}},[p,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:m,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$p.displayName=u2;function Bp(s){return s?"checked":"unchecked"}var Up=Op,h2=zp;const it=f.forwardRef(({className:s,...a},l)=>e.jsx(Up,{className:tt("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]",s),...a,ref:l,children:e.jsx(h2,{className:tt("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")})}));it.displayName=Up.displayName;function ku(s){const a=s+"CollectionProvider",[l,o]=en(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),h=S=>{const{scope:b,children:N}=S,E=Us.useRef(null),j=Us.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:N})};h.displayName=a;const m=s+"CollectionSlot",p=xl(m),y=Us.forwardRef((S,b)=>{const{scope:N,children:E}=S,j=d(m,N),R=et(b,j.collectionRef);return e.jsx(p,{ref:R,children:E})});y.displayName=m;const g=s+"CollectionItemSlot",v="data-radix-collection-item",C=xl(g),P=Us.forwardRef((S,b)=>{const{scope:N,children:E,...j}=S,R=Us.useRef(null),B=et(b,R),U=d(g,N);return Us.useEffect(()=>(U.itemMap.set(R,{ref:R,...j}),()=>void U.itemMap.delete(R))),e.jsx(C,{[v]:"",ref:B,children:E})});P.displayName=g;function T(S){const b=d(s+"CollectionConsumer",S);return Us.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,k)=>j.indexOf(U.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:h,Slot:y,ItemSlot:P},T,o]}var f2=f.createContext(void 0);function vo(s){const a=f.useContext(f2);return s||a||"ltr"}var Rd="rovingFocusGroup.onEntryFocus",m2={bubbles:!1,cancelable:!0},vl="RovingFocusGroup",[Yd,Vp,x2]=ku(vl),[p2,Wp]=en(vl,[x2]),[g2,y2]=p2(vl),Hp=f.forwardRef((s,a)=>e.jsx(Yd.Provider,{scope:s.__scopeRovingFocusGroup,children:e.jsx(Yd.Slot,{scope:s.__scopeRovingFocusGroup,children:e.jsx(v2,{...s,ref:a})})}));Hp.displayName=vl;var v2=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:h,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=s,C=f.useRef(null),P=et(a,C),T=vo(d),[S,b]=bn({prop:h,defaultProp:m??null,onChange:p,caller:vl}),[N,E]=f.useState(!1),j=Qs(y),R=Vp(l),B=f.useRef(!1),[U,k]=f.useState(0);return f.useEffect(()=>{const L=C.current;if(L)return L.addEventListener(Rd,j),()=>L.removeEventListener(Rd,j)},[j]),e.jsx(g2,{scope:l,orientation:o,dir:T,loop:c,currentTabStopId:S,onItemFocus:f.useCallback(L=>b(L),[b]),onItemShiftTab:f.useCallback(()=>E(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(L=>L+1),[]),onFocusableItemRemove:f.useCallback(()=>k(L=>L-1),[]),children:e.jsx(Ke.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...s.style},onMouseDown:Be(s.onMouseDown,()=>{B.current=!0}),onFocus:Be(s.onFocus,L=>{const _=!B.current;if(L.target===L.currentTarget&&_&&!N){const se=new CustomEvent(Rd,m2);if(L.currentTarget.dispatchEvent(se),!se.defaultPrevented){const le=R().filter(ce=>ce.focusable),ie=le.find(ce=>ce.active),ee=le.find(ce=>ce.id===S),Q=[ie,ee,...le].filter(Boolean).map(ce=>ce.ref.current);Gp(Q,g)}}B.current=!1}),onBlur:Be(s.onBlur,()=>E(!1))})})}),Kp="RovingFocusGroupItem",Yp=f.forwardRef((s,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:h,...m}=s,p=Gs(),y=d||p,g=y2(Kp,l),v=g.currentTabStopId===y,C=Vp(l),{onFocusableItemAdd:P,onFocusableItemRemove:T,currentTabStopId:S}=g;return f.useEffect(()=>{if(o)return P(),()=>T()},[o,P,T]),e.jsx(Yd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(Ke.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...m,ref:a,onMouseDown:Be(s.onMouseDown,b=>{o?g.onItemFocus(y):b.preventDefault()}),onFocus:Be(s.onFocus,()=>g.onItemFocus(y)),onKeyDown:Be(s.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=N2(b,g.orientation,g.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(R=>R.focusable).map(R=>R.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const R=j.indexOf(b.currentTarget);j=g.loop?w2(j,R+1):j.slice(R+1)}setTimeout(()=>Gp(j))}}),children:typeof h=="function"?h({isCurrentTabStop:v,hasTabStop:S!=null}):h})})});Yp.displayName=Kp;var j2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function b2(s,a){return a!=="rtl"?s:s==="ArrowLeft"?"ArrowRight":s==="ArrowRight"?"ArrowLeft":s}function N2(s,a,l){const o=b2(s.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return j2[o]}function Gp(s,a=!1){const l=document.activeElement;for(const o of s)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function w2(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var S2=Hp,C2=Yp,jo="Tabs",[k2]=en(jo,[Wp]),Qp=Wp(),[E2,Eu]=k2(jo),qp=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:h="horizontal",dir:m,activationMode:p="automatic",...y}=s,g=vo(m),[v,C]=bn({prop:o,onChange:c,defaultProp:d??"",caller:jo});return e.jsx(E2,{scope:l,baseId:Gs(),value:v,onValueChange:C,orientation:h,dir:g,activationMode:p,children:e.jsx(Ke.div,{dir:g,"data-orientation":h,...y,ref:a})})});qp.displayName=jo;var Xp="TabsList",Jp=f.forwardRef((s,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=s,d=Eu(Xp,l),h=Qp(l);return e.jsx(S2,{asChild:!0,...h,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(Ke.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Jp.displayName=Xp;var Zp="TabsTrigger",eg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=s,h=Eu(Zp,l),m=Qp(l),p=sg(h.baseId,o),y=ng(h.baseId,o),g=o===h.value;return e.jsx(C2,{asChild:!0,...m,focusable:!c,active:g,children:e.jsx(Ke.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:Be(s.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?h.onValueChange(o):v.preventDefault()}),onKeyDown:Be(s.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&h.onValueChange(o)}),onFocus:Be(s.onFocus,()=>{const v=h.activationMode!=="manual";!g&&!c&&v&&h.onValueChange(o)})})})});eg.displayName=Zp;var tg="TabsContent",rg=f.forwardRef((s,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...h}=s,m=Eu(tg,l),p=sg(m.baseId,o),y=ng(m.baseId,o),g=o===m.value,v=f.useRef(g);return f.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(yl,{present:c||g,children:({present:C})=>e.jsx(Ke.div,{"data-state":g?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!C,id:y,tabIndex:0,...h,ref:a,style:{...s.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});rg.displayName=tg;function sg(s,a){return`${s}-trigger-${a}`}function ng(s,a){return`${s}-content-${a}`}var P2=qp,ag=Jp,lg=eg,ig=rg;const bo=P2,jl=f.forwardRef(({className:s,...a},l)=>e.jsx(ag,{ref:l,className:tt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...a}));jl.displayName=ag.displayName;const Zt=f.forwardRef(({className:s,...a},l)=>e.jsx(lg,{ref:l,className:tt("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",s),...a}));Zt.displayName=lg.displayName;const er=f.forwardRef(({className:s,...a},l)=>e.jsx(ig,{ref:l,className:tt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...a}));er.displayName=ig.displayName;function T2({open:s,onClose:a,userId:l,onUserUpdated:o}){var ce;const[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(!1),[b,N]=f.useState("info"),[E,j]=f.useState(""),[R,B]=f.useState(""),[U,k]=f.useState([]),[L,_]=f.useState("");f.useEffect(()=>{s&&l&&se()},[s,l]);async function se(){if(l){v(!0);try{const re=await Fe(`/api/db/users?id=${encodeURIComponent(l)}`);if(re!=null&&re.success&&re.user){const A=re.user;d(A),j(A.phone||""),B(A.nickname||""),k(typeof A.tags=="string"?JSON.parse(A.tags||"[]"):[])}try{const A=await Fe(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);A!=null&&A.success&&A.tracks&&m(A.tracks)}catch{m([])}try{const A=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);A!=null&&A.success&&A.referrals&&y(A.referrals)}catch{y([])}}catch(re){console.error("Load user detail error:",re)}finally{v(!1)}}}async function le(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}P(!0);try{const re=await Et("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});re!=null&&re.success?(alert("同步成功"),se()):alert("同步失败: "+(re==null?void 0:re.error))}catch(re){console.error("Sync CKB error:",re),alert("同步失败")}finally{P(!1)}}async function ie(){if(c){S(!0);try{const re={id:c.id,phone:E||void 0,nickname:R||void 0,tags:JSON.stringify(U)},A=await Nt("/api/db/users",re);A!=null&&A.success?(alert("保存成功"),se(),o==null||o()):alert("保存失败: "+(A==null?void 0:A.error))}catch(re){console.error("Save user error:",re),alert("保存失败")}finally{S(!1)}}}const ee=()=>{L&&!U.includes(L)&&(k([...U,L]),_(""))},G=re=>{k(U.filter(A=>A!==re))},Q=re=>{const ne={view_chapter:us,purchase:Bd,match:Qt,login:ra,register:ra,share:Ys,bind_phone:Wb,bind_wechat:Ob}[re]||_m;return e.jsx(ne,{className:"w-4 h-4"})};return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"})]})}),g?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[70vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-4",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac]",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((ce=c.nickname)==null?void 0:ce.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:["ID: ",c.id," · 推广码: ",c.referralCode??"-"]})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"})]})]}),e.jsxs(bo,{value:b,onValueChange:N,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(jl,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-4",children:[e.jsx(Zt,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"基础信息"}),e.jsx(Zt,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"标签体系"}),e.jsx(Zt,{value:"tracks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"行为轨迹"}),e.jsx(Zt,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac]",children:"关系链路"})]}),e.jsxs(er,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:E,onChange:re=>j(re.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:R,onChange:re=>B(re.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(Z,{size:"sm",onClick:le,disabled:C||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsx(er,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(rN,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"系统标签"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[U.map((re,A)=>e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[re,e.jsx("button",{type:"button",onClick:()=>G(re),className:"ml-1 hover:text-red-400",children:e.jsx(Sr,{className:"w-3 h-3"})})]},A)),U.length===0&&e.jsx("span",{className:"text-gray-500 text-sm",children:"暂无标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"添加新标签",value:L,onChange:re=>_(re.target.value),onKeyDown:re=>re.key==="Enter"&&ee()}),e.jsx(Z,{onClick:ee,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})}),e.jsx(er,{value:"tracks",className:"flex-1 overflow-auto",children:e.jsx("div",{className:"space-y-2",children:h.length>0?h.map(re=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:Q(re.action)}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-white font-medium",children:re.actionLabel}),re.chapterTitle&&e.jsxs("span",{className:"text-gray-400 text-sm",children:["- ",re.chapterTitle]})]}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[e.jsx(Ox,{className:"w-3 h-3 inline mr-1"}),re.timeAgo," · ",new Date(re.createdAt).toLocaleString()]})]})]},re.id)):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(_m,{className:"w-10 h-10 text-[#38bdac]/40 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无行为轨迹"})]})})}),e.jsx(er,{value:"relations",className:"flex-1 overflow-auto space-y-4",children:e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ys,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"推荐的用户"})]}),e.jsxs(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:["共 ",p.length," 人"]})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:p.length>0?p.map((re,A)=>{var W;const ne=re;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((W=ne.nickname)==null?void 0:W.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:ne.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[ne.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:ne.createdAt?new Date(ne.createdAt).toLocaleDateString():""})]})]},ne.id||A)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-4 border-t border-gray-700 mt-4",children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(Z,{onClick:ie,disabled:T,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),T?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Id={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function R2({open:s,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,h]=f.useState(Id),[m,p]=f.useState([]),[y,g]=f.useState(!1),[v,C]=f.useState(!1);f.useEffect(()=>{if(!s){h(Id);return}let T=!1;return g(!0),Promise.all([Fe("/api/db/vip-roles"),l?Fe(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([S,b])=>{if(T)return;const N=S!=null&&S.success&&S.data?S.data:[];p(N);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),R=N.some(B=>B.name===j);h({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:R?j:j?"__custom__":"",vipRoleCustom:R?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else h(Id)}).catch(S=>{T||console.error("Load error:",S)}).finally(()=>{T||g(!1)}),()=>{T=!0}},[s,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const T=new Date(d.vipExpireDate);if(isNaN(T.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const T=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,S={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:T||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await Nt("/api/db/users",S);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(T){console.error("Save VIP error:",T),alert("保存失败")}finally{C(!1)}}}return s?e.jsx(wt,{open:s,onOpenChange:()=>a(),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(it,{checked:d.isVip,onCheckedChange:T=>h(S=>({...S,isVip:T}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(de,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:T=>h(S=>({...S,vipExpireDate:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:T=>{const S=T.target.value;h(b=>({...b,vipSort:S===""?"":parseInt(S,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:T=>h(S=>({...S,vipRole:T.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),m.map(T=>e.jsx("option",{value:T.name,children:T.name},T.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:T=>h(S=>({...S,vipRoleCustom:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:T=>h(S=>({...S,vipName:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:T=>h(S=>({...S,vipProject:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:T=>h(S=>({...S,vipContact:T.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:T=>h(S=>({...S,vipBio:T.target.value}))})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}function I2(){var Xr,xs,ps,$t,gs;const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),g=wu(p,300),[v,C]=f.useState("all"),[P,T]=f.useState(!0),[S,b]=f.useState(null),[N,E]=f.useState(!1),[j,R]=f.useState(!1),[B,U]=f.useState(null),[k,L]=f.useState(""),[_,se]=f.useState(""),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState({referrals:[],stats:{}}),[re,A]=f.useState(!1),[ne,W]=f.useState(null),[M,O]=f.useState(!1),[F,X]=f.useState(null),[H,ue]=f.useState(!1),[K,ye]=f.useState(null),[ge,D]=f.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1});async function fe(){T(!0),b(null);try{const oe=new URLSearchParams({page:String(c),pageSize:String(h),search:g,...v==="vip"&&{vip:"true"}}),Qe=await Fe(`/api/db/users?${oe}`);Qe!=null&&Qe.success?(a(Qe.users||[]),o(Qe.total??0)):b((Qe==null?void 0:Qe.error)||"加载失败")}catch(oe){console.error("Load users error:",oe),b("网络错误,请检查连接")}finally{T(!1)}}f.useEffect(()=>{d(1)},[g,v]),f.useEffect(()=>{fe()},[c,h,g,v]);const Se=Math.ceil(l/h)||1;async function ze(oe){if(confirm("确定要删除这个用户吗?"))try{const Qe=await vn(`/api/db/users?id=${encodeURIComponent(oe)}`);Qe!=null&&Qe.success?fe():alert("删除失败: "+((Qe==null?void 0:Qe.error)||"未知错误"))}catch(Qe){console.error("Delete user error:",Qe),alert("删除失败")}}const We=oe=>{U(oe),D({phone:oe.phone||"",nickname:oe.nickname||"",password:"",isAdmin:!!(oe.isAdmin??!1),hasFullBook:!!(oe.hasFullBook??!1)}),E(!0)},qe=()=>{U(null),D({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function Ze(){if(!ge.phone||!ge.nickname){alert("请填写手机号和昵称");return}ie(!0);try{if(B){const oe=await Nt("/api/db/users",{id:B.id,nickname:ge.nickname,isAdmin:ge.isAdmin,hasFullBook:ge.hasFullBook,...ge.password&&{password:ge.password}});if(!(oe!=null&&oe.success)){alert("更新失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}else{const oe=await Et("/api/db/users",{phone:ge.phone,nickname:ge.nickname,password:ge.password,isAdmin:ge.isAdmin});if(!(oe!=null&&oe.success)){alert("创建失败: "+((oe==null?void 0:oe.error)||"未知错误"));return}}E(!1),fe()}catch(oe){console.error("Save user error:",oe),alert("保存失败")}finally{ie(!1)}}const st=oe=>{U(oe),L(""),se(""),R(!0)};async function ft(oe){W(oe),G(!0),A(!0);try{const Qe=await Fe(`/api/db/users/referrals?userId=${encodeURIComponent(oe.id)}`);Qe!=null&&Qe.success?ce({referrals:Qe.referrals||[],stats:Qe.stats||{}}):ce({referrals:[],stats:{}})}catch(Qe){console.error("Load referrals error:",Qe),ce({referrals:[],stats:{}})}finally{A(!1)}}const nt=oe=>{X(oe.id),O(!0)},Vt=oe=>{ye(oe),ue(!0)};async function Fr(){if(!k){alert("请输入新密码");return}if(k!==_){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}ie(!0);try{const oe=await Nt("/api/db/users",{id:B==null?void 0:B.id,password:k});oe!=null&&oe.success?(alert("密码修改成功"),R(!1)):alert("密码修改失败: "+((oe==null?void 0:oe.error)||"未知错误"))}catch(oe){console.error("Change password error:",oe),alert("密码修改失败")}finally{ie(!1)}}return e.jsxs("div",{className:"p-8 w-full",children:[S&&e.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:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",l," 位注册用户",v==="vip"&&",当前筛选 VIP"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(Z,{variant:"outline",onClick:fe,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新"]}),e.jsxs("select",{value:v,onChange:oe=>{C(oe.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(de,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:p,onChange:oe=>y(oe.target.value)})]}),e.jsxs(Z,{onClick:qe,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Vd,{className:"w-4 h-4 mr-2"}),"添加用户"]})]})]}),e.jsx(wt,{open:N,onOpenChange:E,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[B?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Vd,{className:"w-5 h-5 text-[#38bdac]"}),B?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ge.phone,onChange:oe=>D({...ge,phone:oe.target.value}),disabled:!!B})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ge.nickname,onChange:oe=>D({...ge,nickname:oe.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:B?"新密码 (留空则不修改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:B?"留空则不修改":"请输入密码",value:ge.password,onChange:oe=>D({...ge,password:oe.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(it,{checked:ge.isAdmin,onCheckedChange:oe=>D({...ge,isAdmin:oe})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(it,{checked:ge.hasFullBook,onCheckedChange:oe=>D({...ge,hasFullBook:oe})})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:Ze,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),le?"保存中...":"保存"]})]})]})}),e.jsx(wt,{open:j,onOpenChange:R,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Mm,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",B==null?void 0:B.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",B==null?void 0:B.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:oe=>L(oe.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:_,onChange:oe=>se(oe.target.value)})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>R(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Fr,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?"保存中...":"确认修改"})]})]})}),e.jsx(T2,{open:M,onClose:()=>O(!1),userId:F,onUserUpdated:fe}),e.jsx(R2,{open:H,onClose:()=>{ue(!1),ye(null)},userId:(K==null?void 0:K.id)??null,userNickname:K==null?void 0:K.nickname,onSaved:fe}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",ne==null?void 0:ne.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((Xr=Q.stats)==null?void 0:Xr.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((xs=Q.stats)==null?void 0:xs.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((ps=Q.stats)==null?void 0:ps.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",((($t=Q.stats)==null?void 0:$t.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),re?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((gs=Q.referrals)==null?void 0:gs.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(Q.referrals??[]).map((oe,Qe)=>{var dr;const Tt=oe;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((dr=Tt.nickname)==null?void 0:dr.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:Tt.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:Tt.phone||(Tt.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[Tt.status==="vip"&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),Tt.status==="paid"&&e.jsxs(Oe,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",Tt.purchasedSections,"章"]}),Tt.status==="free"&&e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:Tt.createdAt?new Date(Tt.createdAt).toLocaleDateString():""})]})]},Tt.id||Qe)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(Ft,{children:e.jsx(Z,{variant:"outline",onClick:()=>G(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:P?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"用户信息"}),e.jsx(je,{className:"text-gray-400",children:"绑定信息"}),e.jsx(je,{className:"text-gray-400",children:"购买状态"}),e.jsx(je,{className:"text-gray-400",children:"分销收益"}),e.jsx(je,{className:"text-gray-400",children:"推广码"}),e.jsx(je,{className:"text-gray-400",children:"注册时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(oe=>{var Qe,Tt,dr;return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:oe.avatar?e.jsx("img",{src:oe.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Qe=oe.nickname)==null?void 0:Qe.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium text-white",children:oe.nickname}),oe.isAdmin&&e.jsx(Oe,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),oe.openId&&!((Tt=oe.id)!=null&&Tt.startsWith("user_"))&&e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:oe.openId?oe.openId.slice(0,12)+"...":(dr=oe.id)==null?void 0:dr.slice(0,12)})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[oe.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:oe.phone})]}),oe.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:oe.wechatId})]}),oe.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:oe.openId,children:[oe.openId.slice(0,12),"..."]})]}),!oe.phone&&!oe.wechatId&&!oe.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(pe,{children:oe.hasFullBook?e.jsx(Oe,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(pe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(oe.earnings||0)).toFixed(2)]}),parseFloat(String(oe.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(oe.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>ft(oe),onKeyDown:zr=>zr.key==="Enter"&&ft(oe),role:"button",tabIndex:0,children:[e.jsx(Qt,{className:"w-3 h-3"}),"绑定",oe.referralCount||0,"人"]})]})}),e.jsx(pe,{children:e.jsx("code",{className:"text-[#38bdac] text-xs bg-[#38bdac]/10 px-2 py-0.5 rounded",children:oe.referralCode||"-"})}),e.jsx(pe,{className:"text-gray-400",children:oe.createdAt?new Date(oe.createdAt).toLocaleDateString():"-"}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>Vt(oe),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(mo,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>nt(oe),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情",children:e.jsx(ds,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>We(oe),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>st(oe),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Mm,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>ze(oe.id),title:"删除",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},oe.id)}),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Ar,{page:c,totalPages:Se,total:l,pageSize:h,onPageChange:d,onPageSizeChange:oe=>{m(oe),d(1)}})]})})})]})}function _2(){var ge;const[s,a]=f.useState("overview"),[l,o]=f.useState([]),[c,d]=f.useState(null),[h,m]=f.useState([]),[p,y]=f.useState([]),[g,v]=f.useState([]),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(""),[E,j]=f.useState("all"),[R,B]=f.useState(1),[U,k]=f.useState(10),[L,_]=f.useState(0),[se,le]=f.useState(new Set),[ie,ee]=f.useState(null),[G,Q]=f.useState(""),[ce,re]=f.useState(!1);f.useEffect(()=>{A()},[]),f.useEffect(()=>{B(1)},[s,E]),f.useEffect(()=>{ne(s)},[s]),f.useEffect(()=>{["orders","bindings","withdrawals"].includes(s)&&ne(s,!0)},[R,U,E,b]);async function A(){S(null);try{const D=await Fe("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),S("加载概览失败")}try{const D=await Fe("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function ne(D,fe=!1){var Se;if(!(!fe&&se.has(D))){P(!0);try{const ze=g;switch(D){case"overview":break;case"orders":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E},...b&&{search:b}}),qe=await Fe(`/api/orders?${We}`);if(qe!=null&&qe.success&&qe.orders){const Ze=qe.orders.map(st=>{const ft=ze.find(Vt=>Vt.id===st.userId),nt=st.referrerId?ze.find(Vt=>Vt.id===st.referrerId):null;return{...st,amount:parseFloat(String(st.amount))||0,userNickname:(ft==null?void 0:ft.nickname)||st.userNickname||"未知用户",userPhone:(ft==null?void 0:ft.phone)||st.userPhone||"-",referrerNickname:(nt==null?void 0:nt.nickname)||null,referrerCode:(nt==null?void 0:nt.referralCode)??null,type:st.productType||st.type}});o(Ze),_(qe.total??Ze.length)}else o([]),_(0)}catch(We){console.error(We),S("加载订单失败"),o([])}break}case"bindings":{try{const We=new URLSearchParams({page:String(R),pageSize:String(U),...E!=="all"&&{status:E}}),qe=await Fe(`/api/db/distribution?${We}`);m((qe==null?void 0:qe.bindings)||[]),_((qe==null?void 0:qe.total)??((Se=qe==null?void 0:qe.bindings)==null?void 0:Se.length)??0)}catch(We){console.error(We),S("加载绑定数据失败"),m([])}break}case"withdrawals":{try{const We=E==="completed"?"success":E==="rejected"?"failed":E,qe=new URLSearchParams({...We&&We!=="all"&&{status:We},page:String(R),pageSize:String(U)}),Ze=await Fe(`/api/admin/withdrawals?${qe}`);if(Ze!=null&&Ze.success&&Ze.withdrawals){const st=Ze.withdrawals.map(ft=>({...ft,account:ft.account??"未绑定微信号",status:ft.status==="success"?"completed":ft.status==="failed"?"rejected":ft.status}));y(st),_((Ze==null?void 0:Ze.total)??st.length)}else Ze!=null&&Ze.success||S(`获取提现记录失败: ${(Ze==null?void 0:Ze.error)||"未知错误"}`),y([])}catch(We){console.error(We),S("加载提现数据失败"),y([])}break}}le(We=>new Set(We).add(D))}catch(ze){console.error(ze)}finally{P(!1)}}}async function W(){S(null),le(D=>{const fe=new Set(D);return fe.delete(s),fe}),s==="overview"&&A(),await ne(s,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const fe=await Nt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(fe!=null&&fe.success)){const Se=(fe==null?void 0:fe.message)||(fe==null?void 0:fe.error)||"操作失败";alert(Se);return}await W()}catch(fe){console.error(fe),alert("操作失败")}}async function O(D){const fe=prompt("请输入拒绝原因:");if(fe)try{const Se=await Nt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:fe});if(!(Se!=null&&Se.success)){alert((Se==null?void 0:Se.error)||"操作失败");return}await W()}catch(Se){console.error(Se),alert("操作失败")}}async function F(){var D;if(!(!(ie!=null&&ie.orderSn)&&!(ie!=null&&ie.id))){re(!0),S(null);try{const fe=await Nt("/api/admin/orders/refund",{orderSn:ie.orderSn||ie.id,reason:G||void 0});fe!=null&&fe.success?(ee(null),Q(""),await ne("orders",!0)):S((fe==null?void 0:fe.error)||"退款失败")}catch(fe){const Se=fe;S(((D=Se==null?void 0:Se.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{re(!1)}}}function X(D){const fe={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"},Se={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(Oe,{className:`${fe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:Se[D]||D})}const H=Math.ceil(L/U)||1,ue=l,K=h.filter(D=>{var Se,ze,We,qe;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.refereeNickname)==null?void 0:Se.toLowerCase().includes(fe))||((ze=D.refereePhone)==null?void 0:ze.includes(fe))||((We=D.referrerName)==null?void 0:We.toLowerCase().includes(fe))||((qe=D.referrerCode)==null?void 0:qe.toLowerCase().includes(fe))}),ye=p.filter(D=>{var Se;if(!b)return!0;const fe=b.toLowerCase();return((Se=D.userName)==null?void 0:Se.toLowerCase().includes(fe))||D.account&&D.account.toLowerCase().includes(fe)});return e.jsxs("div",{className:"p-8 w-full",children:[T&&e.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:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(Z,{onClick:W,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:ul},{key:"orders",label:"订单管理",icon:Xi},{key:"bindings",label:"绑定管理",icon:Ys},{key:"withdrawals",label:"提现审核",icon:aa}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${s===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx($e,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[s==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(ds,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Qt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(ul,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(Ys,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Im,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(Xi,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((ge=c.todayClicksByPage)==null?void 0:ge.length)??0)>0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ds,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(we,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,fe)=>fe.clicks-D.clicks).map((D,fe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},fe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Ne,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Ox,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Ne,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(we,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(aa,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(Z,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(ul,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(we,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(we,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),s==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ue.map(D=>{var fe,Se;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(fe=D.id)==null?void 0:fe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:ze==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const ze=D.productType||D.type;return ze==="fullbook"?"全书解锁":ze==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(Oe,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(Oe,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((Se=D.referrerId)==null?void 0:Se.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(Z,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{ee(D),Q("")},children:[e.jsx(Bx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),s==="orders"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[K.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:K.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),s==="bindings"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),s==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(yn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(de,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-0",children:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(Oe,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(Z,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Im,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>O(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(Lx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),s==="withdrawals"&&e.jsx(Ar,{page:R,totalPages:H,total:L,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]})]}),e.jsx(wt,{open:!!ie,onOpenChange:D=>!D&&ee(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),ie&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",ie.orderSn||ie.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof ie.amount=="number"?ie.amount.toFixed(2):parseFloat(String(ie.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:G,onChange:D=>Q(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>ee(null),disabled:ce,children:"取消"}),e.jsx(Z,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:F,disabled:ce,children:ce?"退款中...":"确认退款"})]})]})})]})}function M2(){const[s,a]=f.useState([]),[l,o]=f.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=f.useState(!0),[h,m]=f.useState(null),[p,y]=f.useState("all"),[g,v]=f.useState(1),[C,P]=f.useState(10),[T,S]=f.useState(0),[b,N]=f.useState(null);async function E(){var k,L,_,se,le,ie,ee;d(!0),m(null);try{const G=new URLSearchParams({status:p,page:String(g),pageSize:String(C)}),Q=await Fe(`/api/admin/withdrawals?${G}`);if(Q!=null&&Q.success){const ce=Q.withdrawals||[];a(ce),S(Q.total??((k=Q.stats)==null?void 0:k.total)??ce.length),o({total:((L=Q.stats)==null?void 0:L.total)??Q.total??ce.length,pendingCount:((_=Q.stats)==null?void 0:_.pendingCount)??0,pendingAmount:((se=Q.stats)==null?void 0:se.pendingAmount)??0,successCount:((le=Q.stats)==null?void 0:le.successCount)??0,successAmount:((ie=Q.stats)==null?void 0:ie.successAmount)??0,failedCount:((ee=Q.stats)==null?void 0:ee.failedCount)??0})}else m("加载提现记录失败")}catch(G){console.error("Load withdrawals error:",G),m("加载失败,请检查网络后重试")}finally{d(!1)}}f.useEffect(()=>{v(1)},[p]),f.useEffect(()=>{E()},[p,g,C]);const j=Math.ceil(T/C)||1;async function R(k){const L=s.find(_=>_.id===k);if(L!=null&&L.userCommissionInfo&&L.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${L.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 - -确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"approve"});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function B(k){const L=prompt("请输入拒绝原因(将返还用户余额):");if(L){N(k);try{const _=await Nt("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:L});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(k){switch(k){case"pending":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(Oe,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(Oe,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(Oe,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(Oe,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return e.jsxs("div",{className:"p-8 w-full",children:[h&&e.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:[e.jsx("span",{children:h}),e.jsx("button",{type:"button",onClick:()=>m(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(Z,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Ne,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(we,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(we,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>e.jsx(Z,{variant:p===k?"default":"outline",size:"sm",onClick:()=>y(k),className:p===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))}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):s.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(aa,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:s.map(k=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?e.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.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)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:k.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(k.status),k.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(Z,{size:"sm",onClick:()=>R(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(fo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(Z,{size:"sm",variant:"outline",onClick:()=>B(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),e.jsx(Ar,{page:g,totalPages:j,total:T,pageSize:C,onPageChange:v,onPageSizeChange:k=>{P(k),v(1)}})]})})})]})}const jn=f.forwardRef(({className:s,...a},l)=>e.jsx("textarea",{className:tt("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",s),ref:l,...a}));jn.displayName="Textarea";function no(s,[a,l]){return Math.min(l,Math.max(a,s))}const A2=["top","right","bottom","left"],qs=Math.min,xr=Math.max,ao=Math.round,Wi=Math.floor,Gr=s=>({x:s,y:s}),D2={left:"right",right:"left",bottom:"top",top:"bottom"},L2={start:"end",end:"start"};function Gd(s,a,l){return xr(s,qs(a,l))}function hs(s,a){return typeof s=="function"?s(a):s}function fs(s){return s.split("-")[0]}function fa(s){return s.split("-")[1]}function Pu(s){return s==="x"?"y":"x"}function Tu(s){return s==="y"?"height":"width"}const O2=new Set(["top","bottom"]);function Yr(s){return O2.has(fs(s))?"y":"x"}function Ru(s){return Pu(Yr(s))}function F2(s,a,l){l===void 0&&(l=!1);const o=fa(s),c=Ru(s),d=Tu(c);let h=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(h=lo(h)),[h,lo(h)]}function z2(s){const a=lo(s);return[Qd(s),a,Qd(a)]}function Qd(s){return s.replace(/start|end/g,a=>L2[a])}const sx=["left","right"],nx=["right","left"],$2=["top","bottom"],B2=["bottom","top"];function U2(s,a,l){switch(s){case"top":case"bottom":return l?a?nx:sx:a?sx:nx;case"left":case"right":return a?$2:B2;default:return[]}}function V2(s,a,l,o){const c=fa(s);let d=U2(fs(s),l==="start",o);return c&&(d=d.map(h=>h+"-"+c),a&&(d=d.concat(d.map(Qd)))),d}function lo(s){return s.replace(/left|right|bottom|top/g,a=>D2[a])}function W2(s){return{top:0,right:0,bottom:0,left:0,...s}}function og(s){return typeof s!="number"?W2(s):{top:s,right:s,bottom:s,left:s}}function io(s){const{x:a,y:l,width:o,height:c}=s;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ax(s,a,l){let{reference:o,floating:c}=s;const d=Yr(a),h=Ru(a),m=Tu(h),p=fs(a),y=d==="y",g=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[m]/2-c[m]/2;let P;switch(p){case"top":P={x:g,y:o.y-c.height};break;case"bottom":P={x:g,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(fa(a)){case"start":P[h]-=C*(l&&y?-1:1);break;case"end":P[h]+=C*(l&&y?-1:1);break}return P}async function H2(s,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:h,elements:m,strategy:p}=s,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=hs(a,s),T=og(P),b=m[C?v==="floating"?"reference":"floating":v],N=io(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(m.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:o,y:c,width:h.floating.width,height:h.floating.height}:h.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(m.floating)),R=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},B=io(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:E,offsetParent:j,strategy:p}):E);return{top:(N.top-B.top+T.top)/R.y,bottom:(B.bottom-N.bottom+T.bottom)/R.y,left:(N.left-B.left+T.left)/R.x,right:(B.right-N.right+T.right)/R.x}}const K2=async(s,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,m=d.filter(Boolean),p=await(h.isRTL==null?void 0:h.isRTL(a));let y=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:g,y:v}=ax(y,o,p),C=o,P={},T=0;for(let b=0;b({name:"arrow",options:s,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:h,elements:m,middlewareData:p}=a,{element:y,padding:g=0}=hs(s,a)||{};if(y==null)return{};const v=og(g),C={x:l,y:o},P=Ru(c),T=Tu(P),S=await h.getDimensions(y),b=P==="y",N=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",R=d.reference[T]+d.reference[P]-C[P]-d.floating[T],B=C[P]-d.reference[P],U=await(h.getOffsetParent==null?void 0:h.getOffsetParent(y));let k=U?U[j]:0;(!k||!await(h.isElement==null?void 0:h.isElement(U)))&&(k=m.floating[j]||d.floating[T]);const L=R/2-B/2,_=k/2-S[T]/2-1,se=qs(v[N],_),le=qs(v[E],_),ie=se,ee=k-S[T]-le,G=k/2-S[T]/2+L,Q=Gd(ie,G,ee),ce=!p.arrow&&fa(c)!=null&&G!==Q&&d.reference[T]/2-(GG<=0)){var le,ie;const G=(((le=d.flip)==null?void 0:le.index)||0)+1,Q=k[G];if(Q&&(!(v==="alignment"?E!==Yr(Q):!1)||se.every(A=>Yr(A.placement)===E?A.overflows[0]>0:!0)))return{data:{index:G,overflows:se},reset:{placement:Q}};let ce=(ie=se.filter(re=>re.overflows[0]<=0).sort((re,A)=>re.overflows[1]-A.overflows[1])[0])==null?void 0:ie.placement;if(!ce)switch(P){case"bestFit":{var ee;const re=(ee=se.filter(A=>{if(U){const ne=Yr(A.placement);return ne===E||ne==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(ne=>ne>0).reduce((ne,W)=>ne+W,0)]).sort((A,ne)=>A[1]-ne[1])[0])==null?void 0:ee[0];re&&(ce=re);break}case"initialPlacement":ce=m;break}if(c!==ce)return{reset:{placement:ce}}}return{}}}};function lx(s,a){return{top:s.top-a.height,right:s.right-a.width,bottom:s.bottom-a.height,left:s.left-a.width}}function ix(s){return A2.some(a=>s[a]>=0)}const Q2=function(s){return s===void 0&&(s={}),{name:"hide",options:s,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=hs(s,a);switch(c){case"referenceHidden":{const h=await o.detectOverflow(a,{...d,elementContext:"reference"}),m=lx(h,l.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:ix(m)}}}case"escaped":{const h=await o.detectOverflow(a,{...d,altBoundary:!0}),m=lx(h,l.floating);return{data:{escapedOffsets:m,escaped:ix(m)}}}default:return{}}}}},cg=new Set(["left","top"]);async function q2(s,a){const{placement:l,platform:o,elements:c}=s,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),h=fs(l),m=fa(l),p=Yr(l)==="y",y=cg.has(h)?-1:1,g=d&&p?-1:1,v=hs(a,s);let{mainAxis:C,crossAxis:P,alignmentAxis:T}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return m&&typeof T=="number"&&(P=m==="end"?T*-1:T),p?{x:P*g,y:C*y}:{x:C*y,y:P*g}}const X2=function(s){return s===void 0&&(s=0),{name:"offset",options:s,async fn(a){var l,o;const{x:c,y:d,placement:h,middlewareData:m}=a,p=await q2(a,s);return h===((l=m.offset)==null?void 0:l.placement)&&(o=m.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:h}}}}},J2=function(s){return s===void 0&&(s={}),{name:"shift",options:s,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:h=!0,crossAxis:m=!1,limiter:p={fn:N=>{let{x:E,y:j}=N;return{x:E,y:j}}},...y}=hs(s,a),g={x:l,y:o},v=await d.detectOverflow(a,y),C=Yr(fs(c)),P=Pu(C);let T=g[P],S=g[C];if(h){const N=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=T+v[N],R=T-v[E];T=Gd(j,T,R)}if(m){const N=C==="y"?"top":"left",E=C==="y"?"bottom":"right",j=S+v[N],R=S-v[E];S=Gd(j,S,R)}const b=p.fn({...a,[P]:T,[C]:S});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:h,[C]:m}}}}}},Z2=function(s){return s===void 0&&(s={}),{options:s,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:h}=a,{offset:m=0,mainAxis:p=!0,crossAxis:y=!0}=hs(s,a),g={x:l,y:o},v=Yr(c),C=Pu(v);let P=g[C],T=g[v];const S=hs(m,a),b=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=C==="y"?"height":"width",R=d.reference[C]-d.floating[j]+b.mainAxis,B=d.reference[C]+d.reference[j]-b.mainAxis;PB&&(P=B)}if(y){var N,E;const j=C==="y"?"width":"height",R=cg.has(fs(c)),B=d.reference[v]-d.floating[j]+(R&&((N=h.offset)==null?void 0:N[v])||0)+(R?0:b.crossAxis),U=d.reference[v]+d.reference[j]+(R?0:((E=h.offset)==null?void 0:E[v])||0)-(R?b.crossAxis:0);TU&&(T=U)}return{[C]:P,[v]:T}}}},eS=function(s){return s===void 0&&(s={}),{name:"size",options:s,async fn(a){var l,o;const{placement:c,rects:d,platform:h,elements:m}=a,{apply:p=()=>{},...y}=hs(s,a),g=await h.detectOverflow(a,y),v=fs(c),C=fa(c),P=Yr(c)==="y",{width:T,height:S}=d.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(h.isRTL==null?void 0:h.isRTL(m.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const E=S-g.top-g.bottom,j=T-g.left-g.right,R=qs(S-g[b],E),B=qs(T-g[N],j),U=!a.middlewareData.shift;let k=R,L=B;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(L=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),U&&!C){const se=xr(g.left,0),le=xr(g.right,0),ie=xr(g.top,0),ee=xr(g.bottom,0);P?L=T-2*(se!==0||le!==0?se+le:xr(g.left,g.right)):k=S-2*(ie!==0||ee!==0?ie+ee:xr(g.top,g.bottom))}await p({...a,availableWidth:L,availableHeight:k});const _=await h.getDimensions(m.floating);return T!==_.width||S!==_.height?{reset:{rects:!0}}:{}}}};function No(){return typeof window<"u"}function ma(s){return dg(s)?(s.nodeName||"").toLowerCase():"#document"}function pr(s){var a;return(s==null||(a=s.ownerDocument)==null?void 0:a.defaultView)||window}function qr(s){var a;return(a=(dg(s)?s.ownerDocument:s.document)||window.document)==null?void 0:a.documentElement}function dg(s){return No()?s instanceof Node||s instanceof pr(s).Node:!1}function Dr(s){return No()?s instanceof Element||s instanceof pr(s).Element:!1}function Qr(s){return No()?s instanceof HTMLElement||s instanceof pr(s).HTMLElement:!1}function ox(s){return!No()||typeof ShadowRoot>"u"?!1:s instanceof ShadowRoot||s instanceof pr(s).ShadowRoot}const tS=new Set(["inline","contents"]);function bl(s){const{overflow:a,overflowX:l,overflowY:o,display:c}=Lr(s);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!tS.has(c)}const rS=new Set(["table","td","th"]);function sS(s){return rS.has(ma(s))}const nS=[":popover-open",":modal"];function wo(s){return nS.some(a=>{try{return s.matches(a)}catch{return!1}})}const aS=["transform","translate","scale","rotate","perspective"],lS=["transform","translate","scale","rotate","perspective","filter"],iS=["paint","layout","strict","content"];function Iu(s){const a=_u(),l=Dr(s)?Lr(s):s;return aS.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)||lS.some(o=>(l.willChange||"").includes(o))||iS.some(o=>(l.contain||"").includes(o))}function oS(s){let a=Xs(s);for(;Qr(a)&&!ia(a);){if(Iu(a))return a;if(wo(a))return null;a=Xs(a)}return null}function _u(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const cS=new Set(["html","body","#document"]);function ia(s){return cS.has(ma(s))}function Lr(s){return pr(s).getComputedStyle(s)}function So(s){return Dr(s)?{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}:{scrollLeft:s.scrollX,scrollTop:s.scrollY}}function Xs(s){if(ma(s)==="html")return s;const a=s.assignedSlot||s.parentNode||ox(s)&&s.host||qr(s);return ox(a)?a.host:a}function ug(s){const a=Xs(s);return ia(a)?s.ownerDocument?s.ownerDocument.body:s.body:Qr(a)&&bl(a)?a:ug(a)}function pl(s,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=ug(s),d=c===((o=s.ownerDocument)==null?void 0:o.body),h=pr(c);if(d){const m=qd(h);return a.concat(h,h.visualViewport||[],bl(c)?c:[],m&&l?pl(m):[])}return a.concat(c,pl(c,[],l))}function qd(s){return s.parent&&Object.getPrototypeOf(s.parent)?s.frameElement:null}function hg(s){const a=Lr(s);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=Qr(s),d=c?s.offsetWidth:l,h=c?s.offsetHeight:o,m=ao(l)!==d||ao(o)!==h;return m&&(l=d,o=h),{width:l,height:o,$:m}}function Mu(s){return Dr(s)?s:s.contextElement}function na(s){const a=Mu(s);if(!Qr(a))return Gr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=hg(a);let h=(d?ao(l.width):l.width)/o,m=(d?ao(l.height):l.height)/c;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const dS=Gr(0);function fg(s){const a=pr(s);return!_u()||!a.visualViewport?dS:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function uS(s,a,l){return a===void 0&&(a=!1),!l||a&&l!==pr(s)?!1:a}function wn(s,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=s.getBoundingClientRect(),d=Mu(s);let h=Gr(1);a&&(o?Dr(o)&&(h=na(o)):h=na(s));const m=uS(d,l,o)?fg(d):Gr(0);let p=(c.left+m.x)/h.x,y=(c.top+m.y)/h.y,g=c.width/h.x,v=c.height/h.y;if(d){const C=pr(d),P=o&&Dr(o)?pr(o):o;let T=C,S=qd(T);for(;S&&o&&P!==T;){const b=na(S),N=S.getBoundingClientRect(),E=Lr(S),j=N.left+(S.clientLeft+parseFloat(E.paddingLeft))*b.x,R=N.top+(S.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=R,T=pr(S),S=qd(T)}}return io({width:g,height:v,x:p,y})}function Co(s,a){const l=So(s).scrollLeft;return a?a.left+l:wn(qr(s)).left+l}function mg(s,a){const l=s.getBoundingClientRect(),o=l.left+a.scrollLeft-Co(s,l),c=l.top+a.scrollTop;return{x:o,y:c}}function hS(s){let{elements:a,rect:l,offsetParent:o,strategy:c}=s;const d=c==="fixed",h=qr(o),m=a?wo(a.floating):!1;if(o===h||m&&d)return l;let p={scrollLeft:0,scrollTop:0},y=Gr(1);const g=Gr(0),v=Qr(o);if((v||!v&&!d)&&((ma(o)!=="body"||bl(h))&&(p=So(o)),Qr(o))){const P=wn(o);y=na(o),g.x=P.x+o.clientLeft,g.y=P.y+o.clientTop}const C=h&&!v&&!d?mg(h,p):Gr(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+C.x,y:l.y*y.y-p.scrollTop*y.y+g.y+C.y}}function fS(s){return Array.from(s.getClientRects())}function mS(s){const a=qr(s),l=So(s),o=s.ownerDocument.body,c=xr(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=xr(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let h=-l.scrollLeft+Co(s);const m=-l.scrollTop;return Lr(o).direction==="rtl"&&(h+=xr(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:h,y:m}}const cx=25;function xS(s,a){const l=pr(s),o=qr(s),c=l.visualViewport;let d=o.clientWidth,h=o.clientHeight,m=0,p=0;if(c){d=c.width,h=c.height;const g=_u();(!g||g&&a==="fixed")&&(m=c.offsetLeft,p=c.offsetTop)}const y=Co(o);if(y<=0){const g=o.ownerDocument,v=g.body,C=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,T=Math.abs(o.clientWidth-v.clientWidth-P);T<=cx&&(d-=T)}else y<=cx&&(d+=y);return{width:d,height:h,x:m,y:p}}const pS=new Set(["absolute","fixed"]);function gS(s,a){const l=wn(s,!0,a==="fixed"),o=l.top+s.clientTop,c=l.left+s.clientLeft,d=Qr(s)?na(s):Gr(1),h=s.clientWidth*d.x,m=s.clientHeight*d.y,p=c*d.x,y=o*d.y;return{width:h,height:m,x:p,y}}function dx(s,a,l){let o;if(a==="viewport")o=xS(s,l);else if(a==="document")o=mS(qr(s));else if(Dr(a))o=gS(a,l);else{const c=fg(s);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return io(o)}function xg(s,a){const l=Xs(s);return l===a||!Dr(l)||ia(l)?!1:Lr(l).position==="fixed"||xg(l,a)}function yS(s,a){const l=a.get(s);if(l)return l;let o=pl(s,[],!1).filter(m=>Dr(m)&&ma(m)!=="body"),c=null;const d=Lr(s).position==="fixed";let h=d?Xs(s):s;for(;Dr(h)&&!ia(h);){const m=Lr(h),p=Iu(h);!p&&m.position==="fixed"&&(c=null),(d?!p&&!c:!p&&m.position==="static"&&!!c&&pS.has(c.position)||bl(h)&&!p&&xg(s,h))?o=o.filter(g=>g!==h):c=m,h=Xs(h)}return a.set(s,o),o}function vS(s){let{element:a,boundary:l,rootBoundary:o,strategy:c}=s;const h=[...l==="clippingAncestors"?wo(a)?[]:yS(a,this._c):[].concat(l),o],m=h[0],p=h.reduce((y,g)=>{const v=dx(a,g,c);return y.top=xr(v.top,y.top),y.right=qs(v.right,y.right),y.bottom=qs(v.bottom,y.bottom),y.left=xr(v.left,y.left),y},dx(a,m,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function jS(s){const{width:a,height:l}=hg(s);return{width:a,height:l}}function bS(s,a,l){const o=Qr(a),c=qr(a),d=l==="fixed",h=wn(s,!0,d,a);let m={scrollLeft:0,scrollTop:0};const p=Gr(0);function y(){p.x=Co(c)}if(o||!o&&!d)if((ma(a)!=="body"||bl(c))&&(m=So(a)),o){const P=wn(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!o&&c&&y();const g=c&&!o&&!d?mg(c,m):Gr(0),v=h.left+m.scrollLeft-p.x-g.x,C=h.top+m.scrollTop-p.y-g.y;return{x:v,y:C,width:h.width,height:h.height}}function _d(s){return Lr(s).position==="static"}function ux(s,a){if(!Qr(s)||Lr(s).position==="fixed")return null;if(a)return a(s);let l=s.offsetParent;return qr(s)===l&&(l=l.ownerDocument.body),l}function pg(s,a){const l=pr(s);if(wo(s))return l;if(!Qr(s)){let c=Xs(s);for(;c&&!ia(c);){if(Dr(c)&&!_d(c))return c;c=Xs(c)}return l}let o=ux(s,a);for(;o&&sS(o)&&_d(o);)o=ux(o,a);return o&&ia(o)&&_d(o)&&!Iu(o)?l:o||oS(s)||l}const NS=async function(s){const a=this.getOffsetParent||pg,l=this.getDimensions,o=await l(s.floating);return{reference:bS(s.reference,await a(s.floating),s.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wS(s){return Lr(s).direction==="rtl"}const SS={convertOffsetParentRelativeRectToViewportRelativeRect:hS,getDocumentElement:qr,getClippingRect:vS,getOffsetParent:pg,getElementRects:NS,getClientRects:fS,getDimensions:jS,getScale:na,isElement:Dr,isRTL:wS};function gg(s,a){return s.x===a.x&&s.y===a.y&&s.width===a.width&&s.height===a.height}function CS(s,a){let l=null,o;const c=qr(s);function d(){var m;clearTimeout(o),(m=l)==null||m.disconnect(),l=null}function h(m,p){m===void 0&&(m=!1),p===void 0&&(p=1),d();const y=s.getBoundingClientRect(),{left:g,top:v,width:C,height:P}=y;if(m||a(),!C||!P)return;const T=Wi(v),S=Wi(c.clientWidth-(g+C)),b=Wi(c.clientHeight-(v+P)),N=Wi(g),j={rootMargin:-T+"px "+-S+"px "+-b+"px "+-N+"px",threshold:xr(0,qs(1,p))||1};let R=!0;function B(U){const k=U[0].intersectionRatio;if(k!==p){if(!R)return h();k?h(!1,k):o=setTimeout(()=>{h(!1,1e-7)},1e3)}k===1&&!gg(y,s.getBoundingClientRect())&&h(),R=!1}try{l=new IntersectionObserver(B,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(B,j)}l.observe(s)}return h(!0),d}function kS(s,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,y=Mu(s),g=c||d?[...y?pl(y):[],...pl(a)]:[];g.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const v=y&&m?CS(y,l):null;let C=-1,P=null;h&&(P=new ResizeObserver(N=>{let[E]=N;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let T,S=p?wn(s):null;p&&b();function b(){const N=wn(s);S&&!gg(S,N)&&l(),S=N,T=requestAnimationFrame(b)}return l(),()=>{var N;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(N=P)==null||N.disconnect(),P=null,p&&cancelAnimationFrame(T)}}const ES=X2,PS=J2,TS=G2,RS=eS,IS=Q2,hx=Y2,_S=Z2,MS=(s,a,l)=>{const o=new Map,c={platform:SS,...l},d={...c.platform,_c:o};return K2(s,a,{...c,platform:d})};var AS=typeof document<"u",DS=function(){},Gi=AS?f.useLayoutEffect:DS;function oo(s,a){if(s===a)return!0;if(typeof s!=typeof a)return!1;if(typeof s=="function"&&s.toString()===a.toString())return!0;let l,o,c;if(s&&a&&typeof s=="object"){if(Array.isArray(s)){if(l=s.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!oo(s[o],a[o]))return!1;return!0}if(c=Object.keys(s),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 d=c[o];if(!(d==="_owner"&&s.$$typeof)&&!oo(s[d],a[d]))return!1}return!0}return s!==s&&a!==a}function yg(s){return typeof window>"u"?1:(s.ownerDocument.defaultView||window).devicePixelRatio||1}function fx(s,a){const l=yg(s);return Math.round(a*l)/l}function Md(s){const a=f.useRef(s);return Gi(()=>{a.current=s}),a}function LS(s){s===void 0&&(s={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:h}={},transform:m=!0,whileElementsMounted:p,open:y}=s,[g,v]=f.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=f.useState(o);oo(C,o)||P(o);const[T,S]=f.useState(null),[b,N]=f.useState(null),E=f.useCallback(A=>{A!==U.current&&(U.current=A,S(A))},[]),j=f.useCallback(A=>{A!==k.current&&(k.current=A,N(A))},[]),R=d||T,B=h||b,U=f.useRef(null),k=f.useRef(null),L=f.useRef(g),_=p!=null,se=Md(p),le=Md(c),ie=Md(y),ee=f.useCallback(()=>{if(!U.current||!k.current)return;const A={placement:a,strategy:l,middleware:C};le.current&&(A.platform=le.current),MS(U.current,k.current,A).then(ne=>{const W={...ne,isPositioned:ie.current!==!1};G.current&&!oo(L.current,W)&&(L.current=W,gl.flushSync(()=>{v(W)}))})},[C,a,l,le,ie]);Gi(()=>{y===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,v(A=>({...A,isPositioned:!1})))},[y]);const G=f.useRef(!1);Gi(()=>(G.current=!0,()=>{G.current=!1}),[]),Gi(()=>{if(R&&(U.current=R),B&&(k.current=B),R&&B){if(se.current)return se.current(R,B,ee);ee()}},[R,B,ee,se,_]);const Q=f.useMemo(()=>({reference:U,floating:k,setReference:E,setFloating:j}),[E,j]),ce=f.useMemo(()=>({reference:R,floating:B}),[R,B]),re=f.useMemo(()=>{const A={position:l,left:0,top:0};if(!ce.floating)return A;const ne=fx(ce.floating,g.x),W=fx(ce.floating,g.y);return m?{...A,transform:"translate("+ne+"px, "+W+"px)",...yg(ce.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:ne,top:W}},[l,m,ce.floating,g.x,g.y]);return f.useMemo(()=>({...g,update:ee,refs:Q,elements:ce,floatingStyles:re}),[g,ee,Q,ce,re])}const OS=s=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:s,fn(l){const{element:o,padding:c}=typeof s=="function"?s(l):s;return o&&a(o)?o.current!=null?hx({element:o.current,padding:c}).fn(l):{}:o?hx({element:o,padding:c}).fn(l):{}}}},FS=(s,a)=>({...ES(s),options:[s,a]}),zS=(s,a)=>({...PS(s),options:[s,a]}),$S=(s,a)=>({..._S(s),options:[s,a]}),BS=(s,a)=>({...TS(s),options:[s,a]}),US=(s,a)=>({...RS(s),options:[s,a]}),VS=(s,a)=>({...IS(s),options:[s,a]}),WS=(s,a)=>({...OS(s),options:[s,a]});var HS="Arrow",vg=f.forwardRef((s,a)=>{const{children:l,width:o=10,height:c=5,...d}=s;return e.jsx(Ke.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:s.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});vg.displayName=HS;var KS=vg,Au="Popper",[jg,bg]=en(Au),[YS,Ng]=jg(Au),wg=s=>{const{__scopePopper:a,children:l}=s,[o,c]=f.useState(null);return e.jsx(YS,{scope:a,anchor:o,onAnchorChange:c,children:l})};wg.displayName=Au;var Sg="PopperAnchor",Cg=f.forwardRef((s,a)=>{const{__scopePopper:l,virtualRef:o,...c}=s,d=Ng(Sg,l),h=f.useRef(null),m=et(a,h),p=f.useRef(null);return f.useEffect(()=>{const y=p.current;p.current=(o==null?void 0:o.current)||h.current,y!==p.current&&d.onAnchorChange(p.current)}),o?null:e.jsx(Ke.div,{...c,ref:m})});Cg.displayName=Sg;var Du="PopperContent",[GS,QS]=jg(Du),kg=f.forwardRef((s,a)=>{var K,ye,ge,D,fe,Se;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:h=0,arrowPadding:m=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:T,...S}=s,b=Ng(Du,l),[N,E]=f.useState(null),j=et(a,ze=>E(ze)),[R,B]=f.useState(null),U=Cu(R),k=(U==null?void 0:U.width)??0,L=(U==null?void 0:U.height)??0,_=o+(d!=="center"?"-"+d:""),se=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},le=Array.isArray(y)?y:[y],ie=le.length>0,ee={padding:se,boundary:le.filter(XS),altBoundary:ie},{refs:G,floatingStyles:Q,placement:ce,isPositioned:re,middlewareData:A}=LS({strategy:"fixed",placement:_,whileElementsMounted:(...ze)=>kS(...ze,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[FS({mainAxis:c+L,alignmentAxis:h}),p&&zS({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?$S():void 0,...ee}),p&&BS({...ee}),US({...ee,apply:({elements:ze,rects:We,availableWidth:qe,availableHeight:Ze})=>{const{width:st,height:ft}=We.reference,nt=ze.floating.style;nt.setProperty("--radix-popper-available-width",`${qe}px`),nt.setProperty("--radix-popper-available-height",`${Ze}px`),nt.setProperty("--radix-popper-anchor-width",`${st}px`),nt.setProperty("--radix-popper-anchor-height",`${ft}px`)}}),R&&WS({element:R,padding:m}),JS({arrowWidth:k,arrowHeight:L}),C&&VS({strategy:"referenceHidden",...ee})]}),[ne,W]=Tg(ce),M=Qs(T);qt(()=>{re&&(M==null||M())},[re,M]);const O=(K=A.arrow)==null?void 0:K.x,F=(ye=A.arrow)==null?void 0:ye.y,X=((ge=A.arrow)==null?void 0:ge.centerOffset)!==0,[H,ue]=f.useState();return qt(()=>{N&&ue(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:re?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(D=A.transformOrigin)==null?void 0:D.x,(fe=A.transformOrigin)==null?void 0:fe.y].join(" "),...((Se=A.hide)==null?void 0:Se.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:s.dir,children:e.jsx(GS,{scope:l,placedSide:ne,onArrowChange:B,arrowX:O,arrowY:F,shouldHideArrow:X,children:e.jsx(Ke.div,{"data-side":ne,"data-align":W,...S,ref:j,style:{...S.style,animation:re?void 0:"none"}})})})});kg.displayName=Du;var Eg="PopperArrow",qS={top:"bottom",right:"left",bottom:"top",left:"right"},Pg=f.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=QS(Eg,o),h=qS[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(KS,{...c,ref:l,style:{...c.style,display:"block"}})})});Pg.displayName=Eg;function XS(s){return s!==null}var JS=s=>({name:"transformOrigin",options:s,fn(a){var b,N,E;const{placement:l,rects:o,middlewareData:c}=a,h=((b=c.arrow)==null?void 0:b.centerOffset)!==0,m=h?0:s.arrowWidth,p=h?0:s.arrowHeight,[y,g]=Tg(l),v={start:"0%",center:"50%",end:"100%"}[g],C=(((N=c.arrow)==null?void 0:N.x)??0)+m/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let T="",S="";return y==="bottom"?(T=h?v:`${C}px`,S=`${-p}px`):y==="top"?(T=h?v:`${C}px`,S=`${o.floating.height+p}px`):y==="right"?(T=`${-p}px`,S=h?v:`${P}px`):y==="left"&&(T=`${o.floating.width+p}px`,S=h?v:`${P}px`),{data:{x:T,y:S}}}});function Tg(s){const[a,l="center"]=s.split("-");return[a,l]}var ZS=wg,eC=Cg,tC=kg,rC=Pg,Rg=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"}),sC="VisuallyHidden",nC=f.forwardRef((s,a)=>e.jsx(Ke.span,{...s,ref:a,style:{...Rg,...s.style}}));nC.displayName=sC;var aC=[" ","Enter","ArrowUp","ArrowDown"],lC=[" ","Enter"],Sn="Select",[ko,Eo,iC]=ku(Sn),[xa]=en(Sn,[iC,bg]),Po=bg(),[oC,tn]=xa(Sn),[cC,dC]=xa(Sn),Ig=s=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:h,defaultValue:m,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:C,required:P,form:T}=s,S=Po(a),[b,N]=f.useState(null),[E,j]=f.useState(null),[R,B]=f.useState(!1),U=vo(y),[k,L]=bn({prop:o,defaultProp:c??!1,onChange:d,caller:Sn}),[_,se]=bn({prop:h,defaultProp:m,onChange:p,caller:Sn}),le=f.useRef(null),ie=b?T||!!b.closest("form"):!0,[ee,G]=f.useState(new Set),Q=Array.from(ee).map(ce=>ce.props.value).join(";");return e.jsx(ZS,{...S,children:e.jsxs(oC,{required:P,scope:a,trigger:b,onTriggerChange:N,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:R,onValueNodeHasChildrenChange:B,contentId:Gs(),value:_,onValueChange:se,open:k,onOpenChange:L,dir:U,triggerPointerDownPosRef:le,disabled:C,children:[e.jsx(ko.Provider,{scope:a,children:e.jsx(cC,{scope:s.__scopeSelect,onNativeOptionAdd:f.useCallback(ce=>{G(re=>new Set(re).add(ce))},[]),onNativeOptionRemove:f.useCallback(ce=>{G(re=>{const A=new Set(re);return A.delete(ce),A})},[]),children:l})}),ie?e.jsxs(Zg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:_,onChange:ce=>se(ce.target.value),disabled:C,form:T,children:[_===void 0?e.jsx("option",{value:""}):null,Array.from(ee)]},Q):null]})})};Ig.displayName=Sn;var _g="SelectTrigger",Mg=f.forwardRef((s,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=s,d=Po(l),h=tn(_g,l),m=h.disabled||o,p=et(a,h.onTriggerChange),y=Eo(l),g=f.useRef("touch"),[v,C,P]=t0(S=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===h.value),E=r0(b,S,N);E!==void 0&&h.onValueChange(E.value)}),T=S=>{m||(h.onOpenChange(!0),P()),S&&(h.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return e.jsx(eC,{asChild:!0,...d,children:e.jsx(Ke.button,{type:"button",role:"combobox","aria-controls":h.contentId,"aria-expanded":h.open,"aria-required":h.required,"aria-autocomplete":"none",dir:h.dir,"data-state":h.open?"open":"closed",disabled:m,"data-disabled":m?"":void 0,"data-placeholder":e0(h.value)?"":void 0,...c,ref:p,onClick:Be(c.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&T(S)}),onPointerDown:Be(c.onPointerDown,S=>{g.current=S.pointerType;const b=S.target;b.hasPointerCapture(S.pointerId)&&b.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(T(S),S.preventDefault())}),onKeyDown:Be(c.onKeyDown,S=>{const b=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&C(S.key),!(b&&S.key===" ")&&aC.includes(S.key)&&(T(),S.preventDefault())})})})});Mg.displayName=_g;var Ag="SelectValue",Dg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:h="",...m}=s,p=tn(Ag,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=et(a,p.onValueNodeChange);return qt(()=>{y(g)},[y,g]),e.jsx(Ke.span,{...m,ref:v,style:{pointerEvents:"none"},children:e0(p.value)?e.jsx(e.Fragment,{children:h}):d})});Dg.displayName=Ag;var uC="SelectIcon",Lg=f.forwardRef((s,a)=>{const{__scopeSelect:l,children:o,...c}=s;return e.jsx(Ke.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});Lg.displayName=uC;var hC="SelectPortal",Og=s=>e.jsx(yu,{asChild:!0,...s});Og.displayName=hC;var Cn="SelectContent",Fg=f.forwardRef((s,a)=>{const l=tn(Cn,s.__scopeSelect),[o,c]=f.useState();if(qt(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?gl.createPortal(e.jsx(zg,{scope:s.__scopeSelect,children:e.jsx(ko.Slot,{scope:s.__scopeSelect,children:e.jsx("div",{children:s.children})})}),d):null}return e.jsx($g,{...s,ref:a})});Fg.displayName=Cn;var Mr=10,[zg,rn]=xa(Cn),fC="SelectContentImpl",mC=xl("SelectContent.RemoveScroll"),$g=f.forwardRef((s,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:h,side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b,...N}=s,E=tn(Cn,l),[j,R]=f.useState(null),[B,U]=f.useState(null),k=et(a,K=>R(K)),[L,_]=f.useState(null),[se,le]=f.useState(null),ie=Eo(l),[ee,G]=f.useState(!1),Q=f.useRef(!1);f.useEffect(()=>{if(j)return yp(j)},[j]),cp();const ce=f.useCallback(K=>{const[ye,...ge]=ie().map(Se=>Se.ref.current),[D]=ge.slice(-1),fe=document.activeElement;for(const Se of K)if(Se===fe||(Se==null||Se.scrollIntoView({block:"nearest"}),Se===ye&&B&&(B.scrollTop=0),Se===D&&B&&(B.scrollTop=B.scrollHeight),Se==null||Se.focus(),document.activeElement!==fe))return},[ie,B]),re=f.useCallback(()=>ce([L,j]),[ce,L,j]);f.useEffect(()=>{ee&&re()},[ee,re]);const{onOpenChange:A,triggerPointerDownPosRef:ne}=E;f.useEffect(()=>{if(j){let K={x:0,y:0};const ye=D=>{var fe,Se;K={x:Math.abs(Math.round(D.pageX)-(((fe=ne.current)==null?void 0:fe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((Se=ne.current)==null?void 0:Se.y)??0))}},ge=D=>{K.x<=10&&K.y<=10?D.preventDefault():j.contains(D.target)||A(!1),document.removeEventListener("pointermove",ye),ne.current=null};return ne.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ge,{capture:!0})}}},[j,A,ne]),f.useEffect(()=>{const K=()=>A(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[A]);const[W,M]=t0(K=>{const ye=ie().filter(fe=>!fe.disabled),ge=ye.find(fe=>fe.ref.current===document.activeElement),D=r0(ye,K,ge);D&&setTimeout(()=>D.ref.current.focus())}),O=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&(_(K),D&&(Q.current=!0))},[E.value]),F=f.useCallback(()=>j==null?void 0:j.focus(),[j]),X=f.useCallback((K,ye,ge)=>{const D=!Q.current&&!ge;(E.value!==void 0&&E.value===ye||D)&&le(K)},[E.value]),H=o==="popper"?Xd:Bg,ue=H===Xd?{side:m,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:T,hideWhenDetached:S,avoidCollisions:b}:{};return e.jsx(zg,{scope:l,content:j,viewport:B,onViewportChange:U,itemRefCallback:O,selectedItem:L,onItemLeave:F,itemTextRefCallback:X,focusSelectedItem:re,selectedItemText:se,position:o,isPositioned:ee,searchRef:W,children:e.jsx(vu,{as:mC,allowPinchZoom:!0,children:e.jsx(gu,{asChild:!0,trapped:E.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Be(c,K=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),K.preventDefault()}),children:e.jsx(pu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(H,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:K=>K.preventDefault(),...N,...ue,onPlaced:()=>G(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:Be(N.onKeyDown,K=>{const ye=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ye&&K.key.length===1&&M(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let D=ie().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);if(["ArrowUp","End"].includes(K.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const fe=K.target,Se=D.indexOf(fe);D=D.slice(Se+1)}setTimeout(()=>ce(D)),K.preventDefault()}})})})})})})});$g.displayName=fC;var xC="SelectItemAlignedPosition",Bg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=s,d=tn(Cn,l),h=rn(Cn,l),[m,p]=f.useState(null),[y,g]=f.useState(null),v=et(a,k=>g(k)),C=Eo(l),P=f.useRef(!1),T=f.useRef(!0),{viewport:S,selectedItem:b,selectedItemText:N,focusSelectedItem:E}=h,j=f.useCallback(()=>{if(d.trigger&&d.valueNode&&m&&y&&S&&b&&N){const k=d.trigger.getBoundingClientRect(),L=y.getBoundingClientRect(),_=d.valueNode.getBoundingClientRect(),se=N.getBoundingClientRect();if(d.dir!=="rtl"){const fe=se.left-L.left,Se=_.left-fe,ze=k.left-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.left=st+"px"}else{const fe=L.right-se.right,Se=window.innerWidth-_.right-fe,ze=window.innerWidth-k.right-Se,We=k.width+ze,qe=Math.max(We,L.width),Ze=window.innerWidth-Mr,st=no(Se,[Mr,Math.max(Mr,Ze-qe)]);m.style.minWidth=We+"px",m.style.right=st+"px"}const le=C(),ie=window.innerHeight-Mr*2,ee=S.scrollHeight,G=window.getComputedStyle(y),Q=parseInt(G.borderTopWidth,10),ce=parseInt(G.paddingTop,10),re=parseInt(G.borderBottomWidth,10),A=parseInt(G.paddingBottom,10),ne=Q+ce+ee+A+re,W=Math.min(b.offsetHeight*5,ne),M=window.getComputedStyle(S),O=parseInt(M.paddingTop,10),F=parseInt(M.paddingBottom,10),X=k.top+k.height/2-Mr,H=ie-X,ue=b.offsetHeight/2,K=b.offsetTop+ue,ye=Q+ce+K,ge=ne-ye;if(ye<=X){const fe=le.length>0&&b===le[le.length-1].ref.current;m.style.bottom="0px";const Se=y.clientHeight-S.offsetTop-S.offsetHeight,ze=Math.max(H,ue+(fe?F:0)+Se+re),We=ye+ze;m.style.height=We+"px"}else{const fe=le.length>0&&b===le[0].ref.current;m.style.top="0px";const ze=Math.max(X,Q+S.offsetTop+(fe?O:0)+ue)+ge;m.style.height=ze+"px",S.scrollTop=ye-X+S.offsetTop}m.style.margin=`${Mr}px 0`,m.style.minHeight=W+"px",m.style.maxHeight=ie+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,m,y,S,b,N,d.dir,o]);qt(()=>j(),[j]);const[R,B]=f.useState();qt(()=>{y&&B(window.getComputedStyle(y).zIndex)},[y]);const U=f.useCallback(k=>{k&&T.current===!0&&(j(),E==null||E(),T.current=!1)},[j,E]);return e.jsx(gC,{scope:l,contentWrapper:m,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:e.jsx(Ke.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Bg.displayName=xC;var pC="SelectPopperPosition",Xd=f.forwardRef((s,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Mr,...d}=s,h=Po(l);return e.jsx(tC,{...h,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Xd.displayName=pC;var[gC,Lu]=xa(Cn,{}),Jd="SelectViewport",Ug=f.forwardRef((s,a)=>{const{__scopeSelect:l,nonce:o,...c}=s,d=rn(Jd,l),h=Lu(Jd,l),m=et(a,d.onViewportChange),p=f.useRef(0);return e.jsxs(e.Fragment,{children:[e.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}),e.jsx(ko.Slot,{scope:l,children:e.jsx(Ke.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:m,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:Be(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=h;if(C!=null&&C.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const T=window.innerHeight-Mr*2,S=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(S,b);if(N0?R:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});Ug.displayName=Jd;var Vg="SelectGroup",[yC,vC]=xa(Vg),jC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Gs();return e.jsx(yC,{scope:l,id:c,children:e.jsx(Ke.div,{role:"group","aria-labelledby":c,...o,ref:a})})});jC.displayName=Vg;var Wg="SelectLabel",bC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=vC(Wg,l);return e.jsx(Ke.div,{id:c.id,...o,ref:a})});bC.displayName=Wg;var co="SelectItem",[NC,Hg]=xa(co),Kg=f.forwardRef((s,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...h}=s,m=tn(co,l),p=rn(co,l),y=m.value===o,[g,v]=f.useState(d??""),[C,P]=f.useState(!1),T=et(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,o,c)}),S=Gs(),b=f.useRef("touch"),N=()=>{c||(m.onValueChange(o),m.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(NC,{scope:l,value:o,disabled:c,textId:S,isSelected:y,onItemTextChange:f.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(ko.ItemSlot,{scope:l,value:o,disabled:c,textValue:g,children:e.jsx(Ke.div,{role:"option","aria-labelledby":S,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...h,ref:T,onFocus:Be(h.onFocus,()=>P(!0)),onBlur:Be(h.onBlur,()=>P(!1)),onClick:Be(h.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:Be(h.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:Be(h.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:Be(h.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Be(h.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:Be(h.onKeyDown,E=>{var R;((R=p.searchRef)==null?void 0:R.current)!==""&&E.key===" "||(lC.includes(E.key)&&N(),E.key===" "&&E.preventDefault())})})})})});Kg.displayName=co;var cl="SelectItemText",Yg=f.forwardRef((s,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=s,h=tn(cl,l),m=rn(cl,l),p=Hg(cl,l),y=dC(cl,l),[g,v]=f.useState(null),C=et(a,N=>v(N),p.onItemTextChange,N=>{var E;return(E=m.itemTextRefCallback)==null?void 0:E.call(m,N,p.value,p.disabled)}),P=g==null?void 0:g.textContent,T=f.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:b}=y;return qt(()=>(S(T),()=>b(T)),[S,b,T]),e.jsxs(e.Fragment,{children:[e.jsx(Ke.span,{id:p.textId,...d,ref:C}),p.isSelected&&h.valueNode&&!h.valueNodeHasChildren?gl.createPortal(d.children,h.valueNode):null]})});Yg.displayName=cl;var Gg="SelectItemIndicator",Qg=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return Hg(Gg,l).isSelected?e.jsx(Ke.span,{"aria-hidden":!0,...o,ref:a}):null});Qg.displayName=Gg;var Zd="SelectScrollUpButton",qg=f.forwardRef((s,a)=>{const l=rn(Zd,s.__scopeSelect),o=Lu(Zd,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return m(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop-p.offsetHeight)}}):null});qg.displayName=Zd;var eu="SelectScrollDownButton",Xg=f.forwardRef((s,a)=>{const l=rn(eu,s.__scopeSelect),o=Lu(eu,s.__scopeSelect),[c,d]=f.useState(!1),h=et(a,o.onScrollButtonChange);return qt(()=>{if(l.viewport&&l.isPositioned){let m=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",m)}},[l.viewport,l.isPositioned]),c?e.jsx(Jg,{...s,ref:h,onAutoScroll:()=>{const{viewport:m,selectedItem:p}=l;m&&p&&(m.scrollTop=m.scrollTop+p.offsetHeight)}}):null});Xg.displayName=eu;var Jg=f.forwardRef((s,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=s,d=rn("SelectScrollButton",l),h=f.useRef(null),m=Eo(l),p=f.useCallback(()=>{h.current!==null&&(window.clearInterval(h.current),h.current=null)},[]);return f.useEffect(()=>()=>p(),[p]),qt(()=>{var g;const y=m().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[m]),e.jsx(Ke.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:Be(c.onPointerDown,()=>{h.current===null&&(h.current=window.setInterval(o,50))}),onPointerMove:Be(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),h.current===null&&(h.current=window.setInterval(o,50))}),onPointerLeave:Be(c.onPointerLeave,()=>{p()})})}),wC="SelectSeparator",SC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s;return e.jsx(Ke.div,{"aria-hidden":!0,...o,ref:a})});SC.displayName=wC;var tu="SelectArrow",CC=f.forwardRef((s,a)=>{const{__scopeSelect:l,...o}=s,c=Po(l),d=tn(tu,l),h=rn(tu,l);return d.open&&h.position==="popper"?e.jsx(rC,{...c,...o,ref:a}):null});CC.displayName=tu;var kC="SelectBubbleInput",Zg=f.forwardRef(({__scopeSelect:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(o,c),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("change",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.select,{...l,style:{...Rg,...l.style},ref:d,defaultValue:a})});Zg.displayName=kC;function e0(s){return s===""||s===void 0}function t0(s){const a=Qs(s),l=f.useRef(""),o=f.useRef(0),c=f.useCallback(h=>{const m=l.current+h;a(m),(function p(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(m)},[a]),d=f.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function r0(s,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?s.indexOf(l):-1;let h=EC(s,Math.max(d,0));c.length===1&&(h=h.filter(y=>y!==l));const p=h.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function EC(s,a){return s.map((l,o)=>s[(a+o)%s.length])}var PC=Ig,s0=Mg,TC=Dg,RC=Lg,IC=Og,n0=Fg,_C=Ug,a0=Kg,MC=Yg,AC=Qg,DC=qg,LC=Xg;const il=PC,ol=TC,ea=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(s0,{ref:o,className:tt("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",s),...l,children:[a,e.jsx(RC,{asChild:!0,children:e.jsx(ml,{className:"h-4 w-4 opacity-50"})})]}));ea.displayName=s0.displayName;const ta=f.forwardRef(({className:s,children:a,position:l="popper",...o},c)=>e.jsx(IC,{children:e.jsxs(n0,{ref:c,className:tt("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",s),position:l,...o,children:[e.jsx(DC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ax,{className:"h-4 w-4"})}),e.jsx(_C,{className:"p-1",children:a}),e.jsx(LC,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(ml,{className:"h-4 w-4"})})]})}));ta.displayName=n0.displayName;const Hr=f.forwardRef(({className:s,children:a,...l},o)=>e.jsxs(a0,{ref:o,className:tt("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",s),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(AC,{children:e.jsx(fo,{className:"h-4 w-4"})})}),e.jsx(MC,{children:a})]}));Hr.displayName=a0.displayName;const OC=["一","二","三","四","五","六","七","八","九","十"];function Ad(s){return s.startsWith("part:")?{type:"part",id:s.slice(5)}:s.startsWith("chapter:")?{type:"chapter",id:s.slice(8)}:s.startsWith("section:")?{type:"section",id:s.slice(8)}:null}function FC({parts:s,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:h,onAddChapterInPart:m,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:T}){const[S,b]=f.useState(null),[N,E]=f.useState(null),j=(_,se)=>(S==null?void 0:S.type)===_&&(S==null?void 0:S.id)===se,R=(_,se)=>(N==null?void 0:N.type)===_&&(N==null?void 0:N.id)===se,B=f.useCallback(()=>{const _=[];for(const se of s)for(const le of se.chapters)for(const ie of le.sections)_.push({id:ie.id,partId:se.id,partTitle:se.title,chapterId:le.id,chapterTitle:le.title});return _},[s]),U=f.useCallback(async(_,se,le,ie)=>{var re;_.preventDefault(),_.stopPropagation();const ee=_.dataTransfer.getData("text/plain"),G=Ad(ee);if(!G||G.type===se&&G.id===le)return;const Q=B(),ce=new Map(Q.map(A=>[A.id,A]));if(G.type==="part"&&se==="part"){const A=s.map(F=>F.id),ne=A.indexOf(G.id),W=A.indexOf(le);if(ne===-1||W===-1)return;const M=[...A];M.splice(ne,1),M.splice(neH.id===F);if(X)for(const H of X.chapters)for(const ue of H.sections){const K=ce.get(ue.id);K&&O.push(K)}}await o(O);return}if(G.type==="chapter"&&(se==="chapter"||se==="section"||se==="part")){const A=s.find(K=>K.chapters.some(ye=>ye.id===G.id)),ne=A==null?void 0:A.chapters.find(K=>K.id===G.id);if(!A||!ne)return;let W,M,O=null;if(se==="section"){const K=ce.get(le);if(!K)return;W=K.partId,M=K.partTitle,O=le}else if(se==="chapter"){const K=s.find(D=>D.chapters.some(fe=>fe.id===le)),ye=K==null?void 0:K.chapters.find(D=>D.id===le);if(!K||!ye)return;W=K.id,M=K.title;const ge=Q.filter(D=>D.chapterId===le).pop();O=(ge==null?void 0:ge.id)??null}else{const K=s.find(ge=>ge.id===le);if(!K||!K.chapters[0])return;W=K.id,M=K.title;const ye=Q.filter(ge=>ge.partId===K.id&&ge.chapterId===K.chapters[0].id);O=((re=ye[ye.length-1])==null?void 0:re.id)??null}const F=ne.sections.map(K=>K.id),X=Q.filter(K=>!F.includes(K.id));let H=X.length;if(O){const K=X.findIndex(ye=>ye.id===O);K>=0&&(H=K+1)}const ue=F.map(K=>({...ce.get(K),partId:W,partTitle:M,chapterId:ne.id,chapterTitle:ne.title}));await o([...X.slice(0,H),...ue,...X.slice(H)]);return}if(G.type==="section"&&(se==="section"||se==="chapter"||se==="part")){if(!ie)return;const{partId:A,partTitle:ne,chapterId:W,chapterTitle:M}=ie;let O;if(se==="section")O=Q.findIndex(ye=>ye.id===le);else if(se==="chapter"){const ye=Q.filter(ge=>ge.chapterId===le).pop();O=ye?Q.findIndex(ge=>ge.id===ye.id)+1:Q.length}else{const ye=s.find(fe=>fe.id===le);if(!(ye!=null&&ye.chapters[0]))return;const ge=Q.filter(fe=>fe.partId===ye.id&&fe.chapterId===ye.chapters[0].id),D=ge[ge.length-1];O=D?Q.findIndex(fe=>fe.id===D.id)+1:0}const F=Q.findIndex(ye=>ye.id===G.id);if(F===-1)return;const X=Q.filter(ye=>ye.id!==G.id),H=F({onDragEnter:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragOver:ie=>{ie.preventDefault(),ie.stopPropagation(),ie.dataTransfer.dropEffect="move",E({type:_,id:se})},onDragLeave:()=>E(null),onDrop:ie=>{E(null);const ee=Ad(ie.dataTransfer.getData("text/plain"));if(ee&&!(_==="section"&&ee.type==="section"&&ee.id===se))if(_==="part")if(ee.type==="part")U(ie,"part",se);else{const G=s.find(ce=>ce.id===se);(G==null?void 0:G.chapters[0])&&le&&U(ie,"part",se,le)}else _==="chapter"&&le?(ee.type==="section"||ee.type==="chapter")&&U(ie,"chapter",se,le):_==="section"&&le&&U(ie,"section",se,le)}}),L=_=>OC[_]??String(_+1);return e.jsx("div",{className:"space-y-3",children:s.map((_,se)=>{var ne,W,M,O;const le=_.title==="序言"||_.title.includes("序言"),ie=_.title==="尾声"||_.title.includes("尾声"),ee=_.title==="附录"||_.title.includes("附录"),G=R("part",_.id),Q=a.includes(_.id),ce=_.chapters.length,re=_.chapters.reduce((F,X)=>F+X.sections.length,0);if(le&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}if(_.title==="2026每日派对干货"||_.title.includes("2026每日派对干货")){const F=R("part",_.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${F?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((ne=_.chapters[0])==null?void 0:ne.id)??"",chapterTitle:((W=_.chapters[0])==null?void 0:W.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+_.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&_.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]},H.id)})})]},X.id))})]},_.id)}if(ee)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map((F,X)=>F.sections.length>0?F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",F.title," | ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},H.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",F.title,"(空)"]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500 shrink-0"})]},F.id))})]},_.id);if(ie&&_.chapters.length===1&&_.chapters[0].sections.length===1){const F=_.chapters[0].sections[0],X=R("section",F.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+F.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:F.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",F.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(F.id),onChange:()=>P(F.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(us,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",F.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[F.price===0||F.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",F.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",F.clickCount??0," · 付款 ",F.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(F.hotScore??0).toFixed(1)," · 第",F.hotRank&&F.hotRank>0?F.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(F),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(F),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}return ie?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map(F=>F.sections.map(X=>{const H=R("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+X.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${H?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",X.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[F.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),T&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>T(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},_.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${G?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((M=_.chapters[0])==null?void 0:M.id)??"",chapterTitle:((O=_.chapters[0])==null?void 0:O.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:F=>{F.stopPropagation(),F.dataTransfer.setData("text/plain","part:"+_.id),F.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(is,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.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:L(se)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",re," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:F=>F.stopPropagation(),onClick:F=>F.stopPropagation(),children:[h&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>h(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),y&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),g&&e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),Q?e.jsx(ml,{className:"w-5 h-5 text-gray-500"}):e.jsx(Vs,{className:"w-5 h-5 text-gray-500"})]})]}),Q&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(F=>{const X=R("chapter",F.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:H=>{H.stopPropagation(),H.dataTransfer.setData("text/plain","chapter:"+F.id),H.dataTransfer.effectAllowed="move",b({type:"chapter",id:F.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragOver:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:F.id})},onDragLeave:()=>E(null),onDrop:H=>{E(null);const ue=Ad(H.dataTransfer.getData("text/plain"));if(!ue)return;const K={partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title};(ue.type==="section"||ue.type==="chapter")&&U(H,"chapter",F.id,K)},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 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",F.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:F.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>v(_,F),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),m&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(At,{className:"w-3.5 h-3.5"})}),p&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>p(_,F),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:F.sections.map(H=>{const ue=R("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:K=>{K.stopPropagation(),K.dataTransfer.setData("text/plain","section:"+H.id),K.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(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 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:F.id,chapterTitle:F.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:K=>K.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(is,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${H.price===0||H.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:K=>K.stopPropagation(),onClick:K=>K.stopPropagation(),children:[H.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),H.price===0||H.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",H.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),T&&e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ds,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yt,{className:"w-3.5 h-3.5"})}),e.jsx(Z,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Gt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Vs,{className:"w-4 h-4 text-gray-500"})]})]},H.id)})})]},F.id)})})]},_.id)})})}function zC(s){const a=new Map;for(const m of s){const p=m.partId||"part-1",y=m.partTitle||"未分类",g=m.chapterId||"chapter-1",v=m.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const C=a.get(p);C.chapters.has(g)||C.chapters.set(g,{id:g,title:v,sections:[]}),C.chapters.get(g).sections.push({id:m.id,title:m.title,price:m.price??1,filePath:m.filePath,isFree:m.isFree,isNew:m.isNew,clickCount:m.clickCount??0,payCount:m.payCount??0,hotScore:m.hotScore??0,hotRank:m.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(m=>m.title===o||m.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(m=>({...m,chapters:Array.from(m.chapters.values())})),h=m=>m.includes("序言")?0:m.includes(o)?1.5:m.includes("附录")?2:m.includes("尾声")?3:1;return d.sort((m,p)=>{const y=h(m.title),g=h(p.title);return y!==g?y-g:0})}function $C(){var js,Pl,bs;const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState([]),[h,m]=f.useState(null),[p,y]=f.useState(!1),[g,v]=f.useState(!1),[C,P]=f.useState(!1),[T,S]=f.useState(""),[b,N]=f.useState([]),[E,j]=f.useState(!1),[R,B]=f.useState(!1),U=f.useRef(null),[k,L]=f.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[_,se]=f.useState(null),[le,ie]=f.useState(!1),[ee,G]=f.useState(!1),[Q,ce]=f.useState(null),[re,A]=f.useState(!1),[ne,W]=f.useState([]),[M,O]=f.useState(!1),[F,X]=f.useState(""),[H,ue]=f.useState(""),[K,ye]=f.useState(!1),[ge,D]=f.useState(""),[fe,Se]=f.useState(!1),[ze,We]=f.useState(null),[qe,Ze]=f.useState(!1),[st,ft]=f.useState(!1),[nt,Vt]=f.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[Fr,Xr]=f.useState(!1),[xs,ps]=f.useState(!1),$t=zC(s),gs=s.length,oe=async()=>{o(!0);try{const z=await Fe("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(z==null?void 0:z.sections)?z.sections:[])}catch(z){console.error(z),a([])}finally{o(!1)}};f.useEffect(()=>{oe()},[]);const Qe=z=>{d(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},Tt=f.useCallback(z=>{const ae=s,be=z.flatMap(Ee=>{const mt=ae.find(gr=>gr.id===Ee.id);return mt?[{...mt,partId:Ee.partId,partTitle:Ee.partTitle,chapterId:Ee.chapterId,chapterTitle:Ee.chapterTitle}]:[]});return a(be),Nt("/api/db/book",{action:"reorder",items:z}).then(Ee=>{Ee&&Ee.success===!1&&(a(ae),alert("排序失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误")))}).catch(Ee=>{a(ae),console.error("排序失败:",Ee),alert("排序失败: "+(Ee instanceof Error?Ee.message:"网络或服务异常"))}),Promise.resolve()},[s]),dr=async z=>{if(confirm(`确定要删除章节「${z.title}」吗?此操作不可恢复。`))try{const ae=await vn(`/api/db/book?id=${encodeURIComponent(z.id)}`);ae&&ae.success!==!1?(alert("已删除"),oe()):alert("删除失败: "+(ae&&typeof ae=="object"&&"error"in ae?ae.error:"未知错误"))}catch(ae){console.error(ae),alert("删除失败")}},zr=f.useCallback(async()=>{Xr(!0);try{const z=await Fe("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ae=z&&z.data;ae&&typeof ae.readWeight=="number"&&typeof ae.recencyWeight=="number"&&typeof ae.payWeight=="number"&&Vt({readWeight:Math.max(0,Math.min(1,ae.readWeight)),recencyWeight:Math.max(0,Math.min(1,ae.recencyWeight)),payWeight:Math.max(0,Math.min(1,ae.payWeight))})}catch{}finally{Xr(!1)}},[]);f.useEffect(()=>{st&&zr()},[st,zr]);const Ro=async()=>{const{readWeight:z,recencyWeight:ae,payWeight:be}=nt,Ee=z+ae+be;if(Math.abs(Ee-1)>.001){alert("三个权重之和必须等于 1");return}ps(!0);try{const mt=await Et("/api/db/config",{key:"article_ranking_weights",value:{readWeight:z,recencyWeight:ae,payWeight:be},description:"文章排名算法权重"});mt&&mt.success!==!1?(alert("已保存"),oe()):alert("保存失败: "+(mt&&typeof mt=="object"&&"error"in mt?mt.error:""))}catch(mt){console.error(mt),alert("保存失败")}finally{ps(!1)}},Nl=async z=>{We({section:z,orders:[]}),Ze(!0);try{const ae=await Fe(`/api/db/book?action=section-orders&id=${encodeURIComponent(z.id)}`),be=ae!=null&&ae.success&&Array.isArray(ae.orders)?ae.orders:[];We(Ee=>Ee?{...Ee,orders:be}:null)}catch(ae){console.error(ae),We(be=>be?{...be,orders:[]}:null)}finally{Ze(!1)}},ga=async z=>{v(!0);try{const ae=await Fe(`/api/db/book?action=read&id=${encodeURIComponent(z.id)}`);if(ae!=null&&ae.success&&ae.section){const be=ae.section;m({id:z.id,title:ae.section.title??z.title,price:ae.section.price??z.price,content:ae.section.content??"",filePath:z.filePath,isFree:z.isFree||z.price===0,isNew:be.isNew??z.isNew})}else m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree,isNew:z.isNew}),ae&&!ae.success&&alert("无法读取文件内容: "+(ae.error||"未知错误"))}catch(ae){console.error(ae),m({id:z.id,title:z.title,price:z.price,content:"",filePath:z.filePath,isFree:z.isFree})}finally{v(!1)}},Io=async()=>{var z;if(h){P(!0);try{let ae=h.content||"";const be=[new RegExp(`^#+\\s*${h.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${h.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(z=h.title)==null?void 0:z.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const mt of be)ae=ae.replace(mt,"");ae=ae.replace(/^\s*\n+/,"").trim();const Ee=await Nt("/api/db/book",{id:h.id,title:h.title,price:h.isFree?0:h.price,content:ae,isFree:h.isFree||h.price===0,isNew:h.isNew,saveToFile:!0});Ee&&Ee.success!==!1?(alert(`已保存章节: ${h.title}`),m(null),oe()):alert("保存失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{P(!1)}}},ya=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}P(!0);try{const z=await Nt("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});z&&z.success!==!1?(alert(`章节创建成功: ${k.title}`),y(!1),L({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),oe()):alert("创建失败: "+(z&&typeof z=="object"&&"error"in z?z.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{P(!1)}},va=z=>{L(ae=>{var be;return{...ae,partId:z.id,chapterId:((be=z.chapters[0])==null?void 0:be.id)??"chapter-1"}}),y(!0)},ja=z=>{se({id:z.id,title:z.title})},ba=async()=>{var z;if((z=_==null?void 0:_.title)!=null&&z.trim()){ie(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||"part-1",partTitle:Ee.partId===_.id?_.title.trim():Ee.partTitle||"",chapterId:Ee.chapterId||"chapter-1",chapterTitle:Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(se(null),oe()):alert("更新篇名失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("更新篇名失败")}finally{ie(!1)}}},Na=z=>{const ae=z.chapters.length+1,be=`chapter-${z.id}-${ae}-${Date.now()}`;L({id:`${ae}.1`,title:"新章节",price:1,partId:z.id,chapterId:be,content:""}),y(!0)},ys=(z,ae)=>{ce({part:z,chapter:ae,title:ae.title})},vs=async()=>{var z;if((z=Q==null?void 0:Q.title)!=null&&z.trim()){A(!0);try{const ae=s.map(Ee=>({id:Ee.id,partId:Ee.partId||Q.part.id,partTitle:Ee.partId===Q.part.id?Q.part.title:Ee.partTitle||"",chapterId:Ee.chapterId||Q.chapter.id,chapterTitle:Ee.partId===Q.part.id&&Ee.chapterId===Q.chapter.id?Q.title.trim():Ee.chapterTitle||""})),be=await Nt("/api/db/book",{action:"reorder",items:ae});be&&be.success!==!1?(ce(null),oe()):alert("保存失败: "+(be&&typeof be=="object"&&"error"in be?be.error:"未知错误"))}catch(ae){console.error(ae),alert("保存失败")}finally{A(!1)}}},wl=async(z,ae)=>{const be=ae.sections.map(Ee=>Ee.id);if(be.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${z.chapters.indexOf(ae)+1}章 | ${ae.title}」吗?将删除共 ${be.length} 节,此操作不可恢复。`))try{for(const Ee of be)await vn(`/api/db/book?id=${encodeURIComponent(Ee)}`);oe()}catch(Ee){console.error(Ee),alert("删除失败")}},Sl=async()=>{if(!ge.trim()){alert("请输入篇名");return}Se(!0);try{const z=`part-new-${Date.now()}`,ae="chapter-1",be=`part-placeholder-${Date.now()}`,Ee=await Nt("/api/db/book",{id:be,title:"占位节(可编辑)",price:0,content:"",partId:z,partTitle:ge.trim(),chapterId:ae,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Ee&&Ee.success!==!1?(alert(`篇「${ge}」创建成功,请编辑占位节`),G(!1),D(""),oe()):alert("创建失败: "+(Ee&&typeof Ee=="object"&&"error"in Ee?Ee.error:"未知错误"))}catch(z){console.error(z),alert("创建失败")}finally{Se(!1)}},Cl=async()=>{if(ne.length===0){alert("请先勾选要移动的章节");return}const z=$t.find(be=>be.id===F),ae=z==null?void 0:z.chapters.find(be=>be.id===H);if(!z||!ae||!F||!H){alert("请选择目标篇和章");return}ye(!0);try{const be=()=>{const at=new Set(ne),Cr=s.map(Rt=>({id:Rt.id,partId:Rt.partId||"",partTitle:Rt.partTitle||"",chapterId:Rt.chapterId||"",chapterTitle:Rt.chapterTitle||""})),Tl=Cr.filter(Rt=>at.has(Rt.id)).map(Rt=>({...Rt,partId:F,partTitle:z.title||F,chapterId:H,chapterTitle:ae.title||H})),sn=Cr.filter(Rt=>!at.has(Rt.id));let En=sn.length;for(let Rt=sn.length-1;Rt>=0;Rt-=1){const Ca=sn[Rt];if(Ca.partId===F&&Ca.chapterId===H){En=Rt+1;break}}return[...sn.slice(0,En),...Tl,...sn.slice(En)]},Ee=async()=>{const at=be(),Cr=await Nt("/api/db/book",{action:"reorder",items:at});return Cr&&Cr.success!==!1?(alert(`已移动 ${ne.length} 节到「${z.title}」-「${ae.title}」`),O(!1),W([]),await oe(),!0):!1},mt={action:"move-sections",sectionIds:ne,targetPartId:F,targetChapterId:H,targetPartTitle:z.title||F,targetChapterTitle:ae.title||H},gr=await Nt("/api/db/book",mt);if(gr&&gr.success!==!1)alert(`已移动 ${gr.count??ne.length} 节到「${z.title}」-「${ae.title}」`),O(!1),W([]),await oe();else{const at=gr&&typeof gr=="object"&&"error"in gr?gr.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Ee())return;alert("移动失败: "+at)}}catch(be){console.error(be),alert("移动失败: "+(be instanceof Error?be.message:"网络或服务异常"))}finally{ye(!1)}},kl=z=>{W(ae=>ae.includes(z)?ae.filter(be=>be!==z):[...ae,z])},El=async z=>{const ae=s.filter(be=>be.partId===z.id).map(be=>be.id);if(ae.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${z.title}」整篇吗?将删除共 ${ae.length} 节内容,此操作不可恢复。`))try{for(const be of ae)await vn(`/api/db/book?id=${encodeURIComponent(be)}`);oe()}catch(be){console.error(be),alert("删除失败")}},wa=async z=>{var be,Ee;const ae=(be=z.target.files)==null?void 0:be[0];if(ae){B(!0);try{const mt=new FormData;mt.append("file",ae),mt.append("folder","book-images");const at=await(await fetch(la("/api/upload"),{method:"POST",body:mt,credentials:"include"})).json();if(at!=null&&at.success&&((Ee=at==null?void 0:at.data)!=null&&Ee.url)){const Cr=`![${ae.name}](${at.data.url})`;h&&m({...h,content:(h.content||"")+` - -`+Cr}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(mt){console.error(mt),alert("上传失败")}finally{B(!1),U.current&&(U.current.value="")}}},Sa=async()=>{var z;if(T.trim()){j(!0);try{const ae=await Fe(`/api/search?q=${encodeURIComponent(T)}`);ae!=null&&ae.success&&((z=ae.data)!=null&&z.results)?N(ae.data.results):(N([]),ae&&!ae.success&&alert("搜索失败: "+ae.error))}catch(ae){console.error(ae),N([]),alert("搜索失败")}finally{j(!1)}}},Jr=$t.find(z=>z.id===k.partId),kn=(Jr==null?void 0:Jr.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",$t.length," 篇 · ",gs," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:()=>ft(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(Z,{onClick:()=>{const z=typeof window<"u"?`${window.location.origin}/api-doc`:"";z&&window.open(z,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Ys,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(wt,{open:p,onOpenChange:y,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:z=>L({...k,id:z.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:z=>L({...k,price:Number(z.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:z=>L({...k,title:z.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(il,{value:k.partId,onValueChange:z=>L({...k,partId:z,chapterId:"chapter-1"}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),$t.length===0&&e.jsx(Hr,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属章"}),e.jsxs(il,{value:k.chapterId,onValueChange:z=>L({...k,chapterId:z}),children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[kn.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id)),kn.length===0&&e.jsx(Hr,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:z=>L({...k,content:z.target.value})})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ya,disabled:C||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(wt,{open:!!_,onOpenChange:z=>!z&&se(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:z=>se({..._,title:z.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>se(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:ba,disabled:le||!((js=_==null?void 0:_.title)!=null&&js.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:!!Q,onOpenChange:z=>!z&&ce(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),Q&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:Q.title,onChange:z=>ce({...Q,title:z.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>ce(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:vs,disabled:re||!((Pl=Q==null?void 0:Q.title)!=null&&Pl.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:re?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:M,onOpenChange:z=>{var ae;if(O(z),z&&$t.length>0){const be=$t[0];X(be.id),ue(((ae=be.chapters[0])==null?void 0:ae.id)??"")}},children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:ne.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(il,{value:F,onValueChange:z=>{var be;X(z);const ae=$t.find(Ee=>Ee.id===z);ue(((be=ae==null?void 0:ae.chapters[0])==null?void 0:be.id)??"")},children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择篇"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:$t.map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(il,{value:H,onValueChange:ue,children:[e.jsx(ea,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章"})}),e.jsx(ta,{className:"bg-[#0f2137] border-gray-700",children:(((bs=$t.find(z=>z.id===F))==null?void 0:bs.chapters)??[]).map(z=>e.jsx(Hr,{value:z.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:z.title},z.id))})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>O(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Cl,disabled:K||ne.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:K?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(wt,{open:!!ze,onOpenChange:z=>!z&&We(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white",children:["付款记录 — ",(ze==null?void 0:ze.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:qe?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):ze&&ze.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):ze?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:ze.orders.map(z=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.userId??z.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",z.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:z.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:z.payTime??z.createdAt??"-"})]},z.id??z.orderSn??""))})]}):null})]})}),e.jsx(wt,{open:st,onOpenChange:ft,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(jd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1)"}),Fr?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.readWeight,onChange:z=>Vt(ae=>({...ae,readWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.recencyWeight,onChange:z=>Vt(ae=>({...ae,recencyWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(de,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:nt.payWeight,onChange:z=>Vt(ae=>({...ae,payWeight:Math.max(0,Math.min(1,parseFloat(z.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(nt.readWeight+nt.recencyWeight+nt.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(Z,{onClick:Ro,disabled:xs||Math.abs(nt.readWeight+nt.recencyWeight+nt.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:xs?"保存中...":"保存权重"})]})]})]})}),e.jsx(wt,{open:ee,onOpenChange:G,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(At,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:ge,onChange:z=>D(z.target.value),placeholder:"输入篇名"})]})}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>{G(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(Z,{onClick:Sl,disabled:fe||!ge.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:fe?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(wt,{open:!!h,onOpenChange:()=>m(null),children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(St,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),h&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:h.isFree?0:h.price,onChange:z=>m({...h,price:Number(z.target.value),isFree:Number(z.target.value)===0}),disabled:h.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isFree||h.price===0,onChange:z=>m({...h,isFree:z.target.checked,price:z.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:h.isNew??!1,onChange:z=>m({...h,isNew:z.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:h.title,onChange:z=>m({...h,title:z.target.value})})]}),h.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:h.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:wa,className:"hidden"}),e.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>{var z;return(z=U.current)==null?void 0:z.click()},disabled:R,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[R?e.jsx($e,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx($x,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:h.content,onChange:z=>m({...h,content:z.target.value})})]})]}),e.jsxs(Ft,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(Z,{variant:"outline",onClick:()=>m(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(Z,{onClick:Io,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(bo,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(us,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(Zt,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(yn,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(Zt,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(jd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(er,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.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:e.jsx(us,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:gs}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(Z,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(Z,{onClick:()=>G(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(Z,{variant:"outline",onClick:()=>O(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",ne.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(FC,{parts:$t,expandedParts:c,onTogglePart:Qe,onReorder:Tt,onReadSection:ga,onDeleteSection:dr,onAddSectionInPart:va,onAddChapterInPart:Na,onDeleteChapter:wl,onEditPart:ja,onDeletePart:El,onEditChapter:ys,selectedSectionIds:ne,onToggleSectionSelect:kl,onShowSectionOrders:Nl})]}),e.jsx(er,{value:"search",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"内容搜索"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:T,onChange:z=>S(z.target.value),onKeyDown:z=>z.key==="Enter"&&Sa()}),e.jsx(Z,{onClick:Sa,disabled:E||!T.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx($e,{className:"w-4 h-4 animate-spin"}):e.jsx(yn,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(z=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>ga({id:z.id,title:z.title,price:z.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:z.id}),e.jsx("span",{className:"text-white",children:z.title})]}),e.jsx(Oe,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:z.matchType==="title"?"标题匹配":"内容匹配"})]}),z.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:z.snippet}),(z.partTitle||z.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[z.partTitle," · ",z.chapterTitle]})]},z.id))]})]})]})}),e.jsx(er,{value:"hooks",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(il,{defaultValue:"3",children:[e.jsx(ea,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(ol,{placeholder:"选择章节"})}),e.jsxs(ta,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(Hr,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(Hr,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(Hr,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(jn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(Z,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var l0=["PageUp","PageDown"],i0=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],o0={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},pa="Slider",[ru,BC,UC]=ku(pa),[c0]=en(pa,[UC]),[VC,To]=c0(pa),d0=f.forwardRef((s,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:h="horizontal",disabled:m=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[o],value:g,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:T,...S}=s,b=f.useRef(new Set),N=f.useRef(0),j=h==="horizontal"?WC:HC,[R=[],B]=bn({prop:g,defaultProp:y,onChange:le=>{var ee;(ee=[...b.current][N.current])==null||ee.focus(),v(le)}}),U=f.useRef(R);function k(le){const ie=qC(R,le);se(le,ie)}function L(le){se(le,N.current)}function _(){const le=U.current[N.current];R[N.current]!==le&&C(R)}function se(le,ie,{commit:ee}={commit:!1}){const G=e4(d),Q=t4(Math.round((le-o)/d)*d+o,G),ce=no(Q,[o,c]);B((re=[])=>{const A=GC(re,ce,ie);if(ZC(A,p*d)){N.current=A.indexOf(ce);const ne=String(A)!==String(re);return ne&&ee&&C(A),ne?A:re}else return re})}return e.jsx(VC,{scope:s.__scopeSlider,name:l,disabled:m,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:R,orientation:h,form:T,children:e.jsx(ru.Provider,{scope:s.__scopeSlider,children:e.jsx(ru.Slot,{scope:s.__scopeSlider,children:e.jsx(j,{"aria-disabled":m,"data-disabled":m?"":void 0,...S,ref:a,onPointerDown:Be(S.onPointerDown,()=>{m||(U.current=R)}),min:o,max:c,inverted:P,onSlideStart:m?void 0:k,onSlideMove:m?void 0:L,onSlideEnd:m?void 0:_,onHomeKeyDown:()=>!m&&se(o,0,{commit:!0}),onEndKeyDown:()=>!m&&se(c,R.length-1,{commit:!0}),onStepKeyDown:({event:le,direction:ie})=>{if(!m){const Q=l0.includes(le.key)||le.shiftKey&&i0.includes(le.key)?10:1,ce=N.current,re=R[ce],A=d*Q*ie;se(re+A,ce,{commit:!0})}}})})})})});d0.displayName=pa;var[u0,h0]=c0(pa,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WC=f.forwardRef((s,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:h,onSlideMove:m,onSlideEnd:p,onStepKeyDown:y,...g}=s,[v,C]=f.useState(null),P=et(a,j=>C(j)),T=f.useRef(void 0),S=vo(c),b=S==="ltr",N=b&&!d||!b&&d;function E(j){const R=T.current||v.getBoundingClientRect(),B=[0,R.width],k=Ou(B,N?[l,o]:[o,l]);return T.current=R,k(j-R.left)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(f0,{dir:S,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const R=E(j.clientX);h==null||h(R)},onSlideMove:j=>{const R=E(j.clientX);m==null||m(R)},onSlideEnd:()=>{T.current=void 0,p==null||p()},onStepKeyDown:j=>{const B=o0[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:B?-1:1})}})})}),HC=f.forwardRef((s,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:h,onSlideEnd:m,onStepKeyDown:p,...y}=s,g=f.useRef(null),v=et(a,g),C=f.useRef(void 0),P=!c;function T(S){const b=C.current||g.current.getBoundingClientRect(),N=[0,b.height],j=Ou(N,P?[o,l]:[l,o]);return C.current=b,j(S-b.top)}return e.jsx(u0,{scope:s.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(f0,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const b=T(S.clientY);d==null||d(b)},onSlideMove:S=>{const b=T(S.clientY);h==null||h(b)},onSlideEnd:()=>{C.current=void 0,m==null||m()},onStepKeyDown:S=>{const N=o0[P?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:N?-1:1})}})})}),f0=f.forwardRef((s,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:h,onEndKeyDown:m,onStepKeyDown:p,...y}=s,g=To(pa,l);return e.jsx(Ke.span,{...y,ref:a,onKeyDown:Be(s.onKeyDown,v=>{v.key==="Home"?(h(v),v.preventDefault()):v.key==="End"?(m(v),v.preventDefault()):l0.concat(i0).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:Be(s.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(C)?C.focus():o(v)}),onPointerMove:Be(s.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:Be(s.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),m0="SliderTrack",x0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(m0,l);return e.jsx(Ke.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});x0.displayName=m0;var su="SliderRange",p0=f.forwardRef((s,a)=>{const{__scopeSlider:l,...o}=s,c=To(su,l),d=h0(su,l),h=f.useRef(null),m=et(a,h),p=c.values.length,y=c.values.map(C=>v0(C,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(Ke.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:m,style:{...s.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});p0.displayName=su;var nu="SliderThumb",g0=f.forwardRef((s,a)=>{const l=BC(s.__scopeSlider),[o,c]=f.useState(null),d=et(a,m=>c(m)),h=f.useMemo(()=>o?l().findIndex(m=>m.ref.current===o):-1,[l,o]);return e.jsx(KC,{...s,ref:d,index:h})}),KC=f.forwardRef((s,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=s,h=To(nu,l),m=h0(nu,l),[p,y]=f.useState(null),g=et(a,E=>y(E)),v=p?h.form||!!p.closest("form"):!0,C=Cu(p),P=h.values[o],T=P===void 0?0:v0(P,h.min,h.max),S=QC(o,h.values.length),b=C==null?void 0:C[m.size],N=b?XC(b,T,m.direction):0;return f.useEffect(()=>{if(p)return h.thumbs.add(p),()=>{h.thumbs.delete(p)}},[p,h.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[m.startEdge]:`calc(${T}% + ${N}px)`},children:[e.jsx(ru.ItemSlot,{scope:s.__scopeSlider,children:e.jsx(Ke.span,{role:"slider","aria-label":s["aria-label"]||S,"aria-valuemin":h.min,"aria-valuenow":P,"aria-valuemax":h.max,"aria-orientation":h.orientation,"data-orientation":h.orientation,"data-disabled":h.disabled?"":void 0,tabIndex:h.disabled?void 0:0,...d,ref:g,style:P===void 0?{display:"none"}:s.style,onFocus:Be(s.onFocus,()=>{h.valueIndexToChangeRef.current=o})})}),v&&e.jsx(y0,{name:c??(h.name?h.name+(h.values.length>1?"[]":""):void 0),form:h.form,value:P},o)]})});g0.displayName=nu;var YC="RadioBubbleInput",y0=f.forwardRef(({__scopeSlider:s,value:a,...l},o)=>{const c=f.useRef(null),d=et(c,o),h=Su(a);return f.useEffect(()=>{const m=c.current;if(!m)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(h!==a&&g){const v=new Event("input",{bubbles:!0});g.call(m,a),m.dispatchEvent(v)}},[h,a]),e.jsx(Ke.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});y0.displayName=YC;function GC(s=[],a,l){const o=[...s];return o[l]=a,o.sort((c,d)=>c-d)}function v0(s,a,l){const d=100/(l-a)*(s-a);return no(d,[0,100])}function QC(s,a){return a>2?`Value ${s+1} of ${a}`:a===2?["Minimum","Maximum"][s]:void 0}function qC(s,a){if(s.length===1)return 0;const l=s.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function XC(s,a,l){const o=s/2,d=Ou([0,50],[0,o]);return(o-d(a)*l)*l}function JC(s){return s.slice(0,-1).map((a,l)=>s[l+1]-a)}function ZC(s,a){if(a>0){const l=JC(s);return Math.min(...l)>=a}return!0}function Ou(s,a){return l=>{if(s[0]===s[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(s[1]-s[0]);return a[0]+o*(l-s[0])}}function e4(s){return(String(s).split(".")[1]||"").length}function t4(s,a){const l=Math.pow(10,a);return Math.round(s*l)/l}var r4=d0,s4=x0,n4=p0,a4=g0;function l4({className:s,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const h=f.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(r4,{defaultValue:a,value:l,min:o,max:c,className:tt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",s),...d,children:[e.jsx(s4,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(n4,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:h.length},(m,p)=>e.jsx(a4,{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"},p))]})}const i4={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function o4(){const[s,a]=f.useState(i4),[l,o]=f.useState(!0),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/admin/referral-settings").then(p=>{const y=p==null?void 0:p.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const h=async()=>{d(!0);try{const p={distributorShare:Number(s.distributorShare)||0,minWithdrawAmount:Number(s.minWithdrawAmount)||0,bindingDays:Number(s.bindingDays)||0,userDiscount:Number(s.userDiscount)||0,enableAutoWithdraw:!!s.enableAutoWithdraw,vipOrderShareVip:Number(s.vipOrderShareVip)||20,vipOrderShareNonVip:Number(s.vipOrderShareNonVip)||10},y=await Et("/api/admin/referral-settings",p);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功! - -• 小程序与网站的推广规则会一起生效 -• 绑定关系会使用新的天数配置 -• 佣金比例会立即应用到新订单 - -如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},m=p=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[p]:isNaN(g)?0:g}))};return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(aa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(Z,{onClick:h,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(Ub,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(ht,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.userDiscount,onChange:m("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(l4,{className:"flex-1",min:10,max:100,step:1,value:[s.distributorShare],onValueChange:([p])=>a(y=>({...y,distributorShare:p}))}),e.jsx(de,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:s.distributorShare,onChange:m("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[s.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareVip,onChange:m("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Li,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.vipOrderShareNonVip,onChange:m("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Qt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(de,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:s.bindingDays,onChange:m("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(aa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(ht,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(we,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(de,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:s.minWithdrawAmount,onChange:m("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(Oe,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(it,{checked:s.enableAutoWithdraw,onCheckedChange:p=>a(y=>({...y,enableAutoWithdraw:p}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsxs(Ve,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Li,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(we,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.jsx("p",{children:"3. 如遇前端展示与实际结算不一致,优先以此处配置为准,再排查缓存和小程序版本。"})]})]})]})]})}const cs={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 mx(s){return Array.isArray(s)?s.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):cs.stats}function xx(s){return Array.isArray(s)?s.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):cs.highlights}function c4(){const[s,a]=f.useState(cs),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{Fe("/api/admin/author-settings").then(N=>{const E=N==null?void 0:N.data;E&&typeof E=="object"&&a({name:String(E.name??cs.name),avatar:String(E.avatar??cs.avatar),avatarImg:String(E.avatarImg??""),title:String(E.title??cs.title),bio:String(E.bio??cs.bio),stats:mx(E.stats).length?mx(E.stats):cs.stats,highlights:xx(E.highlights).length?xx(E.highlights):cs.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{d(!0);try{const N={name:s.name,avatar:s.avatar||"K",avatarImg:s.avatarImg,title:s.title,bio:s.bio,stats:s.stats.filter(R=>R.label||R.value),highlights:s.highlights.filter(Boolean)},E=await Et("/api/admin/author-settings",N);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{d(!1)}},g=async N=>{var j;const E=(j=N.target.files)==null?void 0:j[0];if(E){m(!0);try{const R=new FormData;R.append("file",E),R.append("folder","avatars");const B=fu(),U={};B&&(U.Authorization=`Bearer ${B}`);const L=await(await fetch(la("/api/upload"),{method:"POST",body:R,credentials:"include",headers:U})).json();L!=null&&L.success&&(L!=null&&L.url)?a(_=>({..._,avatarImg:L.url})):alert("上传失败: "+((L==null?void 0:L.error)||"未知错误"))}catch(R){console.error(R),alert("上传失败")}finally{m(!1),p.current&&(p.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(E=>({...E,stats:E.stats.filter((j,R)=>R!==N)})),P=(N,E,j)=>a(R=>({...R,stats:R.stats.map((B,U)=>U===N?{...B,[E]:j}:B)})),T=()=>a(N=>({...N,highlights:[...N.highlights,""]})),S=N=>a(E=>({...E,highlights:E.highlights.filter((j,R)=>R!==N)})),b=(N,E)=>a(j=>({...j,highlights:j.highlights.map((R,B)=>B===N?E:R)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ra,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(Z,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"flex items-center gap-2 text-white",children:[e.jsx(ra,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(ht,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.name,onChange:N=>a(E=>({...E,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:s.avatar,onChange:N=>a(E=>({...E,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx($x,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:s.avatarImg,onChange:N=>a(E=>({...E,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:h,onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),h?"上传中...":"上传"]})]}),s.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:s.avatarImg.startsWith("http")?s.avatarImg:la(s.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头衔"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:s.title,onChange:N=>a(E=>({...E,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(jn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:s.bio,onChange:N=>a(E=>({...E,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"统计数据"}),e.jsx(ht,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.stats.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsx(Ve,{className:"text-white",children:"亮点标签"}),e.jsx(ht,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(we,{className:"space-y-3",children:[s.highlights.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(Z,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>S(E),children:e.jsx(Sr,{className:"w-4 h-4"})})]},E)),e.jsxs(Z,{variant:"outline",size:"sm",onClick:T,className:"border-gray-600 text-gray-400",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function d4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h]=f.useState(10),[m,p]=f.useState(0),[y,g]=f.useState(""),v=wu(y,300),[C,P]=f.useState(!0),[T,S]=f.useState(null),[b,N]=f.useState(!1),[E,j]=f.useState(null),[R,B]=f.useState(""),[U,k]=f.useState(""),[L,_]=f.useState(""),[se,le]=f.useState("admin"),[ie,ee]=f.useState("active"),[G,Q]=f.useState(!1);async function ce(){var O;P(!0),S(null);try{const F=new URLSearchParams({page:String(c),pageSize:String(h)});v.trim()&&F.set("search",v.trim());const X=await Fe(`/api/admin/users?${F}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),p(X.totalPages??0)):S(X.error||"加载失败")}catch(F){const X=F;S(X.status===403?"无权限访问":((O=X==null?void 0:X.data)==null?void 0:O.error)||"加载失败"),a([])}finally{P(!1)}}f.useEffect(()=>{ce()},[c,h,v]);const re=()=>{j(null),B(""),k(""),_(""),le("admin"),ee("active"),N(!0)},A=O=>{j(O),B(O.username),k(""),_(O.name||""),le(O.role==="super_admin"?"super_admin":"admin"),ee(O.status==="disabled"?"disabled":"active"),N(!0)},ne=async()=>{var O;if(!R.trim()){S("用户名不能为空");return}if(!E&&!U){S("新建时密码必填,至少 6 位");return}if(U&&U.length<6){S("密码至少 6 位");return}S(null),Q(!0);try{if(E){const F=await Nt("/api/admin/users",{id:E.id,password:U||void 0,name:L.trim(),role:se,status:ie});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}else{const F=await Et("/api/admin/users",{username:R.trim(),password:U,name:L.trim(),role:se});F!=null&&F.success?(N(!1),ce()):S((F==null?void 0:F.error)||"保存失败")}}catch(F){const X=F;S(((O=X==null?void 0:X.data)==null?void 0:O.error)||"保存失败")}finally{Q(!1)}},W=async O=>{var F;if(confirm("确定删除该管理员?"))try{const X=await vn(`/api/admin/users?id=${O}`);X!=null&&X.success?ce():S((X==null?void 0:X.error)||"删除失败")}catch(X){const H=X;S(((F=H==null?void 0:H.data)==null?void 0:F.error)||"删除失败")}},M=O=>{if(!O)return"-";try{const F=new Date(O);return isNaN(F.getTime())?O:F.toLocaleString("zh-CN")}catch{return O}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(uu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{placeholder:"搜索用户名/昵称",value:y,onChange:O=>g(O.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(Z,{variant:"outline",size:"sm",onClick:ce,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx($e,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(Z,{onClick:re,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),T&&e.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:[e.jsx("span",{children:T}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户名"}),e.jsx(je,{className:"text-gray-400",children:"昵称"}),e.jsx(je,{className:"text-gray-400",children:"角色"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(O=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:O.id}),e.jsx(pe,{className:"text-white font-medium",children:O.username}),e.jsx(pe,{className:"text-gray-400",children:O.name||"-"}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:O.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(pe,{children:e.jsx(Oe,{variant:"outline",className:O.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:O.status==="active"?"正常":"已禁用"})}),e.jsx(pe,{className:"text-gray-500 text-sm",children:M(O.createdAt)}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>A(O),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>W(O.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},O.id)),s.length===0&&!C&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:T==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),m>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Ar,{page:c,pageSize:h,total:l,totalPages:m,onPageChange:d})})]})})}),e.jsx(wt,{open:b,onOpenChange:N,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"用户名"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:R,onChange:O=>B(O.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:U,onChange:O=>k(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:L,onChange:O=>_(O.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:se,onChange:O=>le(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:ie,onChange:O=>ee(O.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:ne,disabled:G,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),G?"保存中...":"保存"]})]})]})})]})}const u4={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},h4={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},f4={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...h4}},m4={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},x4=["system","author","admin"];function p4(){const[s,a]=Cj(),l=s.get("tab")??"system",o=x4.includes(l)?l:"system",[c,d]=f.useState(f4),[h,m]=f.useState(m4),[p,y]=f.useState(u4),[g,v]=f.useState(!1),[C,P]=f.useState(!0),[T,S]=f.useState(!1),[b,N]=f.useState(""),[E,j]=f.useState(""),[R,B]=f.useState(!1),[U,k]=f.useState(!1),L=(ee,G,Q=!1)=>{N(ee),j(G),B(Q),S(!0)};f.useEffect(()=>{(async()=>{try{const G=await Fe("/api/admin/settings");if(!G||G.success===!1)return;if(G.featureConfig&&Object.keys(G.featureConfig).length&&m(Q=>({...Q,...G.featureConfig})),G.mpConfig&&typeof G.mpConfig=="object"&&y(Q=>({...Q,...G.mpConfig})),G.siteSettings&&typeof G.siteSettings=="object"){const Q=G.siteSettings;d(ce=>({...ce,...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:{...ce.authorInfo,...Q.authorInfo}}}))}}catch(G){console.error("Load settings error:",G)}finally{P(!1)}})()},[]);const _=async(ee,G)=>{k(!0);try{const Q=await Et("/api/admin/settings",{featureConfig:ee});if(!Q||Q.success===!1){G(),L("保存失败",(Q==null?void 0:Q.error)??"未知错误",!0);return}L("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(Q){console.error("Save feature config error:",Q),G(),L("保存失败",Q instanceof Error?Q.message:String(Q),!0)}finally{k(!1)}},se=(ee,G)=>{const Q=h,ce={...Q,[ee]:G};m(ce),_(ce,()=>m(Q))},le=async()=>{v(!0);try{const ee=await Et("/api/admin/settings",{featureConfig:h,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!ee||ee.success===!1){L("保存失败",(ee==null?void 0:ee.error)??"未知错误",!0);return}L("已保存","设置已保存成功。")}catch(ee){console.error("Save settings error:",ee),L("保存失败",ee instanceof Error?ee.message:String(ee),!0)}finally{v(!1)}},ie=ee=>{a(ee==="system"?{}:{tab:ee})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(Z,{onClick:le,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(bo,{value:o,onValueChange:ie,className:"w-full",children:[e.jsxs(jl,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(Zt,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(dl,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(Zt,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(vd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(Zt,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(uu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(er,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(vd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(ht,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(vd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(de,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,name:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(de,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,startDate:ee.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(qi,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(de,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,liveTime:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Mb,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(de,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,platform:ee.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(us,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(de,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,description:ee.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(jn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:ee=>d(G=>({...G,authorInfo:{...G.authorInfo,bio:ee.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.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:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Xi,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:ee=>d(G=>({...G,sectionPrice:Number.parseFloat(ee.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:ee=>d(G=>({...G,baseBookPrice:Number.parseFloat(ee.target.value)||9.9}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(ht,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(we,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:ee=>y(G=>({...G,appId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:ee=>y(G=>({...G,withdrawSubscribeTmplId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:ee=>y(G=>({...G,mchId:ee.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:ee=>y(G=>({...G,minWithdraw:Number.parseFloat(ee.target.value)||10}))})]})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(ht,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Qt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(it,{id:"match-enabled",checked:h.matchEnabled,disabled:U,onCheckedChange:ee=>se("matchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ob,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(it,{id:"referral-enabled",checked:h.referralEnabled,disabled:U,onCheckedChange:ee=>se("referralEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(us,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(it,{id:"search-enabled",checked:h.searchEnabled,disabled:U,onCheckedChange:ee=>se("searchEnabled",ee)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(dl,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(it,{id:"about-enabled",checked:h.aboutEnabled,disabled:U,onCheckedChange:ee=>se("aboutEnabled",ee)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(er,{value:"author",className:"mt-0",children:e.jsx(c4,{})}),e.jsx(er,{value:"admin",className:"mt-0",children:e.jsx(d4,{})})]}),e.jsx(wt,{open:T,onOpenChange:S,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(St,{children:[e.jsx(Ct,{className:R?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(s2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(Ft,{className:"mt-4",children:e.jsx(Z,{onClick:()=>S(!1),className:R?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const px={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 g4(){const[s,a]=f.useState(!1),[l,o]=f.useState(px),[c,d]=f.useState(""),h=async()=>{a(!0);try{const N=await Fe("/api/config");N!=null&&N.paymentMethods&&o({...px,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};f.useEffect(()=>{h()},[]);const m=async()=>{a(!0);try{await Et("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,E)=>{navigator.clipboard.writeText(N),d(E),setTimeout(()=>d(""),2e3)},y=(N,E)=>{o(j=>({...j,wechat:{...j.wechat,[N]:E}}))},g=(N,E)=>{o(j=>({...j,alipay:{...j.alipay,[N]:E}}))},v=(N,E)=>{o(j=>({...j,usdt:{...j.usdt,[N]:E}}))},C=(N,E)=>{o(j=>({...j,paypal:{...j.paypal,[N]:E}}))},P=l.wechat,T=l.alipay,S=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:h,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${s?"animate-spin":""}`}),"同步配置"]}),e.jsxs(Z,{onClick:m,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),e.jsxs(bo,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(jl,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(Zt,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Ud,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(Zt,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(zd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(Zt,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Rm,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(Zt,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx($d,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(er,{value:"wechat",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Ud,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(it,{checked:!!P.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网站AppID"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(de,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(er,{value:"alipay",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(zd,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(ht,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(it,{checked:!!T.enabled,onCheckedChange:N=>g("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.partnerId??""),onChange:N=>g("partnerId",N.target.value)}),e.jsx(Z,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(T.partnerId??""),"pid"),children:c==="pid"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(de,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(T.securityKey??""),onChange:N=>g("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(Ji,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(T.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(er,{value:"usdt",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Rm,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(it,{checked:!!S.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(er,{value:"paypal",className:"space-y-4",children:e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ve,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(it,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const y4={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},v4={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},j4={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function b4(){const[s,a]=f.useState({siteConfig:{...y4},menuConfig:{...v4},pageConfig:{...j4}}),[l,o]=f.useState(!1),[c,d]=f.useState(!1);f.useEffect(()=>{Fe("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const h=async()=>{d(!0);try{await Et("/api/db/config",{key:"site_config",value:s.siteConfig,description:"网站基础配置"}),await Et("/api/db/config",{key:"menu_config",value:s.menuConfig,description:"底部菜单配置"}),await Et("/api/db/config",{key:"page_config",value:s.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},m=s.siteConfig,p=s.menuConfig,y=s.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(Z,{onClick:h,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx($d,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(de,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(de,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(de,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:m.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(de,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:m.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(de,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:m.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(zb,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(ht,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(we,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(de,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:m.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:m.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Db,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(ht,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(we,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(it,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(de,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(nb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function N4(){const[s,a]=f.useState(""),[l,o]=f.useState(""),[c,d]=f.useState(""),[h,m]=f.useState({}),p=async()=>{var P,T,S,b;try{const N=await Fe("/api/config"),E=(T=(P=N==null?void 0:N.liveQRCodes)==null?void 0:P[0])==null?void 0:T.urls;Array.isArray(E)&&a(E.join(` -`));const j=(b=(S=N==null?void 0:N.paymentMethods)==null?void 0:S.wechat)==null?void 0:b.groupQrCode;j&&o(j),m({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};f.useEffect(()=>{p()},[]);const y=(P,T)=>{navigator.clipboard.writeText(P),d(T),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=s.split(` -`).map(S=>S.trim()).filter(Boolean),T=[...h.liveQRCodes||[]];T[0]?T[0].urls=P:T.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await Et("/api/db/config",{key:"live_qr_codes",value:T,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await Et("/api/db/config",{key:"payment_methods",value:{...h.paymentMethods||{},wechat:{...((P=h.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(T){console.error(T),alert("保存失败: "+(T instanceof Error?T.message:String(T)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Dx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(de,{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:P=>o(P.target.value)}),e.jsx(Z,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(fo,{className:"w-4 h-4 text-green-500"}):e.jsx(Fx,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(Ji,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(Z,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(Ji,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Dm,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(ht,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(we,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Am,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(jn,{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:s,onChange:P=>a(P.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[s.split(` -`).filter(Boolean).length," 个"]})]}),e.jsxs(Z,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const gx={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}},w4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function S4(){const[s,a]=f.useState(gx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...gx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(dl,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:w4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const yx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function C4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.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:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(yx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,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:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:yx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function k4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState(""),[g,v]=f.useState(0),[C,P]=f.useState(!1);async function T(){o(!0);try{const j=await Fe("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}f.useEffect(()=>{T()},[]);const S=()=>{m(null),y(""),v(s.length>0?Math.max(...s.map(j=>j.sort))+1:0),d(!0)},b=j=>{m(j),y(j.name),v(j.sort),d(!0)},N=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(h){const j=await Nt("/api/db/vip-roles",{id:h.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await Et("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),T()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const R=await vn(`/api/db/vip-roles?id=${j}`);R!=null&&R.success?T():alert("删除失败: "+(R==null?void 0:R.error))}catch(R){console.error("Delete error:",R),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(mo,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(Z,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"角色名称"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(j=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white",children:j.name}),e.jsx(pe,{className:"text-gray-400",children:j.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},j.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function E4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(null),[p,y]=f.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[g,v]=f.useState(!1),[C,P]=f.useState(!1),T=f.useRef(null),S=async k=>{var _;const L=(_=k.target.files)==null?void 0:_[0];if(L){P(!0);try{const se=new FormData;se.append("file",L),se.append("folder","mentors");const le=fu(),ie={};le&&(ie.Authorization=`Bearer ${le}`);const G=await(await fetch(la("/api/upload"),{method:"POST",body:se,credentials:"include",headers:ie})).json();G!=null&&G.success&&(G!=null&&G.url)?y(Q=>({...Q,avatar:G.url})):alert("上传失败: "+((G==null?void 0:G.error)||"未知错误"))}catch(se){console.error(se),alert("上传失败")}finally{P(!1),T.current&&(T.current.value="")}}};async function b(){o(!0);try{const k=await Fe("/api/db/mentors");k!=null&&k.success&&k.data&&a(k.data)}catch(k){console.error("Load mentors error:",k)}finally{o(!1)}}f.useEffect(()=>{b()},[]);const N=()=>{y({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:s.length>0?Math.max(...s.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{m(null),N(),d(!0)},j=k=>{m(k),y({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}),d(!0)},R=async()=>{if(!p.name.trim()){alert("导师姓名不能为空");return}v(!0);try{const k=_=>_===""?void 0:parseFloat(_),L={name:p.name.trim(),avatar:p.avatar.trim()||void 0,intro:p.intro.trim()||void 0,tags:p.tags.trim()||void 0,priceSingle:k(p.priceSingle),priceHalfYear:k(p.priceHalfYear),priceYear:k(p.priceYear),quote:p.quote.trim()||void 0,whyFind:p.whyFind.trim()||void 0,offering:p.offering.trim()||void 0,judgmentStyle:p.judgmentStyle.trim()||void 0,sort:p.sort,enabled:p.enabled};if(h){const _=await Nt("/api/db/mentors",{id:h.id,...L});_!=null&&_.success?(d(!1),b()):alert("更新失败: "+(_==null?void 0:_.error))}else{const _=await Et("/api/db/mentors",L);_!=null&&_.success?(d(!1),b()):alert("新增失败: "+(_==null?void 0:_.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{v(!1)}},B=async k=>{if(confirm("确定删除该导师?"))try{const L=await vn(`/api/db/mentors?id=${k}`);L!=null&&L.success?b():alert("删除失败: "+(L==null?void 0:L.error))}catch(L){console.error("Delete error:",L),alert("删除失败")}},U=k=>k!=null?`¥${k}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(Z,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"姓名"}),e.jsx(je,{className:"text-gray-400",children:"简介"}),e.jsx(je,{className:"text-gray-400",children:"单次"}),e.jsx(je,{className:"text-gray-400",children:"半年"}),e.jsx(je,{className:"text-gray-400",children:"年度"}),e.jsx(je,{className:"text-gray-400",children:"排序"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(cr,{children:[s.map(k=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:k.id}),e.jsx(pe,{className:"text-white",children:k.name}),e.jsx(pe,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceSingle)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceHalfYear)}),e.jsx(pe,{className:"text-gray-400",children:U(k.priceYear)}),e.jsx(pe,{className:"text-gray-400",children:k.sort}),e.jsxs(pe,{className:"text-right",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>j(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>B(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Gt,{className:"w-4 h-4"})})]})]},k.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:h?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名 *"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:p.name,onChange:k=>y(L=>({...L,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(de,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.sort,onChange:k=>y(L=>({...L,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(de,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:p.avatar,onChange:k=>y(L=>({...L,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:S}),e.jsxs(Z,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:C,onClick:()=>{var k;return(k=T.current)==null?void 0:k.click()},children:[e.jsx(Zi,{className:"w-4 h-4 mr-2"}),C?"上传中...":"上传"]})]}),p.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:p.avatar.startsWith("http")?p.avatar:la(p.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"简介"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:p.intro,onChange:k=>y(L=>({...L,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:p.tags,onChange:k=>y(L=>({...L,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(te,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:p.priceSingle,onChange:k=>y(L=>({...L,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:p.priceHalfYear,onChange:k=>y(L=>({...L,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(de,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:p.priceYear,onChange:k=>y(L=>({...L,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:p.quote,onChange:k=>y(L=>({...L,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.whyFind,onChange:k=>y(L=>({...L,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.offering,onChange:k=>y(L=>({...L,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:p.judgmentStyle,onChange:k=>y(L=>({...L,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:p.enabled,onChange:k=>y(L=>({...L,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(te,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(Ft,{children:[e.jsxs(Z,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(Sr,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(Z,{onClick:R,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存"]})]})]})})]})}function P4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Fe(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}f.useEffect(()=>{h()},[c]);const m={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(qi,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(m).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(y=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:y.id}),e.jsx(pe,{className:"text-gray-400",children:y.userId}),e.jsx(pe,{className:"text-gray-400",children:y.mentorId}),e.jsx(pe,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",y.amount]}),e.jsx(pe,{className:"text-gray-400",children:m[y.status]||y.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const vx={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}},T4=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function R4(){const[s,a]=f.useState(vx),[l,o]=f.useState(!0),[c,d]=f.useState(!1),[h,m]=f.useState(!1),[p,y]=f.useState(null),[g,v]=f.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Fe("/api/db/config/full?key=match_config"),R=(j==null?void 0:j.data)??(j==null?void 0:j.config);R&&a({...vx,...R})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};f.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await Et("/api/db/config",{key:"match_config",value:s,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{d(!1)}},T=j=>{y(j),v({...j}),m(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),m(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...s.matchTypes];if(p){const R=j.findIndex(B=>B.id===p.id);R!==-1&&(j[R]={...g})}else{if(j.some(R=>R.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...s,matchTypes:j}),m(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...s,matchTypes:s.matchTypes.filter(R=>R.id!==j)})},E=j=>{a({...s,matchTypes:s.matchTypes.map(R=>R.id===j?{...R,enabled:!R.enabled}:R)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(Z,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(Z,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(eo,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(ht,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(we,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(de,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.freeMatchLimit,onChange:j=>a({...s,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:s.matchPrice,onChange:j=>a({...s,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(de,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:s.settings.maxMatchesPerDay,onChange:j=>a({...s,settings:{...s.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enableFreeMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:s.settings.enablePaidMatches,onCheckedChange:j=>a({...s,settings:{...s.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(ht,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(Z,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(At,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(we,{children:e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"图标"}),e.jsx(je,{className:"text-gray-400",children:"类型ID"}),e.jsx(je,{className:"text-gray-400",children:"显示名称"}),e.jsx(je,{className:"text-gray-400",children:"匹配标签"}),e.jsx(je,{className:"text-gray-400",children:"价格"}),e.jsx(je,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(cr,{children:s.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(pe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(pe,{className:"text-white font-medium",children:j.label}),e.jsx(pe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(pe,{children:e.jsxs(Oe,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(pe,{children:j.matchFromDB?e.jsx(Oe,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(Oe,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(pe,{children:e.jsx(it,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(pe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>T(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(yt,{className:"w-4 h-4"})}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Gt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:h,onOpenChange:m,children:e.jsxs(vt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(yt,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(At,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:T4.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(de,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(de,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(it,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(Ft,{children:[e.jsx(Z,{variant:"outline",onClick:()=>m(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(Z,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(zt,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const jx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function I4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(""),[g,v]=f.useState(!0),[C,P]=f.useState(null);async function T(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(h)});p&&b.set("matchType",p);const N=await Fe(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}f.useEffect(()=>{T()},[c,p]);const S=Math.ceil(l/h)||1;return e.jsxs("div",{children:[C&&e.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:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(jx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:T,disabled:g,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:[e.jsx($e,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(cr,{children:[s.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(pe,{children:e.jsx(Oe,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:jx[b.matchType]||b.matchType})}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:S,total:l,pageSize:h,onPageChange:d,onPageSizeChange:b=>{m(b),d(1)}})]})})})]})}function _4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"investor"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,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:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}const bx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},M4={single:"单次",half_year:"半年",year:"年度"};function A4(){const[s,a]=f.useState([]),[l,o]=f.useState(!0),[c,d]=f.useState("");async function h(){o(!0);try{const m=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Fe(m);p!=null&&p.success&&p.data&&a(p.data)}catch(m){console.error(m)}finally{o(!1)}}return f.useEffect(()=>{h()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:m=>d(m.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(bx).map(([m,p])=>e.jsx("option",{value:m,children:p},m))]}),e.jsxs(Z,{onClick:h,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(we,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"ID"}),e.jsx(je,{className:"text-gray-400",children:"用户ID"}),e.jsx(je,{className:"text-gray-400",children:"导师ID"}),e.jsx(je,{className:"text-gray-400",children:"类型"}),e.jsx(je,{className:"text-gray-400",children:"金额"}),e.jsx(je,{className:"text-gray-400",children:"状态"}),e.jsx(je,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(cr,{children:[s.map(m=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(pe,{className:"text-gray-300",children:m.id}),e.jsx(pe,{className:"text-gray-400",children:m.userId}),e.jsx(pe,{className:"text-gray-400",children:m.mentorId}),e.jsx(pe,{className:"text-gray-400",children:M4[m.consultationType]||m.consultationType}),e.jsxs(pe,{className:"text-white",children:["¥",m.amount]}),e.jsx(pe,{className:"text-gray-400",children:bx[m.status]||m.status}),e.jsx(pe,{className:"text-gray-500 text-sm",children:m.createdAt?new Date(m.createdAt).toLocaleString():"-"})]},m.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function D4(){const[s,a]=f.useState([]),[l,o]=f.useState(0),[c,d]=f.useState(1),[h,m]=f.useState(10),[p,y]=f.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(h),matchType:"team"}),P=await Fe(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}f.useEffect(()=>{g()},[c]);const v=Math.ceil(l/h)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,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:[e.jsx($e,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(we,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx($e,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ir,{children:[e.jsx(or,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(je,{className:"text-gray-400",children:"发起人"}),e.jsx(je,{className:"text-gray-400",children:"匹配到"}),e.jsx(je,{className:"text-gray-400",children:"联系方式"}),e.jsx(je,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(cr,{children:[s.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(pe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(pe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(pe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(pe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),s.length===0&&e.jsx(Ge,{children:e.jsx(pe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Ar,{page:c,totalPages:v,total:l,pageSize:h,onPageChange:d,onPageSizeChange:C=>{m(C),d(1)}})]})})})]})}function L4(){const[s,a]=f.useState(null),[l,o]=f.useState(!0),[c,d]=f.useState([{endpoint:"/api/ckb/join",label:"CKB 加入(ckb/join)",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报(ckb/match)",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若(ckb/lead)",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置(match/config)",status:"idle"}]),h={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},m=f.useCallback(async()=>{o(!0);try{const g=await Fe("/api/db/match-records?stats=true");if(g!=null&&g.success&&g.data)a(g.data);else{const v=await Fe("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(g){console.error("加载统计失败:",g)}finally{o(!1)}},[]);f.useEffect(()=>{m()},[m]);const p=async g=>{const v=c[g],C=[...c];C[g]={...v,status:"testing",message:void 0,responseTime:void 0},d(C);const P=performance.now();try{let T;v.endpoint.includes("match/config")?T=await Fe(v.endpoint):T=await Et(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const S=Math.round(performance.now()-P),b=[...c],N=(T==null?void 0:T.success)!==void 0||(T==null?void 0:T.code)===200||(T==null?void 0:T.code)===400;b[g]={...v,status:N?"success":"error",message:(T==null?void 0:T.message)||(N?"接口可用":"响应异常"),responseTime:S},d(b)}catch(T){const S=Math.round(performance.now()-P),b=[...c];b[g]={...v,status:"error",message:T instanceof Error?T.message:"请求失败",responseTime:S},d(b)}},y=async()=>{for(let g=0;g0&&e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(we,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:s.byType.map(g=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:h[g.matchType]||g.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:g.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[s.totalMatches>0?(g.count/s.totalMatches*100).toFixed(1):0,"%"]})]},g.matchType))})})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ue,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ve,{className:"text-white flex items-center gap-2",children:[e.jsx(Ys,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Z,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx($e,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(Z,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(eo,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(we,{children:e.jsx("div",{className:"space-y-3",children:c.map((g,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),g.status==="testing"&&e.jsx($e,{className:"w-4 h-4 text-yellow-400 animate-spin"}),g.status==="success"&&e.jsx(Wj,{className:"w-4 h-4 text-green-400"}),g.status==="error"&&e.jsx(Lx,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:g.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:g.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g.message&&e.jsx("span",{className:`text-xs ${g.status==="success"?"text-green-400":g.status==="error"?"text-red-400":"text-gray-400"}`,children:g.message}),g.responseTime!==void 0&&e.jsxs(Oe,{className:"bg-gray-700 text-gray-300 border-0",children:[g.responseTime,"ms"]}),e.jsx(Z,{size:"sm",variant:"outline",onClick:()=>p(v),disabled:g.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},g.endpoint))})})]})]})}const O4=[{id:"pool",label:"匹配池",icon:Qt},{id:"records",label:"匹配记录",icon:Eb},{id:"resource",label:"资源对接",icon:xb},{id:"mentor",label:"导师预约",icon:zx},{id:"team",label:"团队招募",icon:Vd},{id:"stats",label:"存客宝统计",icon:Dj}];function F4(){const[s,a]=f.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Qt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:O4.map(l=>{const o=s===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),s==="pool"&&e.jsx(R4,{}),s==="records"&&e.jsx(I4,{}),s==="resource"&&e.jsx(_4,{}),s==="mentor"&&e.jsx(A4,{}),s==="team"&&e.jsx(D4,{}),s==="stats"&&e.jsx(L4,{})]})}function z4(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(Ys,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(we,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"3. 支付"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Ne,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ue,{children:e.jsx(Ve,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(we,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function $4(){const s=Zs();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.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:e.jsx(Bj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:s.pathname}),e.jsx(Z,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Hi,{to:"/",children:[e.jsx(yb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function B4(){return e.jsxs(fj,{children:[e.jsx(dt,{path:"/login",element:e.jsx(gw,{})}),e.jsxs(dt,{path:"/",element:e.jsx(jN,{}),children:[e.jsx(dt,{index:!0,element:e.jsx(yd,{to:"/dashboard",replace:!0})}),e.jsx(dt,{path:"dashboard",element:e.jsx(vw,{})}),e.jsx(dt,{path:"orders",element:e.jsx(n2,{})}),e.jsx(dt,{path:"users",element:e.jsx(I2,{})}),e.jsx(dt,{path:"distribution",element:e.jsx(_2,{})}),e.jsx(dt,{path:"withdrawals",element:e.jsx(M2,{})}),e.jsx(dt,{path:"content",element:e.jsx($C,{})}),e.jsx(dt,{path:"referral-settings",element:e.jsx(o4,{})}),e.jsx(dt,{path:"author-settings",element:e.jsx(yd,{to:"/settings?tab=author",replace:!0})}),e.jsx(dt,{path:"admin-users",element:e.jsx(yd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(dt,{path:"vip-roles",element:e.jsx(k4,{})}),e.jsx(dt,{path:"mentors",element:e.jsx(E4,{})}),e.jsx(dt,{path:"mentor-consultations",element:e.jsx(P4,{})}),e.jsx(dt,{path:"settings",element:e.jsx(p4,{})}),e.jsx(dt,{path:"payment",element:e.jsx(g4,{})}),e.jsx(dt,{path:"site",element:e.jsx(b4,{})}),e.jsx(dt,{path:"qrcodes",element:e.jsx(N4,{})}),e.jsx(dt,{path:"find-partner",element:e.jsx(F4,{})}),e.jsx(dt,{path:"match",element:e.jsx(S4,{})}),e.jsx(dt,{path:"match-records",element:e.jsx(C4,{})}),e.jsx(dt,{path:"api-doc",element:e.jsx(z4,{})})]}),e.jsx(dt,{path:"*",element:e.jsx($4,{})})]})}gv.createRoot(document.getElementById("root")).render(e.jsx(f.StrictMode,{children:e.jsx(bj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(B4,{})})})); diff --git a/soul-admin/dist/assets/index-g_Ms_Ty3.css b/soul-admin/dist/assets/index-g_Ms_Ty3.css new file mode 100644 index 00000000..e00942b0 --- /dev/null +++ b/soul-admin/dist/assets/index-g_Ms_Ty3.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--text-4xl:2.25rem;--text-4xl--line-height:calc(2.5/2.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-1\/4{top:25%}.top-4{top:calc(var(--spacing)*4)}.top-\[50\%\]{top:50%}.right-1\/4{right:25%}.right-4{right:calc(var(--spacing)*4)}.bottom-1\/4{bottom:25%}.left-1\/4{left:25%}.left-2{left:calc(var(--spacing)*2)}.left-3{left:calc(var(--spacing)*3)}.left-\[50\%\]{left:50%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.z-10{z-index:10}.z-50{z-index:50}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-2{margin-inline:calc(var(--spacing)*-2)}.mx-auto{margin-inline:auto}.mt-0{margin-top:calc(var(--spacing)*0)}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-6{margin-top:calc(var(--spacing)*6)}.mr-1{margin-right:calc(var(--spacing)*1)}.mr-2{margin-right:calc(var(--spacing)*2)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-1\.5{margin-bottom:calc(var(--spacing)*1.5)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.mb-8{margin-bottom:calc(var(--spacing)*8)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-6{margin-left:calc(var(--spacing)*6)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-8{width:calc(var(--spacing)*8);height:calc(var(--spacing)*8)}.size-9{width:calc(var(--spacing)*9);height:calc(var(--spacing)*9)}.size-10{width:calc(var(--spacing)*10);height:calc(var(--spacing)*10)}.h-1\.5{height:calc(var(--spacing)*1.5)}.h-2{height:calc(var(--spacing)*2)}.h-3{height:calc(var(--spacing)*3)}.h-3\.5{height:calc(var(--spacing)*3.5)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-7{height:calc(var(--spacing)*7)}.h-8{height:calc(var(--spacing)*8)}.h-9{height:calc(var(--spacing)*9)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-20{height:calc(var(--spacing)*20)}.h-24{height:calc(var(--spacing)*24)}.h-96{height:calc(var(--spacing)*96)}.h-\[70vh\]{height:70vh}.h-\[75vh\]{height:75vh}.h-auto{height:auto}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[85vh\]{max-height:85vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[200px\]{max-height:200px}.max-h-\[250px\]{max-height:250px}.max-h-\[300px\]{max-height:300px}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[32px\]{min-height:32px}.min-h-\[40px\]{min-height:40px}.min-h-\[60vh\]{min-height:60vh}.min-h-\[80px\]{min-height:80px}.min-h-\[100px\]{min-height:100px}.min-h-\[120px\]{min-height:120px}.min-h-\[300px\]{min-height:300px}.min-h-\[400px\]{min-height:400px}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-0\.5{width:calc(var(--spacing)*.5)}.w-2{width:calc(var(--spacing)*2)}.w-3{width:calc(var(--spacing)*3)}.w-3\.5{width:calc(var(--spacing)*3.5)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-9{width:calc(var(--spacing)*9)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-24{width:calc(var(--spacing)*24)}.w-48{width:calc(var(--spacing)*48)}.w-64{width:calc(var(--spacing)*64)}.w-96{width:calc(var(--spacing)*96)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-\[100px\]{max-width:100px}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing)*0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[120px\]{min-width:120px}.min-w-\[1024px\]{min-width:1024px}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.translate-none{translate:none}.scale-3d{scale:var(--tw-scale-x)var(--tw-scale-y)var(--tw-scale-z)}.scale-\[0\.98\]{scale:.98}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,)var(--tw-pan-y,)var(--tw-pinch-zoom,)}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-0\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.gap-8{gap:calc(var(--spacing)*8)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1.5)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1.5)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px*var(--tw-divide-x-reverse));border-inline-end-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}:where(.divide-gray-700\/50>:not(:last-child)){border-color:#36415380}@supports (color:color-mix(in lab,red,red)){:where(.divide-gray-700\/50>:not(:last-child)){border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}:where(.divide-white\/5>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){:where(.divide-white\/5>:not(:last-child)){border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-\[\#07C160\]{border-color:#07c160}.border-\[\#07C160\]\/20{border-color:#07c16033}.border-\[\#07C160\]\/30{border-color:#07c1604d}.border-\[\#38bdac\]{border-color:#38bdac}.border-\[\#38bdac\]\/20{border-color:#38bdac33}.border-\[\#38bdac\]\/30{border-color:#38bdac4d}.border-\[\#38bdac\]\/40{border-color:#38bdac66}.border-\[\#38bdac\]\/50{border-color:#38bdac80}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500)30%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500)50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500)30%,transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/50{border-color:color-mix(in oklab,var(--color-blue-500)50%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500)30%,transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-600{border-color:var(--color-gray-600)}.border-gray-700{border-color:var(--color-gray-700)}.border-gray-700\/30{border-color:#3641534d}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/30{border-color:color-mix(in oklab,var(--color-gray-700)30%,transparent)}}.border-gray-700\/50{border-color:#36415380}@supports (color:color-mix(in lab,red,red)){.border-gray-700\/50{border-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab,red,red)){.border-green-500\/30{border-color:color-mix(in oklab,var(--color-green-500)30%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500)30%,transparent)}}.border-orange-500\/50{border-color:#fe6e0080}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/50{border-color:color-mix(in oklab,var(--color-orange-500)50%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500)30%,transparent)}}.border-purple-500\/40{border-color:#ac4bff66}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/40{border-color:color-mix(in oklab,var(--color-purple-500)40%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500)30%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500)50%,transparent)}}.border-transparent{border-color:#0000}.border-white\/5{border-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.border-white\/5{border-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab,red,red)){.border-white\/20{border-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab,red,red)){.border-yellow-500\/30{border-color:color-mix(in oklab,var(--color-yellow-500)30%,transparent)}}.bg-\[\#0a1628\]{background-color:#0a1628}.bg-\[\#0a1628\]\/50{background-color:#0a162880}.bg-\[\#0f2137\]{background-color:#0f2137}.bg-\[\#00CED1\]{background-color:#00ced1}.bg-\[\#1C1C1E\]{background-color:#1c1c1e}.bg-\[\#07C160\]{background-color:#07c160}.bg-\[\#07C160\]\/5{background-color:#07c1600d}.bg-\[\#07C160\]\/10{background-color:#07c1601a}.bg-\[\#38bdac\]{background-color:#38bdac}.bg-\[\#38bdac\]\/5{background-color:#38bdac0d}.bg-\[\#38bdac\]\/10{background-color:#38bdac1a}.bg-\[\#38bdac\]\/15{background-color:#38bdac26}.bg-\[\#38bdac\]\/20{background-color:#38bdac33}.bg-\[\#38bdac\]\/30{background-color:#38bdac4d}.bg-\[\#38bdac\]\/80{background-color:#38bdaccc}.bg-\[\#162840\]{background-color:#162840}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.bg-black{background-color:var(--color-black)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.bg-black\/90{background-color:#000000e6}@supports (color:color-mix(in lab,red,red)){.bg-black\/90{background-color:color-mix(in oklab,var(--color-black)90%,transparent)}}.bg-blue-500\/5{background-color:#3080ff0d}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/5{background-color:color-mix(in oklab,var(--color-blue-500)5%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.bg-gray-600{background-color:var(--color-gray-600)}.bg-gray-600\/50{background-color:#4a556580}@supports (color:color-mix(in lab,red,red)){.bg-gray-600\/50{background-color:color-mix(in oklab,var(--color-gray-600)50%,transparent)}}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-700\/50{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.bg-gray-700\/50{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.bg-green-600{background-color:var(--color-green-600)}.bg-orange-500{background-color:var(--color-orange-500)}.bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.bg-white\/10{background-color:color-mix(in oklab,var(--color-white)10%,transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.bg-white\/20{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-\[\#00CED1\]{--tw-gradient-from:#00ced1;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-\[\#38bdac\]\/10{--tw-gradient-from:oklab(72.378% -.11483 -.0053193/.1);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab,red,red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-cyan-500)20%,transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-green-500\/20{--tw-gradient-from:#00c75833}@supports (color:color-mix(in lab,red,red)){.from-green-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.from-green-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-purple-500\/20{--tw-gradient-from:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.from-purple-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.from-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.from-yellow-500\/20{--tw-gradient-from:#edb20033}@supports (color:color-mix(in lab,red,red)){.from-yellow-500\/20{--tw-gradient-from:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.from-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#0f2137\]{--tw-gradient-to:#0f2137;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-\[\#20B2AA\]{--tw-gradient-to:#20b2aa;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-cyan-500\/5{--tw-gradient-to:#00b7d70d}@supports (color:color-mix(in lab,red,red)){.to-cyan-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-cyan-500)5%,transparent)}}.to-cyan-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-green-500\/5{--tw-gradient-to:#00c7580d}@supports (color:color-mix(in lab,red,red)){.to-green-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-green-500)5%,transparent)}}.to-green-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-purple-500\/5{--tw-gradient-to:#ac4bff0d}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-purple-500)5%,transparent)}}.to-purple-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-yellow-500\/5{--tw-gradient-to:#edb2000d}@supports (color:color-mix(in lab,red,red)){.to-yellow-500\/5{--tw-gradient-to:color-mix(in oklab,var(--color-yellow-500)5%,transparent)}}.to-yellow-500\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.bg-repeat{background-repeat:repeat}.mask-no-clip{-webkit-mask-clip:no-clip;mask-clip:no-clip}.mask-repeat{-webkit-mask-repeat:repeat;mask-repeat:repeat}.object-cover{object-fit:cover}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.p-8{padding:calc(var(--spacing)*8)}.px-1\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-5{padding-inline:calc(var(--spacing)*5)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-1\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-2\.5{padding-block:calc(var(--spacing)*2.5)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.py-16{padding-block:calc(var(--spacing)*16)}.py-20{padding-block:calc(var(--spacing)*20)}.py-24{padding-block:calc(var(--spacing)*24)}.pt-0{padding-top:calc(var(--spacing)*0)}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-3{padding-top:calc(var(--spacing)*3)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-6{padding-top:calc(var(--spacing)*6)}.pr-1{padding-right:calc(var(--spacing)*1)}.pr-2{padding-right:calc(var(--spacing)*2)}.pr-4{padding-right:calc(var(--spacing)*4)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-3{padding-bottom:calc(var(--spacing)*3)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.pl-8{padding-left:calc(var(--spacing)*8)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#00CED1\]{color:#00ced1}.text-\[\#07C160\]{color:#07c160}.text-\[\#07C160\]\/60{color:#07c16099}.text-\[\#07C160\]\/70{color:#07c160b3}.text-\[\#07C160\]\/80{color:#07c160cc}.text-\[\#26A17B\]{color:#26a17b}.text-\[\#38bdac\]{color:#38bdac}.text-\[\#38bdac\]\/30{color:#38bdac4d}.text-\[\#38bdac\]\/40{color:#38bdac66}.text-\[\#38bdac\]\/50{color:#38bdac80}.text-\[\#169BD7\]{color:#169bd7}.text-\[\#1677FF\]{color:#1677ff}.text-\[\#FFD700\]{color:gold}.text-amber-200{color:var(--color-amber-200)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400)90%,transparent)}}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-blue-300\/60{color:#90c5ff99}@supports (color:color-mix(in lab,red,red)){.text-blue-300\/60{color:color-mix(in oklab,var(--color-blue-300)60%,transparent)}}.text-blue-400{color:var(--color-blue-400)}.text-blue-400\/50{color:#54a2ff80}@supports (color:color-mix(in lab,red,red)){.text-blue-400\/50{color:color-mix(in oklab,var(--color-blue-400)50%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-gray-200{color:var(--color-gray-200)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-green-400{color:var(--color-green-400)}.text-green-400\/50{color:#05df7280}@supports (color:color-mix(in lab,red,red)){.text-green-400\/50{color:color-mix(in oklab,var(--color-green-400)50%,transparent)}}.text-green-500{color:var(--color-green-500)}.text-orange-300{color:var(--color-orange-300)}.text-orange-300\/60{color:#ffb96d99}@supports (color:color-mix(in lab,red,red)){.text-orange-300\/60{color:color-mix(in oklab,var(--color-orange-300)60%,transparent)}}.text-orange-400{color:var(--color-orange-400)}.text-orange-400\/80{color:#ff8b1acc}@supports (color:color-mix(in lab,red,red)){.text-orange-400\/80{color:color-mix(in oklab,var(--color-orange-400)80%,transparent)}}.text-purple-400{color:var(--color-purple-400)}.text-red-400{color:var(--color-red-400)}.text-white{color:var(--color-white)}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab,red,red)){.text-white\/40{color:color-mix(in oklab,var(--color-white)40%,transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white)60%,transparent)}}.text-white\/70{color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.text-white\/70{color:color-mix(in oklab,var(--color-white)70%,transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab,red,red)){.text-white\/80{color:color-mix(in oklab,var(--color-white)80%,transparent)}}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-400\/50{color:#fac80080}@supports (color:color-mix(in lab,red,red)){.text-yellow-400\/50{color:color-mix(in oklab,var(--color-yellow-400)50%,transparent)}}.text-yellow-500\/70{color:#edb200b3}@supports (color:color-mix(in lab,red,red)){.text-yellow-500\/70{color:color-mix(in oklab,var(--color-yellow-500)70%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(0px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.inset-ring{--tw-inset-ring-shadow:inset 0 0 0 1px var(--tw-inset-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-\[\#38bdac\]\/20{--tw-shadow-color:#38bdac33}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/20{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.2) var(--tw-shadow-alpha),transparent)}}.shadow-\[\#38bdac\]\/30{--tw-shadow-color:#38bdac4d}@supports (color:color-mix(in lab,red,red)){.shadow-\[\#38bdac\]\/30{--tw-shadow-color:color-mix(in oklab,oklab(72.378% -.11483 -.0053193/.3) var(--tw-shadow-alpha),transparent)}}.ring-\[\#38bdac\]{--tw-ring-color:#38bdac}.ring-\[\#38bdac\]\/40{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.4)}.ring-\[\#38bdac\]\/50{--tw-ring-color:oklab(72.378% -.11483 -.0053193/.5)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a))drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a)drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,)var(--tw-backdrop-brightness,)var(--tw-backdrop-contrast,)var(--tw-backdrop-grayscale,)var(--tw-backdrop-hue-rotate,)var(--tw-backdrop-invert,)var(--tw-backdrop-opacity,)var(--tw-backdrop-saturate,)var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:text-\[\#38bdac\]:is(:where(.group):hover *){color:#38bdac}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.placeholder\:text-gray-500::placeholder{color:var(--color-gray-500)}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){.hover\:border-\[\#38bdac\]\/30:hover{border-color:#38bdac4d}.hover\:border-\[\#38bdac\]\/50:hover{border-color:#38bdac80}.hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.hover\:bg-\[\#0a1628\]:hover{background-color:#0a1628}.hover\:bg-\[\#1a3050\]:hover{background-color:#1a3050}.hover\:bg-\[\#2da396\]:hover{background-color:#2da396}.hover\:bg-\[\#06AD51\]:hover{background-color:#06ad51}.hover\:bg-\[\#07C160\]\/10:hover{background-color:#07c1601a}.hover\:bg-\[\#20B2AA\]:hover{background-color:#20b2aa}.hover\:bg-\[\#38bdac\]\/10:hover{background-color:#38bdac1a}.hover\:bg-\[\#38bdac\]\/20:hover{background-color:#38bdac33}.hover\:bg-\[\#162840\]\/30:hover{background-color:#1628404d}.hover\:bg-\[\#162840\]\/50:hover{background-color:#16284080}.hover\:bg-amber-400\/10:hover{background-color:#fcbb001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-400\/10:hover{background-color:color-mix(in oklab,var(--color-amber-400)10%,transparent)}}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500)10%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500)20%,transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-blue-400\/10:hover{background-color:#54a2ff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-400\/10:hover{background-color:color-mix(in oklab,var(--color-blue-400)10%,transparent)}}.hover\:bg-blue-500\/20:hover{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-blue-500\/20:hover{background-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.hover\:bg-gray-500\/20:hover{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-500\/20:hover{background-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.hover\:bg-gray-700\/50:hover{background-color:#36415380}@supports (color:color-mix(in lab,red,red)){.hover\:bg-gray-700\/50:hover{background-color:color-mix(in oklab,var(--color-gray-700)50%,transparent)}}.hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.hover\:bg-green-500\/20:hover{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.hover\:bg-green-500\/20:hover{background-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.hover\:bg-green-700:hover{background-color:var(--color-green-700)}.hover\:bg-orange-500\/20:hover{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-orange-500\/20:hover{background-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.hover\:bg-orange-600:hover{background-color:var(--color-orange-600)}.hover\:bg-purple-500\/10:hover{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/10:hover{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.hover\:bg-purple-500\/20:hover{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-purple-500\/20:hover{background-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab,var(--color-white)5%,transparent)}}.hover\:bg-white\/20:hover{background-color:#fff3}@supports (color:color-mix(in lab,red,red)){.hover\:bg-white\/20:hover{background-color:color-mix(in oklab,var(--color-white)20%,transparent)}}.hover\:bg-yellow-400\/10:hover{background-color:#fac8001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-400\/10:hover{background-color:color-mix(in oklab,var(--color-yellow-400)10%,transparent)}}.hover\:bg-yellow-500\/20:hover{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-yellow-500\/20:hover{background-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}.hover\:text-\[\#38bdac\]:hover{color:#38bdac}.hover\:text-amber-300:hover{color:var(--color-amber-300)}.hover\:text-amber-400:hover{color:var(--color-amber-400)}.hover\:text-blue-400:hover{color:var(--color-blue-400)}.hover\:text-gray-300:hover{color:var(--color-gray-300)}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-yellow-400:hover{color:var(--color-yellow-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}}.focus\:border-\[\#38bdac\]:focus{border-color:#38bdac}.focus\:bg-\[\#38bdac\]\/20:focus{background-color:#38bdac33}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-\[\#38bdac\]:focus{--tw-ring-color:#38bdac}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(3px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[\#38bdac\]:focus-visible{--tw-ring-color:#38bdac}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus-visible\:ring-offset-\[\#0a1628\]:focus-visible{--tw-ring-offset-color:#0a1628}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.active\:cursor-grabbing:active{cursor:grabbing}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing)*2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing)*3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing)*4)}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:calc(var(--spacing)*1);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=active\]\:bg-\[\#07C160\]\/20[data-state=active]{background-color:#07c16033}.data-\[state\=active\]\:bg-\[\#26A17B\]\/20[data-state=active]{background-color:#26a17b33}.data-\[state\=active\]\:bg-\[\#38bdac\]\/20[data-state=active]{background-color:#38bdac33}.data-\[state\=active\]\:bg-\[\#1677FF\]\/20[data-state=active]{background-color:#1677ff33}.data-\[state\=active\]\:bg-\[\#003087\]\/20[data-state=active]{background-color:#00308733}.data-\[state\=active\]\:font-medium[data-state=active]{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.data-\[state\=active\]\:text-\[\#07C160\][data-state=active]{color:#07c160}.data-\[state\=active\]\:text-\[\#26A17B\][data-state=active]{color:#26a17b}.data-\[state\=active\]\:text-\[\#38bdac\][data-state=active]{color:#38bdac}.data-\[state\=active\]\:text-\[\#169BD7\][data-state=active]{color:#169bd7}.data-\[state\=active\]\:text-\[\#1677FF\][data-state=active]{color:#1677ff}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x:calc(var(--spacing)*4);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=checked\]\:bg-\[\#38bdac\][data-state=checked]{background-color:#38bdac}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x:calc(var(--spacing)*0);translate:var(--tw-translate-x)var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-gray-600[data-state=unchecked]{background-color:var(--color-gray-600)}@media(min-width:40rem){.sm\:max-w-lg{max-width:var(--container-lg)}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:text-left{text-align:left}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing)*0)}.\[\&\>span\]\:line-clamp-1>span{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}}:root{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20% .02 240);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20% .02 240);--popover-foreground:oklch(98.5% 0 0);--primary:oklch(65% .15 180);--primary-foreground:oklch(20% 0 0);--secondary:oklch(27% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(27% 0 0);--muted-foreground:oklch(65% 0 0);--accent:oklch(27% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(55% .2 25);--destructive-foreground:oklch(98.5% 0 0);--border:oklch(35% 0 0);--input:oklch(35% 0 0);--ring:oklch(65% .15 180);--radius:.625rem}body{font-family:var(--font-sans);color:var(--foreground);background:#0a1628}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}} diff --git a/soul-admin/dist/assets/index-t8ySgN6q.js b/soul-admin/dist/assets/index-t8ySgN6q.js new file mode 100644 index 00000000..d6b357e7 --- /dev/null +++ b/soul-admin/dist/assets/index-t8ySgN6q.js @@ -0,0 +1,495 @@ +function hv(r,a){for(var l=0;lo[c]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function Cx(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var fd={exports:{}},yl={},xd={exports:{}},Je={};/** + * @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 xf;function mv(){if(xf)return Je;xf=1;var r=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"),d=Symbol.for("react.provider"),m=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function C(M){return M===null||typeof M!="object"?null:(M=v&&M[v]||M["@@iterator"],typeof M=="function"?M:null)}var P={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,S={};function b(M,L,O){this.props=M,this.context=L,this.refs=S,this.updater=O||P}b.prototype.isReactComponent={},b.prototype.setState=function(M,L){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,L,"setState")},b.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function N(){}N.prototype=b.prototype;function E(M,L,O){this.props=M,this.context=L,this.refs=S,this.updater=O||P}var j=E.prototype=new N;j.constructor=E,R(j,b.prototype),j.isPureReactComponent=!0;var T=Array.isArray,B=Object.prototype.hasOwnProperty,U={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function A(M,L,O){var X,H={},ue=null,Y=null;if(L!=null)for(X in L.ref!==void 0&&(Y=L.ref),L.key!==void 0&&(ue=""+L.key),L)B.call(L,X)&&!k.hasOwnProperty(X)&&(H[X]=L[X]);var ye=arguments.length-2;if(ye===1)H.children=O;else if(1>>1,L=$[M];if(0>>1;Mc(H,K))uec(Y,H)?($[M]=Y,$[ue]=K,M=ue):($[M]=H,$[X]=K,M=X);else if(uec(Y,K))$[M]=Y,$[ue]=K,M=ue;else break e}}return oe}function c($,oe){var K=$.sortIndex-oe.sortIndex;return K!==0?K:$.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var d=performance;r.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();r.unstable_now=function(){return m.now()-f}}var p=[],y=[],g=1,v=null,C=3,P=!1,R=!1,S=!1,b=typeof setTimeout=="function"?setTimeout:null,N=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 j($){for(var oe=l(y);oe!==null;){if(oe.callback===null)o(y);else if(oe.startTime<=$)o(y),oe.sortIndex=oe.expirationTime,a(p,oe);else break;oe=l(y)}}function T($){if(S=!1,j($),!R)if(l(p)!==null)R=!0,ce(B);else{var oe=l(y);oe!==null&&je(T,oe.startTime-$)}}function B($,oe){R=!1,S&&(S=!1,N(A),A=-1),P=!0;var K=C;try{for(j(oe),v=l(p);v!==null&&(!(v.expirationTime>oe)||$&&!ae());){var M=v.callback;if(typeof M=="function"){v.callback=null,C=v.priorityLevel;var L=M(v.expirationTime<=oe);oe=r.unstable_now(),typeof L=="function"?v.callback=L:v===l(p)&&o(p),j(oe)}else o(p);v=l(p)}if(v!==null)var O=!0;else{var X=l(y);X!==null&&je(T,X.startTime-oe),O=!1}return O}finally{v=null,C=K,P=!1}}var U=!1,k=null,A=-1,_=5,re=-1;function ae(){return!(r.unstable_now()-re<_)}function le(){if(k!==null){var $=r.unstable_now();re=$;var oe=!0;try{oe=k(!0,$)}finally{oe?se():(U=!1,k=null)}}else U=!1}var se;if(typeof E=="function")se=function(){E(le)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,q=G.port2;G.port1.onmessage=le,se=function(){q.postMessage(null)}}else se=function(){b(le,0)};function ce($){k=$,U||(U=!0,se())}function je($,oe){A=b(function(){$(r.unstable_now())},oe)}r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function($){$.callback=null},r.unstable_continueExecution=function(){R||P||(R=!0,ce(B))},r.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"):_=0<$?Math.floor(1e3/$):5},r.unstable_getCurrentPriorityLevel=function(){return C},r.unstable_getFirstCallbackNode=function(){return l(p)},r.unstable_next=function($){switch(C){case 1:case 2:case 3:var oe=3;break;default:oe=C}var K=C;C=oe;try{return $()}finally{C=K}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=function(){},r.unstable_runWithPriority=function($,oe){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var K=C;C=$;try{return oe()}finally{C=K}},r.unstable_scheduleCallback=function($,oe,K){var M=r.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0M?($.sortIndex=K,a(y,$),l(p)===null&&$===l(y)&&(S?(N(A),A=-1):S=!0,je(T,K-M))):($.sortIndex=L,a(p,$),R||P||(R=!0,ce(B))),$},r.unstable_shouldYield=ae,r.unstable_wrapCallback=function($){var oe=C;return function(){var K=C;C=oe;try{return $.apply(this,arguments)}finally{C=K}}}})(yd)),yd}var jf;function gv(){return jf||(jf=1,gd.exports=pv()),gd.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 bf;function yv(){if(bf)return ds;bf=1;var r=du(),a=gv();function l(t){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,y=/^[: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]*$/,g={},v={};function C(t){return p.call(v,t)?!0:p.call(g,t)?!1:y.test(t)?v[t]=!0:(g[t]=!0,!1)}function P(t,s,n,i){if(n!==null&&n.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return i?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function R(t,s,n,i){if(s===null||typeof s>"u"||P(t,s,n,i))return!0;if(i)return!1;if(n!==null)switch(n.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function S(t,s,n,i,u,x,w){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=i,this.attributeNamespace=u,this.mustUseProperty=n,this.propertyName=t,this.type=s,this.sanitizeURL=x,this.removeEmptyString=w}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){b[t]=new S(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var s=t[0];b[s]=new S(s,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){b[t]=new S(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){b[t]=new S(t,2,!1,t,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(t){b[t]=new S(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){b[t]=new S(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){b[t]=new S(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){b[t]=new S(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){b[t]=new S(t,5,!1,t.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(t){return t[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(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var s=t.replace(N,E);b[s]=new S(s,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!1,!1)}),b.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){b[t]=new S(t,1,!1,t.toLowerCase(),null,!0,!0)});function j(t,s,n,i){var u=b.hasOwnProperty(s)?b[s]:null;(u!==null?u.type!==0:i||!(2I||u[w]!==x[I]){var z=` +`+u[w].replace(" at new "," at ");return t.displayName&&z.includes("")&&(z=z.replace("",t.displayName)),z}while(1<=w&&0<=I);break}}}finally{O=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?L(t):""}function H(t){switch(t.tag){case 5:return L(t.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function ue(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case k:return"Fragment";case U:return"Portal";case _:return"Profiler";case A:return"StrictMode";case se:return"Suspense";case G:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ae:return(t.displayName||"Context")+".Consumer";case re:return(t._context.displayName||"Context")+".Provider";case le:var s=t.render;return t=t.displayName,t||(t=s.displayName||s.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return s=t.displayName||null,s!==null?s:ue(t.type)||"Memo";case ce:s=t._payload,t=t._init;try{return ue(t(s))}catch{}}return null}function Y(t){var s=t.type;switch(t.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=s.render,t=t.displayName||t.name||"",s.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(s);case 8:return s===A?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ye(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ve(t){var s=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function D(t){var s=ve(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,s),i=""+t[s];if(!t.hasOwnProperty(s)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var u=n.get,x=n.set;return Object.defineProperty(t,s,{configurable:!0,get:function(){return u.call(this)},set:function(w){i=""+w,x.call(this,w)}}),Object.defineProperty(t,s,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){t._valueTracker=null,delete t[s]}}}}function pe(t){t._valueTracker||(t._valueTracker=D(t))}function we(t){if(!t)return!1;var s=t._valueTracker;if(!s)return!0;var n=s.getValue(),i="";return t&&(i=ve(t)?t.checked?"true":"false":t.value),t=i,t!==n?(s.setValue(t),!0):!1}function $e(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function de(t,s){var n=s.checked;return K({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function he(t,s){var n=s.defaultValue==null?"":s.defaultValue,i=s.checked!=null?s.checked:s.defaultChecked;n=ye(s.value!=null?s.value:n),t._wrapperState={initialChecked:i,initialValue:n,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function We(t,s){s=s.checked,s!=null&&j(t,"checked",s,!1)}function Ze(t,s){We(t,s);var n=ye(s.value),i=s.type;if(n!=null)i==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(i==="submit"||i==="reset"){t.removeAttribute("value");return}s.hasOwnProperty("value")?Xe(t,s.type,n):s.hasOwnProperty("defaultValue")&&Xe(t,s.type,ye(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(t.defaultChecked=!!s.defaultChecked)}function xt(t,s,n){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var i=s.type;if(!(i!=="submit"&&i!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+t._wrapperState.initialValue,n||s===t.value||(t.value=s),t.defaultValue=s}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Xe(t,s,n){(s!=="number"||$e(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var kt=Array.isArray;function Es(t,s,n,i){if(t=t.options,s){s={};for(var u=0;u"+s.valueOf().toString()+"",s=us.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;s.firstChild;)t.appendChild(s.firstChild)}});function ar(t,s){if(s){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=s;return}}t.textContent=s}var Us={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oa=["Webkit","ms","Moz","O"];Object.keys(Us).forEach(function(t){Oa.forEach(function(s){s=s+t.charAt(0).toUpperCase()+t.substring(1),Us[s]=Us[t]})});function $n(t,s,n){return s==null||typeof s=="boolean"||s===""?"":n||typeof s!="number"||s===0||Us.hasOwnProperty(t)&&Us[t]?(""+s).trim():s+"px"}function fn(t,s){t=t.style;for(var n in s)if(s.hasOwnProperty(n)){var i=n.indexOf("--")===0,u=$n(n,s[n],i);n==="float"&&(n="cssFloat"),i?t.setProperty(n,u):t[n]=u}}var Bn=K({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 xn(t,s){if(s){if(Bn[t]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(l(137,t));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(l(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(l(61))}if(s.style!=null&&typeof s.style!="object")throw Error(l(62))}}function pn(t,s){if(t.indexOf("-")===-1)return typeof s.is=="string";switch(t){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 gn=null;function Ps(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Cr=null,Vs=null,Ws=null;function Un(t){if(t=rl(t)){if(typeof Cr!="function")throw Error(l(280));var s=t.stateNode;s&&(s=ti(s),Cr(t.stateNode,t.type,s))}}function Vn(t){Vs?Ws?Ws.push(t):Ws=[t]:Vs=t}function yn(){if(Vs){var t=Vs,s=Ws;if(Ws=Vs=null,Un(t),s)for(t=0;t>>=0,t===0?32:31-(Pg(t)/Rg|0)|0}var Ol=64,Fl=4194304;function za(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function zl(t,s){var n=t.pendingLanes;if(n===0)return 0;var i=0,u=t.suspendedLanes,x=t.pingedLanes,w=n&268435455;if(w!==0){var I=w&~u;I!==0?i=za(I):(x&=w,x!==0&&(i=za(x)))}else w=n&~u,w!==0?i=za(w):x!==0&&(i=za(x));if(i===0)return 0;if(s!==0&&s!==i&&(s&u)===0&&(u=i&-i,x=s&-s,u>=x||u===16&&(x&4194240)!==0))return s;if((i&4)!==0&&(i|=n&16),s=t.entangledLanes,s!==0)for(t=t.entanglements,s&=i;0n;n++)s.push(t);return s}function $a(t,s,n){t.pendingLanes|=s,s!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,s=31-Ts(s),t[s]=n}function Mg(t,s){var n=t.pendingLanes&~s;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=s,t.mutableReadLanes&=s,t.entangledLanes&=s,s=t.entanglements;var i=t.eventTimes;for(t=t.expirationTimes;0=Ga),ih=" ",oh=!1;function ch(t,s){switch(t){case"keyup":return iy.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dh(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Gn=!1;function cy(t,s){switch(t){case"compositionend":return dh(s);case"keypress":return s.which!==32?null:(oh=!0,ih);case"textInput":return t=s.data,t===ih&&oh?null:t;default:return null}}function dy(t,s){if(Gn)return t==="compositionend"||!Go&&ch(t,s)?(t=th(),Wl=Uo=_r=null,Gn=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:n,offset:s-t};t=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gh(n)}}function vh(t,s){return t&&s?t===s?!0:t&&t.nodeType===3?!1:s&&s.nodeType===3?vh(t,s.parentNode):"contains"in t?t.contains(s):t.compareDocumentPosition?!!(t.compareDocumentPosition(s)&16):!1:!1}function jh(){for(var t=window,s=$e();s instanceof t.HTMLIFrameElement;){try{var n=typeof s.contentWindow.location.href=="string"}catch{n=!1}if(n)t=s.contentWindow;else break;s=$e(t.document)}return s}function Xo(t){var s=t&&t.nodeName&&t.nodeName.toLowerCase();return s&&(s==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||s==="textarea"||t.contentEditable==="true")}function vy(t){var s=jh(),n=t.focusedElem,i=t.selectionRange;if(s!==n&&n&&n.ownerDocument&&vh(n.ownerDocument.documentElement,n)){if(i!==null&&Xo(n)){if(s=i.start,t=i.end,t===void 0&&(t=s),"selectionStart"in n)n.selectionStart=s,n.selectionEnd=Math.min(t,n.value.length);else if(t=(s=n.ownerDocument||document)&&s.defaultView||window,t.getSelection){t=t.getSelection();var u=n.textContent.length,x=Math.min(i.start,u);i=i.end===void 0?x:Math.min(i.end,u),!t.extend&&x>i&&(u=i,i=x,x=u),u=yh(n,x);var w=yh(n,i);u&&w&&(t.rangeCount!==1||t.anchorNode!==u.node||t.anchorOffset!==u.offset||t.focusNode!==w.node||t.focusOffset!==w.offset)&&(s=s.createRange(),s.setStart(u.node,u.offset),t.removeAllRanges(),x>i?(t.addRange(s),t.extend(w.node,w.offset)):(s.setEnd(w.node,w.offset),t.addRange(s)))}}for(s=[],t=n;t=t.parentNode;)t.nodeType===1&&s.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Qn=null,Jo=null,Ja=null,Zo=!1;function bh(t,s,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Zo||Qn==null||Qn!==$e(i)||(i=Qn,"selectionStart"in i&&Xo(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}),Ja&&Xa(Ja,i)||(Ja=i,i=Jl(Jo,"onSelect"),0ea||(t.current=uc[ea],uc[ea]=null,ea--)}function ot(t,s){ea++,uc[ea]=t.current,t.current=s}var Lr={},Qt=Dr(Lr),as=Dr(!1),Nn=Lr;function ta(t,s){var n=t.type.contextTypes;if(!n)return Lr;var i=t.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===s)return i.__reactInternalMemoizedMaskedChildContext;var u={},x;for(x in n)u[x]=s[x];return i&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=u),u}function ls(t){return t=t.childContextTypes,t!=null}function si(){dt(as),dt(Qt)}function Lh(t,s,n){if(Qt.current!==Lr)throw Error(l(168));ot(Qt,s),ot(as,n)}function Oh(t,s,n){var i=t.stateNode;if(s=s.childContextTypes,typeof i.getChildContext!="function")return n;i=i.getChildContext();for(var u in i)if(!(u in s))throw Error(l(108,Y(t)||"Unknown",u));return K({},n,i)}function ri(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Lr,Nn=Qt.current,ot(Qt,t),ot(as,as.current),!0}function Fh(t,s,n){var i=t.stateNode;if(!i)throw Error(l(169));n?(t=Oh(t,s,Nn),i.__reactInternalMemoizedMergedChildContext=t,dt(as),dt(Qt),ot(Qt,t)):dt(as),ot(as,n)}var or=null,ni=!1,hc=!1;function zh(t){or===null?or=[t]:or.push(t)}function Iy(t){ni=!0,zh(t)}function Or(){if(!hc&&or!==null){hc=!0;var t=0,s=nt;try{var n=or;for(nt=1;t>=w,u-=w,cr=1<<32-Ts(s)+u|n<Ve?(Vt=ze,ze=null):Vt=ze.sibling;var tt=me(Q,ze,Z[Ve],Ne);if(tt===null){ze===null&&(ze=Vt);break}t&&ze&&tt.alternate===null&&s(Q,ze),W=x(tt,W,Ve),Fe===null?Le=tt:Fe.sibling=tt,Fe=tt,ze=Vt}if(Ve===Z.length)return n(Q,ze),mt&&Sn(Q,Ve),Le;if(ze===null){for(;VeVe?(Vt=ze,ze=null):Vt=ze.sibling;var Kr=me(Q,ze,tt.value,Ne);if(Kr===null){ze===null&&(ze=Vt);break}t&&ze&&Kr.alternate===null&&s(Q,ze),W=x(Kr,W,Ve),Fe===null?Le=Kr:Fe.sibling=Kr,Fe=Kr,ze=Vt}if(tt.done)return n(Q,ze),mt&&Sn(Q,Ve),Le;if(ze===null){for(;!tt.done;Ve++,tt=Z.next())tt=ge(Q,tt.value,Ne),tt!==null&&(W=x(tt,W,Ve),Fe===null?Le=tt:Fe.sibling=tt,Fe=tt);return mt&&Sn(Q,Ve),Le}for(ze=i(Q,ze);!tt.done;Ve++,tt=Z.next())tt=Ee(ze,Q,Ve,tt.value,Ne),tt!==null&&(t&&tt.alternate!==null&&ze.delete(tt.key===null?Ve:tt.key),W=x(tt,W,Ve),Fe===null?Le=tt:Fe.sibling=tt,Fe=tt);return t&&ze.forEach(function(uv){return s(Q,uv)}),mt&&Sn(Q,Ve),Le}function Pt(Q,W,Z,Ne){if(typeof Z=="object"&&Z!==null&&Z.type===k&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case B:e:{for(var Le=Z.key,Fe=W;Fe!==null;){if(Fe.key===Le){if(Le=Z.type,Le===k){if(Fe.tag===7){n(Q,Fe.sibling),W=u(Fe,Z.props.children),W.return=Q,Q=W;break e}}else if(Fe.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===ce&&Hh(Le)===Fe.type){n(Q,Fe.sibling),W=u(Fe,Z.props),W.ref=nl(Q,Fe,Z),W.return=Q,Q=W;break e}n(Q,Fe);break}else s(Q,Fe);Fe=Fe.sibling}Z.type===k?(W=_n(Z.props.children,Q.mode,Ne,Z.key),W.return=Q,Q=W):(Ne=_i(Z.type,Z.key,Z.props,null,Q.mode,Ne),Ne.ref=nl(Q,W,Z),Ne.return=Q,Q=Ne)}return w(Q);case U:e:{for(Fe=Z.key;W!==null;){if(W.key===Fe)if(W.tag===4&&W.stateNode.containerInfo===Z.containerInfo&&W.stateNode.implementation===Z.implementation){n(Q,W.sibling),W=u(W,Z.children||[]),W.return=Q,Q=W;break e}else{n(Q,W);break}else s(Q,W);W=W.sibling}W=cd(Z,Q.mode,Ne),W.return=Q,Q=W}return w(Q);case ce:return Fe=Z._init,Pt(Q,W,Fe(Z._payload),Ne)}if(kt(Z))return Ie(Q,W,Z,Ne);if(oe(Z))return Ae(Q,W,Z,Ne);oi(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"?(Z=""+Z,W!==null&&W.tag===6?(n(Q,W.sibling),W=u(W,Z),W.return=Q,Q=W):(n(Q,W),W=od(Z,Q.mode,Ne),W.return=Q,Q=W),w(Q)):n(Q,W)}return Pt}var aa=Kh(!0),Yh=Kh(!1),ci=Dr(null),di=null,la=null,yc=null;function vc(){yc=la=di=null}function jc(t){var s=ci.current;dt(ci),t._currentValue=s}function bc(t,s,n){for(;t!==null;){var i=t.alternate;if((t.childLanes&s)!==s?(t.childLanes|=s,i!==null&&(i.childLanes|=s)):i!==null&&(i.childLanes&s)!==s&&(i.childLanes|=s),t===n)break;t=t.return}}function ia(t,s){di=t,yc=la=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&s)!==0&&(is=!0),t.firstContext=null)}function ws(t){var s=t._currentValue;if(yc!==t)if(t={context:t,memoizedValue:s,next:null},la===null){if(di===null)throw Error(l(308));la=t,di.dependencies={lanes:0,firstContext:t}}else la=la.next=t;return s}var Cn=null;function Nc(t){Cn===null?Cn=[t]:Cn.push(t)}function Gh(t,s,n,i){var u=s.interleaved;return u===null?(n.next=n,Nc(s)):(n.next=u.next,u.next=n),s.interleaved=n,ur(t,i)}function ur(t,s){t.lanes|=s;var n=t.alternate;for(n!==null&&(n.lanes|=s),n=t,t=t.return;t!==null;)t.childLanes|=s,n=t.alternate,n!==null&&(n.childLanes|=s),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Fr=!1;function wc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qh(t,s){t=t.updateQueue,s.updateQueue===t&&(s.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function hr(t,s){return{eventTime:t,lane:s,tag:0,payload:null,callback:null,next:null}}function zr(t,s,n){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(et&2)!==0){var u=i.pending;return u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s,ur(t,n)}return u=i.interleaved,u===null?(s.next=s,Nc(i)):(s.next=u.next,u.next=s),i.interleaved=s,ur(t,n)}function ui(t,s,n){if(s=s.updateQueue,s!==null&&(s=s.shared,(n&4194240)!==0)){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Oo(t,n)}}function qh(t,s){var n=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,x=null;if(n=n.firstBaseUpdate,n!==null){do{var w={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};x===null?u=x=w:x=x.next=w,n=n.next}while(n!==null);x===null?u=x=s:x=x.next=s}else u=x=s;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:x,shared:i.shared,effects:i.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=s:t.next=s,n.lastBaseUpdate=s}function hi(t,s,n,i){var u=t.updateQueue;Fr=!1;var x=u.firstBaseUpdate,w=u.lastBaseUpdate,I=u.shared.pending;if(I!==null){u.shared.pending=null;var z=I,ee=z.next;z.next=null,w===null?x=ee:w.next=ee,w=z;var xe=t.alternate;xe!==null&&(xe=xe.updateQueue,I=xe.lastBaseUpdate,I!==w&&(I===null?xe.firstBaseUpdate=ee:I.next=ee,xe.lastBaseUpdate=z))}if(x!==null){var ge=u.baseState;w=0,xe=ee=z=null,I=x;do{var me=I.lane,Ee=I.eventTime;if((i&me)===me){xe!==null&&(xe=xe.next={eventTime:Ee,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Ie=t,Ae=I;switch(me=s,Ee=n,Ae.tag){case 1:if(Ie=Ae.payload,typeof Ie=="function"){ge=Ie.call(Ee,ge,me);break e}ge=Ie;break e;case 3:Ie.flags=Ie.flags&-65537|128;case 0:if(Ie=Ae.payload,me=typeof Ie=="function"?Ie.call(Ee,ge,me):Ie,me==null)break e;ge=K({},ge,me);break e;case 2:Fr=!0}}I.callback!==null&&I.lane!==0&&(t.flags|=64,me=u.effects,me===null?u.effects=[I]:me.push(I))}else Ee={eventTime:Ee,lane:me,tag:I.tag,payload:I.payload,callback:I.callback,next:null},xe===null?(ee=xe=Ee,z=ge):xe=xe.next=Ee,w|=me;if(I=I.next,I===null){if(I=u.shared.pending,I===null)break;me=I,I=me.next,me.next=null,u.lastBaseUpdate=me,u.shared.pending=null}}while(!0);if(xe===null&&(z=ge),u.baseState=z,u.firstBaseUpdate=ee,u.lastBaseUpdate=xe,s=u.shared.interleaved,s!==null){u=s;do w|=u.lane,u=u.next;while(u!==s)}else x===null&&(u.shared.lanes=0);Pn|=w,t.lanes=w,t.memoizedState=ge}}function Xh(t,s,n){if(t=s.effects,s.effects=null,t!==null)for(s=0;sn?n:4,t(!0);var i=Pc.transition;Pc.transition={};try{t(!1),s()}finally{nt=n,Pc.transition=i}}function pm(){return Ss().memoizedState}function Dy(t,s,n){var i=Vr(t);if(n={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null},gm(t))ym(s,n);else if(n=Gh(t,s,n,i),n!==null){var u=ts();Ls(n,t,i,u),vm(n,s,i)}}function Ly(t,s,n){var i=Vr(t),u={lane:i,action:n,hasEagerState:!1,eagerState:null,next:null};if(gm(t))ym(s,u);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var w=s.lastRenderedState,I=x(w,n);if(u.hasEagerState=!0,u.eagerState=I,Is(I,w)){var z=s.interleaved;z===null?(u.next=u,Nc(s)):(u.next=z.next,z.next=u),s.interleaved=u;return}}catch{}finally{}n=Gh(t,s,u,i),n!==null&&(u=ts(),Ls(n,t,i,u),vm(n,s,i))}}function gm(t){var s=t.alternate;return t===yt||s!==null&&s===yt}function ym(t,s){ol=xi=!0;var n=t.pending;n===null?s.next=s:(s.next=n.next,n.next=s),t.pending=s}function vm(t,s,n){if((n&4194240)!==0){var i=s.lanes;i&=t.pendingLanes,n|=i,s.lanes=n,Oo(t,n)}}var yi={readContext:ws,useCallback:qt,useContext:qt,useEffect:qt,useImperativeHandle:qt,useInsertionEffect:qt,useLayoutEffect:qt,useMemo:qt,useReducer:qt,useRef:qt,useState:qt,useDebugValue:qt,useDeferredValue:qt,useTransition:qt,useMutableSource:qt,useSyncExternalStore:qt,useId:qt,unstable_isNewReconciler:!1},Oy={readContext:ws,useCallback:function(t,s){return Gs().memoizedState=[t,s===void 0?null:s],t},useContext:ws,useEffect:om,useImperativeHandle:function(t,s,n){return n=n!=null?n.concat([t]):null,pi(4194308,4,um.bind(null,s,t),n)},useLayoutEffect:function(t,s){return pi(4194308,4,t,s)},useInsertionEffect:function(t,s){return pi(4,2,t,s)},useMemo:function(t,s){var n=Gs();return s=s===void 0?null:s,t=t(),n.memoizedState=[t,s],t},useReducer:function(t,s,n){var i=Gs();return s=n!==void 0?n(s):s,i.memoizedState=i.baseState=s,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Dy.bind(null,yt,t),[i.memoizedState,t]},useRef:function(t){var s=Gs();return t={current:t},s.memoizedState=t},useState:lm,useDebugValue:Dc,useDeferredValue:function(t){return Gs().memoizedState=t},useTransition:function(){var t=lm(!1),s=t[0];return t=Ay.bind(null,t[1]),Gs().memoizedState=t,[s,t]},useMutableSource:function(){},useSyncExternalStore:function(t,s,n){var i=yt,u=Gs();if(mt){if(n===void 0)throw Error(l(407));n=n()}else{if(n=s(),Ut===null)throw Error(l(349));(En&30)!==0||tm(i,s,n)}u.memoizedState=n;var x={value:n,getSnapshot:s};return u.queue=x,om(rm.bind(null,i,x,t),[t]),i.flags|=2048,ul(9,sm.bind(null,i,x,n,s),void 0,null),n},useId:function(){var t=Gs(),s=Ut.identifierPrefix;if(mt){var n=dr,i=cr;n=(i&~(1<<32-Ts(i)-1)).toString(32)+n,s=":"+s+"R"+n,n=cl++,0<\/script>",t=t.removeChild(t.firstChild)):typeof i.is=="string"?t=w.createElement(n,{is:i.is}):(t=w.createElement(n),n==="select"&&(w=t,i.multiple?w.multiple=!0:i.size&&(w.size=i.size))):t=w.createElementNS(t,n),t[Ks]=s,t[sl]=i,zm(t,s,!1,!1),s.stateNode=t;e:{switch(w=pn(n,i),n){case"dialog":ct("cancel",t),ct("close",t),u=i;break;case"iframe":case"object":case"embed":ct("load",t),u=i;break;case"video":case"audio":for(u=0;uha&&(s.flags|=128,i=!0,hl(x,!1),s.lanes=4194304)}else{if(!i)if(t=mi(w),t!==null){if(s.flags|=128,i=!0,n=t.updateQueue,n!==null&&(s.updateQueue=n,s.flags|=4),hl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!mt)return Xt(s),null}else 2*Et()-x.renderingStartTime>ha&&n!==1073741824&&(s.flags|=128,i=!0,hl(x,!1),s.lanes=4194304);x.isBackwards?(w.sibling=s.child,s.child=w):(n=x.last,n!==null?n.sibling=w:s.child=w,x.last=w)}return x.tail!==null?(s=x.tail,x.rendering=s,x.tail=s.sibling,x.renderingStartTime=Et(),s.sibling=null,n=gt.current,ot(gt,i?n&1|2:n&1),s):(Xt(s),null);case 22:case 23:return ad(),i=s.memoizedState!==null,t!==null&&t.memoizedState!==null!==i&&(s.flags|=8192),i&&(s.mode&1)!==0?(xs&1073741824)!==0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),null;case 24:return null;case 25:return null}throw Error(l(156,s.tag))}function Hy(t,s){switch(fc(s),s.tag){case 1:return ls(s.type)&&si(),t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 3:return oa(),dt(as),dt(Qt),Ec(),t=s.flags,(t&65536)!==0&&(t&128)===0?(s.flags=t&-65537|128,s):null;case 5:return Cc(s),null;case 13:if(dt(gt),t=s.memoizedState,t!==null&&t.dehydrated!==null){if(s.alternate===null)throw Error(l(340));na()}return t=s.flags,t&65536?(s.flags=t&-65537|128,s):null;case 19:return dt(gt),null;case 4:return oa(),null;case 10:return jc(s.type._context),null;case 22:case 23:return ad(),null;case 24:return null;default:return null}}var Ni=!1,Jt=!1,Ky=typeof WeakSet=="function"?WeakSet:Set,Te=null;function da(t,s){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(i){Nt(t,s,i)}else n.current=null}function Yc(t,s,n){try{n()}catch(i){Nt(t,s,i)}}var Um=!1;function Yy(t,s){if(ac=Ul,t=jh(),Xo(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,x=i.focusNode;i=i.focusOffset;try{n.nodeType,x.nodeType}catch{n=null;break e}var w=0,I=-1,z=-1,ee=0,xe=0,ge=t,me=null;t:for(;;){for(var Ee;ge!==n||u!==0&&ge.nodeType!==3||(I=w+u),ge!==x||i!==0&&ge.nodeType!==3||(z=w+i),ge.nodeType===3&&(w+=ge.nodeValue.length),(Ee=ge.firstChild)!==null;)me=ge,ge=Ee;for(;;){if(ge===t)break t;if(me===n&&++ee===u&&(I=w),me===x&&++xe===i&&(z=w),(Ee=ge.nextSibling)!==null)break;ge=me,me=ge.parentNode}ge=Ee}n=I===-1||z===-1?null:{start:I,end:z}}else n=null}n=n||{start:0,end:0}}else n=null;for(lc={focusedElem:t,selectionRange:n},Ul=!1,Te=s;Te!==null;)if(s=Te,t=s.child,(s.subtreeFlags&1028)!==0&&t!==null)t.return=s,Te=t;else for(;Te!==null;){s=Te;try{var Ie=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Ie!==null){var Ae=Ie.memoizedProps,Pt=Ie.memoizedState,Q=s.stateNode,W=Q.getSnapshotBeforeUpdate(s.elementType===s.type?Ae:Ms(s.type,Ae),Pt);Q.__reactInternalSnapshotBeforeUpdate=W}break;case 3:var Z=s.stateNode.containerInfo;Z.nodeType===1?Z.textContent="":Z.nodeType===9&&Z.documentElement&&Z.removeChild(Z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(l(163))}}catch(Ne){Nt(s,s.return,Ne)}if(t=s.sibling,t!==null){t.return=s.return,Te=t;break}Te=s.return}return Ie=Um,Um=!1,Ie}function ml(t,s,n){var i=s.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var u=i=i.next;do{if((u.tag&t)===t){var x=u.destroy;u.destroy=void 0,x!==void 0&&Yc(s,n,x)}u=u.next}while(u!==i)}}function wi(t,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var n=s=s.next;do{if((n.tag&t)===t){var i=n.create;n.destroy=i()}n=n.next}while(n!==s)}}function Gc(t){var s=t.ref;if(s!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof s=="function"?s(t):s.current=t}}function Vm(t){var s=t.alternate;s!==null&&(t.alternate=null,Vm(s)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(s=t.stateNode,s!==null&&(delete s[Ks],delete s[sl],delete s[dc],delete s[Ry],delete s[Ty])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Wm(t){return t.tag===5||t.tag===3||t.tag===4}function Hm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Qc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.nodeType===8?n.parentNode.insertBefore(t,s):n.insertBefore(t,s):(n.nodeType===8?(s=n.parentNode,s.insertBefore(t,n)):(s=n,s.appendChild(t)),n=n._reactRootContainer,n!=null||s.onclick!==null||(s.onclick=ei));else if(i!==4&&(t=t.child,t!==null))for(Qc(t,s,n),t=t.sibling;t!==null;)Qc(t,s,n),t=t.sibling}function qc(t,s,n){var i=t.tag;if(i===5||i===6)t=t.stateNode,s?n.insertBefore(t,s):n.appendChild(t);else if(i!==4&&(t=t.child,t!==null))for(qc(t,s,n),t=t.sibling;t!==null;)qc(t,s,n),t=t.sibling}var Ht=null,As=!1;function $r(t,s,n){for(n=n.child;n!==null;)Km(t,s,n),n=n.sibling}function Km(t,s,n){if(Hs&&typeof Hs.onCommitFiberUnmount=="function")try{Hs.onCommitFiberUnmount(Ll,n)}catch{}switch(n.tag){case 5:Jt||da(n,s);case 6:var i=Ht,u=As;Ht=null,$r(t,s,n),Ht=i,As=u,Ht!==null&&(As?(t=Ht,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Ht.removeChild(n.stateNode));break;case 18:Ht!==null&&(As?(t=Ht,n=n.stateNode,t.nodeType===8?cc(t.parentNode,n):t.nodeType===1&&cc(t,n),Ha(t)):cc(Ht,n.stateNode));break;case 4:i=Ht,u=As,Ht=n.stateNode.containerInfo,As=!0,$r(t,s,n),Ht=i,As=u;break;case 0:case 11:case 14:case 15:if(!Jt&&(i=n.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){u=i=i.next;do{var x=u,w=x.destroy;x=x.tag,w!==void 0&&((x&2)!==0||(x&4)!==0)&&Yc(n,s,w),u=u.next}while(u!==i)}$r(t,s,n);break;case 1:if(!Jt&&(da(n,s),i=n.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=n.memoizedProps,i.state=n.memoizedState,i.componentWillUnmount()}catch(I){Nt(n,s,I)}$r(t,s,n);break;case 21:$r(t,s,n);break;case 22:n.mode&1?(Jt=(i=Jt)||n.memoizedState!==null,$r(t,s,n),Jt=i):$r(t,s,n);break;default:$r(t,s,n)}}function Ym(t){var s=t.updateQueue;if(s!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new Ky),s.forEach(function(i){var u=sv.bind(null,t,i);n.has(i)||(n.add(i),i.then(u,u))})}}function Ds(t,s){var n=s.deletions;if(n!==null)for(var i=0;iu&&(u=w),i&=~x}if(i=u,i=Et()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Qy(i/1960))-i,10t?16:t,Ur===null)var i=!1;else{if(t=Ur,Ur=null,Pi=0,(et&6)!==0)throw Error(l(331));var u=et;for(et|=4,Te=t.current;Te!==null;){var x=Te,w=x.child;if((Te.flags&16)!==0){var I=x.deletions;if(I!==null){for(var z=0;zEt()-Zc?Tn(t,0):Jc|=n),cs(t,s)}function lf(t,s){s===0&&((t.mode&1)===0?s=1:(s=Fl,Fl<<=1,(Fl&130023424)===0&&(Fl=4194304)));var n=ts();t=ur(t,s),t!==null&&($a(t,s,n),cs(t,n))}function tv(t){var s=t.memoizedState,n=0;s!==null&&(n=s.retryLane),lf(t,n)}function sv(t,s){var n=0;switch(t.tag){case 13:var i=t.stateNode,u=t.memoizedState;u!==null&&(n=u.retryLane);break;case 19:i=t.stateNode;break;default:throw Error(l(314))}i!==null&&i.delete(s),lf(t,n)}var of;of=function(t,s,n){if(t!==null)if(t.memoizedProps!==s.pendingProps||as.current)is=!0;else{if((t.lanes&n)===0&&(s.flags&128)===0)return is=!1,Vy(t,s,n);is=(t.flags&131072)!==0}else is=!1,mt&&(s.flags&1048576)!==0&&$h(s,li,s.index);switch(s.lanes=0,s.tag){case 2:var i=s.type;bi(t,s),t=s.pendingProps;var u=ta(s,Qt.current);ia(s,n),u=Tc(null,s,i,t,u,n);var x=Ic();return s.flags|=1,typeof u=="object"&&u!==null&&typeof u.render=="function"&&u.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,ls(i)?(x=!0,ri(s)):x=!1,s.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,wc(s),u.updater=vi,s.stateNode=u,u._reactInternals=s,Oc(s,i,t,n),s=Bc(null,s,i,!0,x,n)):(s.tag=0,mt&&x&&mc(s),es(null,s,u,n),s=s.child),s;case 16:i=s.elementType;e:{switch(bi(t,s),t=s.pendingProps,u=i._init,i=u(i._payload),s.type=i,u=s.tag=nv(i),t=Ms(i,t),u){case 0:s=$c(null,s,i,t,n);break e;case 1:s=Mm(null,s,i,t,n);break e;case 11:s=Pm(null,s,i,t,n);break e;case 14:s=Rm(null,s,i,Ms(i.type,t),n);break e}throw Error(l(306,i,""))}return s;case 0:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ms(i,u),$c(t,s,i,u,n);case 1:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ms(i,u),Mm(t,s,i,u,n);case 3:e:{if(Am(s),t===null)throw Error(l(387));i=s.pendingProps,x=s.memoizedState,u=x.element,Qh(t,s),hi(s,i,null,n);var w=s.memoizedState;if(i=w.element,x.isDehydrated)if(x={element:i,isDehydrated:!1,cache:w.cache,pendingSuspenseBoundaries:w.pendingSuspenseBoundaries,transitions:w.transitions},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){u=ca(Error(l(423)),s),s=Dm(t,s,i,n,u);break e}else if(i!==u){u=ca(Error(l(424)),s),s=Dm(t,s,i,n,u);break e}else for(fs=Ar(s.stateNode.containerInfo.firstChild),ms=s,mt=!0,_s=null,n=Yh(s,null,i,n),s.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(na(),i===u){s=mr(t,s,n);break e}es(t,s,i,n)}s=s.child}return s;case 5:return Jh(s),t===null&&pc(s),i=s.type,u=s.pendingProps,x=t!==null?t.memoizedProps:null,w=u.children,ic(i,u)?w=null:x!==null&&ic(i,x)&&(s.flags|=32),_m(t,s),es(t,s,w,n),s.child;case 6:return t===null&&pc(s),null;case 13:return Lm(t,s,n);case 4:return Sc(s,s.stateNode.containerInfo),i=s.pendingProps,t===null?s.child=aa(s,null,i,n):es(t,s,i,n),s.child;case 11:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ms(i,u),Pm(t,s,i,u,n);case 7:return es(t,s,s.pendingProps,n),s.child;case 8:return es(t,s,s.pendingProps.children,n),s.child;case 12:return es(t,s,s.pendingProps.children,n),s.child;case 10:e:{if(i=s.type._context,u=s.pendingProps,x=s.memoizedProps,w=u.value,ot(ci,i._currentValue),i._currentValue=w,x!==null)if(Is(x.value,w)){if(x.children===u.children&&!as.current){s=mr(t,s,n);break e}}else for(x=s.child,x!==null&&(x.return=s);x!==null;){var I=x.dependencies;if(I!==null){w=x.child;for(var z=I.firstContext;z!==null;){if(z.context===i){if(x.tag===1){z=hr(-1,n&-n),z.tag=2;var ee=x.updateQueue;if(ee!==null){ee=ee.shared;var xe=ee.pending;xe===null?z.next=z:(z.next=xe.next,xe.next=z),ee.pending=z}}x.lanes|=n,z=x.alternate,z!==null&&(z.lanes|=n),bc(x.return,n,s),I.lanes|=n;break}z=z.next}}else if(x.tag===10)w=x.type===s.type?null:x.child;else if(x.tag===18){if(w=x.return,w===null)throw Error(l(341));w.lanes|=n,I=w.alternate,I!==null&&(I.lanes|=n),bc(w,n,s),w=x.sibling}else w=x.child;if(w!==null)w.return=x;else for(w=x;w!==null;){if(w===s){w=null;break}if(x=w.sibling,x!==null){x.return=w.return,w=x;break}w=w.return}x=w}es(t,s,u.children,n),s=s.child}return s;case 9:return u=s.type,i=s.pendingProps.children,ia(s,n),u=ws(u),i=i(u),s.flags|=1,es(t,s,i,n),s.child;case 14:return i=s.type,u=Ms(i,s.pendingProps),u=Ms(i.type,u),Rm(t,s,i,u,n);case 15:return Tm(t,s,s.type,s.pendingProps,n);case 17:return i=s.type,u=s.pendingProps,u=s.elementType===i?u:Ms(i,u),bi(t,s),s.tag=1,ls(i)?(t=!0,ri(s)):t=!1,ia(s,n),bm(s,i,u),Oc(s,i,u,n),Bc(null,s,i,!0,t,n);case 19:return Fm(t,s,n);case 22:return Im(t,s,n)}throw Error(l(156,s.tag))};function cf(t,s){return Fa(t,s)}function rv(t,s,n,i){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,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 ks(t,s,n,i){return new rv(t,s,n,i)}function id(t){return t=t.prototype,!(!t||!t.isReactComponent)}function nv(t){if(typeof t=="function")return id(t)?1:0;if(t!=null){if(t=t.$$typeof,t===le)return 11;if(t===q)return 14}return 2}function Hr(t,s){var n=t.alternate;return n===null?(n=ks(t.tag,s,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=s,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,s=t.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function _i(t,s,n,i,u,x){var w=2;if(i=t,typeof t=="function")id(t)&&(w=1);else if(typeof t=="string")w=5;else e:switch(t){case k:return _n(n.children,u,x,s);case A:w=8,u|=8;break;case _:return t=ks(12,n,s,u|2),t.elementType=_,t.lanes=x,t;case se:return t=ks(13,n,s,u),t.elementType=se,t.lanes=x,t;case G:return t=ks(19,n,s,u),t.elementType=G,t.lanes=x,t;case je:return Mi(n,u,x,s);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case re:w=10;break e;case ae:w=9;break e;case le:w=11;break e;case q:w=14;break e;case ce:w=16,i=null;break e}throw Error(l(130,t==null?t:typeof t,""))}return s=ks(w,n,s,u),s.elementType=t,s.type=i,s.lanes=x,s}function _n(t,s,n,i){return t=ks(7,t,i,s),t.lanes=n,t}function Mi(t,s,n,i){return t=ks(22,t,i,s),t.elementType=je,t.lanes=n,t.stateNode={isHidden:!1},t}function od(t,s,n){return t=ks(6,t,null,s),t.lanes=n,t}function cd(t,s,n){return s=ks(4,t.children!==null?t.children:[],t.key,s),s.lanes=n,s.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},s}function av(t,s,n,i,u){this.tag=s,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Lo(0),this.expirationTimes=Lo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lo(0),this.identifierPrefix=i,this.onRecoverableError=u,this.mutableSourceEagerHydrationData=null}function dd(t,s,n,i,u,x,w,I,z){return t=new av(t,s,n,I,z),s===1?(s=1,x===!0&&(s|=8)):s=0,x=ks(3,null,null,s),t.current=x,x.stateNode=t,x.memoizedState={element:i,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wc(x),t}function lv(t,s,n){var i=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(a){console.error(a)}}return r(),pd.exports=yv(),pd.exports}var wf;function vv(){if(wf)return $i;wf=1;var r=kx();return $i.createRoot=r.createRoot,$i.hydrateRoot=r.hydrateRoot,$i}var jv=vv(),Pl=kx();const bv=Cx(Pl);/** + * @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 wl(){return wl=Object.assign?Object.assign.bind():function(r){for(var a=1;a"u")throw new Error(a)}function uu(r,a){if(!r){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function wv(){return Math.random().toString(36).substr(2,8)}function Cf(r,a){return{usr:r.state,key:r.key,idx:a}}function Fd(r,a,l,o){return l===void 0&&(l=null),wl({pathname:typeof r=="string"?r:r.pathname,search:"",hash:""},typeof a=="string"?Ea(a):a,{state:l,key:a&&a.key||o||wv()})}function to(r){let{pathname:a="/",search:l="",hash:o=""}=r;return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function Ea(r){let a={};if(r){let l=r.indexOf("#");l>=0&&(a.hash=r.substr(l),r=r.substr(0,l));let o=r.indexOf("?");o>=0&&(a.search=r.substr(o),r=r.substr(0,o)),r&&(a.pathname=r)}return a}function Sv(r,a,l,o){o===void 0&&(o={});let{window:c=document.defaultView,v5Compat:d=!1}=o,m=c.history,f=Xr.Pop,p=null,y=g();y==null&&(y=0,m.replaceState(wl({},m.state,{idx:y}),""));function g(){return(m.state||{idx:null}).idx}function v(){f=Xr.Pop;let b=g(),N=b==null?null:b-y;y=b,p&&p({action:f,location:S.location,delta:N})}function C(b,N){f=Xr.Push;let E=Fd(S.location,b,N);y=g()+1;let j=Cf(E,y),T=S.createHref(E);try{m.pushState(j,"",T)}catch(B){if(B instanceof DOMException&&B.name==="DataCloneError")throw B;c.location.assign(T)}d&&p&&p({action:f,location:S.location,delta:1})}function P(b,N){f=Xr.Replace;let E=Fd(S.location,b,N);y=g();let j=Cf(E,y),T=S.createHref(E);m.replaceState(j,"",T),d&&p&&p({action:f,location:S.location,delta:0})}function R(b){let N=c.location.origin!=="null"?c.location.origin:c.location.href,E=typeof b=="string"?b:to(b);return E=E.replace(/ $/,"%20"),Tt(N,"No window.location.(origin|href) available to create URL for href: "+E),new URL(E,N)}let S={get action(){return f},get location(){return r(c,m)},listen(b){if(p)throw new Error("A history only accepts one active listener");return c.addEventListener(Sf,v),p=b,()=>{c.removeEventListener(Sf,v),p=null}},createHref(b){return a(c,b)},createURL:R,encodeLocation(b){let N=R(b);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:C,replace:P,go(b){return m.go(b)}};return S}var kf;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(kf||(kf={}));function Cv(r,a,l){return l===void 0&&(l="/"),kv(r,a,l)}function kv(r,a,l,o){let c=typeof a=="string"?Ea(a):a,d=hu(c.pathname||"/",l);if(d==null)return null;let m=Ex(r);Ev(m);let f=null;for(let p=0;f==null&&p{let p={relativePath:f===void 0?d.path||"":f,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};p.relativePath.startsWith("/")&&(Tt(p.relativePath.startsWith(o),'Absolute route path "'+p.relativePath+'" nested under path '+('"'+o+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),p.relativePath=p.relativePath.slice(o.length));let y=Zr([o,p.relativePath]),g=l.concat(p);d.children&&d.children.length>0&&(Tt(d.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+y+'".')),Ex(d.children,a,g,y)),!(d.path==null&&!d.index)&&a.push({path:y,score:Av(y,d.index),routesMeta:g})};return r.forEach((d,m)=>{var f;if(d.path===""||!((f=d.path)!=null&&f.includes("?")))c(d,m);else for(let p of Px(d.path))c(d,m,p)}),a}function Px(r){let a=r.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let m=Px(o.join("/")),f=[];return f.push(...m.map(p=>p===""?d:[d,p].join("/"))),c&&f.push(...m),f.map(p=>r.startsWith("/")&&p===""?"/":p)}function Ev(r){r.sort((a,l)=>a.score!==l.score?l.score-a.score:Dv(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}const Pv=/^:[\w-]+$/,Rv=3,Tv=2,Iv=1,_v=10,Mv=-2,Ef=r=>r==="*";function Av(r,a){let l=r.split("/"),o=l.length;return l.some(Ef)&&(o+=Mv),a&&(o+=Tv),l.filter(c=>!Ef(c)).reduce((c,d)=>c+(Pv.test(d)?Rv:d===""?Iv:_v),o)}function Dv(r,a){return r.length===a.length&&r.slice(0,-1).every((o,c)=>o===a[c])?r[r.length-1]-a[a.length-1]:0}function Lv(r,a,l){let{routesMeta:o}=r,c={},d="/",m=[];for(let f=0;f{let{paramName:C,isOptional:P}=g;if(C==="*"){let S=f[v]||"";m=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const R=f[v];return P&&!R?y[C]=void 0:y[C]=(R||"").replace(/%2F/g,"/"),y},{}),pathname:d,pathnameBase:m,pattern:r}}function Fv(r,a,l){a===void 0&&(a=!1),l===void 0&&(l=!0),uu(r==="*"||!r.endsWith("*")||r.endsWith("/*"),'Route path "'+r+'" will be treated as if it were '+('"'+r.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+r.replace(/\*$/,"/*")+'".'));let o=[],c="^"+r.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,p)=>(o.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)"));return r.endsWith("*")?(o.push({paramName:"*"}),c+=r==="*"||r==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":r!==""&&r!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function zv(r){try{return r.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return uu(!1,'The URL path "'+r+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+a+").")),r}}function hu(r,a){if(a==="/")return r;if(!r.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=r.charAt(l);return o&&o!=="/"?null:r.slice(l)||"/"}const $v=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bv=r=>$v.test(r);function Uv(r,a){a===void 0&&(a="/");let{pathname:l,search:o="",hash:c=""}=typeof r=="string"?Ea(r):r,d;if(l)if(Bv(l))d=l;else{if(l.includes("//")){let m=l;l=l.replace(/\/\/+/g,"/"),uu(!1,"Pathnames cannot have embedded double slashes - normalizing "+(m+" -> "+l))}l.startsWith("/")?d=Pf(l.substring(1),"/"):d=Pf(l,a)}else d=a;return{pathname:d,search:Hv(o),hash:Kv(c)}}function Pf(r,a){let l=a.replace(/\/+$/,"").split("/");return r.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function vd(r,a,l,o){return"Cannot include a '"+r+"' 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 and the router will parse it for you.'}function Vv(r){return r.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function mu(r,a){let l=Vv(r);return a?l.map((o,c)=>c===l.length-1?o.pathname:o.pathnameBase):l.map(o=>o.pathnameBase)}function fu(r,a,l,o){o===void 0&&(o=!1);let c;typeof r=="string"?c=Ea(r):(c=wl({},r),Tt(!c.pathname||!c.pathname.includes("?"),vd("?","pathname","search",c)),Tt(!c.pathname||!c.pathname.includes("#"),vd("#","pathname","hash",c)),Tt(!c.search||!c.search.includes("#"),vd("#","search","hash",c)));let d=r===""||c.pathname==="",m=d?"/":c.pathname,f;if(m==null)f=l;else{let v=a.length-1;if(!o&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),v-=1;c.pathname=C.join("/")}f=v>=0?a[v]:"/"}let p=Uv(c,f),y=m&&m!=="/"&&m.endsWith("/"),g=(d||m===".")&&l.endsWith("/");return!p.pathname.endsWith("/")&&(y||g)&&(p.pathname+="/"),p}const Zr=r=>r.join("/").replace(/\/\/+/g,"/"),Wv=r=>r.replace(/\/+$/,"").replace(/^\/*/,"/"),Hv=r=>!r||r==="?"?"":r.startsWith("?")?r:"?"+r,Kv=r=>!r||r==="#"?"":r.startsWith("#")?r:"#"+r;function Yv(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const Rx=["post","put","patch","delete"];new Set(Rx);const Gv=["get",...Rx];new Set(Gv);/** + * 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 Sl(){return Sl=Object.assign?Object.assign.bind():function(r){for(var a=1;a{f.current=!0}),h.useCallback(function(y,g){if(g===void 0&&(g={}),!f.current)return;if(typeof y=="number"){o.go(y);return}let v=fu(y,JSON.parse(m),d,g.relative==="path");r==null&&a!=="/"&&(v.pathname=v.pathname==="/"?a:Zr([a,v.pathname])),(g.replace?o.replace:o.push)(v,g.state,g)},[a,o,m,d,r])}const Jv=h.createContext(null);function Zv(r){let a=h.useContext(Nr).outlet;return a&&h.createElement(Jv.Provider,{value:r},a)}function _x(r,a){let{relative:l}=a===void 0?{}:a,{future:o}=h.useContext(on),{matches:c}=h.useContext(Nr),{pathname:d}=cn(),m=JSON.stringify(mu(c,o.v7_relativeSplatPath));return h.useMemo(()=>fu(r,JSON.parse(m),d,l==="path"),[r,m,d,l])}function ej(r,a){return tj(r,a)}function tj(r,a,l,o){Pa()||Tt(!1);let{navigator:c}=h.useContext(on),{matches:d}=h.useContext(Nr),m=d[d.length-1],f=m?m.params:{};m&&m.pathname;let p=m?m.pathnameBase:"/";m&&m.route;let y=cn(),g;if(a){var v;let b=typeof a=="string"?Ea(a):a;p==="/"||(v=b.pathname)!=null&&v.startsWith(p)||Tt(!1),g=b}else g=y;let C=g.pathname||"/",P=C;if(p!=="/"){let b=p.replace(/^\//,"").split("/");P="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let R=Cv(r,{pathname:P}),S=lj(R&&R.map(b=>Object.assign({},b,{params:Object.assign({},f,b.params),pathname:Zr([p,c.encodeLocation?c.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?p:Zr([p,c.encodeLocation?c.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),d,l,o);return a&&S?h.createElement(yo.Provider,{value:{location:Sl({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:Xr.Pop}},S):S}function sj(){let r=dj(),a=Yv(r)?r.status+" "+r.statusText:r instanceof Error?r.message:JSON.stringify(r),l=r instanceof Error?r.stack:null,c={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return 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 rj=h.createElement(sj,null);class nj 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(Nr.Provider,{value:this.props.routeContext},h.createElement(Tx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function aj(r){let{routeContext:a,match:l,children:o}=r,c=h.useContext(xu);return c&&c.static&&c.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=l.route.id),h.createElement(Nr.Provider,{value:a},o)}function lj(r,a,l,o){var c;if(a===void 0&&(a=[]),l===void 0&&(l=null),o===void 0&&(o=null),r==null){var d;if(!l)return null;if(l.errors)r=l.matches;else if((d=o)!=null&&d.v7_partialHydration&&a.length===0&&!l.initialized&&l.matches.length>0)r=l.matches;else return null}let m=r,f=(c=l)==null?void 0:c.errors;if(f!=null){let g=m.findIndex(v=>v.route.id&&(f==null?void 0:f[v.route.id])!==void 0);g>=0||Tt(!1),m=m.slice(0,Math.min(m.length,g+1))}let p=!1,y=-1;if(l&&o&&o.v7_partialHydration)for(let g=0;g=0?m=m.slice(0,y+1):m=[m[0]];break}}}return m.reduceRight((g,v,C)=>{let P,R=!1,S=null,b=null;l&&(P=f&&v.route.id?f[v.route.id]:void 0,S=v.route.errorElement||rj,p&&(y<0&&C===0?(hj("route-fallback"),R=!0,b=null):y===C&&(R=!0,b=v.route.hydrateFallbackElement||null)));let N=a.concat(m.slice(0,C+1)),E=()=>{let j;return P?j=S:R?j=b:v.route.Component?j=h.createElement(v.route.Component,null):v.route.element?j=v.route.element:j=g,h.createElement(aj,{match:v,routeContext:{outlet:g,matches:N,isDataRoute:l!=null},children:j})};return l&&(v.route.ErrorBoundary||v.route.errorElement||C===0)?h.createElement(nj,{location:l.location,revalidation:l.revalidation,component:S,error:P,children:E(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):E()},null)}var Mx=(function(r){return r.UseBlocker="useBlocker",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r})(Mx||{}),Ax=(function(r){return r.UseBlocker="useBlocker",r.UseLoaderData="useLoaderData",r.UseActionData="useActionData",r.UseRouteError="useRouteError",r.UseNavigation="useNavigation",r.UseRouteLoaderData="useRouteLoaderData",r.UseMatches="useMatches",r.UseRevalidator="useRevalidator",r.UseNavigateStable="useNavigate",r.UseRouteId="useRouteId",r})(Ax||{});function ij(r){let a=h.useContext(xu);return a||Tt(!1),a}function oj(r){let a=h.useContext(Qv);return a||Tt(!1),a}function cj(r){let a=h.useContext(Nr);return a||Tt(!1),a}function Dx(r){let a=cj(),l=a.matches[a.matches.length-1];return l.route.id||Tt(!1),l.route.id}function dj(){var r;let a=h.useContext(Tx),l=oj(),o=Dx();return a!==void 0?a:(r=l.errors)==null?void 0:r[o]}function uj(){let{router:r}=ij(Mx.UseNavigateStable),a=Dx(Ax.UseNavigateStable),l=h.useRef(!1);return Ix(()=>{l.current=!0}),h.useCallback(function(c,d){d===void 0&&(d={}),l.current&&(typeof c=="number"?r.navigate(c):r.navigate(c,Sl({fromRouteId:a},d)))},[r,a])}const Rf={};function hj(r,a,l){Rf[r]||(Rf[r]=!0)}function mj(r,a){r==null||r.v7_startTransition,r==null||r.v7_relativeSplatPath}function jd(r){let{to:a,replace:l,state:o,relative:c}=r;Pa()||Tt(!1);let{future:d,static:m}=h.useContext(on),{matches:f}=h.useContext(Nr),{pathname:p}=cn(),y=Ra(),g=fu(a,mu(f,d.v7_relativeSplatPath),p,c==="path"),v=JSON.stringify(g);return h.useEffect(()=>y(JSON.parse(v),{replace:l,state:o,relative:c}),[y,v,c,l,o]),null}function fj(r){return Zv(r.context)}function ut(r){Tt(!1)}function xj(r){let{basename:a="/",children:l=null,location:o,navigationType:c=Xr.Pop,navigator:d,static:m=!1,future:f}=r;Pa()&&Tt(!1);let p=a.replace(/^\/*/,"/"),y=h.useMemo(()=>({basename:p,navigator:d,static:m,future:Sl({v7_relativeSplatPath:!1},f)}),[p,f,d,m]);typeof o=="string"&&(o=Ea(o));let{pathname:g="/",search:v="",hash:C="",state:P=null,key:R="default"}=o,S=h.useMemo(()=>{let b=hu(g,p);return b==null?null:{location:{pathname:b,search:v,hash:C,state:P,key:R},navigationType:c}},[p,g,v,C,P,R,c]);return S==null?null:h.createElement(on.Provider,{value:y},h.createElement(yo.Provider,{children:l,value:S}))}function pj(r){let{children:a,location:l}=r;return ej(zd(a),l)}new Promise(()=>{});function zd(r,a){a===void 0&&(a=[]);let l=[];return h.Children.forEach(r,(o,c)=>{if(!h.isValidElement(o))return;let d=[...a,c];if(o.type===h.Fragment){l.push.apply(l,zd(o.props.children,d));return}o.type!==ut&&Tt(!1),!o.props.index||!o.props.children||Tt(!1);let m={id:o.props.id||d.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&&(m.children=zd(o.props.children,d)),l.push(m)}),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 $d(){return $d=Object.assign?Object.assign.bind():function(r){for(var a=1;a=0)&&(l[c]=r[c]);return l}function yj(r){return!!(r.metaKey||r.altKey||r.ctrlKey||r.shiftKey)}function vj(r,a){return r.button===0&&(!a||a==="_self")&&!yj(r)}function Bd(r){return r===void 0&&(r=""),new URLSearchParams(typeof r=="string"||Array.isArray(r)||r instanceof URLSearchParams?r:Object.keys(r).reduce((a,l)=>{let o=r[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function jj(r,a){let l=Bd(r);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(d=>{l.append(c,d)})}),l}const bj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Nj="6";try{window.__reactRouterVersion=Nj}catch{}const wj="startTransition",Tf=go[wj];function Sj(r){let{basename:a,children:l,future:o,window:c}=r,d=h.useRef();d.current==null&&(d.current=Nv({window:c,v5Compat:!0}));let m=d.current,[f,p]=h.useState({action:m.action,location:m.location}),{v7_startTransition:y}=o||{},g=h.useCallback(v=>{y&&Tf?Tf(()=>p(v)):p(v)},[p,y]);return h.useLayoutEffect(()=>m.listen(g),[m,g]),h.useEffect(()=>mj(o),[o]),h.createElement(xj,{basename:a,children:l,location:f.location,navigationType:f.action,navigator:m,future:o})}const Cj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xi=h.forwardRef(function(a,l){let{onClick:o,relative:c,reloadDocument:d,replace:m,state:f,target:p,to:y,preventScrollReset:g,viewTransition:v}=a,C=gj(a,bj),{basename:P}=h.useContext(on),R,S=!1;if(typeof y=="string"&&kj.test(y)&&(R=y,Cj))try{let j=new URL(window.location.href),T=y.startsWith("//")?new URL(j.protocol+y):new URL(y),B=hu(T.pathname,P);T.origin===j.origin&&B!=null?y=B+T.search+T.hash:S=!0}catch{}let b=qv(y,{relative:c}),N=Ej(y,{replace:m,state:f,target:p,preventScrollReset:g,relative:c,viewTransition:v});function E(j){o&&o(j),j.defaultPrevented||N(j)}return h.createElement("a",$d({},C,{href:R||b,onClick:S||d?o:E,ref:l,target:p}))});var If;(function(r){r.UseScrollRestoration="useScrollRestoration",r.UseSubmit="useSubmit",r.UseSubmitFetcher="useSubmitFetcher",r.UseFetcher="useFetcher",r.useViewTransitionState="useViewTransitionState"})(If||(If={}));var _f;(function(r){r.UseFetcher="useFetcher",r.UseFetchers="useFetchers",r.UseScrollRestoration="useScrollRestoration"})(_f||(_f={}));function Ej(r,a){let{target:l,replace:o,state:c,preventScrollReset:d,relative:m,viewTransition:f}=a===void 0?{}:a,p=Ra(),y=cn(),g=_x(r,{relative:m});return h.useCallback(v=>{if(vj(v,l)){v.preventDefault();let C=o!==void 0?o:to(y)===to(g);p(r,{replace:C,state:c,preventScrollReset:d,relative:m,viewTransition:f})}},[y,p,g,o,c,l,r,d,m,f])}function Pj(r){let a=h.useRef(Bd(r)),l=h.useRef(!1),o=cn(),c=h.useMemo(()=>jj(o.search,l.current?null:a.current),[o.search]),d=Ra(),m=h.useCallback((f,p)=>{const y=Bd(typeof f=="function"?f(c):f);l.current=!0,d("?"+y,p)},[d,c]);return[c,m]}/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rj=r=>r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Tj=r=>r.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,l,o)=>o?o.toUpperCase():l.toLowerCase()),Mf=r=>{const a=Tj(r);return a.charAt(0).toUpperCase()+a.slice(1)},Lx=(...r)=>r.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).join(" ").trim(),Ij=r=>{for(const a in r)if(a.startsWith("aria-")||a==="role"||a==="title")return!0};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var _j={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 Mj=h.forwardRef(({color:r="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:m,...f},p)=>h.createElement("svg",{ref:p,..._j,width:a,height:a,stroke:r,strokeWidth:o?Number(l)*24/Number(a):l,className:Lx("lucide",c),...!d&&!Ij(f)&&{"aria-hidden":"true"},...f},[...m.map(([y,g])=>h.createElement(y,g)),...Array.isArray(d)?d:[d]]));/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pe=(r,a)=>{const l=h.forwardRef(({className:o,...c},d)=>h.createElement(Mj,{ref:d,iconNode:a,className:Lx(`lucide-${Rj(Mf(r))}`,`lucide-${r}`,o),...c}));return l.displayName=Mf(r),l};/** + * @license lucide-react v0.562.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aj=[["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"}]],Af=Pe("bitcoin",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 Dj=[["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"}]],tr=Pe("book-open",Dj);/** + * @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:"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"}]],so=Pe("calendar",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=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Fj=Pe("chart-column",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 zj=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vo=Pe("check",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=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Cl=Pe("chevron-down",$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:"m9 18 6-6-6-6",key:"mthhwq"}]],Qr=Pe("chevron-right",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 Uj=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ox=Pe("chevron-up",Uj);/** + * @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=[["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"}]],Wj=Pe("circle-alert",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 Hj=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Df=Pe("circle-check-big",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 Kj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Ud=Pe("circle-check",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 Yj=[["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"}]],Fx=Pe("circle-question-mark",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 Gj=[["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"}]],bd=Pe("circle-user",Gj);/** + * @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=[["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"}]],zx=Pe("circle-x",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 qj=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Vd=Pe("clock",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=[["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"}]],$x=Pe("copy",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 Jj=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Wd=Pe("credit-card",Jj);/** + * @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"}]],Rl=Pe("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 eb=[["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"}]],ro=Pe("dollar-sign",eb);/** + * @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 tb=[["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"}]],sb=Pe("download",tb);/** + * @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 rb=[["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"}]],no=Pe("external-link",rb);/** + * @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 nb=[["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"}]],yr=Pe("eye",nb);/** + * @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 ab=[["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"}]],lb=Pe("file-text",ab);/** + * @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 ib=[["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"}]],ob=Pe("funnel",ib);/** + * @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 cb=[["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"}]],db=Pe("gift",cb);/** + * @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 ub=[["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"}]],hb=Pe("git-merge",ub);/** + * @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 mb=[["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"}]],Hd=Pe("globe",mb);/** + * @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 fb=[["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"}]],Bx=Pe("graduation-cap",fb);/** + * @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 xb=[["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"}]],xr=Pe("grip-vertical",xb);/** + * @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 pb=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],gb=Pe("handshake",pb);/** + * @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 yb=[["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"}]],vb=Pe("house",yb);/** + * @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 jb=[["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"}]],Ux=Pe("image",jb);/** + * @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 bb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Bi=Pe("info",bb);/** + * @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 Nb=[["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"}]],Lf=Pe("key",Nb);/** + * @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 wb=[["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"}]],Sb=Pe("layout-dashboard",wb);/** + * @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 Cb=[["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"}]],en=Pe("link-2",Cb);/** + * @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 kb=[["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"}]],Of=Pe("link",kb);/** + * @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 Eb=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Pb=Pe("list",Eb);/** + * @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 Rb=[["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"}]],Tb=Pe("lock",Rb);/** + * @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 Ib=[["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"}]],_b=Pe("log-out",Ib);/** + * @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 Mb=[["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"}]],Vx=Pe("map-pin",Mb);/** + * @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 Ab=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Db=Pe("menu",Ab);/** + * @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 Lb=[["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"}]],Ob=Pe("message-circle",Lb);/** + * @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 Fb=[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]],Ui=Pe("navigation",Fb);/** + * @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 zb=[["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"}]],$b=Pe("palette",zb);/** + * @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 Bb=[["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"}]],ht=Pe("pen-line",Bb);/** + * @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 Ub=[["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"}]],Vb=Pe("percent",Ub);/** + * @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 Wb=[["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"}]],Hb=Pe("phone",Wb);/** + * @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 Kb=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rt=Pe("plus",Kb);/** + * @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 Yb=[["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"}]],Ff=Pe("qr-code",Yb);/** + * @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 Gb=[["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"}]],Be=Pe("refresh-cw",Gb);/** + * @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 Qb=[["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"}]],$t=Pe("save",Qb);/** + * @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 qb=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],vr=Pe("search",qb);/** + * @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 Xb=[["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"}]],ja=Pe("settings",Xb);/** + * @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 Jb=[["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"}]],Nd=Pe("settings-2",Jb);/** + * @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 Zb=[["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"}]],pu=Pe("shield-check",Zb);/** + * @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:"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"}]],Kd=Pe("shopping-bag",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 tN=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Yd=Pe("smartphone",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 sN=[["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"}]],wd=Pe("tag",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 rN=[["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"}]],Yt=Pe("trash-2",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:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Zs=Pe("trending-up",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 aN=[["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"}]],Wx=Pe("undo-2",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 lN=[["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"}]],ao=Pe("upload",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=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],oN=Pe("user-check",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 cN=[["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"}]],Gd=Pe("user-plus",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 dN=[["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"}]],ba=Pe("user",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 uN=[["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"}]],Gt=Pe("users",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 hN=[["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"}]],Sa=Pe("wallet",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 mN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ys=Pe("x",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 fN=[["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"}]],Jr=Pe("zap",fN),gu="admin_token";function yu(){try{return localStorage.getItem(gu)}catch{return null}}function xN(r){try{localStorage.setItem(gu,r)}catch{}}function pN(){try{localStorage.removeItem(gu)}catch{}}const gN="https://soulapi.quwanzhi.com",yN=()=>{const r="https://soulapi.quwanzhi.com";return r.length>0?r.replace(/\/$/,""):gN};function Ca(r){const a=yN(),l=r.startsWith("/")?r:`/${r}`;return a?`${a}${l}`:l}async function jo(r,a={}){const{data:l,...o}=a,c=Ca(r),d=new Headers(o.headers),m=yu();m&&d.set("Authorization",`Bearer ${m}`),l!=null&&!d.has("Content-Type")&&d.set("Content-Type","application/json");const f=l!=null?JSON.stringify(l):o.body,p=await fetch(c,{...o,headers:d,body:f,credentials:"include"}),g=(p.headers.get("Content-Type")||"").includes("application/json")?await p.json():p;if(!p.ok){const v=new Error((g==null?void 0:g.error)||`HTTP ${p.status}`);throw v.status=p.status,v.data=g,v}return g}function Ue(r,a){return jo(r,{...a,method:"GET"})}function bt(r,a,l){return jo(r,{...l,method:"POST",data:a})}function vt(r,a,l){return jo(r,{...l,method:"PUT",data:a})}function tn(r,a){return jo(r,{...a,method:"DELETE"})}const vN=[{icon:Sb,label:"数据概览",href:"/dashboard"},{icon:tr,label:"内容管理",href:"/content"},{icon:Gt,label:"用户管理",href:"/users"}],zf=[{icon:hb,label:"找伙伴",href:"/find-partner"},{icon:Rl,label:"VIP 角色",href:"/vip-roles"},{icon:Bx,label:"导师管理",href:"/mentors"},{icon:Sa,label:"推广中心",href:"/distribution"},{icon:Wd,label:"推广设置",href:"/referral-settings"}];function jN(){const r=cn(),a=Ra(),[l,o]=h.useState(!1),[c,d]=h.useState(!1),[m,f]=h.useState(!1);h.useEffect(()=>{o(!0)},[]),h.useEffect(()=>{zf.some(g=>r.pathname===g.href)&&f(!0)},[r.pathname]),h.useEffect(()=>{if(!l)return;d(!1);let y=!1;return Ue("/api/admin").then(g=>{y||(g&&g.success!==!1?d(!0):a("/login",{replace:!0}))}).catch(()=>{y||a("/login",{replace:!0})}),()=>{y=!0}},[l,a]);const p=async()=>{pN();try{await bt("/api/admin/logout",{})}catch{}a("/login",{replace:!0})};return!l||!c?e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsx("div",{className:"w-64 bg-[#0f2137] border-r border-gray-700/50"}),e.jsx("div",{className:"flex-1 flex items-center justify-center",children:e.jsx("div",{className:"text-[#38bdac]",children:"加载中..."})})]}):e.jsxs("div",{className:"flex min-h-screen bg-[#0a1628]",children:[e.jsxs("div",{className:"w-64 bg-[#0f2137] flex flex-col border-r border-gray-700/50 shadow-xl",children:[e.jsxs("div",{className:"p-6 border-b border-gray-700/50",children:[e.jsx("h1",{className:"text-xl font-bold text-[#38bdac]",children:"管理后台"}),e.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Soul创业派对"})]}),e.jsxs("nav",{className:"flex-1 p-4 space-y-1 overflow-y-auto",children:[vN.map(y=>{const g=r.pathname===y.href;return e.jsxs(Xi,{to:y.href,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)}),e.jsx("button",{type:"button",onClick:()=>f(!m),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:e.jsxs("span",{className:"flex items-center gap-3",children:[m?e.jsx(Ox,{className:"w-5 h-5"}):e.jsx(Cl,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"更多"})]})}),m&&e.jsx("div",{className:"space-y-1 pl-4",children:zf.map(y=>{const g=r.pathname===y.href;return e.jsxs(Xi,{to:y.href,className:`flex items-center gap-3 px-4 py-2 rounded-lg transition-colors ${g?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(y.icon,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:y.label})]},y.href)})}),e.jsx("div",{className:"pt-4 mt-4 border-t border-gray-700/50",children:e.jsxs(Xi,{to:"/settings",className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${r.pathname==="/settings"?"bg-[#38bdac]/20 text-[#38bdac] font-medium":"text-gray-400 hover:bg-gray-700/50 hover:text-white"}`,children:[e.jsx(ja,{className:"w-5 h-5 shrink-0"}),e.jsx("span",{className:"text-sm",children:"系统设置"})]})})]}),e.jsx("div",{className:"p-4 border-t border-gray-700/50 space-y-1",children:e.jsxs("button",{type:"button",onClick:p,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:[e.jsx(_b,{className:"w-5 h-5"}),e.jsx("span",{className:"text-sm",children:"退出登录"})]})})]}),e.jsx("div",{className:"flex-1 overflow-auto bg-[#0a1628] min-w-0",children:e.jsx("div",{className:"w-full min-w-[1024px] min-h-full",children:e.jsx(fj,{})})})]})}function $f(r,a){if(typeof r=="function")return r(a);r!=null&&(r.current=a)}function vu(...r){return a=>{let l=!1;const o=r.map(c=>{const d=$f(c,a);return!l&&typeof d=="function"&&(l=!0),d});if(l)return()=>{for(let c=0;c{let{children:d,...m}=o;Hx(d)&&typeof lo=="function"&&(d=lo(d._payload));const f=h.Children.toArray(d),p=f.find(CN);if(p){const y=p.props.children,g=f.map(v=>v===p?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}var Yx=Kx("Slot");function wN(r){const a=h.forwardRef((l,o)=>{let{children:c,...d}=l;if(Hx(c)&&typeof lo=="function"&&(c=lo(c._payload)),h.isValidElement(c)){const m=EN(c),f=kN(d,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var SN=Symbol("radix.slottable");function CN(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===SN}function kN(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function EN(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}function Gx(r){var a,l,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var c=r.length;for(a=0;atypeof r=="boolean"?`${r}`:r===0?"0":r,Uf=Qx,qx=(r,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return Uf(r,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:d}=a,m=Object.keys(c).map(y=>{const g=l==null?void 0:l[y],v=d==null?void 0:d[y];if(g===null)return null;const C=Bf(g)||Bf(v);return c[y][C]}),f=l&&Object.entries(l).reduce((y,g)=>{let[v,C]=g;return C===void 0||(y[v]=C),y},{}),p=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((y,g)=>{let{class:v,className:C,...P}=g;return Object.entries(P).every(R=>{let[S,b]=R;return Array.isArray(b)?b.includes({...d,...f}[S]):{...d,...f}[S]===b})?[...y,v,C]:y},[]);return Uf(r,m,p,l==null?void 0:l.class,l==null?void 0:l.className)},PN=(r,a)=>{const l=new Array(r.length+a.length);for(let o=0;o({classGroupId:r,validator:a}),Xx=(r=new Map,a=null,l)=>({nextPart:r,validators:a,classGroupId:l}),io="-",Vf=[],TN="arbitrary..",IN=r=>{const a=MN(r),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=r;return{getClassGroupId:m=>{if(m.startsWith("[")&&m.endsWith("]"))return _N(m);const f=m.split(io),p=f[0]===""&&f.length>1?1:0;return Jx(f,p,a)},getConflictingClassGroupIds:(m,f)=>{if(f){const p=o[m],y=l[m];return p?y?PN(y,p):p:y||Vf}return l[m]||Vf}}},Jx=(r,a,l)=>{if(r.length-a===0)return l.classGroupId;const c=r[a],d=l.nextPart.get(c);if(d){const y=Jx(r,a+1,d);if(y)return y}const m=l.validators;if(m===null)return;const f=a===0?r.join(io):r.slice(a).join(io),p=m.length;for(let y=0;yr.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const a=r.slice(1,-1),l=a.indexOf(":"),o=a.slice(0,l);return o?TN+o:void 0})(),MN=r=>{const{theme:a,classGroups:l}=r;return AN(l,a)},AN=(r,a)=>{const l=Xx();for(const o in r){const c=r[o];ju(c,l,o,a)}return l},ju=(r,a,l,o)=>{const c=r.length;for(let d=0;d{if(typeof r=="string"){LN(r,a,l);return}if(typeof r=="function"){ON(r,a,l,o);return}FN(r,a,l,o)},LN=(r,a,l)=>{const o=r===""?a:Zx(a,r);o.classGroupId=l},ON=(r,a,l,o)=>{if(zN(r)){ju(r(o),a,l,o);return}a.validators===null&&(a.validators=[]),a.validators.push(RN(l,r))},FN=(r,a,l,o)=>{const c=Object.entries(r),d=c.length;for(let m=0;m{let l=r;const o=a.split(io),c=o.length;for(let d=0;d"isThemeGetter"in r&&r.isThemeGetter===!0,$N=r=>{if(r<1)return{get:()=>{},set:()=>{}};let a=0,l=Object.create(null),o=Object.create(null);const c=(d,m)=>{l[d]=m,a++,a>r&&(a=0,o=l,l=Object.create(null))};return{get(d){let m=l[d];if(m!==void 0)return m;if((m=o[d])!==void 0)return c(d,m),m},set(d,m){d in l?l[d]=m:c(d,m)}}},Qd="!",Wf=":",BN=[],Hf=(r,a,l,o,c)=>({modifiers:r,hasImportantModifier:a,baseClassName:l,maybePostfixModifierPosition:o,isExternal:c}),UN=r=>{const{prefix:a,experimentalParseClassName:l}=r;let o=c=>{const d=[];let m=0,f=0,p=0,y;const g=c.length;for(let S=0;Sp?y-p:void 0;return Hf(d,P,C,R)};if(a){const c=a+Wf,d=o;o=m=>m.startsWith(c)?d(m.slice(c.length)):Hf(BN,!1,m,void 0,!0)}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},VN=r=>{const a=new Map;return r.orderSensitiveModifiers.forEach((l,o)=>{a.set(l,1e6+o)}),l=>{const o=[];let c=[];for(let d=0;d0&&(c.sort(),o.push(...c),c=[]),o.push(m)):c.push(m)}return c.length>0&&(c.sort(),o.push(...c)),o}},WN=r=>({cache:$N(r.cacheSize),parseClassName:UN(r),sortModifiers:VN(r),...IN(r)}),HN=/\s+/,KN=(r,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=a,m=[],f=r.trim().split(HN);let p="";for(let y=f.length-1;y>=0;y-=1){const g=f[y],{isExternal:v,modifiers:C,hasImportantModifier:P,baseClassName:R,maybePostfixModifierPosition:S}=l(g);if(v){p=g+(p.length>0?" "+p:p);continue}let b=!!S,N=o(b?R.substring(0,S):R);if(!N){if(!b){p=g+(p.length>0?" "+p:p);continue}if(N=o(R),!N){p=g+(p.length>0?" "+p:p);continue}b=!1}const E=C.length===0?"":C.length===1?C[0]:d(C).join(":"),j=P?E+Qd:E,T=j+N;if(m.indexOf(T)>-1)continue;m.push(T);const B=c(N,b);for(let U=0;U0?" "+p:p)}return p},YN=(...r)=>{let a=0,l,o,c="";for(;a{if(typeof r=="string")return r;let a,l="";for(let o=0;o{let l,o,c,d;const m=p=>{const y=a.reduce((g,v)=>v(g),r());return l=WN(y),o=l.cache.get,c=l.cache.set,d=f,f(p)},f=p=>{const y=o(p);if(y)return y;const g=KN(p,l);return c(p,g),g};return d=m,(...p)=>d(YN(...p))},QN=[],Ft=r=>{const a=l=>l[r]||QN;return a.isThemeGetter=!0,a},tp=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sp=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qN=/^\d+\/\d+$/,XN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,JN=/\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$/,ZN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ew=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fa=r=>qN.test(r),Qe=r=>!!r&&!Number.isNaN(Number(r)),Yr=r=>!!r&&Number.isInteger(Number(r)),Sd=r=>r.endsWith("%")&&Qe(r.slice(0,-1)),pr=r=>XN.test(r),sw=()=>!0,rw=r=>JN.test(r)&&!ZN.test(r),rp=()=>!1,nw=r=>ew.test(r),aw=r=>tw.test(r),lw=r=>!_e(r)&&!Me(r),iw=r=>Ta(r,lp,rp),_e=r=>tp.test(r),Mn=r=>Ta(r,ip,rw),Cd=r=>Ta(r,hw,Qe),Kf=r=>Ta(r,np,rp),ow=r=>Ta(r,ap,aw),Vi=r=>Ta(r,op,nw),Me=r=>sp.test(r),vl=r=>Ia(r,ip),cw=r=>Ia(r,mw),Yf=r=>Ia(r,np),dw=r=>Ia(r,lp),uw=r=>Ia(r,ap),Wi=r=>Ia(r,op,!0),Ta=(r,a,l)=>{const o=tp.exec(r);return o?o[1]?a(o[1]):l(o[2]):!1},Ia=(r,a,l=!1)=>{const o=sp.exec(r);return o?o[1]?a(o[1]):l:!1},np=r=>r==="position"||r==="percentage",ap=r=>r==="image"||r==="url",lp=r=>r==="length"||r==="size"||r==="bg-size",ip=r=>r==="length",hw=r=>r==="number",mw=r=>r==="family-name",op=r=>r==="shadow",fw=()=>{const r=Ft("color"),a=Ft("font"),l=Ft("text"),o=Ft("font-weight"),c=Ft("tracking"),d=Ft("leading"),m=Ft("breakpoint"),f=Ft("container"),p=Ft("spacing"),y=Ft("radius"),g=Ft("shadow"),v=Ft("inset-shadow"),C=Ft("text-shadow"),P=Ft("drop-shadow"),R=Ft("blur"),S=Ft("perspective"),b=Ft("aspect"),N=Ft("ease"),E=Ft("animate"),j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],B=()=>[...T(),Me,_e],U=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],A=()=>[Me,_e,p],_=()=>[fa,"full","auto",...A()],re=()=>[Yr,"none","subgrid",Me,_e],ae=()=>["auto",{span:["full",Yr,Me,_e]},Yr,Me,_e],le=()=>[Yr,"auto",Me,_e],se=()=>["auto","min","max","fr",Me,_e],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],ce=()=>["auto",...A()],je=()=>[fa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],$=()=>[r,Me,_e],oe=()=>[...T(),Yf,Kf,{position:[Me,_e]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",dw,iw,{size:[Me,_e]}],L=()=>[Sd,vl,Mn],O=()=>["","none","full",y,Me,_e],X=()=>["",Qe,vl,Mn],H=()=>["solid","dashed","dotted","double"],ue=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Qe,Sd,Yf,Kf],ye=()=>["","none",R,Me,_e],ve=()=>["none",Qe,Me,_e],D=()=>["none",Qe,Me,_e],pe=()=>[Qe,Me,_e],we=()=>[fa,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pr],breakpoint:[pr],color:[sw],container:[pr],"drop-shadow":[pr],ease:["in","out","in-out"],font:[lw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pr],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pr],shadow:[pr],spacing:["px",Qe],text:[pr],"text-shadow":[pr],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fa,_e,Me,b]}],container:["container"],columns:[{columns:[Qe,_e,Me,f]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:B()}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[Yr,"auto",Me,_e]}],basis:[{basis:[fa,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,fa,"auto","initial","none",_e]}],grow:[{grow:["",Qe,Me,_e]}],shrink:[{shrink:["",Qe,Me,_e]}],order:[{order:[Yr,"first","last","none",Me,_e]}],"grid-cols":[{"grid-cols":re()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":re()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":se()}],"auto-rows":[{"auto-rows":se()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:je()}],w:[{w:[f,"screen",...je()]}],"min-w":[{"min-w":[f,"screen","none",...je()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[m]},...je()]}],h:[{h:["screen","lh",...je()]}],"min-h":[{"min-h":["screen","lh","none",...je()]}],"max-h":[{"max-h":["screen","lh",...je()]}],"font-size":[{text:["base",l,vl,Mn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Me,Cd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Sd,_e]}],"font-family":[{font:[cw,_e,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,Me,_e]}],"line-clamp":[{"line-clamp":[Qe,"none",Me,Cd]}],leading:[{leading:[d,...A()]}],"list-image":[{"list-image":["none",Me,_e]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Me,_e]}],"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:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",Me,Mn]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[Qe,"auto",Me,_e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me,_e]}],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",Me,_e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Yr,Me,_e],radial:["",Me,_e],conic:[Yr,Me,_e]},uw,ow]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:X()}],"border-w-x":[{"border-x":X()}],"border-w-y":[{"border-y":X()}],"border-w-s":[{"border-s":X()}],"border-w-e":[{"border-e":X()}],"border-w-t":[{"border-t":X()}],"border-w-r":[{"border-r":X()}],"border-w-b":[{"border-b":X()}],"border-w-l":[{"border-l":X()}],"divide-x":[{"divide-x":X()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":X()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"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:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,Me,_e]}],"outline-w":[{outline:["",Qe,vl,Mn]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",g,Wi,Vi]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",v,Wi,Vi]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:X()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[Qe,Mn]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":X()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",C,Wi,Vi]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[Qe,Me,_e]}],"mix-blend":[{"mix-blend":[...ue(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ue()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Me,_e]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"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":T()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"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:oe()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Me,_e]}],filter:[{filter:["","none",Me,_e]}],blur:[{blur:ye()}],brightness:[{brightness:[Qe,Me,_e]}],contrast:[{contrast:[Qe,Me,_e]}],"drop-shadow":[{"drop-shadow":["","none",P,Wi,Vi]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",Qe,Me,_e]}],"hue-rotate":[{"hue-rotate":[Qe,Me,_e]}],invert:[{invert:["",Qe,Me,_e]}],saturate:[{saturate:[Qe,Me,_e]}],sepia:[{sepia:["",Qe,Me,_e]}],"backdrop-filter":[{"backdrop-filter":["","none",Me,_e]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,Me,_e]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,Me,_e]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,Me,_e]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,Me,_e]}],"backdrop-invert":[{"backdrop-invert":["",Qe,Me,_e]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,Me,_e]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,Me,_e]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,Me,_e]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Me,_e]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",Me,_e]}],ease:[{ease:["linear","initial",N,Me,_e]}],delay:[{delay:[Qe,Me,_e]}],animate:[{animate:["none",E,Me,_e]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Me,_e]}],"perspective-origin":[{"perspective-origin":B()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[Me,_e,"","none","gpu","cpu"]}],"transform-origin":[{origin:B()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:we()}],"translate-x":[{"translate-x":we()}],"translate-y":[{"translate-y":we()}],"translate-z":[{"translate-z":we()}],"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",Me,_e]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Me,_e]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[Qe,vl,Mn,Cd]}],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"]}},xw=GN(fw);function rt(...r){return xw(Qx(r))}const pw=qx("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 J({className:r,variant:a,size:l,asChild:o=!1,...c}){const d=o?Yx:"button";return e.jsx(d,{"data-slot":"button",className:rt(pw({variant:a,size:l,className:r})),...c})}function ie({className:r,type:a,...l}){return e.jsx("input",{type:a,"data-slot":"input",className:rt("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none placeholder:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 md:text-sm focus-visible:ring-2 focus-visible:ring-ring",r),...l})}function gw(){const r=Ra(),[a,l]=h.useState(""),[o,c]=h.useState(""),[d,m]=h.useState(""),[f,p]=h.useState(!1),y=async()=>{m(""),p(!0);try{const g=await bt("/api/admin",{username:a.trim(),password:o});if((g==null?void 0:g.success)!==!1&&(g!=null&&g.token)){xN(g.token),r("/dashboard",{replace:!0});return}m(g.error||"用户名或密码错误")}catch(g){const v=g;m(v.status===401?"用户名或密码错误":(v==null?void 0:v.message)||"网络错误,请重试")}finally{p(!1)}};return e.jsxs("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-4",children:[e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-1/4 left-1/4 w-96 h-96 bg-[#38bdac]/5 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-1/4 right-1/4 w-96 h-96 bg-blue-500/5 rounded-full blur-3xl"})]}),e.jsxs("div",{className:"w-full max-w-md relative z-10",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.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:e.jsx(pu,{className:"w-8 h-8 text-[#38bdac]"})}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"管理后台"}),e.jsx("p",{className:"text-gray-400",children:"一场SOUL的创业实验场"})]}),e.jsxs("div",{className:"bg-[#0f2137] rounded-2xl p-8 shadow-xl border border-gray-700/50 backdrop-blur-xl",children:[e.jsx("h2",{className:"text-xl font-semibold text-white mb-6 text-center",children:"管理员登录"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"用户名"}),e.jsxs("div",{className:"relative",children:[e.jsx(ba,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ie,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"请输入用户名",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-gray-400 text-sm mb-2",children:"密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(Tb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-gray-500"}),e.jsx(ie,{type:"password",value:o,onChange:g=>c(g.target.value),placeholder:"请输入密码",className:"pl-10 bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 focus:border-[#38bdac]",onKeyDown:g=>g.key==="Enter"&&y()})]})]}),d&&e.jsx("div",{className:"bg-red-500/10 text-red-400 text-sm p-3 rounded-lg border border-red-500/20",children:d}),e.jsx(J,{onClick:y,disabled:f,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white py-5 disabled:opacity-50",children:f?"登录中...":"登录"})]})]}),e.jsx("p",{className:"text-center text-gray-500 text-xs mt-6",children:"Soul创业实验场 · 后台管理系统"})]})]})}const Se=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:rt("rounded-xl border bg-card text-card-foreground shadow",r),...a}));Se.displayName="Card";const Ke=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:rt("flex flex-col space-y-1.5 p-6",r),...a}));Ke.displayName="CardHeader";const Ye=h.forwardRef(({className:r,...a},l)=>e.jsx("h3",{ref:l,className:rt("font-semibold leading-none tracking-tight",r),...a}));Ye.displayName="CardTitle";const ft=h.forwardRef(({className:r,...a},l)=>e.jsx("p",{ref:l,className:rt("text-sm text-muted-foreground",r),...a}));ft.displayName="CardDescription";const Ce=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:rt("p-6 pt-0",r),...a}));Ce.displayName="CardContent";const yw=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{ref:l,className:rt("flex items-center p-6 pt-0",r),...a}));yw.displayName="CardFooter";function vw(){const r=Ra(),[a,l]=h.useState(!0),[o,c]=h.useState([]),[d,m]=h.useState([]),[f,p]=h.useState(0),[y,g]=h.useState(0),[v,C]=h.useState(0),[P,R]=h.useState(0),[S,b]=h.useState(null);async function N(){var B;l(!0),b(null);try{const U=await Ue("/api/admin/dashboard/overview");if(U!=null&&U.success){p(U.totalUsers??0),g(U.paidOrderCount??0),C(U.totalRevenue??0),R(U.conversionRate??0),m(U.recentOrders??[]),c(U.newUsers??[]);return}}catch(U){console.error("数据概览接口失败,尝试降级拉取",U)}try{const[U,k]=await Promise.all([Ue("/api/db/users?page=1&pageSize=10"),Ue("/api/orders?page=1&pageSize=20&status=paid")]),A=typeof(U==null?void 0:U.total)=="number"?U.total:((B=U==null?void 0:U.users)==null?void 0:B.length)??0,_=(k==null?void 0:k.orders)??[],re=typeof(k==null?void 0:k.total)=="number"?k.total:_.length,ae=_.filter(q=>q.status==="paid"||q.status==="completed"||q.status==="success"),le=ae.reduce((q,ce)=>q+Number(ce.amount||0),0),se=new Set(ae.map(q=>q.userId).filter(Boolean)),G=A>0&&se.size>0?se.size/A*100:0;p(A),g(re),C(le),R(G),m(_.slice(0,5)),c((U==null?void 0:U.users)??[])}catch(U){console.error("降级拉取失败",U);const k=U;(k==null?void 0:k.status)===401?b("登录已过期,请重新登录"):b("加载失败,请检查网络或联系管理员")}finally{l(!1)}}if(h.useEffect(()=>{N();const B=setInterval(N,3e4);return()=>clearInterval(B)},[]),a)return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx(Be,{className:"w-12 h-12 text-[#38bdac] animate-spin mb-4"}),e.jsx("span",{className:"text-gray-400",children:"加载中..."})]})]});const E=f,j=B=>{const U=B.productType||"",k=B.description||"";if(k){if(U==="section"&&k.includes("章节")){if(k.includes("-")){const A=k.split("-");if(A.length>=3)return{title:`第${A[1]}章 第${A[2]}节`,subtitle:"《一场Soul的创业实验》"}}return{title:k,subtitle:"章节购买"}}return U==="fullbook"||k.includes("全书")?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"||k.includes("伙伴")?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:k,subtitle:U==="section"?"单章":U==="fullbook"?"全书":"其他"}}return U==="section"?{title:`章节 ${B.productId||""}`,subtitle:"单章购买"}:U==="fullbook"?{title:"《一场Soul的创业实验》",subtitle:"全书购买"}:U==="match"?{title:"找伙伴匹配",subtitle:"功能服务"}:{title:"未知商品",subtitle:U||"其他"}},T=[{title:"总用户数",value:E,icon:Gt,color:"text-blue-400",bg:"bg-blue-500/20",link:"/users"},{title:"总收入",value:`¥${(v??0).toFixed(2)}`,icon:Zs,color:"text-[#38bdac]",bg:"bg-[#38bdac]/20",link:"/orders"},{title:"订单数",value:y,icon:Kd,color:"text-purple-400",bg:"bg-purple-500/20",link:"/orders"},{title:"转化率",value:`${typeof P=="number"?P.toFixed(1):0}%`,icon:tr,color:"text-orange-400",bg:"bg-orange-500/20",link:"/distribution"}];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsx("h1",{className:"text-2xl font-bold mb-8 text-white",children:"数据概览"}),S&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-lg bg-amber-500/20 border border-amber-500/50 text-amber-200 text-sm flex items-center justify-between",children:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>N(),className:"text-amber-400 hover:text-amber-300 underline",children:"重试"})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:T.map((B,U)=>e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl cursor-pointer hover:border-[#38bdac]/50 transition-colors group",onClick:()=>B.link&&r(B.link),children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(Ye,{className:"text-sm font-medium text-gray-400",children:B.title}),e.jsx("div",{className:`p-2 rounded-lg ${B.bg}`,children:e.jsx(B.icon,{className:`w-4 h-4 ${B.color}`})})]}),e.jsx(Ce,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-2xl font-bold text-white",children:B.value}),e.jsx(Qr,{className:"w-5 h-5 text-gray-600 group-hover:text-[#38bdac] transition-colors"})]})})]},U))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ye,{className:"text-white",children:"最近订单"}),e.jsxs("button",{type:"button",onClick:()=>N(),className:"text-xs text-gray-400 hover:text-[#38bdac] flex items-center gap-1",title:"刷新",children:[e.jsx(Be,{className:"w-3.5 h-3.5"}),"刷新(每 30 秒自动更新)"]})]}),e.jsx(Ce,{children:e.jsxs("div",{className:"space-y-3",children:[d.slice(0,5).map(B=>{var re;const U=B.referrerId?o.find(ae=>ae.id===B.referrerId):void 0,k=B.referralCode||(U==null?void 0:U.referralCode)||(U==null?void 0:U.nickname)||(B.referrerId?String(B.referrerId).slice(0,8):""),A=j(B),_=B.userNickname||((re=o.find(ae=>ae.id===B.userId))==null?void 0:re.nickname)||"匿名用户";return e.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:[e.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[B.userAvatar?e.jsx("img",{src:B.userAvatar,alt:_,className:"w-9 h-9 rounded-full object-cover flex-shrink-0 mt-0.5",onError:ae=>{ae.currentTarget.style.display="none";const le=ae.currentTarget.nextElementSibling;le&&le.classList.remove("hidden")}}):null,e.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 ${B.userAvatar?"hidden":""}`,children:_.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm text-gray-300",children:_}),e.jsx("span",{className:"text-gray-600",children:"·"}),e.jsx("span",{className:"text-sm font-medium text-white truncate",children:A.title})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-500",children:[e.jsx("span",{className:"px-1.5 py-0.5 bg-gray-700/50 rounded",children:A.subtitle}),e.jsx("span",{children:new Date(B.createdAt||0).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),k&&e.jsxs("p",{className:"text-xs text-gray-600 mt-1",children:["推荐: ",k]})]})]}),e.jsxs("div",{className:"text-right ml-4 flex-shrink-0",children:[e.jsxs("p",{className:"text-sm font-bold text-[#38bdac]",children:["+¥",Number(B.amount).toFixed(2)]}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:B.paymentMethod||"微信"})]})]},B.id)}),d.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Kd,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无订单数据"})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"新注册用户"})}),e.jsx(Ce,{children:e.jsxs("div",{className:"space-y-3",children:[o.slice(0,5).map(B=>{var U;return e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:((U=B.nickname)==null?void 0:U.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-white",children:B.nickname||"匿名用户"}),e.jsx("p",{className:"text-xs text-gray-500",children:B.phone||"-"})]})]}),e.jsx("p",{className:"text-xs text-gray-400",children:B.createdAt?new Date(B.createdAt).toLocaleDateString():"-"})]},B.id)}),o.length===0&&e.jsx("p",{className:"text-gray-500 text-center py-8",children:"暂无用户数据"})]})})]})]})]})}const ss=h.forwardRef(({className:r,...a},l)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:l,className:rt("w-full caption-bottom text-sm",r),...a})}));ss.displayName="Table";const rs=h.forwardRef(({className:r,...a},l)=>e.jsx("thead",{ref:l,className:rt("[&_tr]:border-b",r),...a}));rs.displayName="TableHeader";const ns=h.forwardRef(({className:r,...a},l)=>e.jsx("tbody",{ref:l,className:rt("[&_tr:last-child]:border-0",r),...a}));ns.displayName="TableBody";const Ge=h.forwardRef(({className:r,...a},l)=>e.jsx("tr",{ref:l,className:rt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));Ge.displayName="TableRow";const be=h.forwardRef(({className:r,...a},l)=>e.jsx("th",{ref:l,className:rt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));be.displayName="TableHead";const fe=h.forwardRef(({className:r,...a},l)=>e.jsx("td",{ref:l,className:rt("p-4 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));fe.displayName="TableCell";const jw=qx("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 De({className:r,variant:a,asChild:l=!1,...o}){const c=l?Yx:"span";return e.jsx(c,{className:rt(jw({variant:a}),r),...o})}function He(r,a,{checkForDefaultPrevented:l=!0}={}){return function(c){if(r==null||r(c),l===!1||!c.defaultPrevented)return a==null?void 0:a(c)}}function bw(r,a){const l=h.createContext(a),o=d=>{const{children:m,...f}=d,p=h.useMemo(()=>f,Object.values(f));return e.jsx(l.Provider,{value:p,children:m})};o.displayName=r+"Provider";function c(d){const m=h.useContext(l);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${r}\``)}return[o,c]}function dn(r,a=[]){let l=[];function o(d,m){const f=h.createContext(m),p=l.length;l=[...l,m];const y=v=>{var N;const{scope:C,children:P,...R}=v,S=((N=C==null?void 0:C[r])==null?void 0:N[p])||f,b=h.useMemo(()=>R,Object.values(R));return e.jsx(S.Provider,{value:b,children:P})};y.displayName=d+"Provider";function g(v,C){var S;const P=((S=C==null?void 0:C[r])==null?void 0:S[p])||f,R=h.useContext(P);if(R)return R;if(m!==void 0)return m;throw new Error(`\`${v}\` must be used within \`${d}\``)}return[y,g]}const c=()=>{const d=l.map(m=>h.createContext(m));return function(f){const p=(f==null?void 0:f[r])||d;return h.useMemo(()=>({[`__scope${r}`]:{...f,[r]:p}}),[f,p])}};return c.scopeName=r,[o,Nw(c,...a)]}function Nw(...r){const a=r[0];if(r.length===1)return a;const l=()=>{const o=r.map(c=>({useScope:c(),scopeName:c.scopeName}));return function(d){const m=o.reduce((f,{useScope:p,scopeName:y})=>{const v=p(d)[`__scope${y}`];return{...f,...v}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:m}),[m])}};return l.scopeName=a.scopeName,l}var Zt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ww=go[" useId ".trim().toString()]||(()=>{}),Sw=0;function sn(r){const[a,l]=h.useState(ww());return Zt(()=>{l(o=>o??String(Sw++))},[r]),a?`radix-${a}`:""}var Cw=go[" useInsertionEffect ".trim().toString()]||Zt;function An({prop:r,defaultProp:a,onChange:l=()=>{},caller:o}){const[c,d,m]=kw({defaultProp:a,onChange:l}),f=r!==void 0,p=f?r:c;{const g=h.useRef(r!==void 0);h.useEffect(()=>{const v=g.current;v!==f&&console.warn(`${o} is changing from ${v?"controlled":"uncontrolled"} to ${f?"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.`),g.current=f},[f,o])}const y=h.useCallback(g=>{var v;if(f){const C=Ew(g)?g(r):g;C!==r&&((v=m.current)==null||v.call(m,C))}else d(g)},[f,r,d,m]);return[p,y]}function kw({defaultProp:r,onChange:a}){const[l,o]=h.useState(r),c=h.useRef(l),d=h.useRef(a);return Cw(()=>{d.current=a},[a]),h.useEffect(()=>{var m;c.current!==l&&((m=d.current)==null||m.call(d,l),c.current=l)},[l,c]),[l,o,d]}function Ew(r){return typeof r=="function"}function kl(r){const a=Pw(r),l=h.forwardRef((o,c)=>{const{children:d,...m}=o,f=h.Children.toArray(d),p=f.find(Tw);if(p){const y=p.props.children,g=f.map(v=>v===p?h.Children.count(y)>1?h.Children.only(null):h.isValidElement(y)?y.props.children:null:v);return e.jsx(a,{...m,ref:c,children:h.isValidElement(y)?h.cloneElement(y,void 0,g):null})}return e.jsx(a,{...m,ref:c,children:d})});return l.displayName=`${r}.Slot`,l}function Pw(r){const a=h.forwardRef((l,o)=>{const{children:c,...d}=l;if(h.isValidElement(c)){const m=_w(c),f=Iw(d,c.props);return c.type!==h.Fragment&&(f.ref=o?vu(o,m):m),h.cloneElement(c,f)}return h.Children.count(c)>1?h.Children.only(null):null});return a.displayName=`${r}.SlotClone`,a}var Rw=Symbol("radix.slottable");function Tw(r){return h.isValidElement(r)&&typeof r.type=="function"&&"__radixId"in r.type&&r.type.__radixId===Rw}function Iw(r,a){const l={...a};for(const o in a){const c=r[o],d=a[o];/^on[A-Z]/.test(o)?c&&d?l[o]=(...f)=>{const p=d(...f);return c(...f),p}:c&&(l[o]=c):o==="style"?l[o]={...c,...d}:o==="className"&&(l[o]=[c,d].filter(Boolean).join(" "))}return{...r,...l}}function _w(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Mw=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=Mw.reduce((r,a)=>{const l=kl(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{});function Aw(r,a){r&&Pl.flushSync(()=>r.dispatchEvent(a))}function nn(r){const a=h.useRef(r);return h.useEffect(()=>{a.current=r}),h.useMemo(()=>(...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)},[])}function Dw(r,a=globalThis==null?void 0:globalThis.document){const l=nn(r);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 Lw="DismissableLayer",qd="dismissableLayer.update",Ow="dismissableLayer.pointerDownOutside",Fw="dismissableLayer.focusOutside",Gf,cp=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bu=h.forwardRef((r,a)=>{const{disableOutsidePointerEvents:l=!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:m,onDismiss:f,...p}=r,y=h.useContext(cp),[g,v]=h.useState(null),C=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,P]=h.useState({}),R=st(a,k=>v(k)),S=Array.from(y.layers),[b]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),N=S.indexOf(b),E=g?S.indexOf(g):-1,j=y.layersWithOutsidePointerEventsDisabled.size>0,T=E>=N,B=Bw(k=>{const A=k.target,_=[...y.branches].some(re=>re.contains(A));!T||_||(c==null||c(k),m==null||m(k),k.defaultPrevented||f==null||f())},C),U=Uw(k=>{const A=k.target;[...y.branches].some(re=>re.contains(A))||(d==null||d(k),m==null||m(k),k.defaultPrevented||f==null||f())},C);return Dw(k=>{E===y.layers.size-1&&(o==null||o(k),!k.defaultPrevented&&f&&(k.preventDefault(),f()))},C),h.useEffect(()=>{if(g)return l&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(Gf=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(g)),y.layers.add(g),Qf(),()=>{l&&y.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=Gf)}},[g,C,l,y]),h.useEffect(()=>()=>{g&&(y.layers.delete(g),y.layersWithOutsidePointerEventsDisabled.delete(g),Qf())},[g,y]),h.useEffect(()=>{const k=()=>P({});return document.addEventListener(qd,k),()=>document.removeEventListener(qd,k)},[]),e.jsx(qe.div,{...p,ref:R,style:{pointerEvents:j?T?"auto":"none":void 0,...r.style},onFocusCapture:He(r.onFocusCapture,U.onFocusCapture),onBlurCapture:He(r.onBlurCapture,U.onBlurCapture),onPointerDownCapture:He(r.onPointerDownCapture,B.onPointerDownCapture)})});bu.displayName=Lw;var zw="DismissableLayerBranch",$w=h.forwardRef((r,a)=>{const l=h.useContext(cp),o=h.useRef(null),c=st(a,o);return h.useEffect(()=>{const d=o.current;if(d)return l.branches.add(d),()=>{l.branches.delete(d)}},[l.branches]),e.jsx(qe.div,{...r,ref:c})});$w.displayName=zw;function Bw(r,a=globalThis==null?void 0:globalThis.document){const l=nn(r),o=h.useRef(!1),c=h.useRef(()=>{});return h.useEffect(()=>{const d=f=>{if(f.target&&!o.current){let p=function(){dp(Ow,l,y,{discrete:!0})};const y={originalEvent:f};f.pointerType==="touch"?(a.removeEventListener("click",c.current),c.current=p,a.addEventListener("click",c.current,{once:!0})):p()}else a.removeEventListener("click",c.current);o.current=!1},m=window.setTimeout(()=>{a.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(m),a.removeEventListener("pointerdown",d),a.removeEventListener("click",c.current)}},[a,l]),{onPointerDownCapture:()=>o.current=!0}}function Uw(r,a=globalThis==null?void 0:globalThis.document){const l=nn(r),o=h.useRef(!1);return h.useEffect(()=>{const c=d=>{d.target&&!o.current&&dp(Fw,l,{originalEvent:d},{discrete:!1})};return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Qf(){const r=new CustomEvent(qd);document.dispatchEvent(r)}function dp(r,a,l,{discrete:o}){const c=l.originalEvent.target,d=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(r,a,{once:!0}),o?Aw(c,d):c.dispatchEvent(d)}var kd="focusScope.autoFocusOnMount",Ed="focusScope.autoFocusOnUnmount",qf={bubbles:!1,cancelable:!0},Vw="FocusScope",Nu=h.forwardRef((r,a)=>{const{loop:l=!1,trapped:o=!1,onMountAutoFocus:c,onUnmountAutoFocus:d,...m}=r,[f,p]=h.useState(null),y=nn(c),g=nn(d),v=h.useRef(null),C=st(a,S=>p(S)),P=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(o){let S=function(j){if(P.paused||!f)return;const T=j.target;f.contains(T)?v.current=T:qr(v.current,{select:!0})},b=function(j){if(P.paused||!f)return;const T=j.relatedTarget;T!==null&&(f.contains(T)||qr(v.current,{select:!0}))},N=function(j){if(document.activeElement===document.body)for(const B of j)B.removedNodes.length>0&&qr(f)};document.addEventListener("focusin",S),document.addEventListener("focusout",b);const E=new MutationObserver(N);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",b),E.disconnect()}}},[o,f,P.paused]),h.useEffect(()=>{if(f){Jf.add(P);const S=document.activeElement;if(!f.contains(S)){const N=new CustomEvent(kd,qf);f.addEventListener(kd,y),f.dispatchEvent(N),N.defaultPrevented||(Ww(Qw(up(f)),{select:!0}),document.activeElement===S&&qr(f))}return()=>{f.removeEventListener(kd,y),setTimeout(()=>{const N=new CustomEvent(Ed,qf);f.addEventListener(Ed,g),f.dispatchEvent(N),N.defaultPrevented||qr(S??document.body,{select:!0}),f.removeEventListener(Ed,g),Jf.remove(P)},0)}}},[f,y,g,P]);const R=h.useCallback(S=>{if(!l&&!o||P.paused)return;const b=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,N=document.activeElement;if(b&&N){const E=S.currentTarget,[j,T]=Hw(E);j&&T?!S.shiftKey&&N===T?(S.preventDefault(),l&&qr(j,{select:!0})):S.shiftKey&&N===j&&(S.preventDefault(),l&&qr(T,{select:!0})):N===E&&S.preventDefault()}},[l,o,P.paused]);return e.jsx(qe.div,{tabIndex:-1,...m,ref:C,onKeyDown:R})});Nu.displayName=Vw;function Ww(r,{select:a=!1}={}){const l=document.activeElement;for(const o of r)if(qr(o,{select:a}),document.activeElement!==l)return}function Hw(r){const a=up(r),l=Xf(a,r),o=Xf(a.reverse(),r);return[l,o]}function up(r){const a=[],l=document.createTreeWalker(r,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 Xf(r,a){for(const l of r)if(!Kw(l,{upTo:a}))return l}function Kw(r,{upTo:a}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(a!==void 0&&r===a)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function Yw(r){return r instanceof HTMLInputElement&&"select"in r}function qr(r,{select:a=!1}={}){if(r&&r.focus){const l=document.activeElement;r.focus({preventScroll:!0}),r!==l&&Yw(r)&&a&&r.select()}}var Jf=Gw();function Gw(){let r=[];return{add(a){const l=r[0];a!==l&&(l==null||l.pause()),r=Zf(r,a),r.unshift(a)},remove(a){var l;r=Zf(r,a),(l=r[0])==null||l.resume()}}}function Zf(r,a){const l=[...r],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}function Qw(r){return r.filter(a=>a.tagName!=="A")}var qw="Portal",wu=h.forwardRef((r,a)=>{var f;const{container:l,...o}=r,[c,d]=h.useState(!1);Zt(()=>d(!0),[]);const m=l||c&&((f=globalThis==null?void 0:globalThis.document)==null?void 0:f.body);return m?bv.createPortal(e.jsx(qe.div,{...o,ref:a}),m):null});wu.displayName=qw;function Xw(r,a){return h.useReducer((l,o)=>a[l][o]??l,r)}var Tl=r=>{const{present:a,children:l}=r,o=Jw(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),d=st(o.ref,Zw(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:d}):null};Tl.displayName="Presence";function Jw(r){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(r),d=h.useRef("none"),m=r?"mounted":"unmounted",[f,p]=Xw(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const y=Hi(o.current);d.current=f==="mounted"?y:"none"},[f]),Zt(()=>{const y=o.current,g=c.current;if(g!==r){const C=d.current,P=Hi(y);r?p("MOUNT"):P==="none"||(y==null?void 0:y.display)==="none"?p("UNMOUNT"):p(g&&C!==P?"ANIMATION_OUT":"UNMOUNT"),c.current=r}},[r,p]),Zt(()=>{if(a){let y;const g=a.ownerDocument.defaultView??window,v=P=>{const S=Hi(o.current).includes(CSS.escape(P.animationName));if(P.target===a&&S&&(p("ANIMATION_END"),!c.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",y=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},C=P=>{P.target===a&&(d.current=Hi(o.current))};return a.addEventListener("animationstart",C),a.addEventListener("animationcancel",v),a.addEventListener("animationend",v),()=>{g.clearTimeout(y),a.removeEventListener("animationstart",C),a.removeEventListener("animationcancel",v),a.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[a,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:h.useCallback(y=>{o.current=y?getComputedStyle(y):null,l(y)},[])}}function Hi(r){return(r==null?void 0:r.animationName)||"none"}function Zw(r){var o,c;let a=(o=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?r.ref:(a=(c=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?r.props.ref:r.props.ref||r.ref)}var Pd=0;function hp(){h.useEffect(()=>{const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",r[0]??ex()),document.body.insertAdjacentElement("beforeend",r[1]??ex()),Pd++,()=>{Pd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(a=>a.remove()),Pd--}},[])}function ex(){const r=document.createElement("span");return r.setAttribute("data-radix-focus-guard",""),r.tabIndex=0,r.style.outline="none",r.style.opacity="0",r.style.position="fixed",r.style.pointerEvents="none",r}var Xs=function(){return Xs=Object.assign||function(a){for(var l,o=1,c=arguments.length;o"u")return p1;var a=g1(r),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])}},v1=pp(),Na="data-scroll-locked",j1=function(r,a,l,o){var c=r.left,d=r.top,m=r.right,f=r.gap;return l===void 0&&(l="margin"),` + .`.concat(t1,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(f,"px ").concat(o,`; + } + body[`).concat(Na,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&` + padding-left: `.concat(c,`px; + padding-top: `).concat(d,`px; + padding-right: `).concat(m,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(f,"px ").concat(o,`; + `),l==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(Ji,` { + right: `).concat(f,"px ").concat(o,`; + } + + .`).concat(Zi,` { + margin-right: `).concat(f,"px ").concat(o,`; + } + + .`).concat(Ji," .").concat(Ji,` { + right: 0 `).concat(o,`; + } + + .`).concat(Zi," .").concat(Zi,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Na,`] { + `).concat(s1,": ").concat(f,`px; + } +`)},sx=function(){var r=parseInt(document.body.getAttribute(Na)||"0",10);return isFinite(r)?r:0},b1=function(){h.useEffect(function(){return document.body.setAttribute(Na,(sx()+1).toString()),function(){var r=sx()-1;r<=0?document.body.removeAttribute(Na):document.body.setAttribute(Na,r.toString())}},[])},N1=function(r){var a=r.noRelative,l=r.noImportant,o=r.gapMode,c=o===void 0?"margin":o;b1();var d=h.useMemo(function(){return y1(c)},[c]);return h.createElement(v1,{styles:j1(d,!a,c,l?"":"!important")})},Xd=!1;if(typeof window<"u")try{var Ki=Object.defineProperty({},"passive",{get:function(){return Xd=!0,!0}});window.addEventListener("test",Ki,Ki),window.removeEventListener("test",Ki,Ki)}catch{Xd=!1}var xa=Xd?{passive:!1}:!1,w1=function(r){return r.tagName==="TEXTAREA"},gp=function(r,a){if(!(r instanceof Element))return!1;var l=window.getComputedStyle(r);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!w1(r)&&l[a]==="visible")},S1=function(r){return gp(r,"overflowY")},C1=function(r){return gp(r,"overflowX")},rx=function(r,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=yp(r,o);if(c){var d=vp(r,o),m=d[1],f=d[2];if(m>f)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},k1=function(r){var a=r.scrollTop,l=r.scrollHeight,o=r.clientHeight;return[a,l,o]},E1=function(r){var a=r.scrollLeft,l=r.scrollWidth,o=r.clientWidth;return[a,l,o]},yp=function(r,a){return r==="v"?S1(a):C1(a)},vp=function(r,a){return r==="v"?k1(a):E1(a)},P1=function(r,a){return r==="h"&&a==="rtl"?-1:1},R1=function(r,a,l,o,c){var d=P1(r,window.getComputedStyle(a).direction),m=d*o,f=l.target,p=a.contains(f),y=!1,g=m>0,v=0,C=0;do{if(!f)break;var P=vp(r,f),R=P[0],S=P[1],b=P[2],N=S-b-d*R;(R||N)&&yp(r,f)&&(v+=N,C+=R);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!p&&f!==document.body||p&&(a.contains(f)||a===f));return(g&&Math.abs(v)<1||!g&&Math.abs(C)<1)&&(y=!0),y},Yi=function(r){return"changedTouches"in r?[r.changedTouches[0].clientX,r.changedTouches[0].clientY]:[0,0]},nx=function(r){return[r.deltaX,r.deltaY]},ax=function(r){return r&&"current"in r?r.current:r},T1=function(r,a){return r[0]===a[0]&&r[1]===a[1]},I1=function(r){return` + .block-interactivity-`.concat(r,` {pointer-events: none;} + .allow-interactivity-`).concat(r,` {pointer-events: all;} +`)},_1=0,pa=[];function M1(r){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(_1++)[0],d=h.useState(pp)[0],m=h.useRef(r);h.useEffect(function(){m.current=r},[r]),h.useEffect(function(){if(r.inert){document.body.classList.add("block-interactivity-".concat(c));var S=e1([r.lockRef.current],(r.shards||[]).map(ax),!0).filter(Boolean);return S.forEach(function(b){return b.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),S.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(c))})}}},[r.inert,r.lockRef.current,r.shards]);var f=h.useCallback(function(S,b){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!m.current.allowPinchZoom;var N=Yi(S),E=l.current,j="deltaX"in S?S.deltaX:E[0]-N[0],T="deltaY"in S?S.deltaY:E[1]-N[1],B,U=S.target,k=Math.abs(j)>Math.abs(T)?"h":"v";if("touches"in S&&k==="h"&&U.type==="range")return!1;var A=window.getSelection(),_=A&&A.anchorNode,re=_?_===U||_.contains(U):!1;if(re)return!1;var ae=rx(k,U);if(!ae)return!0;if(ae?B=k:(B=k==="v"?"h":"v",ae=rx(k,U)),!ae)return!1;if(!o.current&&"changedTouches"in S&&(j||T)&&(o.current=B),!B)return!0;var le=o.current||B;return R1(le,b,S,le==="h"?j:T)},[]),p=h.useCallback(function(S){var b=S;if(!(!pa.length||pa[pa.length-1]!==d)){var N="deltaY"in b?nx(b):Yi(b),E=a.current.filter(function(B){return B.name===b.type&&(B.target===b.target||b.target===B.shadowParent)&&T1(B.delta,N)})[0];if(E&&E.should){b.cancelable&&b.preventDefault();return}if(!E){var j=(m.current.shards||[]).map(ax).filter(Boolean).filter(function(B){return B.contains(b.target)}),T=j.length>0?f(b,j[0]):!m.current.noIsolation;T&&b.cancelable&&b.preventDefault()}}},[]),y=h.useCallback(function(S,b,N,E){var j={name:S,delta:b,target:N,should:E,shadowParent:A1(N)};a.current.push(j),setTimeout(function(){a.current=a.current.filter(function(T){return T!==j})},1)},[]),g=h.useCallback(function(S){l.current=Yi(S),o.current=void 0},[]),v=h.useCallback(function(S){y(S.type,nx(S),S.target,f(S,r.lockRef.current))},[]),C=h.useCallback(function(S){y(S.type,Yi(S),S.target,f(S,r.lockRef.current))},[]);h.useEffect(function(){return pa.push(d),r.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:C}),document.addEventListener("wheel",p,xa),document.addEventListener("touchmove",p,xa),document.addEventListener("touchstart",g,xa),function(){pa=pa.filter(function(S){return S!==d}),document.removeEventListener("wheel",p,xa),document.removeEventListener("touchmove",p,xa),document.removeEventListener("touchstart",g,xa)}},[]);var P=r.removeScrollBar,R=r.inert;return h.createElement(h.Fragment,null,R?h.createElement(d,{styles:I1(c)}):null,P?h.createElement(N1,{noRelative:r.noRelative,gapMode:r.gapMode}):null)}function A1(r){for(var a=null;r!==null;)r instanceof ShadowRoot&&(a=r.host,r=r.host),r=r.parentNode;return a}const D1=c1(xp,M1);var Su=h.forwardRef(function(r,a){return h.createElement(bo,Xs({},r,{ref:a,sideCar:D1}))});Su.classNames=bo.classNames;var L1=function(r){if(typeof document>"u")return null;var a=Array.isArray(r)?r[0]:r;return a.ownerDocument.body},ga=new WeakMap,Gi=new WeakMap,Qi={},_d=0,jp=function(r){return r&&(r.host||jp(r.parentNode))},O1=function(r,a){return a.map(function(l){if(r.contains(l))return l;var o=jp(l);return o&&r.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",r,". Doing nothing"),null)}).filter(function(l){return!!l})},F1=function(r,a,l,o){var c=O1(a,Array.isArray(r)?r:[r]);Qi[l]||(Qi[l]=new WeakMap);var d=Qi[l],m=[],f=new Set,p=new Set(c),y=function(v){!v||f.has(v)||(f.add(v),y(v.parentNode))};c.forEach(y);var g=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(C){if(f.has(C))g(C);else try{var P=C.getAttribute(o),R=P!==null&&P!=="false",S=(ga.get(C)||0)+1,b=(d.get(C)||0)+1;ga.set(C,S),d.set(C,b),m.push(C),S===1&&R&&Gi.set(C,!0),b===1&&C.setAttribute(l,"true"),R||C.setAttribute(o,"true")}catch(N){console.error("aria-hidden: cannot operate on ",C,N)}})};return g(a),f.clear(),_d++,function(){m.forEach(function(v){var C=ga.get(v)-1,P=d.get(v)-1;ga.set(v,C),d.set(v,P),C||(Gi.has(v)||v.removeAttribute(o),Gi.delete(v)),P||v.removeAttribute(l)}),_d--,_d||(ga=new WeakMap,ga=new WeakMap,Gi=new WeakMap,Qi={})}},bp=function(r,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(r)?r:[r]),c=L1(r);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),F1(o,c,l,"aria-hidden")):function(){return null}},No="Dialog",[Np]=dn(No),[z1,Bs]=Np(No),wp=r=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:d,modal:m=!0}=r,f=h.useRef(null),p=h.useRef(null),[y,g]=An({prop:o,defaultProp:c??!1,onChange:d,caller:No});return e.jsx(z1,{scope:a,triggerRef:f,contentRef:p,contentId:sn(),titleId:sn(),descriptionId:sn(),open:y,onOpenChange:g,onOpenToggle:h.useCallback(()=>g(v=>!v),[g]),modal:m,children:l})};wp.displayName=No;var Sp="DialogTrigger",$1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Bs(Sp,l),d=st(a,c.triggerRef);return e.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Eu(c.open),...o,ref:d,onClick:He(r.onClick,c.onOpenToggle)})});$1.displayName=Sp;var Cu="DialogPortal",[B1,Cp]=Np(Cu,{forceMount:void 0}),kp=r=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=r,d=Bs(Cu,a);return e.jsx(B1,{scope:a,forceMount:l,children:h.Children.map(o,m=>e.jsx(Tl,{present:l||d.open,children:e.jsx(wu,{asChild:!0,container:c,children:m})}))})};kp.displayName=Cu;var oo="DialogOverlay",Ep=h.forwardRef((r,a)=>{const l=Cp(oo,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Bs(oo,r.__scopeDialog);return d.modal?e.jsx(Tl,{present:o||d.open,children:e.jsx(V1,{...c,ref:a})}):null});Ep.displayName=oo;var U1=kl("DialogOverlay.RemoveScroll"),V1=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Bs(oo,l);return e.jsx(Su,{as:U1,allowPinchZoom:!0,shards:[c.contentRef],children:e.jsx(qe.div,{"data-state":Eu(c.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})}),Dn="DialogContent",Pp=h.forwardRef((r,a)=>{const l=Cp(Dn,r.__scopeDialog),{forceMount:o=l.forceMount,...c}=r,d=Bs(Dn,r.__scopeDialog);return e.jsx(Tl,{present:o||d.open,children:d.modal?e.jsx(W1,{...c,ref:a}):e.jsx(H1,{...c,ref:a})})});Pp.displayName=Dn;var W1=h.forwardRef((r,a)=>{const l=Bs(Dn,r.__scopeDialog),o=h.useRef(null),c=st(a,l.contentRef,o);return h.useEffect(()=>{const d=o.current;if(d)return bp(d)},[]),e.jsx(Rp,{...r,ref:c,trapFocus:l.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:He(r.onCloseAutoFocus,d=>{var m;d.preventDefault(),(m=l.triggerRef.current)==null||m.focus()}),onPointerDownOutside:He(r.onPointerDownOutside,d=>{const m=d.detail.originalEvent,f=m.button===0&&m.ctrlKey===!0;(m.button===2||f)&&d.preventDefault()}),onFocusOutside:He(r.onFocusOutside,d=>d.preventDefault())})}),H1=h.forwardRef((r,a)=>{const l=Bs(Dn,r.__scopeDialog),o=h.useRef(!1),c=h.useRef(!1);return e.jsx(Rp,{...r,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var m,f;(m=r.onCloseAutoFocus)==null||m.call(r,d),d.defaultPrevented||(o.current||(f=l.triggerRef.current)==null||f.focus(),d.preventDefault()),o.current=!1,c.current=!1},onInteractOutside:d=>{var p,y;(p=r.onInteractOutside)==null||p.call(r,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const m=d.target;((y=l.triggerRef.current)==null?void 0:y.contains(m))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&c.current&&d.preventDefault()}})}),Rp=h.forwardRef((r,a)=>{const{__scopeDialog:l,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:d,...m}=r,f=Bs(Dn,l),p=h.useRef(null),y=st(a,p);return hp(),e.jsxs(e.Fragment,{children:[e.jsx(Nu,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:c,onUnmountAutoFocus:d,children:e.jsx(bu,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Eu(f.open),...m,ref:y,onDismiss:()=>f.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(K1,{titleId:f.titleId}),e.jsx(G1,{contentRef:p,descriptionId:f.descriptionId})]})]})}),ku="DialogTitle",Tp=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Bs(ku,l);return e.jsx(qe.h2,{id:c.titleId,...o,ref:a})});Tp.displayName=ku;var Ip="DialogDescription",_p=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Bs(Ip,l);return e.jsx(qe.p,{id:c.descriptionId,...o,ref:a})});_p.displayName=Ip;var Mp="DialogClose",Ap=h.forwardRef((r,a)=>{const{__scopeDialog:l,...o}=r,c=Bs(Mp,l);return e.jsx(qe.button,{type:"button",...o,ref:a,onClick:He(r.onClick,()=>c.onOpenChange(!1))})});Ap.displayName=Mp;function Eu(r){return r?"open":"closed"}var Dp="DialogTitleWarning",[UC,Lp]=bw(Dp,{contentName:Dn,titleName:ku,docsSlug:"dialog"}),K1=({titleId:r})=>{const a=Lp(Dp),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(()=>{r&&(document.getElementById(r)||console.error(l))},[l,r]),null},Y1="DialogDescriptionWarning",G1=({contentRef:r,descriptionId:a})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lp(Y1).contentName}}.`;return h.useEffect(()=>{var d;const c=(d=r.current)==null?void 0:d.getAttribute("aria-describedby");a&&c&&(document.getElementById(a)||console.warn(o))},[o,r,a]),null},Q1=wp,q1=kp,X1=Ep,J1=Pp,Z1=Tp,e2=_p,t2=Ap;function wt(r){return e.jsx(Q1,{"data-slot":"dialog",...r})}function s2(r){return e.jsx(q1,{...r})}const Op=h.forwardRef(({className:r,...a},l)=>e.jsx(X1,{ref:l,className:rt("fixed inset-0 z-50 bg-black/50",r),...a}));Op.displayName="DialogOverlay";const jt=h.forwardRef(({className:r,children:a,showCloseButton:l=!0,...o},c)=>e.jsxs(s2,{children:[e.jsx(Op,{}),e.jsxs(J1,{ref:c,"aria-describedby":void 0,className:rt("fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border bg-background p-6 shadow-lg sm:max-w-lg",r),...o,children:[a,l&&e.jsxs(t2,{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:[e.jsx(ys,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jt.displayName="DialogContent";function St({className:r,...a}){return e.jsx("div",{className:rt("flex flex-col gap-2 text-center sm:text-left",r),...a})}function zt({className:r,...a}){return e.jsx("div",{className:rt("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",r),...a})}function Ct(r){return e.jsx(Z1,{className:"text-lg font-semibold leading-none",...r})}function r2(r){return e.jsx(e2,{className:"text-sm text-muted-foreground",...r})}function co(r,a){const[l,o]=h.useState(r);return h.useEffect(()=>{const c=setTimeout(()=>o(r),a);return()=>clearTimeout(c)},[r,a]),l}function Fs({page:r,totalPages:a,total:l,pageSize:o,onPageChange:c,onPageSizeChange:d,pageSizeOptions:m=[10,20,50,100]}){return a<=1&&!d?null:e.jsxs("div",{className:"flex items-center justify-between gap-4 py-4 px-5 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[e.jsxs("span",{children:["共 ",l," 条"]}),d&&e.jsx("select",{value:o,onChange:f=>d(Number(f.target.value)),className:"bg-[#0f2137] border border-gray-600 rounded px-2 py-1 text-gray-300 text-sm",children:m.map(f=>e.jsxs("option",{value:f,children:[f," 条/页"]},f))})]}),a>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>c(1),disabled:r<=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:"首页"}),e.jsx("button",{type:"button",onClick:()=>c(r-1),disabled:r<=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:"上一页"}),e.jsxs("span",{className:"px-3 py-1 text-gray-400 text-sm",children:[r," / ",a]}),e.jsx("button",{type:"button",onClick:()=>c(r+1),disabled:r>=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:"下一页"}),e.jsx("button",{type:"button",onClick:()=>c(a),disabled:r>=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 n2(){const[r,a]=h.useState([]),[l,o]=h.useState([]),[c,d]=h.useState(0),[m,f]=h.useState(0),[p,y]=h.useState(0),[g,v]=h.useState(1),[C,P]=h.useState(10),[R,S]=h.useState(""),b=co(R,300),[N,E]=h.useState("all"),[j,T]=h.useState(!0),[B,U]=h.useState(null),[k,A]=h.useState(null),[_,re]=h.useState(""),[ae,le]=h.useState(!1);async function se(){T(!0),U(null);try{const K=N==="all"?"":N==="completed"?"completed":N,M=new URLSearchParams({page:String(g),pageSize:String(C),...K&&{status:K},...b&&{search:b}}),[L,O]=await Promise.all([Ue(`/api/orders?${M}`),Ue("/api/db/users?page=1&pageSize=500")]);L!=null&&L.success&&(a(L.orders||[]),d(L.total??0),f(L.totalRevenue??0),y(L.todayRevenue??0)),O!=null&&O.success&&O.users&&o(O.users)}catch(K){console.error("加载订单失败",K),U("加载订单失败,请检查网络后重试")}finally{T(!1)}}h.useEffect(()=>{v(1)},[b,N]),h.useEffect(()=>{se()},[g,C,b,N]);const G=K=>{var M;return K.userNickname||((M=l.find(L=>L.id===K.userId))==null?void 0:M.nickname)||"匿名用户"},q=K=>{var M;return((M=l.find(L=>L.id===K))==null?void 0:M.phone)||"-"},ce=K=>{const M=K.productType||K.type||"",L=K.description||"";if(L){if(M==="section"&&L.includes("章节")){if(L.includes("-")){const O=L.split("-");if(O.length>=3)return{name:`第${O[1]}章 第${O[2]}节`,type:"《一场Soul的创业实验》"}}return{name:L,type:"章节购买"}}return M==="fullbook"||L.includes("全书")?{name:"《一场Soul的创业实验》",type:"全书购买"}:M==="vip"||L.includes("VIP")?{name:"VIP年度会员",type:"VIP"}:M==="match"||L.includes("伙伴")?{name:"找伙伴匹配",type:"功能服务"}:{name:L,type:"其他"}}return M==="section"?{name:`章节 ${K.productId||K.sectionId||""}`,type:"单章"}:M==="fullbook"?{name:"《一场Soul的创业实验》",type:"全书"}:M==="vip"?{name:"VIP年度会员",type:"VIP"}:M==="match"?{name:"找伙伴匹配",type:"功能"}:{name:"未知商品",type:M||"其他"}},je=Math.ceil(c/C)||1;async function $(){var K;if(!(!(k!=null&&k.orderSn)&&!(k!=null&&k.id))){le(!0),U(null);try{const M=await vt("/api/admin/orders/refund",{orderSn:k.orderSn||k.id,reason:_||void 0});M!=null&&M.success?(A(null),re(""),se()):U((M==null?void 0:M.error)||"退款失败")}catch(M){const L=M;U(((K=L==null?void 0:L.data)==null?void 0:K.error)||"退款失败,请检查网络后重试")}finally{le(!1)}}}function oe(){if(r.length===0){alert("暂无数据可导出");return}const K=["订单号","用户","手机号","商品","金额","支付方式","状态","退款原因","分销佣金","下单时间"],M=r.map(ue=>{const Y=ce(ue);return[ue.orderSn||ue.id||"",G(ue),q(ue.userId),Y.name,Number(ue.amount||0).toFixed(2),ue.paymentMethod==="wechat"?"微信支付":ue.paymentMethod==="alipay"?"支付宝":ue.paymentMethod||"微信支付",ue.status==="refunded"?"已退款":ue.status==="paid"||ue.status==="completed"?"已完成":ue.status==="pending"||ue.status==="created"?"待支付":"已失败",ue.status==="refunded"&&ue.refundReason?ue.refundReason:"-",ue.referrerEarnings?Number(ue.referrerEarnings).toFixed(2):"-",ue.createdAt?new Date(ue.createdAt).toLocaleString("zh-CN"):""].join(",")}),L="\uFEFF"+[K.join(","),...M].join(` +`),O=new Blob([L],{type:"text/csv;charset=utf-8"}),X=URL.createObjectURL(O),H=document.createElement("a");H.href=X,H.download=`订单列表_${new Date().toISOString().slice(0,10)}.csv`,H.click(),URL.revokeObjectURL(X)}return e.jsxs("div",{className:"p-8 w-full",children:[B&&e.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:[e.jsx("span",{children:B}),e.jsx("button",{type:"button",onClick:()=>U(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"订单管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",r.length," 笔订单"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(J,{variant:"outline",onClick:se,disabled:j,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${j?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"text-gray-400",children:"总收入:"}),e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",m.toFixed(2)]}),e.jsx("span",{className:"text-gray-600",children:"|"}),e.jsx("span",{className:"text-gray-400",children:"今日:"}),e.jsxs("span",{className:"text-[#FFD700] font-bold",children:["¥",p.toFixed(2)]})]})]})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1 max-w-md",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ie,{type:"text",placeholder:"搜索订单号/用户/章节...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:R,onChange:K=>S(K.target.value)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ob,{className:"w-4 h-4 text-gray-400"}),e.jsxs("select",{value:N,onChange:K=>E(K.target.value),className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"created",children:"已创建"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsxs(J,{variant:"outline",onClick:oe,disabled:r.length===0,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(sb,{className:"w-4 h-4 mr-2"}),"导出 CSV"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:j?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"订单号"}),e.jsx(be,{className:"text-gray-400",children:"用户"}),e.jsx(be,{className:"text-gray-400",children:"商品"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"支付方式"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"退款原因"}),e.jsx(be,{className:"text-gray-400",children:"分销佣金"}),e.jsx(be,{className:"text-gray-400",children:"下单时间"}),e.jsx(be,{className:"text-gray-400",children:"操作"})]})}),e.jsxs(ns,{children:[r.map(K=>{const M=ce(K);return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsxs(fe,{className:"font-mono text-xs text-gray-400",children:[(K.orderSn||K.id||"").slice(0,12),"..."]}),e.jsx(fe,{children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:G(K)}),e.jsx("p",{className:"text-gray-500 text-xs",children:q(K.userId)})]})}),e.jsx(fe,{children:e.jsxs("div",{children:[e.jsxs("p",{className:"text-white text-sm flex items-center gap-2",children:[M.name,(K.productType||K.type)==="vip"&&e.jsx(De,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0 text-xs",children:"VIP"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:M.type})]})}),e.jsxs(fe,{className:"text-[#38bdac] font-bold",children:["¥",Number(K.amount||0).toFixed(2)]}),e.jsx(fe,{className:"text-gray-300",children:K.paymentMethod==="wechat"?"微信支付":K.paymentMethod==="alipay"?"支付宝":K.paymentMethod||"微信支付"}),e.jsx(fe,{children:K.status==="refunded"?e.jsx(De,{className:"bg-gray-500/20 text-gray-400 hover:bg-gray-500/20 border-0",children:"已退款"}):K.status==="paid"||K.status==="completed"?e.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"}):K.status==="pending"||K.status==="created"?e.jsx(De,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:"待支付"}):e.jsx(De,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已失败"})}),e.jsx(fe,{className:"text-gray-400 text-sm max-w-[120px] truncate",title:K.refundReason,children:K.status==="refunded"&&K.refundReason?K.refundReason:"-"}),e.jsx(fe,{className:"text-[#FFD700]",children:K.referrerEarnings?`¥${Number(K.referrerEarnings).toFixed(2)}`:"-"}),e.jsx(fe,{className:"text-gray-400 text-sm",children:new Date(K.createdAt).toLocaleString("zh-CN")}),e.jsx(fe,{children:(K.status==="paid"||K.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{A(K),re("")},children:[e.jsx(Wx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},K.id)}),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:10,className:"text-center py-12 text-gray-500",children:"暂无订单数据"})})]})]}),e.jsx(Fs,{page:g,totalPages:je,total:c,pageSize:C,onPageChange:v,onPageSizeChange:K=>{P(K),v(1)}})]})})}),e.jsx(wt,{open:!!k,onOpenChange:K=>!K&&A(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),k&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",k.orderSn||k.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",Number(k.amount||0).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:_,onChange:K=>re(K.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>A(null),disabled:ae,children:"取消"}),e.jsx(J,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:$,disabled:ae,children:ae?"退款中...":"确认退款"})]})]})})]})}var a2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],l2=a2.reduce((r,a)=>{const l=Kx(`Primitive.${a}`),o=h.forwardRef((c,d)=>{const{asChild:m,...f}=c,p=m?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(p,{...f,ref:d})});return o.displayName=`Primitive.${a}`,{...r,[a]:o}},{}),i2="Label",Fp=h.forwardRef((r,a)=>e.jsx(l2.label,{...r,ref:a,onMouseDown:l=>{var c;l.target.closest("button, input, select, textarea")||((c=r.onMouseDown)==null||c.call(r,l),!l.defaultPrevented&&l.detail>1&&l.preventDefault())}}));Fp.displayName=i2;var zp=Fp;const te=h.forwardRef(({className:r,...a},l)=>e.jsx(zp,{ref:l,className:rt("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",r),...a}));te.displayName=zp.displayName;function Pu(r){const a=r+"CollectionProvider",[l,o]=dn(a),[c,d]=l(a,{collectionRef:{current:null},itemMap:new Map}),m=S=>{const{scope:b,children:N}=S,E=Gr.useRef(null),j=Gr.useRef(new Map).current;return e.jsx(c,{scope:b,itemMap:j,collectionRef:E,children:N})};m.displayName=a;const f=r+"CollectionSlot",p=kl(f),y=Gr.forwardRef((S,b)=>{const{scope:N,children:E}=S,j=d(f,N),T=st(b,j.collectionRef);return e.jsx(p,{ref:T,children:E})});y.displayName=f;const g=r+"CollectionItemSlot",v="data-radix-collection-item",C=kl(g),P=Gr.forwardRef((S,b)=>{const{scope:N,children:E,...j}=S,T=Gr.useRef(null),B=st(b,T),U=d(g,N);return Gr.useEffect(()=>(U.itemMap.set(T,{ref:T,...j}),()=>void U.itemMap.delete(T))),e.jsx(C,{[v]:"",ref:B,children:E})});P.displayName=g;function R(S){const b=d(r+"CollectionConsumer",S);return Gr.useCallback(()=>{const E=b.collectionRef.current;if(!E)return[];const j=Array.from(E.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((U,k)=>j.indexOf(U.ref.current)-j.indexOf(k.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:m,Slot:y,ItemSlot:P},R,o]}var o2=h.createContext(void 0);function wo(r){const a=h.useContext(o2);return r||a||"ltr"}var Md="rovingFocusGroup.onEntryFocus",c2={bubbles:!1,cancelable:!0},Il="RovingFocusGroup",[Jd,$p,d2]=Pu(Il),[u2,Bp]=dn(Il,[d2]),[h2,m2]=u2(Il),Up=h.forwardRef((r,a)=>e.jsx(Jd.Provider,{scope:r.__scopeRovingFocusGroup,children:e.jsx(Jd.Slot,{scope:r.__scopeRovingFocusGroup,children:e.jsx(f2,{...r,ref:a})})}));Up.displayName=Il;var f2=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,orientation:o,loop:c=!1,dir:d,currentTabStopId:m,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:p,onEntryFocus:y,preventScrollOnEntryFocus:g=!1,...v}=r,C=h.useRef(null),P=st(a,C),R=wo(d),[S,b]=An({prop:m,defaultProp:f??null,onChange:p,caller:Il}),[N,E]=h.useState(!1),j=nn(y),T=$p(l),B=h.useRef(!1),[U,k]=h.useState(0);return h.useEffect(()=>{const A=C.current;if(A)return A.addEventListener(Md,j),()=>A.removeEventListener(Md,j)},[j]),e.jsx(h2,{scope:l,orientation:o,dir:R,loop:c,currentTabStopId:S,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>E(!0),[]),onFocusableItemAdd:h.useCallback(()=>k(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>k(A=>A-1),[]),children:e.jsx(qe.div,{tabIndex:N||U===0?-1:0,"data-orientation":o,...v,ref:P,style:{outline:"none",...r.style},onMouseDown:He(r.onMouseDown,()=>{B.current=!0}),onFocus:He(r.onFocus,A=>{const _=!B.current;if(A.target===A.currentTarget&&_&&!N){const re=new CustomEvent(Md,c2);if(A.currentTarget.dispatchEvent(re),!re.defaultPrevented){const ae=T().filter(ce=>ce.focusable),le=ae.find(ce=>ce.active),se=ae.find(ce=>ce.id===S),q=[le,se,...ae].filter(Boolean).map(ce=>ce.ref.current);Hp(q,g)}}B.current=!1}),onBlur:He(r.onBlur,()=>E(!1))})})}),Vp="RovingFocusGroupItem",Wp=h.forwardRef((r,a)=>{const{__scopeRovingFocusGroup:l,focusable:o=!0,active:c=!1,tabStopId:d,children:m,...f}=r,p=sn(),y=d||p,g=m2(Vp,l),v=g.currentTabStopId===y,C=$p(l),{onFocusableItemAdd:P,onFocusableItemRemove:R,currentTabStopId:S}=g;return h.useEffect(()=>{if(o)return P(),()=>R()},[o,P,R]),e.jsx(Jd.ItemSlot,{scope:l,id:y,focusable:o,active:c,children:e.jsx(qe.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...f,ref:a,onMouseDown:He(r.onMouseDown,b=>{o?g.onItemFocus(y):b.preventDefault()}),onFocus:He(r.onFocus,()=>g.onItemFocus(y)),onKeyDown:He(r.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){g.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const N=g2(b,g.orientation,g.dir);if(N!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let j=C().filter(T=>T.focusable).map(T=>T.ref.current);if(N==="last")j.reverse();else if(N==="prev"||N==="next"){N==="prev"&&j.reverse();const T=j.indexOf(b.currentTarget);j=g.loop?y2(j,T+1):j.slice(T+1)}setTimeout(()=>Hp(j))}}),children:typeof m=="function"?m({isCurrentTabStop:v,hasTabStop:S!=null}):m})})});Wp.displayName=Vp;var x2={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function p2(r,a){return a!=="rtl"?r:r==="ArrowLeft"?"ArrowRight":r==="ArrowRight"?"ArrowLeft":r}function g2(r,a,l){const o=p2(r.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return x2[o]}function Hp(r,a=!1){const l=document.activeElement;for(const o of r)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}function y2(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var v2=Up,j2=Wp,So="Tabs",[b2]=dn(So,[Bp]),Kp=Bp(),[N2,Ru]=b2(So),Yp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,onValueChange:c,defaultValue:d,orientation:m="horizontal",dir:f,activationMode:p="automatic",...y}=r,g=wo(f),[v,C]=An({prop:o,onChange:c,defaultProp:d??"",caller:So});return e.jsx(N2,{scope:l,baseId:sn(),value:v,onValueChange:C,orientation:m,dir:g,activationMode:p,children:e.jsx(qe.div,{dir:g,"data-orientation":m,...y,ref:a})})});Yp.displayName=So;var Gp="TabsList",Qp=h.forwardRef((r,a)=>{const{__scopeTabs:l,loop:o=!0,...c}=r,d=Ru(Gp,l),m=Kp(l);return e.jsx(v2,{asChild:!0,...m,orientation:d.orientation,dir:d.dir,loop:o,children:e.jsx(qe.div,{role:"tablist","aria-orientation":d.orientation,...c,ref:a})})});Qp.displayName=Gp;var qp="TabsTrigger",Xp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,disabled:c=!1,...d}=r,m=Ru(qp,l),f=Kp(l),p=e0(m.baseId,o),y=t0(m.baseId,o),g=o===m.value;return e.jsx(j2,{asChild:!0,...f,focusable:!c,active:g,children:e.jsx(qe.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":y,"data-state":g?"active":"inactive","data-disabled":c?"":void 0,disabled:c,id:p,...d,ref:a,onMouseDown:He(r.onMouseDown,v=>{!c&&v.button===0&&v.ctrlKey===!1?m.onValueChange(o):v.preventDefault()}),onKeyDown:He(r.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&m.onValueChange(o)}),onFocus:He(r.onFocus,()=>{const v=m.activationMode!=="manual";!g&&!c&&v&&m.onValueChange(o)})})})});Xp.displayName=qp;var Jp="TabsContent",Zp=h.forwardRef((r,a)=>{const{__scopeTabs:l,value:o,forceMount:c,children:d,...m}=r,f=Ru(Jp,l),p=e0(f.baseId,o),y=t0(f.baseId,o),g=o===f.value,v=h.useRef(g);return h.useEffect(()=>{const C=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(C)},[]),e.jsx(Tl,{present:c||g,children:({present:C})=>e.jsx(qe.div,{"data-state":g?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":p,hidden:!C,id:y,tabIndex:0,...m,ref:a,style:{...r.style,animationDuration:v.current?"0s":void 0},children:C&&d})})});Zp.displayName=Jp;function e0(r,a){return`${r}-trigger-${a}`}function t0(r,a){return`${r}-content-${a}`}var w2=Yp,s0=Qp,r0=Xp,n0=Zp;const _l=w2,_a=h.forwardRef(({className:r,...a},l)=>e.jsx(s0,{ref:l,className:rt("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",r),...a}));_a.displayName=s0.displayName;const _t=h.forwardRef(({className:r,...a},l)=>e.jsx(r0,{ref:l,className:rt("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",r),...a}));_t.displayName=r0.displayName;const Mt=h.forwardRef(({className:r,...a},l)=>e.jsx(n0,{ref:l,className:rt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r),...a}));Mt.displayName=n0.displayName;function Tu(r){const a=h.useRef({value:r,previous:r});return h.useMemo(()=>(a.current.value!==r&&(a.current.previous=a.current.value,a.current.value=r),a.current.previous),[r])}function Iu(r){const[a,l]=h.useState(void 0);return Zt(()=>{if(r){l({width:r.offsetWidth,height:r.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const d=c[0];let m,f;if("borderBoxSize"in d){const p=d.borderBoxSize,y=Array.isArray(p)?p[0]:p;m=y.inlineSize,f=y.blockSize}else m=r.offsetWidth,f=r.offsetHeight;l({width:m,height:f})});return o.observe(r,{box:"border-box"}),()=>o.unobserve(r)}else l(void 0)},[r]),a}var Co="Switch",[S2]=dn(Co),[C2,k2]=S2(Co),a0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,name:o,checked:c,defaultChecked:d,required:m,disabled:f,value:p="on",onCheckedChange:y,form:g,...v}=r,[C,P]=h.useState(null),R=st(a,j=>P(j)),S=h.useRef(!1),b=C?g||!!C.closest("form"):!0,[N,E]=An({prop:c,defaultProp:d??!1,onChange:y,caller:Co});return e.jsxs(C2,{scope:l,checked:N,disabled:f,children:[e.jsx(qe.button,{type:"button",role:"switch","aria-checked":N,"aria-required":m,"data-state":c0(N),"data-disabled":f?"":void 0,disabled:f,value:p,...v,ref:R,onClick:He(r.onClick,j=>{E(T=>!T),b&&(S.current=j.isPropagationStopped(),S.current||j.stopPropagation())})}),b&&e.jsx(o0,{control:C,bubbles:!S.current,name:o,value:p,checked:N,required:m,disabled:f,form:g,style:{transform:"translateX(-100%)"}})]})});a0.displayName=Co;var l0="SwitchThumb",i0=h.forwardRef((r,a)=>{const{__scopeSwitch:l,...o}=r,c=k2(l0,l);return e.jsx(qe.span,{"data-state":c0(c.checked),"data-disabled":c.disabled?"":void 0,...o,ref:a})});i0.displayName=l0;var E2="SwitchBubbleInput",o0=h.forwardRef(({__scopeSwitch:r,control:a,checked:l,bubbles:o=!0,...c},d)=>{const m=h.useRef(null),f=st(m,d),p=Tu(l),y=Iu(a);return h.useEffect(()=>{const g=m.current;if(!g)return;const v=window.HTMLInputElement.prototype,P=Object.getOwnPropertyDescriptor(v,"checked").set;if(p!==l&&P){const R=new Event("click",{bubbles:o});P.call(g,l),g.dispatchEvent(R)}},[p,l,o]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:l,...c,tabIndex:-1,ref:f,style:{...c.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});o0.displayName=E2;function c0(r){return r?"checked":"unchecked"}var d0=a0,P2=i0;const lt=h.forwardRef(({className:r,...a},l)=>e.jsx(d0,{className:rt("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#38bdac] focus-visible:ring-offset-2 focus-visible:ring-offset-[#0a1628] disabled:cursor-not-allowed disabled:opacity-50 data-[state=unchecked]:bg-gray-600 data-[state=checked]:bg-[#38bdac]",r),...a,ref:l,children:e.jsx(P2,{className:rt("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")})}));lt.displayName=d0.displayName;const rn=h.forwardRef(({className:r,...a},l)=>e.jsx("textarea",{className:rt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:l,...a}));rn.displayName="Textarea";function R2({open:r,onClose:a,userId:l,onUserUpdated:o}){var $e;const[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState(null),[C,P]=h.useState(!1),[R,S]=h.useState(!1),[b,N]=h.useState(!1),[E,j]=h.useState("info"),[T,B]=h.useState(""),[U,k]=h.useState(""),[A,_]=h.useState([]),[re,ae]=h.useState(""),[le,se]=h.useState(!1),[G,q]=h.useState(null),[ce,je]=h.useState(null),[$,oe]=h.useState(""),[K,M]=h.useState(!1),[L,O]=h.useState(null);h.useEffect(()=>{r&&l&&(j("info"),q(null),je(null),O(null),v(null),X())},[r,l]);async function X(){if(l){P(!0);try{const de=await Ue(`/api/db/users?id=${encodeURIComponent(l)}`);if(de!=null&&de.success&&de.user){const he=de.user;d(he),B(he.phone||""),k(he.nickname||""),oe(he.phone||"");try{_(typeof he.tags=="string"?JSON.parse(he.tags||"[]"):[])}catch{_([])}}try{const he=await Ue(`/api/user/track?userId=${encodeURIComponent(l)}&limit=50`);he!=null&&he.success&&he.tracks&&f(he.tracks)}catch{f([])}try{const he=await Ue(`/api/db/users/referrals?userId=${encodeURIComponent(l)}`);he!=null&&he.success&&he.referrals&&y(he.referrals)}catch{y([])}try{const he=await Ue(`/api/db/users/rfm-single?userId=${encodeURIComponent(l)}`);he!=null&&he.success&&he.rfm&&v(he.rfm)}catch{v(null)}}catch(de){console.error("Load user detail error:",de)}finally{P(!1)}}}async function H(){if(!(c!=null&&c.phone)){alert("用户未绑定手机号,无法同步");return}S(!0);try{const de=await bt("/api/ckb/sync",{action:"full_sync",phone:c.phone,userId:c.id});de!=null&&de.success?(alert("同步成功"),X()):alert("同步失败: "+(de==null?void 0:de.error))}catch(de){console.error("Sync CKB error:",de),alert("同步失败")}finally{S(!1)}}async function ue(){if(c){N(!0);try{const de={id:c.id,phone:T||void 0,nickname:U||void 0,tags:JSON.stringify(A)},he=await vt("/api/db/users",de);he!=null&&he.success?(alert("保存成功"),X(),o==null||o()):alert("保存失败: "+(he==null?void 0:he.error))}catch(de){console.error("Save user error:",de),alert("保存失败")}finally{N(!1)}}}const Y=()=>{re&&!A.includes(re)&&(_([...A,re]),ae(""))},ye=de=>_(A.filter(he=>he!==de));async function ve(){if(!$&&!(c!=null&&c.openId)){je("请输入手机号或确保用户已绑定 openId");return}se(!0),je(null),q(null);try{const de=new URLSearchParams;$&&de.set("phone",$),c!=null&&c.openId&&de.set("openId",c.openId);const he=await Ue(`/api/admin/shensheshou/query?${de}`);he!=null&&he.success&&he.data?q(he.data):je((he==null?void 0:he.error)||"未查询到数据,可能该用户未在神射手中收录")}catch(de){console.error("SSS query error:",de),je("请求失败,请检查神射手接口配置")}finally{se(!1)}}async function D(){if(c){M(!0),O(null);try{const de={users:[{phone:c.phone||"",name:c.nickname||"",openId:c.openId||"",tags:A}]},he=await bt("/api/admin/shensheshou/ingest",de);he!=null&&he.success&&he.data?O(he.data):O({error:(he==null?void 0:he.error)||"推送失败"})}catch(de){console.error("SSS ingest error:",de),O({error:"请求失败"})}finally{M(!1)}}}const pe=de=>{const We={view_chapter:tr,purchase:Kd,match:Gt,login:ba,register:ba,share:en,bind_phone:Hb,bind_wechat:Ob,fill_profile:wd,visit_page:Ui}[de]||Vd;return e.jsx(We,{className:"w-4 h-4"})},we=de=>({S:"bg-amber-500/20 text-amber-400",A:"bg-green-500/20 text-green-400",B:"bg-blue-500/20 text-blue-400",C:"bg-gray-500/20 text-gray-400",D:"bg-red-500/20 text-red-400"})[de]||"bg-gray-500/20 text-gray-400";return r?e.jsx(wt,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] overflow-hidden",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ba,{className:"w-5 h-5 text-[#38bdac]"}),"用户详情",(c==null?void 0:c.phone)&&e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 ml-2",children:"已绑定手机"}),(c==null?void 0:c.isVip)&&e.jsx(De,{className:"bg-amber-500/20 text-amber-400 border-0",children:"VIP"})]})}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):c?e.jsxs("div",{className:"flex flex-col h-[75vh]",children:[e.jsxs("div",{className:"flex items-center gap-4 p-4 bg-[#0a1628] rounded-lg mb-3",children:[e.jsx("div",{className:"w-16 h-16 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-2xl text-[#38bdac] shrink-0",children:c.avatar?e.jsx("img",{src:c.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):(($e=c.nickname)==null?void 0:$e.charAt(0))||"?"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"text-lg font-bold text-white",children:c.nickname}),c.isAdmin&&e.jsx(De,{className:"bg-purple-500/20 text-purple-400 border-0",children:"管理员"}),c.hasFullBook&&e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0",children:"全书已购"}),c.vipRole&&e.jsx(De,{className:"bg-amber-500/20 text-amber-400 border-0",children:c.vipRole})]}),e.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[c.phone?`📱 ${c.phone}`:"未绑定手机",c.wechatId&&` · 💬 ${c.wechatId}`,c.mbti&&` · ${c.mbti}`]}),e.jsxs("div",{className:"flex items-center gap-4 mt-1",children:[e.jsxs("p",{className:"text-gray-600 text-xs",children:["ID: ",c.id.slice(0,16),"…"]}),c.referralCode&&e.jsxs("p",{className:"text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"推广码:"}),e.jsx("code",{className:"text-[#38bdac] bg-[#38bdac]/10 px-1.5 py-0.5 rounded",children:c.referralCode})]})]})]}),e.jsxs("div",{className:"text-right shrink-0",children:[e.jsxs("p",{className:"text-[#38bdac] font-bold text-lg",children:["¥",(c.earnings||0).toFixed(2)]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计收益"}),g&&e.jsx("div",{className:"mt-1",children:e.jsxs(De,{className:`border-0 text-xs ${we(g.rfmLevel)}`,children:["RFM ",g.rfmLevel," 级 · ",g.rfmScore,"分"]})})]})]}),e.jsxs(_l,{value:E,onValueChange:j,className:"flex-1 flex flex-col overflow-hidden",children:[e.jsxs(_a,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-3 flex-wrap h-auto gap-1",children:[e.jsx(_t,{value:"info",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"基础信息"}),e.jsxs(_t,{value:"rfm",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(Zs,{className:"w-3 h-3 mr-1"}),"RFM估值"]}),e.jsx(_t,{value:"tags",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"标签体系"}),e.jsxs(_t,{value:"journey",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(Ui,{className:"w-3 h-3 mr-1"}),"用户旅程"]}),e.jsx(_t,{value:"relations",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:"关系链路"}),e.jsxs(_t,{value:"shensheshou",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-xs",children:[e.jsx(Jr,{className:"w-3 h-3 mr-1"}),"神射手"]})]}),e.jsxs(Mt,{value:"info",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入手机号",value:T,onChange:de=>B(de.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入昵称",value:U,onChange:de=>k(de.target.value)})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.openId&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"微信 OpenID"}),e.jsx("p",{className:"text-gray-300 font-mono text-xs break-all",children:c.openId})]}),c.region&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Vx,{className:"w-4 h-4 text-gray-500"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs",children:"地区"}),e.jsx("p",{className:"text-white",children:c.region})]})]}),c.industry&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"行业"}),e.jsx("p",{className:"text-white",children:c.industry})]}),c.position&&e.jsxs("div",{className:"p-3 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"职位"}),e.jsx("p",{className:"text-white",children:c.position})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"推荐人数"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:c.referralCount??0})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"待提现"}),e.jsxs("p",{className:"text-2xl font-bold text-yellow-400",children:["¥",(c.pendingEarnings??0).toFixed(2)]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"创建时间"}),e.jsx("p",{className:"text-sm text-white",children:c.createdAt?new Date(c.createdAt).toLocaleDateString():"-"})]})]}),c.isVip&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-amber-500/20",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Rl,{className:"w-4 h-4 text-amber-400"}),e.jsx("span",{className:"text-white font-medium",children:"VIP 信息"}),e.jsx(De,{className:"bg-amber-500/20 text-amber-400 border-0 text-xs",children:c.vipRole||"VIP"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.vipName&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"展示名:"}),e.jsx("span",{className:"text-white",children:c.vipName})]}),c.vipProject&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"项目:"}),e.jsx("span",{className:"text-white",children:c.vipProject})]}),c.vipContact&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"联系方式:"}),e.jsx("span",{className:"text-white",children:c.vipContact})]}),c.vipExpireDate&&e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"到期时间:"}),e.jsx("span",{className:"text-white",children:new Date(c.vipExpireDate).toLocaleDateString()})]})]}),c.vipBio&&e.jsx("p",{className:"text-gray-400 text-sm mt-2",children:c.vipBio})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(en,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝同步"})]}),e.jsx(J,{size:"sm",onClick:H,disabled:R||!c.phone,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:R?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 同步中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1"})," 同步数据"]})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"同步状态:"}),c.ckbSyncedAt?e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 ml-1",children:"已同步"}):e.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0 ml-1",children:"未同步"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-gray-500",children:"最后同步:"}),e.jsx("span",{className:"text-gray-300 ml-1",children:c.ckbSyncedAt?new Date(c.ckbSyncedAt).toLocaleString():"-"})]})]})]})]}),e.jsx(Mt,{value:"rfm",className:"flex-1 overflow-auto space-y-4",children:g?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg border border-gray-700/30",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Zs,{className:"w-5 h-5 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium text-lg",children:"用户 RFM 估值"})]}),e.jsxs("div",{className:"text-right",children:[e.jsx("div",{className:"text-3xl font-bold text-white",children:g.rfmScore}),e.jsxs(De,{className:`border-0 ${we(g.rfmLevel)}`,children:[g.rfmLevel," 级用户"]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg text-center",children:[e.jsx("div",{className:"w-8 h-8 rounded bg-red-500/20 flex items-center justify-center text-sm font-bold text-red-400 mx-auto mb-2",children:"R"}),e.jsx("div",{className:"text-2xl font-bold text-red-400",children:g.recency}),e.jsx("div",{className:"text-gray-500 text-xs mt-1",children:"最近购买天数"}),e.jsx("div",{className:"text-gray-600 text-xs",children:"越低越好"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg text-center",children:[e.jsx("div",{className:"w-8 h-8 rounded bg-blue-500/20 flex items-center justify-center text-sm font-bold text-blue-400 mx-auto mb-2",children:"F"}),e.jsx("div",{className:"text-2xl font-bold text-blue-400",children:g.frequency}),e.jsx("div",{className:"text-gray-500 text-xs mt-1",children:"购买频次"}),e.jsx("div",{className:"text-gray-600 text-xs",children:"越高越好"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg text-center",children:[e.jsx("div",{className:"w-8 h-8 rounded bg-green-500/20 flex items-center justify-center text-sm font-bold text-green-400 mx-auto mb-2",children:"M"}),e.jsxs("div",{className:"text-2xl font-bold text-green-400",children:["¥",g.monetary.toFixed(0)]}),e.jsx("div",{className:"text-gray-500 text-xs mt-1",children:"消费金额"}),e.jsx("div",{className:"text-gray-600 text-xs",children:"越高越好"})]})]}),g.lastOrderAt&&e.jsxs("div",{className:"mt-3 text-sm text-gray-500",children:["最近订单:",new Date(g.lastOrderAt).toLocaleString()]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-3 font-medium",children:"等级说明"}),e.jsx("div",{className:"space-y-2 text-sm",children:[{level:"S",label:"超级VIP",desc:"高频高额近期活跃,顶级价值用户",color:"text-amber-400"},{level:"A",label:"高价值",desc:"消费能力强,复购率高",color:"text-green-400"},{level:"B",label:"潜力用户",desc:"有一定消费,需重点维护",color:"text-blue-400"},{level:"C",label:"普通用户",desc:"偶发购买,待激活",color:"text-gray-400"},{level:"D",label:"低活跃",desc:"长期未购买或无消费记录",color:"text-red-400"}].map(de=>e.jsxs("div",{className:`flex items-center gap-3 ${g.rfmLevel===de.level?"opacity-100":"opacity-50"}`,children:[e.jsx(De,{className:`border-0 w-6 h-6 flex items-center justify-center p-0 ${we(de.level)}`,children:de.level}),e.jsx("span",{className:`font-medium w-16 ${de.color}`,children:de.label}),e.jsx("span",{className:"text-gray-500",children:de.desc}),g.rfmLevel===de.level&&e.jsx(Ud,{className:"w-4 h-4 text-[#38bdac] ml-auto"})]},de.level))})]})]}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Zs,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400",children:"暂无 RFM 数据"}),e.jsx("p",{className:"text-gray-600 text-sm mt-1",children:"用户需有至少一次购买记录才会生成 RFM 估值"}),e.jsxs(J,{className:"mt-4 bg-[#38bdac] hover:bg-[#2da396] text-white",onClick:X,children:[e.jsx(Be,{className:"w-4 h-4 mr-2"}),"重新加载"]})]})}),e.jsxs(Mt,{value:"tags",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(wd,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"用户标签"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"基于《一场 Soul 的创业实验》维度打标"})]}),e.jsx("div",{className:"mb-4 space-y-3",children:[{category:"身份类型",tags:["创业者","打工人","自由职业","学生","投资人","合伙人"]},{category:"行业背景",tags:["电商","内容","传统行业","科技/AI","金融","教育","餐饮"]},{category:"痛点标签",tags:["找资源","找方向","找合伙人","想赚钱","想学习","找情感出口"]},{category:"付费意愿",tags:["高意向","已付费","观望中","薅羊毛"]},{category:"MBTI",tags:["ENTJ","INTJ","ENFP","INFP","ENTP","INTP","ESTJ","ISFJ"]}].map(de=>e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1.5",children:de.category}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:de.tags.map(he=>e.jsxs("button",{type:"button",onClick:()=>{A.includes(he)?ye(he):_([...A,he])},className:`px-2 py-0.5 rounded text-xs border transition-all ${A.includes(he)?"bg-[#38bdac]/20 border-[#38bdac]/50 text-[#38bdac]":"bg-transparent border-gray-700 text-gray-500 hover:border-gray-500 hover:text-gray-300"}`,children:[A.includes(he)?"✓ ":"",he]},he))})]},de.category))}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-3",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"已选标签"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 min-h-[32px]",children:[A.map((de,he)=>e.jsxs(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0 pr-1",children:[de,e.jsx("button",{type:"button",onClick:()=>ye(de),className:"ml-1 hover:text-red-400",children:e.jsx(ys,{className:"w-3 h-3"})})]},he)),A.length===0&&e.jsx("span",{className:"text-gray-600 text-sm",children:"暂未选择标签"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"自定义标签(回车添加)",value:re,onChange:de=>ae(de.target.value),onKeyDown:de=>de.key==="Enter"&&Y()}),e.jsx(J,{onClick:Y,className:"bg-[#38bdac] hover:bg-[#2da396]",children:"添加"})]})]})]}),c.ckbTags&&e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(wd,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"存客宝标签"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(typeof c.ckbTags=="string"?c.ckbTags.split(","):[]).map((de,he)=>e.jsx(De,{className:"bg-purple-500/20 text-purple-400 border-0",children:de.trim()},he))})]})]}),e.jsxs(Mt,{value:"journey",className:"flex-1 overflow-auto",children:[e.jsxs("div",{className:"mb-3 p-3 bg-[#0a1628] rounded-lg flex items-center gap-2",children:[e.jsx(Ui,{className:"w-4 h-4 text-[#38bdac]"}),e.jsxs("span",{className:"text-gray-400 text-sm",children:["记录用户从注册到付费的完整行动路径,共 ",m.length," 条记录"]})]}),e.jsx("div",{className:"space-y-2",children:m.length>0?m.map((de,he)=>e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-[#38bdac]",children:pe(de.action)}),he0?p.map((de,he)=>{var Ze;const We=de;return e.jsxs("div",{className:"flex items-center justify-between p-2 bg-[#162840] rounded",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:((Ze=We.nickname)==null?void 0:Ze.charAt(0))||"?"}),e.jsx("span",{className:"text-white text-sm",children:We.nickname})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[We.status==="vip"&&e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"已购"}),e.jsx("span",{className:"text-gray-500 text-xs",children:We.createdAt?new Date(We.createdAt).toLocaleDateString():""})]})]},We.id||he)}):e.jsx("p",{className:"text-gray-500 text-sm text-center py-4",children:"暂无推荐用户"})})]})}),e.jsxs(Mt,{value:"shensheshou",className:"flex-1 overflow-auto space-y-4",children:[e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(Jr,{className:"w-5 h-5 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:"神射手数据查询"}),e.jsx("span",{className:"text-gray-500 text-xs",children:"通过手机号 / OpenID 查询用户画像"})]}),e.jsxs("div",{className:"flex gap-2 mb-4",children:[e.jsx(ie,{className:"bg-[#162840] border-gray-700 text-white flex-1",placeholder:"手机号(自动填入已绑定手机)",value:$,onChange:de=>oe(de.target.value)}),e.jsx(J,{onClick:ve,disabled:le,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:le?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 查询中"]}):e.jsxs(e.Fragment,{children:[e.jsx(vr,{className:"w-4 h-4 mr-1"})," 查询"]})})]}),ce&&e.jsx("div",{className:"p-3 bg-red-500/10 border border-red-500/30 rounded-lg text-red-400 text-sm mb-3",children:ce}),G&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"神射手 RFM 分"}),e.jsx("p",{className:"text-2xl font-bold text-[#38bdac]",children:G.rfm_score??"-"})]}),e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-1",children:"用户等级"}),e.jsx("p",{className:"text-2xl font-bold text-white",children:G.user_level??"-"})]})]}),G.tags&&G.tags.length>0&&e.jsxs("div",{className:"p-3 bg-[#162840] rounded-lg",children:[e.jsx("p",{className:"text-gray-500 text-xs mb-2",children:"神射手标签"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:G.tags.map((de,he)=>e.jsx(De,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/20",children:de},he))})]}),G.last_active&&e.jsxs("div",{className:"text-sm text-gray-500",children:["最近活跃:",G.last_active]})]})]}),e.jsxs("div",{className:"p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(Jr,{className:"w-4 h-4 text-purple-400"}),e.jsx("span",{className:"text-white font-medium",children:"推送用户数据到神射手"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"将本用户信息(手机号、昵称、标签等)同步至神射手,自动完善用户画像"})]}),e.jsx(J,{onClick:D,disabled:K||!c.phone,variant:"outline",className:"border-purple-500/40 text-purple-400 hover:bg-purple-500/10 bg-transparent shrink-0 ml-4",children:K?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"})," 推送中"]}):e.jsxs(e.Fragment,{children:[e.jsx(Jr,{className:"w-4 h-4 mr-1"})," 推送"]})})]}),!c.phone&&e.jsx("p",{className:"text-yellow-500/70 text-xs",children:"⚠ 用户未绑定手机号,无法推送"}),L&&e.jsx("div",{className:"mt-3 p-3 bg-[#162840] rounded-lg text-sm",children:L.error?e.jsx("p",{className:"text-red-400",children:String(L.error)}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-green-400 flex items-center gap-1",children:[e.jsx(Ud,{className:"w-4 h-4"})," 推送成功"]}),L.enriched!==void 0&&e.jsxs("p",{className:"text-gray-400",children:["自动补全标签数:",String(L.new_tags_added??0)]})]})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-3 border-t border-gray-700 mt-3",children:[e.jsxs(J,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"关闭"]}),e.jsxs(J,{onClick:ue,disabled:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),b?"保存中...":"保存修改"]})]})]}):e.jsx("div",{className:"text-center py-12 text-gray-500",children:"用户不存在"})]})}):null}const Ad={isVip:!1,vipExpireDate:"",vipSort:"",vipRole:"",vipRoleCustom:"",vipName:"",vipProject:"",vipContact:"",vipBio:""};function T2({open:r,onClose:a,userId:l,userNickname:o="",onSaved:c}){const[d,m]=h.useState(Ad),[f,p]=h.useState([]),[y,g]=h.useState(!1),[v,C]=h.useState(!1);h.useEffect(()=>{if(!r){m(Ad);return}let R=!1;return g(!0),Promise.all([Ue("/api/db/vip-roles"),l?Ue(`/api/db/users?id=${encodeURIComponent(l)}`):Promise.resolve(null)]).then(([S,b])=>{if(R)return;const N=S!=null&&S.success&&S.data?S.data:[];p(N);const E=b&&b.user?b.user:null;if(E){const j=String(E.vipRole??""),T=N.some(B=>B.name===j);m({isVip:!!(E.isVip??!1),vipExpireDate:E.vipExpireDate?String(E.vipExpireDate).slice(0,10):"",vipSort:typeof E.vipSort=="number"?E.vipSort:"",vipRole:T?j:j?"__custom__":"",vipRoleCustom:T?"":j,vipName:String(E.vipName??""),vipProject:String(E.vipProject??""),vipContact:String(E.vipContact??""),vipBio:String(E.vipBio??"")})}else m(Ad)}).catch(S=>{R||console.error("Load error:",S)}).finally(()=>{R||g(!1)}),()=>{R=!0}},[r,l]);async function P(){if(l){if(d.isVip&&!d.vipExpireDate.trim()){alert("开启 VIP 时请填写有效到期日");return}if(d.isVip&&d.vipExpireDate.trim()){const R=new Date(d.vipExpireDate);if(isNaN(R.getTime())){alert("到期日格式无效,请使用 YYYY-MM-DD");return}}C(!0);try{const R=d.vipRole==="__custom__"?d.vipRoleCustom.trim():d.vipRole,S={id:l,isVip:d.isVip,vipExpireDate:d.isVip?d.vipExpireDate:void 0,vipSort:d.vipSort===""?void 0:d.vipSort,vipRole:R||void 0,vipName:d.vipName||void 0,vipProject:d.vipProject||void 0,vipContact:d.vipContact||void 0,vipBio:d.vipBio||void 0},b=await vt("/api/db/users",S);b!=null&&b.success?(alert("VIP 设置已保存"),c==null||c(),a()):alert("保存失败: "+(b==null?void 0:b.error))}catch(R){console.error("Save VIP error:",R),alert("保存失败")}finally{C(!1)}}}return r?e.jsx(wt,{open:r,onOpenChange:()=>a(),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Rl,{className:"w-5 h-5 text-amber-400"}),"设置 VIP - ",o||l]})}),y?e.jsx("div",{className:"py-8 text-center text-gray-400",children:"加载中..."}):e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 会员"}),e.jsx(lt,{checked:d.isVip,onCheckedChange:R=>m(S=>({...S,isVip:R}))})]}),d.isVip&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300",children:["到期日 (YYYY-MM-DD) ",e.jsx("span",{className:"text-amber-400",children:"*"})]}),e.jsx(ie,{type:"date",className:"bg-[#0a1628] border-gray-700 text-white",value:d.vipExpireDate,onChange:R=>m(S=>({...S,vipExpireDate:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"数字越小越靠前,留空按时间",value:d.vipSort===""?"":d.vipSort,onChange:R=>{const S=R.target.value;m(b=>({...b,vipSort:S===""?"":parseInt(S,10)||0}))}})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md px-3 py-2",value:d.vipRole,onChange:R=>m(S=>({...S,vipRole:R.target.value})),children:[e.jsx("option",{value:"",children:"请选择或下方手动填写"}),f.map(R=>e.jsx("option",{value:R.name,children:R.name},R.id)),e.jsx("option",{value:"__custom__",children:"其他(手动填写)"})]}),d.vipRole==="__custom__"&&e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white mt-1",placeholder:"输入自定义角色",value:d.vipRoleCustom,onChange:R=>m(S=>({...S,vipRoleCustom:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"VIP 展示名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"创业老板排行展示名",value:d.vipName,onChange:R=>m(S=>({...S,vipName:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"项目/公司"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"项目名称",value:d.vipProject,onChange:R=>m(S=>({...S,vipProject:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"联系方式"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"微信号或手机",value:d.vipContact,onChange:R=>m(S=>({...S,vipContact:R.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"一句话简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"简要描述业务",value:d.vipBio,onChange:R=>m(S=>({...S,vipBio:R.target.value}))})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:a,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:P,disabled:v||y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),v?"保存中...":"保存"]})]})]})}):null}function I2(){var vn,kr,Er,vs,lr;const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),g=co(p,300),[v,C]=h.useState("all"),[P,R]=h.useState(!0),[S,b]=h.useState(null),[N,E]=h.useState(!1),[j,T]=h.useState(!1),[B,U]=h.useState(null),[k,A]=h.useState(""),[_,re]=h.useState(""),[ae,le]=h.useState(!1),[se,G]=h.useState(!1),[q,ce]=h.useState({referrals:[],stats:{}}),[je,$]=h.useState(!1),[oe,K]=h.useState(null),[M,L]=h.useState(!1),[O,X]=h.useState(null),[H,ue]=h.useState(!1),[Y,ye]=h.useState(null),[ve,D]=h.useState({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),[pe,we]=h.useState([]),[$e,de]=h.useState(!1),[he,We]=h.useState(!1),[Ze,xt]=h.useState(null),[Xe,kt]=h.useState({title:"",description:"",trigger:"",sort:0,enabled:!0}),[Es,wr]=h.useState([]),[nr,Sr]=h.useState(!1),[Wt,mn]=h.useState(""),At=co(Wt,300);async function us(){R(!0),b(null);try{const V=new URLSearchParams({page:String(c),pageSize:String(m),search:g,...v==="vip"&&{vip:"true"}}),Oe=await Ue(`/api/db/users?${V}`);Oe!=null&&Oe.success?(a(Oe.users||[]),o(Oe.total??0)):b((Oe==null?void 0:Oe.error)||"加载失败")}catch(V){console.error("Load users error:",V),b("网络错误,请检查连接")}finally{R(!1)}}h.useEffect(()=>{d(1)},[g,v]),h.useEffect(()=>{us()},[c,m,g,v]);const zn=Math.ceil(l/m)||1;async function ar(V){if(confirm("确定要删除这个用户吗?"))try{const Oe=await tn(`/api/db/users?id=${encodeURIComponent(V)}`);Oe!=null&&Oe.success?us():alert("删除失败: "+((Oe==null?void 0:Oe.error)||"未知错误"))}catch(Oe){console.error("Delete user error:",Oe),alert("删除失败")}}const Us=V=>{U(V),D({phone:V.phone||"",nickname:V.nickname||"",password:"",isAdmin:!!(V.isAdmin??!1),hasFullBook:!!(V.hasFullBook??!1)}),E(!0)},Oa=()=>{U(null),D({phone:"",nickname:"",password:"",isAdmin:!1,hasFullBook:!1}),E(!0)};async function $n(){if(!ve.phone||!ve.nickname){alert("请填写手机号和昵称");return}le(!0);try{if(B){const V=await vt("/api/db/users",{id:B.id,nickname:ve.nickname,isAdmin:ve.isAdmin,hasFullBook:ve.hasFullBook,...ve.password&&{password:ve.password}});if(!(V!=null&&V.success)){alert("更新失败: "+((V==null?void 0:V.error)||"未知错误"));return}}else{const V=await bt("/api/db/users",{phone:ve.phone,nickname:ve.nickname,password:ve.password,isAdmin:ve.isAdmin});if(!(V!=null&&V.success)){alert("创建失败: "+((V==null?void 0:V.error)||"未知错误"));return}}E(!1),us()}catch(V){console.error("Save user error:",V),alert("保存失败")}finally{le(!1)}}const fn=V=>{U(V),A(""),re(""),T(!0)};async function Bn(V){K(V),G(!0),$(!0);try{const Oe=await Ue(`/api/db/users/referrals?userId=${encodeURIComponent(V.id)}`);Oe!=null&&Oe.success?ce({referrals:Oe.referrals||[],stats:Oe.stats||{}}):ce({referrals:[],stats:{}})}catch(Oe){console.error("Load referrals error:",Oe),ce({referrals:[],stats:{}})}finally{$(!1)}}const xn=V=>{X(V.id),L(!0)},pn=V=>{ye(V),ue(!0)};async function gn(){if(!k){alert("请输入新密码");return}if(k!==_){alert("两次输入的密码不一致");return}if(k.length<6){alert("密码长度不能少于6位");return}le(!0);try{const V=await vt("/api/db/users",{id:B==null?void 0:B.id,password:k});V!=null&&V.success?(alert("密码修改成功"),T(!1)):alert("密码修改失败: "+((V==null?void 0:V.error)||"未知错误"))}catch(V){console.error("Change password error:",V),alert("密码修改失败")}finally{le(!1)}}const Ps=h.useCallback(async()=>{de(!0);try{const V=await Ue("/api/db/user-rules");V!=null&&V.success&&we(V.rules||[])}catch(V){console.error("Load rules error:",V)}finally{de(!1)}},[]),Cr=()=>{xt(null),kt({title:"",description:"",trigger:"",sort:0,enabled:!0}),We(!0)},Vs=V=>{xt(V),kt({title:V.title,description:V.description,trigger:V.trigger,sort:V.sort,enabled:V.enabled}),We(!0)};async function Ws(){if(!Xe.title){alert("请填写规则标题");return}le(!0);try{if(Ze){const V=await vt("/api/db/user-rules",{id:Ze.id,...Xe});if(!(V!=null&&V.success)){alert("更新失败: "+((V==null?void 0:V.error)||""));return}}else{const V=await bt("/api/db/user-rules",Xe);if(!(V!=null&&V.success)){alert("创建失败: "+((V==null?void 0:V.error)||""));return}}We(!1),Ps()}catch(V){console.error("Save rule error:",V),alert("保存失败")}finally{le(!1)}}async function Un(V){if(confirm("确定删除该规则?"))try{const Oe=await tn(`/api/db/user-rules?id=${V}`);Oe!=null&&Oe.success?Ps():alert("删除失败: "+((Oe==null?void 0:Oe.error)||""))}catch(Oe){console.error("Delete rule error:",Oe)}}async function Vn(V){try{await vt("/api/db/user-rules",{id:V.id,enabled:!V.enabled}),Ps()}catch(Oe){console.error("Toggle rule error:",Oe)}}const yn=h.useCallback(async()=>{Sr(!0);try{const V=new URLSearchParams({search:At,limit:"50"}),Oe=await Ue(`/api/db/users/rfm?${V}`);Oe!=null&&Oe.success&&wr(Oe.users||[])}catch(V){console.error("Load RFM error:",V)}finally{Sr(!1)}},[At]),Wn=V=>({S:"bg-amber-500/20 text-amber-400",A:"bg-green-500/20 text-green-400",B:"bg-blue-500/20 text-blue-400",C:"bg-gray-500/20 text-gray-400",D:"bg-red-500/20 text-red-400"})[V]||"bg-gray-500/20 text-gray-400";return e.jsxs("div",{className:"p-8 w-full",children:[S&&e.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:[e.jsx("span",{children:S}),e.jsx("button",{type:"button",onClick:()=>b(null),className:"hover:text-red-300",children:"×"})]}),e.jsx("div",{className:"flex justify-between items-center mb-6",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"用户管理"}),e.jsxs("p",{className:"text-gray-400 mt-1 text-sm",children:["共 ",l," 位注册用户"]})]})}),e.jsxs(_l,{defaultValue:"users",className:"w-full",children:[e.jsxs(_a,{className:"bg-[#0a1628] border border-gray-700/50 p-1 mb-6",children:[e.jsxs(_t,{value:"users",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-2",children:[e.jsx(Gt,{className:"w-4 h-4"}),"用户列表"]}),e.jsxs(_t,{value:"rfm",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-2",onClick:yn,children:[e.jsx(Zs,{className:"w-4 h-4"}),"RFM 估值排行"]}),e.jsxs(_t,{value:"rules",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] flex items-center gap-2",onClick:Ps,children:[e.jsx(ja,{className:"w-4 h-4"}),"规则配置"]})]}),e.jsxs(Mt,{value:"users",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4 justify-end",children:[e.jsxs(J,{variant:"outline",onClick:us,disabled:P,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${P?"animate-spin":""}`}),"刷新"]}),e.jsxs("select",{value:v,onChange:V=>{C(V.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"all",children:"全部用户"}),e.jsx("option",{value:"vip",children:"VIP会员"})]}),e.jsxs("div",{className:"relative",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ie,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500 w-64",value:p,onChange:V=>y(V.target.value)})]}),e.jsxs(J,{onClick:Oa,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Gd,{className:"w-4 h-4 mr-2"}),"添加用户"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:P?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs("div",{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"用户信息"}),e.jsx(be,{className:"text-gray-400",children:"绑定信息"}),e.jsx(be,{className:"text-gray-400",children:"购买状态"}),e.jsx(be,{className:"text-gray-400",children:"分销收益"}),e.jsx(be,{className:"text-gray-400",children:"注册时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ns,{children:[r.map(V=>{var Oe,it,F;return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm font-medium text-[#38bdac]",children:V.avatar?e.jsx("img",{src:V.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((Oe=V.nickname)==null?void 0:Oe.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"font-medium text-white",children:V.nickname}),V.isAdmin&&e.jsx(De,{className:"bg-purple-500/20 text-purple-400 hover:bg-purple-500/20 border-0 text-xs",children:"管理员"}),V.openId&&!((it=V.id)!=null&&it.startsWith("user_"))&&e.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0 text-xs",children:"微信"})]}),e.jsx("p",{className:"text-xs text-gray-500 font-mono",children:V.openId?V.openId.slice(0,12)+"...":(F=V.id)==null?void 0:F.slice(0,12)})]})]})}),e.jsx(fe,{children:e.jsxs("div",{className:"space-y-1",children:[V.phone&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"📱"}),e.jsx("span",{className:"text-gray-300",children:V.phone})]}),V.wechatId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"💬"}),e.jsx("span",{className:"text-gray-300",children:V.wechatId})]}),V.openId&&e.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[e.jsx("span",{className:"text-gray-500",children:"🔗"}),e.jsxs("span",{className:"text-gray-500 truncate max-w-[100px]",title:V.openId,children:[V.openId.slice(0,12),"..."]})]}),!V.phone&&!V.wechatId&&!V.openId&&e.jsx("span",{className:"text-gray-600 text-xs",children:"未绑定"})]})}),e.jsx(fe,{children:V.hasFullBook?e.jsx(De,{className:"bg-amber-500/20 text-amber-400 hover:bg-amber-500/20 border-0",children:"VIP"}):e.jsx(De,{variant:"outline",className:"text-gray-500 border-gray-600",children:"未购买"})}),e.jsx(fe,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-white font-medium",children:["¥",parseFloat(String(V.earnings||0)).toFixed(2)]}),parseFloat(String(V.pendingEarnings||0))>0&&e.jsxs("div",{className:"text-xs text-yellow-400",children:["待提现: ¥",parseFloat(String(V.pendingEarnings||0)).toFixed(2)]}),e.jsxs("div",{className:"text-xs text-[#38bdac] cursor-pointer hover:underline flex items-center gap-1",onClick:()=>Bn(V),onKeyDown:ne=>ne.key==="Enter"&&Bn(V),role:"button",tabIndex:0,children:[e.jsx(Gt,{className:"w-3 h-3"}),"绑定",V.referralCount||0,"人"]})]})}),e.jsx(fe,{className:"text-gray-400",children:V.createdAt?new Date(V.createdAt).toLocaleDateString():"-"}),e.jsx(fe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>pn(V),className:"text-gray-400 hover:text-amber-400 hover:bg-amber-400/10",title:"设置 VIP",children:e.jsx(Rl,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>xn(V),className:"text-gray-400 hover:text-blue-400 hover:bg-blue-400/10",title:"查看详情 / 用户旅程",children:e.jsx(yr,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Us(V),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",title:"编辑",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>fn(V),className:"text-gray-400 hover:text-yellow-400 hover:bg-yellow-400/10",title:"修改密码",children:e.jsx(Lf,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",onClick:()=>ar(V.id),title:"删除",children:e.jsx(Yt,{className:"w-4 h-4"})})]})})]},V.id)}),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:6,className:"text-center py-12 text-gray-500",children:"暂无用户数据"})})]})]}),e.jsx(Fs,{page:c,totalPages:zn,total:l,pageSize:m,onPageChange:d,onPageSizeChange:V=>{f(V),d(1)}})]})})})]}),e.jsxs(Mt,{value:"rfm",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-4",children:[e.jsxs("div",{className:"flex-1 max-w-sm relative",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),e.jsx(ie,{type:"text",placeholder:"搜索用户...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500",value:Wt,onChange:V=>mn(V.target.value)})]}),e.jsxs(J,{variant:"outline",onClick:yn,disabled:nr,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${nr?"animate-spin":""}`}),"刷新"]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2 text-xs text-gray-500",children:[e.jsx(De,{className:"bg-amber-500/20 text-amber-400 border-0",children:"S 超级VIP"}),e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0",children:"A 高价值"}),e.jsx(De,{className:"bg-blue-500/20 text-blue-400 border-0",children:"B 潜力用户"}),e.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0",children:"C 普通"}),e.jsx(De,{className:"bg-red-500/20 text-red-400 border-0",children:"D 低活跃"})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-red-500/20 flex items-center justify-center text-xs font-bold text-red-400",children:"R"}),e.jsx("span",{className:"text-white font-medium",children:"最近购买(Recency)"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"距离最近一次购买的天数,越近分值越高"})]}),e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-blue-500/20 flex items-center justify-center text-xs font-bold text-blue-400",children:"F"}),e.jsx("span",{className:"text-white font-medium",children:"购买频率(Frequency)"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计购买次数,频次越高分值越高"})]}),e.jsxs("div",{className:"bg-[#0f2137] border border-gray-700/50 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"w-6 h-6 rounded bg-green-500/20 flex items-center justify-center text-xs font-bold text-green-400",children:"M"}),e.jsx("span",{className:"text-white font-medium",children:"消费金额(Monetary)"})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"累计消费总额,金额越高分值越高"})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:nr?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"计算 RFM 中..."})]}):Es.length===0?e.jsxs("div",{className:"text-center py-16",children:[e.jsx(Zs,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500",children:"点击「刷新」加载 RFM 排行榜"})]}):e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400 w-12",children:"排名"}),e.jsx(be,{className:"text-gray-400",children:"用户"}),e.jsx(be,{className:"text-gray-400",children:"等级"}),e.jsx(be,{className:"text-gray-400 text-center",children:"RFM总分"}),e.jsx(be,{className:"text-gray-400 text-center",children:"R 最近购买"}),e.jsx(be,{className:"text-gray-400 text-center",children:"F 购买频次"}),e.jsx(be,{className:"text-gray-400 text-center",children:"M 消费金额"}),e.jsx(be,{className:"text-gray-400",children:"最近订单"})]})}),e.jsx(ns,{children:Es.map((V,Oe)=>{var it;return e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsxs("span",{className:`text-sm font-bold ${Oe<3?"text-amber-400":"text-gray-500"}`,children:["#",Oe+1]})}),e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-xs text-[#38bdac]",children:V.avatar?e.jsx("img",{src:V.avatar,className:"w-full h-full rounded-full object-cover",alt:""}):((it=V.nickname)==null?void 0:it.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:V.nickname}),V.phone&&e.jsx("p",{className:"text-gray-500 text-xs",children:V.phone})]})]})}),e.jsx(fe,{children:e.jsxs(De,{className:`border-0 ${Wn(V.rfmLevel)}`,children:[V.rfmLevel," 级"]})}),e.jsx(fe,{className:"text-center",children:e.jsx("span",{className:"text-white font-bold text-lg",children:V.rfmScore})}),e.jsx(fe,{className:"text-center",children:e.jsx("span",{className:"text-red-400 font-medium",children:V.recency})}),e.jsx(fe,{className:"text-center",children:e.jsx("span",{className:"text-blue-400 font-medium",children:V.frequency})}),e.jsx(fe,{className:"text-center",children:e.jsxs("span",{className:"text-green-400 font-medium",children:["¥",V.monetary.toFixed(0)]})}),e.jsx(fe,{className:"text-gray-500 text-sm",children:V.lastOrderAt?new Date(V.lastOrderAt).toLocaleDateString():"-"})]},V.id)})})]})})})]}),e.jsxs(Mt,{value:"rules",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-gray-400 text-sm",children:"配置用户旅程引导规则,包括填写头像、完善信息、付款节点等步骤触发规则,帮助用户了解完整路径。"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(J,{variant:"outline",onClick:Ps,disabled:$e,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${$e?"animate-spin":""}`}),"刷新"]}),e.jsxs(J,{onClick:Cr,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加规则"]})]})]}),$e?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):pe.length===0?e.jsxs("div",{className:"text-center py-16 bg-[#0f2137] rounded-lg border border-gray-700/50",children:[e.jsx(tr,{className:"w-12 h-12 text-[#38bdac]/30 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-400 mb-2",children:"暂无规则配置"}),e.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"添加用户旅程规则,帮助引导用户完善个人信息"}),e.jsxs(J,{onClick:Cr,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加第一条规则"]})]}):e.jsx("div",{className:"space-y-3",children:pe.map(V=>e.jsx("div",{className:`p-4 rounded-lg border transition-all ${V.enabled?"bg-[#0f2137] border-gray-700/50":"bg-[#0a1628]/50 border-gray-700/30 opacity-60"}`,children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(ht,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx("span",{className:"text-white font-medium",children:V.title}),V.trigger&&e.jsxs(De,{className:"bg-[#38bdac]/10 text-[#38bdac] border border-[#38bdac]/30 text-xs",children:["触发:",V.trigger]}),e.jsx(De,{className:`text-xs border-0 ${V.enabled?"bg-green-500/20 text-green-400":"bg-gray-500/20 text-gray-400"}`,children:V.enabled?"启用中":"已禁用"})]}),V.description&&e.jsx("p",{className:"text-gray-400 text-sm ml-6 whitespace-pre-wrap",children:V.description})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-4 shrink-0",children:[e.jsx(lt,{checked:V.enabled,onCheckedChange:()=>Vn(V)}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Vs(V),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>Un(V.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Yt,{className:"w-4 h-4"})})]})]})},V.id))})]})]}),e.jsx(wt,{open:N,onOpenChange:E,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[B?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Gd,{className:"w-5 h-5 text-[#38bdac]"}),B?"编辑用户":"添加用户"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"手机号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入手机号",value:ve.phone,onChange:V=>D({...ve,phone:V.target.value}),disabled:!!B})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入昵称",value:ve.nickname,onChange:V=>D({...ve,nickname:V.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:B?"新密码 (留空则不修改)":"密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:B?"留空则不修改":"请输入密码",value:ve.password,onChange:V=>D({...ve,password:V.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"管理员权限"}),e.jsx(lt,{checked:ve.isAdmin,onCheckedChange:V=>D({...ve,isAdmin:V})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"已购全书"}),e.jsx(lt,{checked:ve.hasFullBook,onCheckedChange:V=>D({...ve,hasFullBook:V})})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>E(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:$n,disabled:ae,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),ae?"保存中...":"保存"]})]})]})}),e.jsx(wt,{open:j,onOpenChange:T,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Lf,{className:"w-5 h-5 text-[#38bdac]"}),"修改密码"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["用户:",B==null?void 0:B.nickname]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["手机号:",B==null?void 0:B.phone]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"新密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请输入新密码 (至少6位)",value:k,onChange:V=>A(V.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"确认密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"请再次输入新密码",value:_,onChange:V=>re(V.target.value)})]})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>T(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:gn,disabled:ae,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ae?"保存中...":"确认修改"})]})]})}),e.jsx(wt,{open:he,onOpenChange:We,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}),Ze?"编辑规则":"添加规则"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"规则标题 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:匹配后填写头像、付款1980元需填写信息",value:Xe.title,onChange:V=>kt({...Xe,title:V.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"规则描述"}),e.jsx(rn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px] resize-none",placeholder:"详细说明这个规则的内容,帮助运营人员了解用户旅程节点...",value:Xe.description,onChange:V=>kt({...Xe,description:V.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"触发条件"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例:完成匹配、付款后、注册时",value:Xe.trigger,onChange:V=>kt({...Xe,trigger:V.target.value})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(te,{className:"text-gray-300",children:"启用状态"}),e.jsx("p",{className:"text-gray-500 text-xs mt-0.5",children:"关闭后规则不再生效"})]}),e.jsx(lt,{checked:Xe.enabled,onCheckedChange:V=>kt({...Xe,enabled:V})})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>We(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:Ws,disabled:ae,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),ae?"保存中...":"保存"]})]})]})}),e.jsx(wt,{open:se,onOpenChange:G,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[80vh] overflow-auto",children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-[#38bdac]"}),"绑定关系详情 - ",oe==null?void 0:oe.nickname]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-3",children:[e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-[#38bdac]",children:((vn=q.stats)==null?void 0:vn.total)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"绑定总数"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-green-400",children:((kr=q.stats)==null?void 0:kr.purchased)||0}),e.jsx("div",{className:"text-xs text-gray-400",children:"已付费"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-yellow-400",children:["¥",(((Er=q.stats)==null?void 0:Er.earnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"累计收益"})]}),e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-3 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-orange-400",children:["¥",(((vs=q.stats)==null?void 0:vs.pendingEarnings)||0).toFixed(2)]}),e.jsx("div",{className:"text-xs text-gray-400",children:"待提现"})]})]}),je?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-5 h-5 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):(((lr=q.referrals)==null?void 0:lr.length)??0)>0?e.jsx("div",{className:"space-y-2 max-h-[300px] overflow-y-auto",children:(q.referrals??[]).map((V,Oe)=>{var F;const it=V;return e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-[#38bdac]/20 flex items-center justify-center text-sm text-[#38bdac]",children:((F=it.nickname)==null?void 0:F.charAt(0))||"?"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white text-sm",children:it.nickname}),e.jsx("div",{className:"text-xs text-gray-500",children:it.phone||(it.hasOpenId?"微信用户":"未绑定")})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[it.status==="vip"&&e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0 text-xs",children:"全书已购"}),it.status==="paid"&&e.jsxs(De,{className:"bg-blue-500/20 text-blue-400 border-0 text-xs",children:["已付费",it.purchasedSections,"章"]}),it.status==="free"&&e.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0 text-xs",children:"未付费"}),e.jsx("span",{className:"text-xs text-gray-500",children:it.createdAt?new Date(it.createdAt).toLocaleDateString():""})]})]},it.id||Oe)})}):e.jsx("div",{className:"text-center py-8 text-gray-500",children:"暂无绑定用户"})]}),e.jsx(zt,{children:e.jsx(J,{variant:"outline",onClick:()=>G(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"关闭"})})]})}),e.jsx(R2,{open:M,onClose:()=>L(!1),userId:O,onUserUpdated:us}),e.jsx(T2,{open:H,onClose:()=>{ue(!1),ye(null)},userId:(Y==null?void 0:Y.id)??null,userNickname:Y==null?void 0:Y.nickname,onSaved:us})]})}function _2(){var ve;const[r,a]=h.useState("overview"),[l,o]=h.useState([]),[c,d]=h.useState(null),[m,f]=h.useState([]),[p,y]=h.useState([]),[g,v]=h.useState([]),[C,P]=h.useState(!0),[R,S]=h.useState(null),[b,N]=h.useState(""),[E,j]=h.useState("all"),[T,B]=h.useState(1),[U,k]=h.useState(10),[A,_]=h.useState(0),[re,ae]=h.useState(new Set),[le,se]=h.useState(null),[G,q]=h.useState(""),[ce,je]=h.useState(!1);h.useEffect(()=>{$()},[]),h.useEffect(()=>{B(1)},[r,E]),h.useEffect(()=>{oe(r)},[r]),h.useEffect(()=>{["orders","bindings","withdrawals"].includes(r)&&oe(r,!0)},[T,U,E,b]);async function $(){S(null);try{const D=await Ue("/api/admin/distribution/overview");D!=null&&D.success&&D.overview&&d(D.overview)}catch(D){console.error("[Admin] 概览接口异常:",D),S("加载概览失败")}try{const D=await Ue("/api/db/users");v((D==null?void 0:D.users)||[])}catch(D){console.error("[Admin] 用户数据加载失败:",D)}}async function oe(D,pe=!1){var we;if(!(!pe&&re.has(D))){P(!0);try{const $e=g;switch(D){case"overview":break;case"orders":{try{const de=new URLSearchParams({page:String(T),pageSize:String(U),...E!=="all"&&{status:E},...b&&{search:b}}),he=await Ue(`/api/orders?${de}`);if(he!=null&&he.success&&he.orders){const We=he.orders.map(Ze=>{const xt=$e.find(kt=>kt.id===Ze.userId),Xe=Ze.referrerId?$e.find(kt=>kt.id===Ze.referrerId):null;return{...Ze,amount:parseFloat(String(Ze.amount))||0,userNickname:(xt==null?void 0:xt.nickname)||Ze.userNickname||"未知用户",userPhone:(xt==null?void 0:xt.phone)||Ze.userPhone||"-",referrerNickname:(Xe==null?void 0:Xe.nickname)||null,referrerCode:(Xe==null?void 0:Xe.referralCode)??null,type:Ze.productType||Ze.type}});o(We),_(he.total??We.length)}else o([]),_(0)}catch(de){console.error(de),S("加载订单失败"),o([])}break}case"bindings":{try{const de=new URLSearchParams({page:String(T),pageSize:String(U),...E!=="all"&&{status:E}}),he=await Ue(`/api/db/distribution?${de}`);f((he==null?void 0:he.bindings)||[]),_((he==null?void 0:he.total)??((we=he==null?void 0:he.bindings)==null?void 0:we.length)??0)}catch(de){console.error(de),S("加载绑定数据失败"),f([])}break}case"withdrawals":{try{const de=E==="completed"?"success":E==="rejected"?"failed":E,he=new URLSearchParams({...de&&de!=="all"&&{status:de},page:String(T),pageSize:String(U)}),We=await Ue(`/api/admin/withdrawals?${he}`);if(We!=null&&We.success&&We.withdrawals){const Ze=We.withdrawals.map(xt=>({...xt,account:xt.account??"未绑定微信号",status:xt.status==="success"?"completed":xt.status==="failed"?"rejected":xt.status}));y(Ze),_((We==null?void 0:We.total)??Ze.length)}else We!=null&&We.success||S(`获取提现记录失败: ${(We==null?void 0:We.error)||"未知错误"}`),y([])}catch(de){console.error(de),S("加载提现数据失败"),y([])}break}}ae(de=>new Set(de).add(D))}catch($e){console.error($e)}finally{P(!1)}}}async function K(){S(null),ae(D=>{const pe=new Set(D);return pe.delete(r),pe}),r==="overview"&&$(),await oe(r,!0)}async function M(D){if(confirm("确认审核通过并打款?"))try{const pe=await vt("/api/admin/withdrawals",{id:D,action:"approve"});if(!(pe!=null&&pe.success)){const we=(pe==null?void 0:pe.message)||(pe==null?void 0:pe.error)||"操作失败";alert(we);return}await K()}catch(pe){console.error(pe),alert("操作失败")}}async function L(D){const pe=prompt("请输入拒绝原因:");if(pe)try{const we=await vt("/api/admin/withdrawals",{id:D,action:"reject",errorMessage:pe});if(!(we!=null&&we.success)){alert((we==null?void 0:we.error)||"操作失败");return}await K()}catch(we){console.error(we),alert("操作失败")}}async function O(){var D;if(!(!(le!=null&&le.orderSn)&&!(le!=null&&le.id))){je(!0),S(null);try{const pe=await vt("/api/admin/orders/refund",{orderSn:le.orderSn||le.id,reason:G||void 0});pe!=null&&pe.success?(se(null),q(""),await oe("orders",!0)):S((pe==null?void 0:pe.error)||"退款失败")}catch(pe){const we=pe;S(((D=we==null?void 0:we.data)==null?void 0:D.error)||"退款失败,请检查网络后重试")}finally{je(!1)}}}function X(D){const pe={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"},we={active:"有效",converted:"已转化",expired:"已过期",cancelled:"已取消",pending:"待审核",pending_confirm:"待用户确认",processing:"处理中",completed:"已完成",rejected:"已拒绝"};return e.jsx(De,{className:`${pe[D]||"bg-gray-500/20 text-gray-400"} border-0`,children:we[D]||D})}const H=Math.ceil(A/U)||1,ue=l,Y=m.filter(D=>{var we,$e,de,he;if(!b)return!0;const pe=b.toLowerCase();return((we=D.refereeNickname)==null?void 0:we.toLowerCase().includes(pe))||(($e=D.refereePhone)==null?void 0:$e.includes(pe))||((de=D.referrerName)==null?void 0:de.toLowerCase().includes(pe))||((he=D.referrerCode)==null?void 0:he.toLowerCase().includes(pe))}),ye=p.filter(D=>{var we;if(!b)return!0;const pe=b.toLowerCase();return((we=D.userName)==null?void 0:we.toLowerCase().includes(pe))||D.account&&D.account.toLowerCase().includes(pe)});return e.jsxs("div",{className:"p-8 w-full",children:[R&&e.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:[e.jsx("span",{children:R}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"推广中心"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理:订单、分销绑定、提现审核"})]}),e.jsxs(J,{onClick:K,disabled:C,variant:"outline",className:"border-gray-700 text-gray-300 hover:bg-gray-800",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${C?"animate-spin":""}`}),"刷新数据"]})]}),e.jsx("div",{className:"flex gap-2 mb-6 border-b border-gray-700 pb-4",children:[{key:"overview",label:"数据概览",icon:Zs},{key:"orders",label:"订单管理",icon:ro},{key:"bindings",label:"绑定管理",icon:en},{key:"withdrawals",label:"提现审核",icon:Sa}].map(D=>e.jsxs("button",{type:"button",onClick:()=>{a(D.key),j("all"),N("")},className:`flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors ${r===D.key?"bg-[#38bdac] text-white":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[e.jsx(D.icon,{className:"w-4 h-4"}),D.label]},D.key))}),C?e.jsxs("div",{className:"flex items-center justify-center py-20",children:[e.jsx(Be,{className:"w-8 h-8 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[r==="overview"&&c&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日点击"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayClicks}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"总点击次数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(yr,{className:"w-6 h-6 text-blue-400"})})]})})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日独立用户"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayUniqueVisitors??0}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"去重访客数(实时)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-500/20 flex items-center justify-center",children:e.jsx(Gt,{className:"w-6 h-6 text-cyan-400"})})]})})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日总文章点击率"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:(c.todayClickRate??0).toFixed(2)}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"人均点击(总点击/独立用户)"})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-amber-500/20 flex items-center justify-center",children:e.jsx(Zs,{className:"w-6 h-6 text-amber-400"})})]})})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日绑定"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayBindings})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-green-500/20 flex items-center justify-center",children:e.jsx(en,{className:"w-6 h-6 text-green-400"})})]})})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日转化"}),e.jsx("p",{className:"text-2xl font-bold text-white mt-1",children:c.todayConversions})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-purple-500/20 flex items-center justify-center",children:e.jsx(Df,{className:"w-6 h-6 text-purple-400"})})]})})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"今日佣金"}),e.jsxs("p",{className:"text-2xl font-bold text-[#38bdac] mt-1",children:["¥",c.todayEarnings.toFixed(2)]})]}),e.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#38bdac]/20 flex items-center justify-center",children:e.jsx(ro,{className:"w-6 h-6 text-[#38bdac]"})})]})})})]}),(((ve=c.todayClicksByPage)==null?void 0:ve.length)??0)>0&&e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(yr,{className:"w-5 h-5 text-[#38bdac]"}),"每篇文章今日点击(按来源页/文章统计)"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"实际用户与实际文章的点击均计入;今日总点击与上表一致"})]}),e.jsx(Ce,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"pb-3 pr-4",children:"来源页/文章"}),e.jsx("th",{className:"pb-3 pr-4 text-right",children:"今日点击"}),e.jsx("th",{className:"pb-3 text-right",children:"占比"})]})}),e.jsx("tbody",{children:[...c.todayClicksByPage??[]].sort((D,pe)=>pe.clicks-D.clicks).map((D,pe)=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-4 text-white font-mono",children:D.page||"(未区分)"}),e.jsx("td",{className:"py-2 pr-4 text-right text-white",children:D.clicks}),e.jsxs("td",{className:"py-2 text-right text-gray-400",children:[c.todayClicks>0?(D.clicks/c.todayClicks*100).toFixed(1):0,"%"]})]},pe))})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(Se,{className:"bg-orange-500/10 border-orange-500/30",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-orange-500/20 flex items-center justify-center",children:e.jsx(Vd,{className:"w-6 h-6 text-orange-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-orange-300 font-medium",children:"即将过期绑定"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.expiringBindings," 个"]}),e.jsx("p",{className:"text-orange-300/60 text-sm",children:"7天内到期,需关注转化"})]})]})})}),e.jsx(Se,{className:"bg-blue-500/10 border-blue-500/30",children:e.jsx(Ce,{className:"p-6",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl bg-blue-500/20 flex items-center justify-center",children:e.jsx(Sa,{className:"w-6 h-6 text-blue-400"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-blue-300 font-medium",children:"待审核提现"}),e.jsxs("p",{className:"text-2xl font-bold text-white",children:[c.pendingWithdrawals," 笔"]}),e.jsxs("p",{className:"text-blue-300/60 text-sm",children:["共 ¥",c.pendingWithdrawAmount.toFixed(2)]})]}),e.jsx(J,{onClick:()=>a("withdrawals"),variant:"outline",className:"border-blue-500/50 text-blue-400 hover:bg-blue-500/20",children:"去审核"})]})})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(so,{className:"w-5 h-5 text-[#38bdac]"}),"本月统计"]})}),e.jsx(Ce,{children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"点击量"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthClicks})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"绑定数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthBindings})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"转化数"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.monthConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.monthEarnings.toFixed(2)]})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Zs,{className:"w-5 h-5 text-[#38bdac]"}),"累计统计"]})}),e.jsxs(Ce,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总点击"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalClicks.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总绑定"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalBindings.toLocaleString()})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总转化"}),e.jsx("p",{className:"text-xl font-bold text-white",children:c.totalConversions})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:"总佣金"}),e.jsxs("p",{className:"text-xl font-bold text-[#38bdac]",children:["¥",c.totalEarnings.toFixed(2)]})]})]}),e.jsxs("div",{className:"mt-4 p-4 bg-[#38bdac]/10 rounded-lg flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-300",children:"点击转化率"}),e.jsxs("span",{className:"text-[#38bdac] font-bold text-xl",children:[c.conversionRate,"%"]})]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-[#38bdac]"}),"推广统计"]})}),e.jsx(Ce,{children:e.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-white",children:c.totalDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"推广用户数"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-green-400",children:c.activeDistributors}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"有收益用户"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-[#38bdac]",children:"90%"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"佣金比例"})]}),e.jsxs("div",{className:"p-4 bg-white/5 rounded-lg text-center",children:[e.jsx("p",{className:"text-3xl font-bold text-orange-400",children:"30天"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"绑定有效期"})]})]})})]})]}),r==="orders"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索订单号、用户名、手机号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"pending",children:"待支付"}),e.jsx("option",{value:"failed",children:"已失败"}),e.jsx("option",{value:"refunded",children:"已退款"})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-0",children:[l.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无订单数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"订单号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"商品"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"支付方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"退款原因"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"推荐人/邀请码"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销佣金"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"下单时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ue.map(D=>{var pe,we;return e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsxs("td",{className:"p-4 font-mono text-xs text-gray-400",children:[(pe=D.id)==null?void 0:pe.slice(0,12),"..."]}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:D.userNickname}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.userPhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm",children:(()=>{const $e=D.productType||D.type;return $e==="fullbook"?`${D.bookName||"《底层逻辑》"} - 全本`:$e==="match"?"匹配次数购买":`${D.bookName||"《底层逻辑》"} - ${D.sectionTitle||D.chapterTitle||`章节${D.productId||D.sectionId||""}`}`})()}),e.jsx("p",{className:"text-gray-500 text-xs",children:(()=>{const $e=D.productType||D.type;return $e==="fullbook"?"全书解锁":$e==="match"?"功能权益":D.chapterTitle||"单章购买"})()})]})}),e.jsxs("td",{className:"p-4 text-[#38bdac] font-bold",children:["¥",typeof D.amount=="number"?D.amount.toFixed(2):parseFloat(String(D.amount||"0")).toFixed(2)]}),e.jsx("td",{className:"p-4 text-gray-300",children:D.paymentMethod==="wechat"?"微信支付":D.paymentMethod==="alipay"?"支付宝":D.paymentMethod||"微信支付"}),e.jsx("td",{className:"p-4",children:D.status==="refunded"?e.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0",children:"已退款"}):D.status==="completed"||D.status==="paid"?e.jsx(De,{className:"bg-green-500/20 text-green-400 border-0",children:"已完成"}):D.status==="pending"||D.status==="created"?e.jsx(De,{className:"bg-yellow-500/20 text-yellow-400 border-0",children:"待支付"}):e.jsx(De,{className:"bg-red-500/20 text-red-400 border-0",children:"已失败"})}),e.jsx("td",{className:"p-4 text-gray-400 text-sm max-w-[120px]",title:D.refundReason,children:D.status==="refunded"&&D.refundReason?D.refundReason:"-"}),e.jsx("td",{className:"p-4 text-gray-300 text-sm",children:D.referrerId||D.referralCode?e.jsxs("span",{title:D.referralCode||D.referrerCode||D.referrerId||"",children:[D.referrerNickname||D.referralCode||D.referrerCode||((we=D.referrerId)==null?void 0:we.slice(0,8)),(D.referralCode||D.referrerCode)&&` (${D.referralCode||D.referrerCode})`]}):"-"}),e.jsx("td",{className:"p-4 text-[#FFD700]",children:D.referrerEarnings?`¥${(typeof D.referrerEarnings=="number"?D.referrerEarnings:parseFloat(String(D.referrerEarnings))).toFixed(2)}`:"-"}),e.jsx("td",{className:"p-4 text-gray-400 text-sm",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:(D.status==="paid"||D.status==="completed")&&e.jsxs(J,{variant:"outline",size:"sm",className:"border-orange-500/50 text-orange-400 hover:bg-orange-500/20",onClick:()=>{se(D),q("")},children:[e.jsx(Wx,{className:"w-3 h-3 mr-1"}),"退款"]})})]},D.id)})})]})}),r==="orders"&&e.jsx(Fs,{page:T,totalPages:H,total:A,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),r==="bindings"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户昵称、手机号、推广码...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"active",children:"有效"}),e.jsx("option",{value:"converted",children:"已转化"}),e.jsx("option",{value:"expired",children:"已过期"})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-0",children:[Y.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无绑定数据"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"访客"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"分销商"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"绑定时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"到期时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"佣金"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:Y.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-medium",children:D.refereeNickname||"匿名用户"}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.refereePhone})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white",children:D.referrerName||"-"}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:D.referrerCode})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.boundAt?new Date(D.boundAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:D.expiresAt?new Date(D.expiresAt).toLocaleDateString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4",children:D.commission?e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",D.commission.toFixed(2)]}):e.jsx("span",{className:"text-gray-500",children:"-"})})]},D.id))})]})}),r==="bindings"&&e.jsx(Fs,{page:T,totalPages:H,total:A,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]}),r==="withdrawals"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-4",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(vr,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx(ie,{value:b,onChange:D=>N(D.target.value),placeholder:"搜索用户名称、账号...",className:"pl-10 bg-[#0f2137] border-gray-700 text-white"})]}),e.jsxs("select",{value:E,onChange:D=>j(D.target.value),className:"px-4 py-2 bg-[#0f2137] border border-gray-700 rounded-lg text-white",children:[e.jsx("option",{value:"all",children:"全部状态"}),e.jsx("option",{value:"pending",children:"待审核"}),e.jsx("option",{value:"completed",children:"已完成"}),e.jsx("option",{value:"rejected",children:"已拒绝"})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-0",children:[ye.length===0?e.jsx("div",{className:"py-12 text-center text-gray-500",children:"暂无提现记录"}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请人"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款方式"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"收款账号"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:ye.map(D=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[D.userAvatar?e.jsx("img",{src:D.userAvatar,alt:"",className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-600 flex items-center justify-center text-white text-sm font-medium",children:(D.userName||D.name||"?").slice(0,1)}),e.jsx("p",{className:"text-white font-medium",children:D.userName||D.name})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"text-[#38bdac] font-bold",children:["¥",D.amount.toFixed(2)]})}),e.jsx("td",{className:"p-4",children:e.jsx(De,{className:D.method==="wechat"?"bg-green-500/20 text-green-400 border-0":"bg-blue-500/20 text-blue-400 border-0",children:D.method==="wechat"?"微信":"支付宝"})}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-mono text-xs",children:D.account}),e.jsx("p",{className:"text-gray-500 text-xs",children:D.name})]})}),e.jsx("td",{className:"p-4 text-gray-400",children:D.createdAt?new Date(D.createdAt).toLocaleString("zh-CN"):"-"}),e.jsx("td",{className:"p-4",children:X(D.status)}),e.jsx("td",{className:"p-4 text-right",children:D.status==="pending"&&e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsxs(J,{size:"sm",onClick:()=>M(D.id),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Df,{className:"w-4 h-4 mr-1"}),"通过"]}),e.jsxs(J,{size:"sm",variant:"outline",onClick:()=>L(D.id),className:"border-red-500/50 text-red-400 hover:bg-red-500/20",children:[e.jsx(zx,{className:"w-4 h-4 mr-1"}),"拒绝"]})]})})]},D.id))})]})}),r==="withdrawals"&&e.jsx(Fs,{page:T,totalPages:H,total:A,pageSize:U,onPageChange:B,onPageSizeChange:D=>{k(D),B(1)}})]})})]})]}),e.jsx(wt,{open:!!le,onOpenChange:D=>!D&&se(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"订单退款"})}),le&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["订单号:",le.orderSn||le.id]}),e.jsxs("p",{className:"text-gray-400 text-sm",children:["退款金额:¥",typeof le.amount=="number"?le.amount.toFixed(2):parseFloat(String(le.amount||"0")).toFixed(2)]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-sm text-gray-400 block mb-2",children:"退款原因(选填)"}),e.jsx("div",{className:"form-input",children:e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"如:用户申请退款",value:G,onChange:D=>q(D.target.value)})})]}),e.jsx("p",{className:"text-orange-400/80 text-xs",children:"退款将原路退回至用户微信,且无法撤销,请确认后再操作。"})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",className:"border-gray-600 text-gray-300",onClick:()=>se(null),disabled:ce,children:"取消"}),e.jsx(J,{className:"bg-orange-500 hover:bg-orange-600 text-white",onClick:O,disabled:ce,children:ce?"退款中...":"确认退款"})]})]})})]})}function M2(){const[r,a]=h.useState([]),[l,o]=h.useState({total:0,pendingCount:0,pendingAmount:0,successCount:0,successAmount:0,failedCount:0}),[c,d]=h.useState(!0),[m,f]=h.useState(null),[p,y]=h.useState("all"),[g,v]=h.useState(1),[C,P]=h.useState(10),[R,S]=h.useState(0),[b,N]=h.useState(null);async function E(){var k,A,_,re,ae,le,se;d(!0),f(null);try{const G=new URLSearchParams({status:p,page:String(g),pageSize:String(C)}),q=await Ue(`/api/admin/withdrawals?${G}`);if(q!=null&&q.success){const ce=q.withdrawals||[];a(ce),S(q.total??((k=q.stats)==null?void 0:k.total)??ce.length),o({total:((A=q.stats)==null?void 0:A.total)??q.total??ce.length,pendingCount:((_=q.stats)==null?void 0:_.pendingCount)??0,pendingAmount:((re=q.stats)==null?void 0:re.pendingAmount)??0,successCount:((ae=q.stats)==null?void 0:ae.successCount)??0,successAmount:((le=q.stats)==null?void 0:le.successAmount)??0,failedCount:((se=q.stats)==null?void 0:se.failedCount)??0})}else f("加载提现记录失败")}catch(G){console.error("Load withdrawals error:",G),f("加载失败,请检查网络后重试")}finally{d(!1)}}h.useEffect(()=>{v(1)},[p]),h.useEffect(()=>{E()},[p,g,C]);const j=Math.ceil(R/C)||1;async function T(k){const A=r.find(_=>_.id===k);if(A!=null&&A.userCommissionInfo&&A.userCommissionInfo.availableAfterThis<0){if(!confirm(`⚠️ 风险警告:该用户审核后余额为负数(¥${A.userCommissionInfo.availableAfterThis.toFixed(2)}),可能存在超额提现。 + +确认已核实用户账户并完成打款?`))return}else if(!confirm("确认已完成打款?批准后将更新用户提现记录。"))return;N(k);try{const _=await vt("/api/admin/withdrawals",{id:k,action:"approve"});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}async function B(k){const A=prompt("请输入拒绝原因(将返还用户余额):");if(A){N(k);try{const _=await vt("/api/admin/withdrawals",{id:k,action:"reject",errorMessage:A});_!=null&&_.success?E():alert("操作失败: "+((_==null?void 0:_.error)??""))}catch{alert("操作失败")}finally{N(null)}}}function U(k){switch(k){case"pending":return e.jsx(De,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待处理"});case"pending_confirm":return e.jsx(De,{className:"bg-orange-500/20 text-orange-400 hover:bg-orange-500/20 border-0",children:"待用户确认"});case"processing":return e.jsx(De,{className:"bg-blue-500/20 text-blue-400 hover:bg-blue-500/20 border-0",children:"已审批等待打款"});case"success":case"completed":return e.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"已完成"});case"failed":case"rejected":return e.jsx(De,{className:"bg-red-500/20 text-red-400 hover:bg-red-500/20 border-0",children:"已拒绝"});default:return e.jsx(De,{className:"bg-gray-500/20 text-gray-400 border-0",children:k})}}return e.jsxs("div",{className:"p-8 w-full",children:[m&&e.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:[e.jsx("span",{children:m}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-start mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-white",children:"分账提现管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理用户分销收益的提现申请"})]}),e.jsxs(J,{variant:"outline",onClick:E,disabled:c,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${c?"animate-spin":""}`}),"刷新"]})]}),e.jsx(Se,{className:"bg-gradient-to-r from-[#38bdac]/10 to-[#0f2137] border-[#38bdac]/30 mb-6",children:e.jsx(Ce,{className:"p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac] mt-0.5"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-medium mb-2",children:"自动分账规则"}),e.jsxs("div",{className:"text-sm text-gray-400 space-y-1",children:[e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"分销比例"}),":推广者获得订单金额的"," ",e.jsx("span",{className:"text-white font-medium",children:"90%"})]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"结算方式"}),":用户付款后,分销收益自动计入推广者账户"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"提现方式"}),":用户在小程序端点击提现,系统自动转账到微信零钱"]}),e.jsxs("p",{children:["• ",e.jsx("span",{className:"text-[#38bdac]",children:"审批流程"}),":待处理的提现需管理员手动确认打款后批准"]})]})]})]})})}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-6",children:[e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-[#38bdac]",children:l.total}),e.jsx("div",{className:"text-sm text-gray-400",children:"总申请"})]})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-orange-400",children:l.pendingCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"待处理"}),e.jsxs("div",{className:"text-xs text-orange-400 mt-1",children:["¥",l.pendingAmount.toFixed(2)]})]})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-green-400",children:l.successCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已完成"}),e.jsxs("div",{className:"text-xs text-green-400 mt-1",children:["¥",l.successAmount.toFixed(2)]})]})}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsxs(Ce,{className:"p-4 text-center",children:[e.jsx("div",{className:"text-3xl font-bold text-red-400",children:l.failedCount}),e.jsx("div",{className:"text-sm text-gray-400",children:"已拒绝"})]})})]}),e.jsx("div",{className:"flex gap-2 mb-4",children:["all","pending","success","failed"].map(k=>e.jsx(J,{variant:p===k?"default":"outline",size:"sm",onClick:()=>y(k),className:p===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))}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:c?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):r.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(Sa,{className:"w-12 h-12 text-gray-600 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-500",children:"暂无提现记录"})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-[#0a1628] text-gray-400",children:[e.jsx("th",{className:"p-4 text-left font-medium",children:"申请时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"提现金额"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"用户佣金信息"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"状态"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"处理时间"}),e.jsx("th",{className:"p-4 text-left font-medium",children:"确认收款"}),e.jsx("th",{className:"p-4 text-right font-medium",children:"操作"})]})}),e.jsx("tbody",{className:"divide-y divide-gray-700/50",children:r.map(k=>e.jsxs("tr",{className:"hover:bg-[#0a1628] transition-colors",children:[e.jsx("td",{className:"p-4 text-gray-400",children:new Date(k.createdAt??"").toLocaleString()}),e.jsx("td",{className:"p-4",children:e.jsxs("div",{className:"flex items-center gap-2",children:[k.userAvatar?e.jsx("img",{src:k.userAvatar,alt:k.userName??"",className:"w-8 h-8 rounded-full object-cover"}):e.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)}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-white",children:k.userName??"未知"}),e.jsx("p",{className:"text-xs text-gray-500",children:k.userPhone??k.referralCode??(k.userId??"").slice(0,10)})]})]})}),e.jsx("td",{className:"p-4",children:e.jsxs("span",{className:"font-bold text-orange-400",children:["¥",Number(k.amount).toFixed(2)]})}),e.jsx("td",{className:"p-4",children:k.userCommissionInfo?e.jsxs("div",{className:"text-xs space-y-1",children:[e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"累计佣金:"}),e.jsxs("span",{className:"text-[#38bdac] font-medium",children:["¥",k.userCommissionInfo.totalCommission.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"已提现:"}),e.jsxs("span",{className:"text-gray-400",children:["¥",k.userCommissionInfo.withdrawnEarnings.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4",children:[e.jsx("span",{className:"text-gray-500",children:"待审核:"}),e.jsxs("span",{className:"text-orange-400",children:["¥",k.userCommissionInfo.pendingWithdrawals.toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between gap-4 pt-1 border-t border-gray-700/30",children:[e.jsx("span",{className:"text-gray-500",children:"审核后余额:"}),e.jsxs("span",{className:k.userCommissionInfo.availableAfterThis>=0?"text-green-400 font-medium":"text-red-400 font-medium",children:["¥",k.userCommissionInfo.availableAfterThis.toFixed(2)]})]})]}):e.jsx("span",{className:"text-gray-500 text-xs",children:"暂无数据"})}),e.jsxs("td",{className:"p-4",children:[U(k.status),k.errorMessage&&e.jsx("p",{className:"text-xs text-red-400 mt-1",children:k.errorMessage})]}),e.jsx("td",{className:"p-4 text-gray-400",children:k.processedAt?new Date(k.processedAt).toLocaleString():"-"}),e.jsx("td",{className:"p-4 text-gray-400",children:k.userConfirmedAt?e.jsxs("span",{className:"text-green-400",title:k.userConfirmedAt,children:["已确认 ",new Date(k.userConfirmedAt).toLocaleString()]}):"-"}),e.jsxs("td",{className:"p-4 text-right",children:[(k.status==="pending"||k.status==="pending_confirm")&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsxs(J,{size:"sm",onClick:()=>T(k.id),disabled:b===k.id,className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(vo,{className:"w-4 h-4 mr-1"}),"批准"]}),e.jsxs(J,{size:"sm",variant:"outline",onClick:()=>B(k.id),disabled:b===k.id,className:"border-red-500/50 text-red-400 hover:bg-red-500/10 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-1"}),"拒绝"]})]}),(k.status==="success"||k.status==="completed")&&k.transactionId&&e.jsx("span",{className:"text-xs text-gray-500 font-mono",children:k.transactionId})]})]},k.id))})]})}),e.jsx(Fs,{page:g,totalPages:j,total:R,pageSize:C,onPageChange:v,onPageSizeChange:k=>{P(k),v(1)}})]})})})]})}function uo(r,[a,l]){return Math.min(l,Math.max(a,r))}const A2=["top","right","bottom","left"],an=Math.min,ps=Math.max,ho=Math.round,qi=Math.floor,er=r=>({x:r,y:r}),D2={left:"right",right:"left",bottom:"top",top:"bottom"},L2={start:"end",end:"start"};function Zd(r,a,l){return ps(r,an(a,l))}function jr(r,a){return typeof r=="function"?r(a):r}function br(r){return r.split("-")[0]}function Ma(r){return r.split("-")[1]}function _u(r){return r==="x"?"y":"x"}function Mu(r){return r==="y"?"height":"width"}const O2=new Set(["top","bottom"]);function Js(r){return O2.has(br(r))?"y":"x"}function Au(r){return _u(Js(r))}function F2(r,a,l){l===void 0&&(l=!1);const o=Ma(r),c=Au(r),d=Mu(c);let m=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[d]>a.floating[d]&&(m=mo(m)),[m,mo(m)]}function z2(r){const a=mo(r);return[eu(r),a,eu(a)]}function eu(r){return r.replace(/start|end/g,a=>L2[a])}const lx=["left","right"],ix=["right","left"],$2=["top","bottom"],B2=["bottom","top"];function U2(r,a,l){switch(r){case"top":case"bottom":return l?a?ix:lx:a?lx:ix;case"left":case"right":return a?$2:B2;default:return[]}}function V2(r,a,l,o){const c=Ma(r);let d=U2(br(r),l==="start",o);return c&&(d=d.map(m=>m+"-"+c),a&&(d=d.concat(d.map(eu)))),d}function mo(r){return r.replace(/left|right|bottom|top/g,a=>D2[a])}function W2(r){return{top:0,right:0,bottom:0,left:0,...r}}function u0(r){return typeof r!="number"?W2(r):{top:r,right:r,bottom:r,left:r}}function fo(r){const{x:a,y:l,width:o,height:c}=r;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function ox(r,a,l){let{reference:o,floating:c}=r;const d=Js(a),m=Au(a),f=Mu(m),p=br(a),y=d==="y",g=o.x+o.width/2-c.width/2,v=o.y+o.height/2-c.height/2,C=o[f]/2-c[f]/2;let P;switch(p){case"top":P={x:g,y:o.y-c.height};break;case"bottom":P={x:g,y:o.y+o.height};break;case"right":P={x:o.x+o.width,y:v};break;case"left":P={x:o.x-c.width,y:v};break;default:P={x:o.x,y:o.y}}switch(Ma(a)){case"start":P[m]-=C*(l&&y?-1:1);break;case"end":P[m]+=C*(l&&y?-1:1);break}return P}async function H2(r,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:d,rects:m,elements:f,strategy:p}=r,{boundary:y="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:C=!1,padding:P=0}=jr(a,r),R=u0(P),b=f[C?v==="floating"?"reference":"floating":v],N=fo(await d.getClippingRect({element:(l=await(d.isElement==null?void 0:d.isElement(b)))==null||l?b:b.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(f.floating)),boundary:y,rootBoundary:g,strategy:p})),E=v==="floating"?{x:o,y:c,width:m.floating.width,height:m.floating.height}:m.reference,j=await(d.getOffsetParent==null?void 0:d.getOffsetParent(f.floating)),T=await(d.isElement==null?void 0:d.isElement(j))?await(d.getScale==null?void 0:d.getScale(j))||{x:1,y:1}:{x:1,y:1},B=fo(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:j,strategy:p}):E);return{top:(N.top-B.top+R.top)/T.y,bottom:(B.bottom-N.bottom+R.bottom)/T.y,left:(N.left-B.left+R.left)/T.x,right:(B.right-N.right+R.right)/T.x}}const K2=async(r,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:d=[],platform:m}=l,f=d.filter(Boolean),p=await(m.isRTL==null?void 0:m.isRTL(a));let y=await m.getElementRects({reference:r,floating:a,strategy:c}),{x:g,y:v}=ox(y,o,p),C=o,P={},R=0;for(let b=0;b({name:"arrow",options:r,async fn(a){const{x:l,y:o,placement:c,rects:d,platform:m,elements:f,middlewareData:p}=a,{element:y,padding:g=0}=jr(r,a)||{};if(y==null)return{};const v=u0(g),C={x:l,y:o},P=Au(c),R=Mu(P),S=await m.getDimensions(y),b=P==="y",N=b?"top":"left",E=b?"bottom":"right",j=b?"clientHeight":"clientWidth",T=d.reference[R]+d.reference[P]-C[P]-d.floating[R],B=C[P]-d.reference[P],U=await(m.getOffsetParent==null?void 0:m.getOffsetParent(y));let k=U?U[j]:0;(!k||!await(m.isElement==null?void 0:m.isElement(U)))&&(k=f.floating[j]||d.floating[R]);const A=T/2-B/2,_=k/2-S[R]/2-1,re=an(v[N],_),ae=an(v[E],_),le=re,se=k-S[R]-ae,G=k/2-S[R]/2+A,q=Zd(le,G,se),ce=!p.arrow&&Ma(c)!=null&&G!==q&&d.reference[R]/2-(GG<=0)){var ae,le;const G=(((ae=d.flip)==null?void 0:ae.index)||0)+1,q=k[G];if(q&&(!(v==="alignment"?E!==Js(q):!1)||re.every($=>Js($.placement)===E?$.overflows[0]>0:!0)))return{data:{index:G,overflows:re},reset:{placement:q}};let ce=(le=re.filter(je=>je.overflows[0]<=0).sort((je,$)=>je.overflows[1]-$.overflows[1])[0])==null?void 0:le.placement;if(!ce)switch(P){case"bestFit":{var se;const je=(se=re.filter($=>{if(U){const oe=Js($.placement);return oe===E||oe==="y"}return!0}).map($=>[$.placement,$.overflows.filter(oe=>oe>0).reduce((oe,K)=>oe+K,0)]).sort(($,oe)=>$[1]-oe[1])[0])==null?void 0:se[0];je&&(ce=je);break}case"initialPlacement":ce=f;break}if(c!==ce)return{reset:{placement:ce}}}return{}}}};function cx(r,a){return{top:r.top-a.height,right:r.right-a.width,bottom:r.bottom-a.height,left:r.left-a.width}}function dx(r){return A2.some(a=>r[a]>=0)}const Q2=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...d}=jr(r,a);switch(c){case"referenceHidden":{const m=await o.detectOverflow(a,{...d,elementContext:"reference"}),f=cx(m,l.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:dx(f)}}}case"escaped":{const m=await o.detectOverflow(a,{...d,altBoundary:!0}),f=cx(m,l.floating);return{data:{escapedOffsets:f,escaped:dx(f)}}}default:return{}}}}},h0=new Set(["left","top"]);async function q2(r,a){const{placement:l,platform:o,elements:c}=r,d=await(o.isRTL==null?void 0:o.isRTL(c.floating)),m=br(l),f=Ma(l),p=Js(l)==="y",y=h0.has(m)?-1:1,g=d&&p?-1:1,v=jr(a,r);let{mainAxis:C,crossAxis:P,alignmentAxis:R}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof R=="number"&&(P=f==="end"?R*-1:R),p?{x:P*g,y:C*y}:{x:C*y,y:P*g}}const X2=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(a){var l,o;const{x:c,y:d,placement:m,middlewareData:f}=a,p=await q2(a,r);return m===((l=f.offset)==null?void 0:l.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:c+p.x,y:d+p.y,data:{...p,placement:m}}}}},J2=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(a){const{x:l,y:o,placement:c,platform:d}=a,{mainAxis:m=!0,crossAxis:f=!1,limiter:p={fn:N=>{let{x:E,y:j}=N;return{x:E,y:j}}},...y}=jr(r,a),g={x:l,y:o},v=await d.detectOverflow(a,y),C=Js(br(c)),P=_u(C);let R=g[P],S=g[C];if(m){const N=P==="y"?"top":"left",E=P==="y"?"bottom":"right",j=R+v[N],T=R-v[E];R=Zd(j,R,T)}if(f){const N=C==="y"?"top":"left",E=C==="y"?"bottom":"right",j=S+v[N],T=S-v[E];S=Zd(j,S,T)}const b=p.fn({...a,[P]:R,[C]:S});return{...b,data:{x:b.x-l,y:b.y-o,enabled:{[P]:m,[C]:f}}}}}},Z2=function(r){return r===void 0&&(r={}),{options:r,fn(a){const{x:l,y:o,placement:c,rects:d,middlewareData:m}=a,{offset:f=0,mainAxis:p=!0,crossAxis:y=!0}=jr(r,a),g={x:l,y:o},v=Js(c),C=_u(v);let P=g[C],R=g[v];const S=jr(f,a),b=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(p){const j=C==="y"?"height":"width",T=d.reference[C]-d.floating[j]+b.mainAxis,B=d.reference[C]+d.reference[j]-b.mainAxis;PB&&(P=B)}if(y){var N,E;const j=C==="y"?"width":"height",T=h0.has(br(c)),B=d.reference[v]-d.floating[j]+(T&&((N=m.offset)==null?void 0:N[v])||0)+(T?0:b.crossAxis),U=d.reference[v]+d.reference[j]+(T?0:((E=m.offset)==null?void 0:E[v])||0)-(T?b.crossAxis:0);RU&&(R=U)}return{[C]:P,[v]:R}}}},e4=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(a){var l,o;const{placement:c,rects:d,platform:m,elements:f}=a,{apply:p=()=>{},...y}=jr(r,a),g=await m.detectOverflow(a,y),v=br(c),C=Ma(c),P=Js(c)==="y",{width:R,height:S}=d.floating;let b,N;v==="top"||v==="bottom"?(b=v,N=C===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(N=v,b=C==="end"?"top":"bottom");const E=S-g.top-g.bottom,j=R-g.left-g.right,T=an(S-g[b],E),B=an(R-g[N],j),U=!a.middlewareData.shift;let k=T,A=B;if((l=a.middlewareData.shift)!=null&&l.enabled.x&&(A=j),(o=a.middlewareData.shift)!=null&&o.enabled.y&&(k=E),U&&!C){const re=ps(g.left,0),ae=ps(g.right,0),le=ps(g.top,0),se=ps(g.bottom,0);P?A=R-2*(re!==0||ae!==0?re+ae:ps(g.left,g.right)):k=S-2*(le!==0||se!==0?le+se:ps(g.top,g.bottom))}await p({...a,availableWidth:A,availableHeight:k});const _=await m.getDimensions(f.floating);return R!==_.width||S!==_.height?{reset:{rects:!0}}:{}}}};function ko(){return typeof window<"u"}function Aa(r){return m0(r)?(r.nodeName||"").toLowerCase():"#document"}function gs(r){var a;return(r==null||(a=r.ownerDocument)==null?void 0:a.defaultView)||window}function rr(r){var a;return(a=(m0(r)?r.ownerDocument:r.document)||window.document)==null?void 0:a.documentElement}function m0(r){return ko()?r instanceof Node||r instanceof gs(r).Node:!1}function zs(r){return ko()?r instanceof Element||r instanceof gs(r).Element:!1}function sr(r){return ko()?r instanceof HTMLElement||r instanceof gs(r).HTMLElement:!1}function ux(r){return!ko()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof gs(r).ShadowRoot}const t4=new Set(["inline","contents"]);function Ml(r){const{overflow:a,overflowX:l,overflowY:o,display:c}=$s(r);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&!t4.has(c)}const s4=new Set(["table","td","th"]);function r4(r){return s4.has(Aa(r))}const n4=[":popover-open",":modal"];function Eo(r){return n4.some(a=>{try{return r.matches(a)}catch{return!1}})}const a4=["transform","translate","scale","rotate","perspective"],l4=["transform","translate","scale","rotate","perspective","filter"],i4=["paint","layout","strict","content"];function Du(r){const a=Lu(),l=zs(r)?$s(r):r;return a4.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)||l4.some(o=>(l.willChange||"").includes(o))||i4.some(o=>(l.contain||"").includes(o))}function o4(r){let a=ln(r);for(;sr(a)&&!ka(a);){if(Du(a))return a;if(Eo(a))return null;a=ln(a)}return null}function Lu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const c4=new Set(["html","body","#document"]);function ka(r){return c4.has(Aa(r))}function $s(r){return gs(r).getComputedStyle(r)}function Po(r){return zs(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function ln(r){if(Aa(r)==="html")return r;const a=r.assignedSlot||r.parentNode||ux(r)&&r.host||rr(r);return ux(a)?a.host:a}function f0(r){const a=ln(r);return ka(a)?r.ownerDocument?r.ownerDocument.body:r.body:sr(a)&&Ml(a)?a:f0(a)}function El(r,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=f0(r),d=c===((o=r.ownerDocument)==null?void 0:o.body),m=gs(c);if(d){const f=tu(m);return a.concat(m,m.visualViewport||[],Ml(c)?c:[],f&&l?El(f):[])}return a.concat(c,El(c,[],l))}function tu(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function x0(r){const a=$s(r);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=sr(r),d=c?r.offsetWidth:l,m=c?r.offsetHeight:o,f=ho(l)!==d||ho(o)!==m;return f&&(l=d,o=m),{width:l,height:o,$:f}}function Ou(r){return zs(r)?r:r.contextElement}function wa(r){const a=Ou(r);if(!sr(a))return er(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:d}=x0(a);let m=(d?ho(l.width):l.width)/o,f=(d?ho(l.height):l.height)/c;return(!m||!Number.isFinite(m))&&(m=1),(!f||!Number.isFinite(f))&&(f=1),{x:m,y:f}}const d4=er(0);function p0(r){const a=gs(r);return!Lu()||!a.visualViewport?d4:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function u4(r,a,l){return a===void 0&&(a=!1),!l||a&&l!==gs(r)?!1:a}function Ln(r,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=r.getBoundingClientRect(),d=Ou(r);let m=er(1);a&&(o?zs(o)&&(m=wa(o)):m=wa(r));const f=u4(d,l,o)?p0(d):er(0);let p=(c.left+f.x)/m.x,y=(c.top+f.y)/m.y,g=c.width/m.x,v=c.height/m.y;if(d){const C=gs(d),P=o&&zs(o)?gs(o):o;let R=C,S=tu(R);for(;S&&o&&P!==R;){const b=wa(S),N=S.getBoundingClientRect(),E=$s(S),j=N.left+(S.clientLeft+parseFloat(E.paddingLeft))*b.x,T=N.top+(S.clientTop+parseFloat(E.paddingTop))*b.y;p*=b.x,y*=b.y,g*=b.x,v*=b.y,p+=j,y+=T,R=gs(S),S=tu(R)}}return fo({width:g,height:v,x:p,y})}function Ro(r,a){const l=Po(r).scrollLeft;return a?a.left+l:Ln(rr(r)).left+l}function g0(r,a){const l=r.getBoundingClientRect(),o=l.left+a.scrollLeft-Ro(r,l),c=l.top+a.scrollTop;return{x:o,y:c}}function h4(r){let{elements:a,rect:l,offsetParent:o,strategy:c}=r;const d=c==="fixed",m=rr(o),f=a?Eo(a.floating):!1;if(o===m||f&&d)return l;let p={scrollLeft:0,scrollTop:0},y=er(1);const g=er(0),v=sr(o);if((v||!v&&!d)&&((Aa(o)!=="body"||Ml(m))&&(p=Po(o)),sr(o))){const P=Ln(o);y=wa(o),g.x=P.x+o.clientLeft,g.y=P.y+o.clientTop}const C=m&&!v&&!d?g0(m,p):er(0);return{width:l.width*y.x,height:l.height*y.y,x:l.x*y.x-p.scrollLeft*y.x+g.x+C.x,y:l.y*y.y-p.scrollTop*y.y+g.y+C.y}}function m4(r){return Array.from(r.getClientRects())}function f4(r){const a=rr(r),l=Po(r),o=r.ownerDocument.body,c=ps(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),d=ps(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let m=-l.scrollLeft+Ro(r);const f=-l.scrollTop;return $s(o).direction==="rtl"&&(m+=ps(a.clientWidth,o.clientWidth)-c),{width:c,height:d,x:m,y:f}}const hx=25;function x4(r,a){const l=gs(r),o=rr(r),c=l.visualViewport;let d=o.clientWidth,m=o.clientHeight,f=0,p=0;if(c){d=c.width,m=c.height;const g=Lu();(!g||g&&a==="fixed")&&(f=c.offsetLeft,p=c.offsetTop)}const y=Ro(o);if(y<=0){const g=o.ownerDocument,v=g.body,C=getComputedStyle(v),P=g.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,R=Math.abs(o.clientWidth-v.clientWidth-P);R<=hx&&(d-=R)}else y<=hx&&(d+=y);return{width:d,height:m,x:f,y:p}}const p4=new Set(["absolute","fixed"]);function g4(r,a){const l=Ln(r,!0,a==="fixed"),o=l.top+r.clientTop,c=l.left+r.clientLeft,d=sr(r)?wa(r):er(1),m=r.clientWidth*d.x,f=r.clientHeight*d.y,p=c*d.x,y=o*d.y;return{width:m,height:f,x:p,y}}function mx(r,a,l){let o;if(a==="viewport")o=x4(r,l);else if(a==="document")o=f4(rr(r));else if(zs(a))o=g4(a,l);else{const c=p0(r);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return fo(o)}function y0(r,a){const l=ln(r);return l===a||!zs(l)||ka(l)?!1:$s(l).position==="fixed"||y0(l,a)}function y4(r,a){const l=a.get(r);if(l)return l;let o=El(r,[],!1).filter(f=>zs(f)&&Aa(f)!=="body"),c=null;const d=$s(r).position==="fixed";let m=d?ln(r):r;for(;zs(m)&&!ka(m);){const f=$s(m),p=Du(m);!p&&f.position==="fixed"&&(c=null),(d?!p&&!c:!p&&f.position==="static"&&!!c&&p4.has(c.position)||Ml(m)&&!p&&y0(r,m))?o=o.filter(g=>g!==m):c=f,m=ln(m)}return a.set(r,o),o}function v4(r){let{element:a,boundary:l,rootBoundary:o,strategy:c}=r;const m=[...l==="clippingAncestors"?Eo(a)?[]:y4(a,this._c):[].concat(l),o],f=m[0],p=m.reduce((y,g)=>{const v=mx(a,g,c);return y.top=ps(v.top,y.top),y.right=an(v.right,y.right),y.bottom=an(v.bottom,y.bottom),y.left=ps(v.left,y.left),y},mx(a,f,c));return{width:p.right-p.left,height:p.bottom-p.top,x:p.left,y:p.top}}function j4(r){const{width:a,height:l}=x0(r);return{width:a,height:l}}function b4(r,a,l){const o=sr(a),c=rr(a),d=l==="fixed",m=Ln(r,!0,d,a);let f={scrollLeft:0,scrollTop:0};const p=er(0);function y(){p.x=Ro(c)}if(o||!o&&!d)if((Aa(a)!=="body"||Ml(c))&&(f=Po(a)),o){const P=Ln(a,!0,d,a);p.x=P.x+a.clientLeft,p.y=P.y+a.clientTop}else c&&y();d&&!o&&c&&y();const g=c&&!o&&!d?g0(c,f):er(0),v=m.left+f.scrollLeft-p.x-g.x,C=m.top+f.scrollTop-p.y-g.y;return{x:v,y:C,width:m.width,height:m.height}}function Dd(r){return $s(r).position==="static"}function fx(r,a){if(!sr(r)||$s(r).position==="fixed")return null;if(a)return a(r);let l=r.offsetParent;return rr(r)===l&&(l=l.ownerDocument.body),l}function v0(r,a){const l=gs(r);if(Eo(r))return l;if(!sr(r)){let c=ln(r);for(;c&&!ka(c);){if(zs(c)&&!Dd(c))return c;c=ln(c)}return l}let o=fx(r,a);for(;o&&r4(o)&&Dd(o);)o=fx(o,a);return o&&ka(o)&&Dd(o)&&!Du(o)?l:o||o4(r)||l}const N4=async function(r){const a=this.getOffsetParent||v0,l=this.getDimensions,o=await l(r.floating);return{reference:b4(r.reference,await a(r.floating),r.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function w4(r){return $s(r).direction==="rtl"}const S4={convertOffsetParentRelativeRectToViewportRelativeRect:h4,getDocumentElement:rr,getClippingRect:v4,getOffsetParent:v0,getElementRects:N4,getClientRects:m4,getDimensions:j4,getScale:wa,isElement:zs,isRTL:w4};function j0(r,a){return r.x===a.x&&r.y===a.y&&r.width===a.width&&r.height===a.height}function C4(r,a){let l=null,o;const c=rr(r);function d(){var f;clearTimeout(o),(f=l)==null||f.disconnect(),l=null}function m(f,p){f===void 0&&(f=!1),p===void 0&&(p=1),d();const y=r.getBoundingClientRect(),{left:g,top:v,width:C,height:P}=y;if(f||a(),!C||!P)return;const R=qi(v),S=qi(c.clientWidth-(g+C)),b=qi(c.clientHeight-(v+P)),N=qi(g),j={rootMargin:-R+"px "+-S+"px "+-b+"px "+-N+"px",threshold:ps(0,an(1,p))||1};let T=!0;function B(U){const k=U[0].intersectionRatio;if(k!==p){if(!T)return m();k?m(!1,k):o=setTimeout(()=>{m(!1,1e-7)},1e3)}k===1&&!j0(y,r.getBoundingClientRect())&&m(),T=!1}try{l=new IntersectionObserver(B,{...j,root:c.ownerDocument})}catch{l=new IntersectionObserver(B,j)}l.observe(r)}return m(!0),d}function k4(r,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:d=!0,elementResize:m=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:p=!1}=o,y=Ou(r),g=c||d?[...y?El(y):[],...El(a)]:[];g.forEach(N=>{c&&N.addEventListener("scroll",l,{passive:!0}),d&&N.addEventListener("resize",l)});const v=y&&f?C4(y,l):null;let C=-1,P=null;m&&(P=new ResizeObserver(N=>{let[E]=N;E&&E.target===y&&P&&(P.unobserve(a),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var j;(j=P)==null||j.observe(a)})),l()}),y&&!p&&P.observe(y),P.observe(a));let R,S=p?Ln(r):null;p&&b();function b(){const N=Ln(r);S&&!j0(S,N)&&l(),S=N,R=requestAnimationFrame(b)}return l(),()=>{var N;g.forEach(E=>{c&&E.removeEventListener("scroll",l),d&&E.removeEventListener("resize",l)}),v==null||v(),(N=P)==null||N.disconnect(),P=null,p&&cancelAnimationFrame(R)}}const E4=X2,P4=J2,R4=G2,T4=e4,I4=Q2,xx=Y2,_4=Z2,M4=(r,a,l)=>{const o=new Map,c={platform:S4,...l},d={...c.platform,_c:o};return K2(r,a,{...c,platform:d})};var A4=typeof document<"u",D4=function(){},eo=A4?h.useLayoutEffect:D4;function xo(r,a){if(r===a)return!0;if(typeof r!=typeof a)return!1;if(typeof r=="function"&&r.toString()===a.toString())return!0;let l,o,c;if(r&&a&&typeof r=="object"){if(Array.isArray(r)){if(l=r.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!xo(r[o],a[o]))return!1;return!0}if(c=Object.keys(r),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 d=c[o];if(!(d==="_owner"&&r.$$typeof)&&!xo(r[d],a[d]))return!1}return!0}return r!==r&&a!==a}function b0(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function px(r,a){const l=b0(r);return Math.round(a*l)/l}function Ld(r){const a=h.useRef(r);return eo(()=>{a.current=r}),a}function L4(r){r===void 0&&(r={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:d,floating:m}={},transform:f=!0,whileElementsMounted:p,open:y}=r,[g,v]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[C,P]=h.useState(o);xo(C,o)||P(o);const[R,S]=h.useState(null),[b,N]=h.useState(null),E=h.useCallback($=>{$!==U.current&&(U.current=$,S($))},[]),j=h.useCallback($=>{$!==k.current&&(k.current=$,N($))},[]),T=d||R,B=m||b,U=h.useRef(null),k=h.useRef(null),A=h.useRef(g),_=p!=null,re=Ld(p),ae=Ld(c),le=Ld(y),se=h.useCallback(()=>{if(!U.current||!k.current)return;const $={placement:a,strategy:l,middleware:C};ae.current&&($.platform=ae.current),M4(U.current,k.current,$).then(oe=>{const K={...oe,isPositioned:le.current!==!1};G.current&&!xo(A.current,K)&&(A.current=K,Pl.flushSync(()=>{v(K)}))})},[C,a,l,ae,le]);eo(()=>{y===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,v($=>({...$,isPositioned:!1})))},[y]);const G=h.useRef(!1);eo(()=>(G.current=!0,()=>{G.current=!1}),[]),eo(()=>{if(T&&(U.current=T),B&&(k.current=B),T&&B){if(re.current)return re.current(T,B,se);se()}},[T,B,se,re,_]);const q=h.useMemo(()=>({reference:U,floating:k,setReference:E,setFloating:j}),[E,j]),ce=h.useMemo(()=>({reference:T,floating:B}),[T,B]),je=h.useMemo(()=>{const $={position:l,left:0,top:0};if(!ce.floating)return $;const oe=px(ce.floating,g.x),K=px(ce.floating,g.y);return f?{...$,transform:"translate("+oe+"px, "+K+"px)",...b0(ce.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:oe,top:K}},[l,f,ce.floating,g.x,g.y]);return h.useMemo(()=>({...g,update:se,refs:q,elements:ce,floatingStyles:je}),[g,se,q,ce,je])}const O4=r=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:r,fn(l){const{element:o,padding:c}=typeof r=="function"?r(l):r;return o&&a(o)?o.current!=null?xx({element:o.current,padding:c}).fn(l):{}:o?xx({element:o,padding:c}).fn(l):{}}}},F4=(r,a)=>({...E4(r),options:[r,a]}),z4=(r,a)=>({...P4(r),options:[r,a]}),$4=(r,a)=>({..._4(r),options:[r,a]}),B4=(r,a)=>({...R4(r),options:[r,a]}),U4=(r,a)=>({...T4(r),options:[r,a]}),V4=(r,a)=>({...I4(r),options:[r,a]}),W4=(r,a)=>({...O4(r),options:[r,a]});var H4="Arrow",N0=h.forwardRef((r,a)=>{const{children:l,width:o=10,height:c=5,...d}=r;return e.jsx(qe.svg,{...d,ref:a,width:o,height:c,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:r.asChild?l:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});N0.displayName=H4;var K4=N0,Fu="Popper",[w0,S0]=dn(Fu),[Y4,C0]=w0(Fu),k0=r=>{const{__scopePopper:a,children:l}=r,[o,c]=h.useState(null);return e.jsx(Y4,{scope:a,anchor:o,onAnchorChange:c,children:l})};k0.displayName=Fu;var E0="PopperAnchor",P0=h.forwardRef((r,a)=>{const{__scopePopper:l,virtualRef:o,...c}=r,d=C0(E0,l),m=h.useRef(null),f=st(a,m),p=h.useRef(null);return h.useEffect(()=>{const y=p.current;p.current=(o==null?void 0:o.current)||m.current,y!==p.current&&d.onAnchorChange(p.current)}),o?null:e.jsx(qe.div,{...c,ref:f})});P0.displayName=E0;var zu="PopperContent",[G4,Q4]=w0(zu),R0=h.forwardRef((r,a)=>{var Y,ye,ve,D,pe,we;const{__scopePopper:l,side:o="bottom",sideOffset:c=0,align:d="center",alignOffset:m=0,arrowPadding:f=0,avoidCollisions:p=!0,collisionBoundary:y=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:C=!1,updatePositionStrategy:P="optimized",onPlaced:R,...S}=r,b=C0(zu,l),[N,E]=h.useState(null),j=st(a,$e=>E($e)),[T,B]=h.useState(null),U=Iu(T),k=(U==null?void 0:U.width)??0,A=(U==null?void 0:U.height)??0,_=o+(d!=="center"?"-"+d:""),re=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},ae=Array.isArray(y)?y:[y],le=ae.length>0,se={padding:re,boundary:ae.filter(X4),altBoundary:le},{refs:G,floatingStyles:q,placement:ce,isPositioned:je,middlewareData:$}=L4({strategy:"fixed",placement:_,whileElementsMounted:(...$e)=>k4(...$e,{animationFrame:P==="always"}),elements:{reference:b.anchor},middleware:[F4({mainAxis:c+A,alignmentAxis:m}),p&&z4({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?$4():void 0,...se}),p&&B4({...se}),U4({...se,apply:({elements:$e,rects:de,availableWidth:he,availableHeight:We})=>{const{width:Ze,height:xt}=de.reference,Xe=$e.floating.style;Xe.setProperty("--radix-popper-available-width",`${he}px`),Xe.setProperty("--radix-popper-available-height",`${We}px`),Xe.setProperty("--radix-popper-anchor-width",`${Ze}px`),Xe.setProperty("--radix-popper-anchor-height",`${xt}px`)}}),T&&W4({element:T,padding:f}),J4({arrowWidth:k,arrowHeight:A}),C&&V4({strategy:"referenceHidden",...se})]}),[oe,K]=_0(ce),M=nn(R);Zt(()=>{je&&(M==null||M())},[je,M]);const L=(Y=$.arrow)==null?void 0:Y.x,O=(ye=$.arrow)==null?void 0:ye.y,X=((ve=$.arrow)==null?void 0:ve.centerOffset)!==0,[H,ue]=h.useState();return Zt(()=>{N&&ue(window.getComputedStyle(N).zIndex)},[N]),e.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:je?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[(D=$.transformOrigin)==null?void 0:D.x,(pe=$.transformOrigin)==null?void 0:pe.y].join(" "),...((we=$.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:r.dir,children:e.jsx(G4,{scope:l,placedSide:oe,onArrowChange:B,arrowX:L,arrowY:O,shouldHideArrow:X,children:e.jsx(qe.div,{"data-side":oe,"data-align":K,...S,ref:j,style:{...S.style,animation:je?void 0:"none"}})})})});R0.displayName=zu;var T0="PopperArrow",q4={top:"bottom",right:"left",bottom:"top",left:"right"},I0=h.forwardRef(function(a,l){const{__scopePopper:o,...c}=a,d=Q4(T0,o),m=q4[d.placedSide];return e.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[m]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:e.jsx(K4,{...c,ref:l,style:{...c.style,display:"block"}})})});I0.displayName=T0;function X4(r){return r!==null}var J4=r=>({name:"transformOrigin",options:r,fn(a){var b,N,E;const{placement:l,rects:o,middlewareData:c}=a,m=((b=c.arrow)==null?void 0:b.centerOffset)!==0,f=m?0:r.arrowWidth,p=m?0:r.arrowHeight,[y,g]=_0(l),v={start:"0%",center:"50%",end:"100%"}[g],C=(((N=c.arrow)==null?void 0:N.x)??0)+f/2,P=(((E=c.arrow)==null?void 0:E.y)??0)+p/2;let R="",S="";return y==="bottom"?(R=m?v:`${C}px`,S=`${-p}px`):y==="top"?(R=m?v:`${C}px`,S=`${o.floating.height+p}px`):y==="right"?(R=`${-p}px`,S=m?v:`${P}px`):y==="left"&&(R=`${o.floating.width+p}px`,S=m?v:`${P}px`),{data:{x:R,y:S}}}});function _0(r){const[a,l="center"]=r.split("-");return[a,l]}var Z4=k0,eS=P0,tS=R0,sS=I0,M0=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"}),rS="VisuallyHidden",nS=h.forwardRef((r,a)=>e.jsx(qe.span,{...r,ref:a,style:{...M0,...r.style}}));nS.displayName=rS;var aS=[" ","Enter","ArrowUp","ArrowDown"],lS=[" ","Enter"],On="Select",[To,Io,iS]=Pu(On),[Da]=dn(On,[iS,S0]),_o=S0(),[oS,un]=Da(On),[cS,dS]=Da(On),A0=r=>{const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:d,value:m,defaultValue:f,onValueChange:p,dir:y,name:g,autoComplete:v,disabled:C,required:P,form:R}=r,S=_o(a),[b,N]=h.useState(null),[E,j]=h.useState(null),[T,B]=h.useState(!1),U=wo(y),[k,A]=An({prop:o,defaultProp:c??!1,onChange:d,caller:On}),[_,re]=An({prop:m,defaultProp:f,onChange:p,caller:On}),ae=h.useRef(null),le=b?R||!!b.closest("form"):!0,[se,G]=h.useState(new Set),q=Array.from(se).map(ce=>ce.props.value).join(";");return e.jsx(Z4,{...S,children:e.jsxs(oS,{required:P,scope:a,trigger:b,onTriggerChange:N,valueNode:E,onValueNodeChange:j,valueNodeHasChildren:T,onValueNodeHasChildrenChange:B,contentId:sn(),value:_,onValueChange:re,open:k,onOpenChange:A,dir:U,triggerPointerDownPosRef:ae,disabled:C,children:[e.jsx(To.Provider,{scope:a,children:e.jsx(cS,{scope:r.__scopeSelect,onNativeOptionAdd:h.useCallback(ce=>{G(je=>new Set(je).add(ce))},[]),onNativeOptionRemove:h.useCallback(ce=>{G(je=>{const $=new Set(je);return $.delete(ce),$})},[]),children:l})}),le?e.jsxs(sg,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:v,value:_,onChange:ce=>re(ce.target.value),disabled:C,form:R,children:[_===void 0?e.jsx("option",{value:""}):null,Array.from(se)]},q):null]})})};A0.displayName=On;var D0="SelectTrigger",L0=h.forwardRef((r,a)=>{const{__scopeSelect:l,disabled:o=!1,...c}=r,d=_o(l),m=un(D0,l),f=m.disabled||o,p=st(a,m.onTriggerChange),y=Io(l),g=h.useRef("touch"),[v,C,P]=ng(S=>{const b=y().filter(j=>!j.disabled),N=b.find(j=>j.value===m.value),E=ag(b,S,N);E!==void 0&&m.onValueChange(E.value)}),R=S=>{f||(m.onOpenChange(!0),P()),S&&(m.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return e.jsx(eS,{asChild:!0,...d,children:e.jsx(qe.button,{type:"button",role:"combobox","aria-controls":m.contentId,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":rg(m.value)?"":void 0,...c,ref:p,onClick:He(c.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&R(S)}),onPointerDown:He(c.onPointerDown,S=>{g.current=S.pointerType;const b=S.target;b.hasPointerCapture(S.pointerId)&&b.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(R(S),S.preventDefault())}),onKeyDown:He(c.onKeyDown,S=>{const b=v.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&C(S.key),!(b&&S.key===" ")&&aS.includes(S.key)&&(R(),S.preventDefault())})})})});L0.displayName=D0;var O0="SelectValue",F0=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,children:d,placeholder:m="",...f}=r,p=un(O0,l),{onValueNodeHasChildrenChange:y}=p,g=d!==void 0,v=st(a,p.onValueNodeChange);return Zt(()=>{y(g)},[y,g]),e.jsx(qe.span,{...f,ref:v,style:{pointerEvents:"none"},children:rg(p.value)?e.jsx(e.Fragment,{children:m}):d})});F0.displayName=O0;var uS="SelectIcon",z0=h.forwardRef((r,a)=>{const{__scopeSelect:l,children:o,...c}=r;return e.jsx(qe.span,{"aria-hidden":!0,...c,ref:a,children:o||"▼"})});z0.displayName=uS;var hS="SelectPortal",$0=r=>e.jsx(wu,{asChild:!0,...r});$0.displayName=hS;var Fn="SelectContent",B0=h.forwardRef((r,a)=>{const l=un(Fn,r.__scopeSelect),[o,c]=h.useState();if(Zt(()=>{c(new DocumentFragment)},[]),!l.open){const d=o;return d?Pl.createPortal(e.jsx(U0,{scope:r.__scopeSelect,children:e.jsx(To.Slot,{scope:r.__scopeSelect,children:e.jsx("div",{children:r.children})})}),d):null}return e.jsx(V0,{...r,ref:a})});B0.displayName=Fn;var Os=10,[U0,hn]=Da(Fn),mS="SelectContentImpl",fS=kl("SelectContent.RemoveScroll"),V0=h.forwardRef((r,a)=>{const{__scopeSelect:l,position:o="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:d,onPointerDownOutside:m,side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:R,hideWhenDetached:S,avoidCollisions:b,...N}=r,E=un(Fn,l),[j,T]=h.useState(null),[B,U]=h.useState(null),k=st(a,Y=>T(Y)),[A,_]=h.useState(null),[re,ae]=h.useState(null),le=Io(l),[se,G]=h.useState(!1),q=h.useRef(!1);h.useEffect(()=>{if(j)return bp(j)},[j]),hp();const ce=h.useCallback(Y=>{const[ye,...ve]=le().map(we=>we.ref.current),[D]=ve.slice(-1),pe=document.activeElement;for(const we of Y)if(we===pe||(we==null||we.scrollIntoView({block:"nearest"}),we===ye&&B&&(B.scrollTop=0),we===D&&B&&(B.scrollTop=B.scrollHeight),we==null||we.focus(),document.activeElement!==pe))return},[le,B]),je=h.useCallback(()=>ce([A,j]),[ce,A,j]);h.useEffect(()=>{se&&je()},[se,je]);const{onOpenChange:$,triggerPointerDownPosRef:oe}=E;h.useEffect(()=>{if(j){let Y={x:0,y:0};const ye=D=>{var pe,we;Y={x:Math.abs(Math.round(D.pageX)-(((pe=oe.current)==null?void 0:pe.x)??0)),y:Math.abs(Math.round(D.pageY)-(((we=oe.current)==null?void 0:we.y)??0))}},ve=D=>{Y.x<=10&&Y.y<=10?D.preventDefault():j.contains(D.target)||$(!1),document.removeEventListener("pointermove",ye),oe.current=null};return oe.current!==null&&(document.addEventListener("pointermove",ye),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ye),document.removeEventListener("pointerup",ve,{capture:!0})}}},[j,$,oe]),h.useEffect(()=>{const Y=()=>$(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[$]);const[K,M]=ng(Y=>{const ye=le().filter(pe=>!pe.disabled),ve=ye.find(pe=>pe.ref.current===document.activeElement),D=ag(ye,Y,ve);D&&setTimeout(()=>D.ref.current.focus())}),L=h.useCallback((Y,ye,ve)=>{const D=!q.current&&!ve;(E.value!==void 0&&E.value===ye||D)&&(_(Y),D&&(q.current=!0))},[E.value]),O=h.useCallback(()=>j==null?void 0:j.focus(),[j]),X=h.useCallback((Y,ye,ve)=>{const D=!q.current&&!ve;(E.value!==void 0&&E.value===ye||D)&&ae(Y)},[E.value]),H=o==="popper"?su:W0,ue=H===su?{side:f,sideOffset:p,align:y,alignOffset:g,arrowPadding:v,collisionBoundary:C,collisionPadding:P,sticky:R,hideWhenDetached:S,avoidCollisions:b}:{};return e.jsx(U0,{scope:l,content:j,viewport:B,onViewportChange:U,itemRefCallback:L,selectedItem:A,onItemLeave:O,itemTextRefCallback:X,focusSelectedItem:je,selectedItemText:re,position:o,isPositioned:se,searchRef:K,children:e.jsx(Su,{as:fS,allowPinchZoom:!0,children:e.jsx(Nu,{asChild:!0,trapped:E.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:He(c,Y=>{var ye;(ye=E.trigger)==null||ye.focus({preventScroll:!0}),Y.preventDefault()}),children:e.jsx(bu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:e.jsx(H,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:Y=>Y.preventDefault(),...N,...ue,onPlaced:()=>G(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:He(N.onKeyDown,Y=>{const ye=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!ye&&Y.key.length===1&&M(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let D=le().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(D=D.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const pe=Y.target,we=D.indexOf(pe);D=D.slice(we+1)}setTimeout(()=>ce(D)),Y.preventDefault()}})})})})})})});V0.displayName=mS;var xS="SelectItemAlignedPosition",W0=h.forwardRef((r,a)=>{const{__scopeSelect:l,onPlaced:o,...c}=r,d=un(Fn,l),m=hn(Fn,l),[f,p]=h.useState(null),[y,g]=h.useState(null),v=st(a,k=>g(k)),C=Io(l),P=h.useRef(!1),R=h.useRef(!0),{viewport:S,selectedItem:b,selectedItemText:N,focusSelectedItem:E}=m,j=h.useCallback(()=>{if(d.trigger&&d.valueNode&&f&&y&&S&&b&&N){const k=d.trigger.getBoundingClientRect(),A=y.getBoundingClientRect(),_=d.valueNode.getBoundingClientRect(),re=N.getBoundingClientRect();if(d.dir!=="rtl"){const pe=re.left-A.left,we=_.left-pe,$e=k.left-we,de=k.width+$e,he=Math.max(de,A.width),We=window.innerWidth-Os,Ze=uo(we,[Os,Math.max(Os,We-he)]);f.style.minWidth=de+"px",f.style.left=Ze+"px"}else{const pe=A.right-re.right,we=window.innerWidth-_.right-pe,$e=window.innerWidth-k.right-we,de=k.width+$e,he=Math.max(de,A.width),We=window.innerWidth-Os,Ze=uo(we,[Os,Math.max(Os,We-he)]);f.style.minWidth=de+"px",f.style.right=Ze+"px"}const ae=C(),le=window.innerHeight-Os*2,se=S.scrollHeight,G=window.getComputedStyle(y),q=parseInt(G.borderTopWidth,10),ce=parseInt(G.paddingTop,10),je=parseInt(G.borderBottomWidth,10),$=parseInt(G.paddingBottom,10),oe=q+ce+se+$+je,K=Math.min(b.offsetHeight*5,oe),M=window.getComputedStyle(S),L=parseInt(M.paddingTop,10),O=parseInt(M.paddingBottom,10),X=k.top+k.height/2-Os,H=le-X,ue=b.offsetHeight/2,Y=b.offsetTop+ue,ye=q+ce+Y,ve=oe-ye;if(ye<=X){const pe=ae.length>0&&b===ae[ae.length-1].ref.current;f.style.bottom="0px";const we=y.clientHeight-S.offsetTop-S.offsetHeight,$e=Math.max(H,ue+(pe?O:0)+we+je),de=ye+$e;f.style.height=de+"px"}else{const pe=ae.length>0&&b===ae[0].ref.current;f.style.top="0px";const $e=Math.max(X,q+S.offsetTop+(pe?L:0)+ue)+ve;f.style.height=$e+"px",S.scrollTop=ye-X+S.offsetTop}f.style.margin=`${Os}px 0`,f.style.minHeight=K+"px",f.style.maxHeight=le+"px",o==null||o(),requestAnimationFrame(()=>P.current=!0)}},[C,d.trigger,d.valueNode,f,y,S,b,N,d.dir,o]);Zt(()=>j(),[j]);const[T,B]=h.useState();Zt(()=>{y&&B(window.getComputedStyle(y).zIndex)},[y]);const U=h.useCallback(k=>{k&&R.current===!0&&(j(),E==null||E(),R.current=!1)},[j,E]);return e.jsx(gS,{scope:l,contentWrapper:f,shouldExpandOnScrollRef:P,onScrollButtonChange:U,children:e.jsx("div",{ref:p,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:e.jsx(qe.div,{...c,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});W0.displayName=xS;var pS="SelectPopperPosition",su=h.forwardRef((r,a)=>{const{__scopeSelect:l,align:o="start",collisionPadding:c=Os,...d}=r,m=_o(l);return e.jsx(tS,{...m,...d,ref:a,align:o,collisionPadding:c,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});su.displayName=pS;var[gS,$u]=Da(Fn,{}),ru="SelectViewport",H0=h.forwardRef((r,a)=>{const{__scopeSelect:l,nonce:o,...c}=r,d=hn(ru,l),m=$u(ru,l),f=st(a,d.onViewportChange),p=h.useRef(0);return e.jsxs(e.Fragment,{children:[e.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}),e.jsx(To.Slot,{scope:l,children:e.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:He(c.onScroll,y=>{const g=y.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:C}=m;if(C!=null&&C.current&&v){const P=Math.abs(p.current-g.scrollTop);if(P>0){const R=window.innerHeight-Os*2,S=parseFloat(v.style.minHeight),b=parseFloat(v.style.height),N=Math.max(S,b);if(N0?T:0,v.style.justifyContent="flex-end")}}}p.current=g.scrollTop})})})]})});H0.displayName=ru;var K0="SelectGroup",[yS,vS]=Da(K0),jS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=sn();return e.jsx(yS,{scope:l,id:c,children:e.jsx(qe.div,{role:"group","aria-labelledby":c,...o,ref:a})})});jS.displayName=K0;var Y0="SelectLabel",bS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=vS(Y0,l);return e.jsx(qe.div,{id:c.id,...o,ref:a})});bS.displayName=Y0;var po="SelectItem",[NS,G0]=Da(po),Q0=h.forwardRef((r,a)=>{const{__scopeSelect:l,value:o,disabled:c=!1,textValue:d,...m}=r,f=un(po,l),p=hn(po,l),y=f.value===o,[g,v]=h.useState(d??""),[C,P]=h.useState(!1),R=st(a,E=>{var j;return(j=p.itemRefCallback)==null?void 0:j.call(p,E,o,c)}),S=sn(),b=h.useRef("touch"),N=()=>{c||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(NS,{scope:l,value:o,disabled:c,textId:S,isSelected:y,onItemTextChange:h.useCallback(E=>{v(j=>j||((E==null?void 0:E.textContent)??"").trim())},[]),children:e.jsx(To.ItemSlot,{scope:l,value:o,disabled:c,textValue:g,children:e.jsx(qe.div,{role:"option","aria-labelledby":S,"data-highlighted":C?"":void 0,"aria-selected":y&&C,"data-state":y?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...m,ref:R,onFocus:He(m.onFocus,()=>P(!0)),onBlur:He(m.onBlur,()=>P(!1)),onClick:He(m.onClick,()=>{b.current!=="mouse"&&N()}),onPointerUp:He(m.onPointerUp,()=>{b.current==="mouse"&&N()}),onPointerDown:He(m.onPointerDown,E=>{b.current=E.pointerType}),onPointerMove:He(m.onPointerMove,E=>{var j;b.current=E.pointerType,c?(j=p.onItemLeave)==null||j.call(p):b.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:He(m.onPointerLeave,E=>{var j;E.currentTarget===document.activeElement&&((j=p.onItemLeave)==null||j.call(p))}),onKeyDown:He(m.onKeyDown,E=>{var T;((T=p.searchRef)==null?void 0:T.current)!==""&&E.key===" "||(lS.includes(E.key)&&N(),E.key===" "&&E.preventDefault())})})})})});Q0.displayName=po;var Nl="SelectItemText",q0=h.forwardRef((r,a)=>{const{__scopeSelect:l,className:o,style:c,...d}=r,m=un(Nl,l),f=hn(Nl,l),p=G0(Nl,l),y=dS(Nl,l),[g,v]=h.useState(null),C=st(a,N=>v(N),p.onItemTextChange,N=>{var E;return(E=f.itemTextRefCallback)==null?void 0:E.call(f,N,p.value,p.disabled)}),P=g==null?void 0:g.textContent,R=h.useMemo(()=>e.jsx("option",{value:p.value,disabled:p.disabled,children:P},p.value),[p.disabled,p.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:b}=y;return Zt(()=>(S(R),()=>b(R)),[S,b,R]),e.jsxs(e.Fragment,{children:[e.jsx(qe.span,{id:p.textId,...d,ref:C}),p.isSelected&&m.valueNode&&!m.valueNodeHasChildren?Pl.createPortal(d.children,m.valueNode):null]})});q0.displayName=Nl;var X0="SelectItemIndicator",J0=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return G0(X0,l).isSelected?e.jsx(qe.span,{"aria-hidden":!0,...o,ref:a}):null});J0.displayName=X0;var nu="SelectScrollUpButton",Z0=h.forwardRef((r,a)=>{const l=hn(nu,r.__scopeSelect),o=$u(nu,r.__scopeSelect),[c,d]=h.useState(!1),m=st(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollTop>0;d(y)};const p=l.viewport;return f(),p.addEventListener("scroll",f),()=>p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(tg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop-p.offsetHeight)}}):null});Z0.displayName=nu;var au="SelectScrollDownButton",eg=h.forwardRef((r,a)=>{const l=hn(au,r.__scopeSelect),o=$u(au,r.__scopeSelect),[c,d]=h.useState(!1),m=st(a,o.onScrollButtonChange);return Zt(()=>{if(l.viewport&&l.isPositioned){let f=function(){const y=p.scrollHeight-p.clientHeight,g=Math.ceil(p.scrollTop)p.removeEventListener("scroll",f)}},[l.viewport,l.isPositioned]),c?e.jsx(tg,{...r,ref:m,onAutoScroll:()=>{const{viewport:f,selectedItem:p}=l;f&&p&&(f.scrollTop=f.scrollTop+p.offsetHeight)}}):null});eg.displayName=au;var tg=h.forwardRef((r,a)=>{const{__scopeSelect:l,onAutoScroll:o,...c}=r,d=hn("SelectScrollButton",l),m=h.useRef(null),f=Io(l),p=h.useCallback(()=>{m.current!==null&&(window.clearInterval(m.current),m.current=null)},[]);return h.useEffect(()=>()=>p(),[p]),Zt(()=>{var g;const y=f().find(v=>v.ref.current===document.activeElement);(g=y==null?void 0:y.ref.current)==null||g.scrollIntoView({block:"nearest"})},[f]),e.jsx(qe.div,{"aria-hidden":!0,...c,ref:a,style:{flexShrink:0,...c.style},onPointerDown:He(c.onPointerDown,()=>{m.current===null&&(m.current=window.setInterval(o,50))}),onPointerMove:He(c.onPointerMove,()=>{var y;(y=d.onItemLeave)==null||y.call(d),m.current===null&&(m.current=window.setInterval(o,50))}),onPointerLeave:He(c.onPointerLeave,()=>{p()})})}),wS="SelectSeparator",SS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r;return e.jsx(qe.div,{"aria-hidden":!0,...o,ref:a})});SS.displayName=wS;var lu="SelectArrow",CS=h.forwardRef((r,a)=>{const{__scopeSelect:l,...o}=r,c=_o(l),d=un(lu,l),m=hn(lu,l);return d.open&&m.position==="popper"?e.jsx(sS,{...c,...o,ref:a}):null});CS.displayName=lu;var kS="SelectBubbleInput",sg=h.forwardRef(({__scopeSelect:r,value:a,...l},o)=>{const c=h.useRef(null),d=st(o,c),m=Tu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("change",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.select,{...l,style:{...M0,...l.style},ref:d,defaultValue:a})});sg.displayName=kS;function rg(r){return r===""||r===void 0}function ng(r){const a=nn(r),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(m=>{const f=l.current+m;a(f),(function p(y){l.current=y,window.clearTimeout(o.current),y!==""&&(o.current=window.setTimeout(()=>p(""),1e3))})(f)},[a]),d=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,d]}function ag(r,a,l){const c=a.length>1&&Array.from(a).every(y=>y===a[0])?a[0]:a,d=l?r.indexOf(l):-1;let m=ES(r,Math.max(d,0));c.length===1&&(m=m.filter(y=>y!==l));const p=m.find(y=>y.textValue.toLowerCase().startsWith(c.toLowerCase()));return p!==l?p:void 0}function ES(r,a){return r.map((l,o)=>r[(a+o)%r.length])}var PS=A0,lg=L0,RS=F0,TS=z0,IS=$0,ig=B0,_S=H0,og=Q0,MS=q0,AS=J0,DS=Z0,LS=eg;const jl=PS,bl=RS,ya=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(lg,{ref:o,className:rt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...l,children:[a,e.jsx(TS,{asChild:!0,children:e.jsx(Cl,{className:"h-4 w-4 opacity-50"})})]}));ya.displayName=lg.displayName;const va=h.forwardRef(({className:r,children:a,position:l="popper",...o},c)=>e.jsx(IS,{children:e.jsxs(ig,{ref:c,className:rt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",l==="popper"&&"data-[side=bottom]:translate-y-1",r),position:l,...o,children:[e.jsx(DS,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Ox,{className:"h-4 w-4"})}),e.jsx(_S,{className:"p-1",children:a}),e.jsx(LS,{className:"flex cursor-default items-center justify-center py-1",children:e.jsx(Cl,{className:"h-4 w-4"})})]})}));va.displayName=ig.displayName;const qs=h.forwardRef(({className:r,children:a,...l},o)=>e.jsxs(og,{ref:o,className:rt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(AS,{children:e.jsx(vo,{className:"h-4 w-4"})})}),e.jsx(MS,{children:a})]}));qs.displayName=og.displayName;const OS=["一","二","三","四","五","六","七","八","九","十"];function Od(r){return r.startsWith("part:")?{type:"part",id:r.slice(5)}:r.startsWith("chapter:")?{type:"chapter",id:r.slice(8)}:r.startsWith("section:")?{type:"section",id:r.slice(8)}:null}function FS({parts:r,expandedParts:a,onTogglePart:l,onReorder:o,onReadSection:c,onDeleteSection:d,onAddSectionInPart:m,onAddChapterInPart:f,onDeleteChapter:p,onEditPart:y,onDeletePart:g,onEditChapter:v,selectedSectionIds:C=[],onToggleSectionSelect:P,onShowSectionOrders:R}){const[S,b]=h.useState(null),[N,E]=h.useState(null),j=(_,re)=>(S==null?void 0:S.type)===_&&(S==null?void 0:S.id)===re,T=(_,re)=>(N==null?void 0:N.type)===_&&(N==null?void 0:N.id)===re,B=h.useCallback(()=>{const _=[];for(const re of r)for(const ae of re.chapters)for(const le of ae.sections)_.push({id:le.id,partId:re.id,partTitle:re.title,chapterId:ae.id,chapterTitle:ae.title});return _},[r]),U=h.useCallback(async(_,re,ae,le)=>{var je;_.preventDefault(),_.stopPropagation();const se=_.dataTransfer.getData("text/plain"),G=Od(se);if(!G||G.type===re&&G.id===ae)return;const q=B(),ce=new Map(q.map($=>[$.id,$]));if(G.type==="part"&&re==="part"){const $=r.map(O=>O.id),oe=$.indexOf(G.id),K=$.indexOf(ae);if(oe===-1||K===-1)return;const M=[...$];M.splice(oe,1),M.splice(oeH.id===O);if(X)for(const H of X.chapters)for(const ue of H.sections){const Y=ce.get(ue.id);Y&&L.push(Y)}}await o(L);return}if(G.type==="chapter"&&(re==="chapter"||re==="section"||re==="part")){const $=r.find(Y=>Y.chapters.some(ye=>ye.id===G.id)),oe=$==null?void 0:$.chapters.find(Y=>Y.id===G.id);if(!$||!oe)return;let K,M,L=null;if(re==="section"){const Y=ce.get(ae);if(!Y)return;K=Y.partId,M=Y.partTitle,L=ae}else if(re==="chapter"){const Y=r.find(D=>D.chapters.some(pe=>pe.id===ae)),ye=Y==null?void 0:Y.chapters.find(D=>D.id===ae);if(!Y||!ye)return;K=Y.id,M=Y.title;const ve=q.filter(D=>D.chapterId===ae).pop();L=(ve==null?void 0:ve.id)??null}else{const Y=r.find(ve=>ve.id===ae);if(!Y||!Y.chapters[0])return;K=Y.id,M=Y.title;const ye=q.filter(ve=>ve.partId===Y.id&&ve.chapterId===Y.chapters[0].id);L=((je=ye[ye.length-1])==null?void 0:je.id)??null}const O=oe.sections.map(Y=>Y.id),X=q.filter(Y=>!O.includes(Y.id));let H=X.length;if(L){const Y=X.findIndex(ye=>ye.id===L);Y>=0&&(H=Y+1)}const ue=O.map(Y=>({...ce.get(Y),partId:K,partTitle:M,chapterId:oe.id,chapterTitle:oe.title}));await o([...X.slice(0,H),...ue,...X.slice(H)]);return}if(G.type==="section"&&(re==="section"||re==="chapter"||re==="part")){if(!le)return;const{partId:$,partTitle:oe,chapterId:K,chapterTitle:M}=le;let L;if(re==="section")L=q.findIndex(ye=>ye.id===ae);else if(re==="chapter"){const ye=q.filter(ve=>ve.chapterId===ae).pop();L=ye?q.findIndex(ve=>ve.id===ye.id)+1:q.length}else{const ye=r.find(pe=>pe.id===ae);if(!(ye!=null&&ye.chapters[0]))return;const ve=q.filter(pe=>pe.partId===ye.id&&pe.chapterId===ye.chapters[0].id),D=ve[ve.length-1];L=D?q.findIndex(pe=>pe.id===D.id)+1:0}const O=q.findIndex(ye=>ye.id===G.id);if(O===-1)return;const X=q.filter(ye=>ye.id!==G.id),H=O({onDragEnter:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:_,id:re})},onDragOver:le=>{le.preventDefault(),le.stopPropagation(),le.dataTransfer.dropEffect="move",E({type:_,id:re})},onDragLeave:()=>E(null),onDrop:le=>{E(null);const se=Od(le.dataTransfer.getData("text/plain"));if(se&&!(_==="section"&&se.type==="section"&&se.id===re))if(_==="part")if(se.type==="part")U(le,"part",re);else{const G=r.find(ce=>ce.id===re);(G==null?void 0:G.chapters[0])&&ae&&U(le,"part",re,ae)}else _==="chapter"&&ae?(se.type==="section"||se.type==="chapter")&&U(le,"chapter",re,ae):_==="section"&&ae&&U(le,"section",re,ae)}}),A=_=>OS[_]??String(_+1);return e.jsx("div",{className:"space-y-3",children:r.map((_,re)=>{var oe,K,M,L;const ae=_.title==="序言"||_.title.includes("序言"),le=_.title==="尾声"||_.title.includes("尾声"),se=_.title==="附录"||_.title.includes("附录"),G=T("part",_.id),q=a.includes(_.id),ce=_.chapters.length,je=_.chapters.reduce((O,X)=>O+X.sections.length,0);if(ae&&_.chapters.length===1&&_.chapters[0].sections.length===1){const O=_.chapters[0].sections[0],X=T("section",O.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+O.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:O.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",O.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(xr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(O.id),onChange:()=>P(O.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(tr,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[O.price===0||O.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),R&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>R(O),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Qr,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}if(_.title==="2026每日派对干货"||_.title.includes("2026每日派对干货")){const O=T("part",_.id);return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-all duration-200 ${O?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50 bg-[#1C1C1E]"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((oe=_.chapters[0])==null?void 0:oe.id)??"",chapterTitle:((K=_.chapters[0])==null?void 0:K.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:X=>{X.stopPropagation(),X.dataTransfer.setData("text/plain","part:"+_.id),X.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(xr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.jsx("div",{className:"w-10 h-10 rounded-xl bg-[#38bdac]/80 flex items-center justify-center text-white font-bold shrink-0",children:"派"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",je," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:X=>X.stopPropagation(),onClick:X=>X.stopPropagation(),children:[m&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),q?e.jsx(Cl,{className:"w-5 h-5 text-gray-500"}):e.jsx(Qr,{className:"w-5 h-5 text-gray-500"})]})]}),q&&_.chapters.length>0&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(X=>e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:X.title}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>v(_,X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),f&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>f(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>p(_,X),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:X.sections.map(H=>{const ue=T("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+H.id),Y.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between py-2 px-3 rounded-lg min-h-[40px] cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:X.id,chapterTitle:X.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(xr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),R&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]})]},H.id)})})]},X.id))})]},_.id)}if(se)return e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"附录"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map((O,X)=>O.sections.length>0?O.sections.map(H=>{const ue=T("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+H.id),Y.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 group cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(xr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300 truncate",children:["附录",X+1," | ",O.title," | ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),R&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx(Qr,{className:"w-4 h-4 text-gray-500 shrink-0"})]},H.id)}):e.jsxs("div",{className:"flex justify-between items-center py-2 select-none hover:bg-[#162840]/50 rounded px-2 -mx-2",children:[e.jsxs("span",{className:"text-sm text-gray-500",children:["附录",X+1," | ",O.title,"(空)"]}),e.jsx(Qr,{className:"w-4 h-4 text-gray-500 shrink-0"})]},O.id))})]},_.id);if(le&&_.chapters.length===1&&_.chapters[0].sections.length===1){const O=_.chapters[0].sections[0],X=T("section",O.id),H={partId:_.id,partTitle:_.title,chapterId:_.chapters[0].id,chapterTitle:_.chapters[0].title};return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+O.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:O.id})},onDragEnd:()=>{b(null),E(null)},className:`rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between hover:border-[#38bdac]/30 transition-colors cursor-grab active:cursor-grabbing select-none min-h-[40px] ${X?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",O.id,H),children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0 select-none",children:[e.jsx(xr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(O.id),onChange:()=>P(O.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-600/50 flex items-center justify-center shrink-0",children:e.jsx(tr,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("span",{className:"font-medium text-gray-200 truncate",children:[_.chapters[0].title," | ",O.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:ue=>ue.stopPropagation(),onClick:ue=>ue.stopPropagation(),children:[O.price===0||O.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",O.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",O.clickCount??0," · 付款 ",O.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(O.hotScore??0).toFixed(1)," · 第",O.hotRank&&O.hotRank>0?O.hotRank:"-","名"]}),R&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>R(O),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(O),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Qr,{className:"w-4 h-4 text-gray-500"})]})]},_.id)}return le?e.jsxs("div",{className:"rounded-xl border border-gray-700/50 bg-[#1C1C1E] p-5",children:[e.jsx("h3",{className:"text-sm font-medium text-gray-400 mb-4",children:"尾声"}),e.jsx("div",{className:"space-y-3",children:_.chapters.map(O=>O.sections.map(X=>{const H=T("section",X.id);return e.jsxs("div",{draggable:!0,onDragStart:ue=>{ue.stopPropagation(),ue.dataTransfer.setData("text/plain","section:"+X.id),ue.dataTransfer.effectAllowed="move",b({type:"section",id:X.id})},onDragEnd:()=>{b(null),E(null)},className:`flex justify-between items-center py-2 select-none rounded px-2 -mx-2 cursor-grab active:cursor-grabbing min-h-[40px] transition-all duration-200 ${H?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":"hover:bg-[#162840]/50"} ${j("section",X.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":""}`,...k("section",X.id,{partId:_.id,partTitle:_.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[e.jsx(xr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:ue=>ue.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(X.id),onChange:()=>P(X.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsxs("span",{className:"text-sm text-gray-300",children:[O.title," | ",X.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs("span",{className:"text-[10px] text-gray-500",children:["点击 ",X.clickCount??0," · 付款 ",X.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(X.hotScore??0).toFixed(1)," · 第",X.hotRank&&X.hotRank>0?X.hotRank:"-","名"]}),R&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>R(X),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:"付款记录"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(X),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(X),className:"text-gray-500 hover:text-red-400 h-7 px-2",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]})]})]},X.id)}))})]},_.id):e.jsxs("div",{className:`rounded-xl border bg-[#1C1C1E] overflow-hidden transition-all duration-200 ${G?"border-[#38bdac] ring-2 ring-[#38bdac]/40 bg-[#38bdac]/5":"border-gray-700/50"}`,...k("part",_.id,{partId:_.id,partTitle:_.title,chapterId:((M=_.chapters[0])==null?void 0:M.id)??"",chapterTitle:((L=_.chapters[0])==null?void 0:L.title)??""}),children:[e.jsxs("div",{draggable:!0,onDragStart:O=>{O.stopPropagation(),O.dataTransfer.setData("text/plain","part:"+_.id),O.dataTransfer.effectAllowed="move",b({type:"part",id:_.id})},onDragEnd:()=>{b(null),E(null)},className:`flex items-center justify-between p-4 cursor-grab active:cursor-grabbing select-none transition-all duration-200 ${j("part",_.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] rounded-xl shadow-xl shadow-[#38bdac]/20":"hover:bg-[#162840]/50"}`,onClick:()=>l(_.id),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx(xr,{className:"w-5 h-5 text-gray-500 shrink-0 opacity-60"}),e.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:A(re)}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-white text-base",children:_.title}),e.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:["共 ",je," 节"]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:O=>O.stopPropagation(),onClick:O=>O.stopPropagation(),children:[m&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>m(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"在本篇下新增章节",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),y&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>y(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-2",title:"编辑篇名",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),g&&e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>g(_),className:"text-gray-500 hover:text-red-400 h-7 px-2",title:"删除本篇",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})}),e.jsxs("span",{className:"text-xs text-gray-500",children:[ce,"章"]}),q?e.jsx(Cl,{className:"w-5 h-5 text-gray-500"}):e.jsx(Qr,{className:"w-5 h-5 text-gray-500"})]})]}),q&&e.jsx("div",{className:"border-t border-gray-700/50 pl-4 pr-4 pb-4 pt-3 space-y-4",children:_.chapters.map(O=>{const X=T("chapter",O.id);return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2 w-full",children:[e.jsxs("div",{draggable:!0,onDragStart:H=>{H.stopPropagation(),H.dataTransfer.setData("text/plain","chapter:"+O.id),H.dataTransfer.effectAllowed="move",b({type:"chapter",id:O.id})},onDragEnd:()=>{b(null),E(null)},onDragEnter:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragOver:H=>{H.preventDefault(),H.stopPropagation(),H.dataTransfer.dropEffect="move",E({type:"chapter",id:O.id})},onDragLeave:()=>E(null),onDrop:H=>{E(null);const ue=Od(H.dataTransfer.getData("text/plain"));if(!ue)return;const Y={partId:_.id,partTitle:_.title,chapterId:O.id,chapterTitle:O.title};(ue.type==="section"||ue.type==="chapter")&&U(H,"chapter",O.id,Y)},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 ${X?"bg-[#38bdac]/15 ring-1 ring-[#38bdac]/50":""} ${j("chapter",O.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac]":"hover:bg-[#162840]/30"}`,children:[e.jsx(xr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("p",{className:"text-xs text-gray-500 pb-1 flex-1",children:O.title})]}),e.jsxs("div",{className:"flex gap-0.5 shrink-0",onClick:H=>H.stopPropagation(),children:[v&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>v(_,O),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"编辑章节名称",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),f&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>f(_),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",title:"新增第X章",children:e.jsx(Rt,{className:"w-3.5 h-3.5"})}),p&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>p(_,O),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",title:"删除本章",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]})]}),e.jsx("div",{className:"space-y-1 pl-2",children:O.sections.map(H=>{const ue=T("section",H.id);return e.jsxs("div",{draggable:!0,onDragStart:Y=>{Y.stopPropagation(),Y.dataTransfer.setData("text/plain","section:"+H.id),Y.dataTransfer.effectAllowed="move",b({type:"section",id:H.id})},onDragEnd:()=>{b(null),E(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 ${ue?"bg-[#38bdac]/15 ring-2 ring-[#38bdac]/50":""} ${j("section",H.id)?"opacity-60 scale-[0.98] ring-2 ring-[#38bdac] shadow-lg":"hover:bg-[#162840]/50"}`,...k("section",H.id,{partId:_.id,partTitle:_.title,chapterId:O.id,chapterTitle:O.title}),children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[P&&e.jsx("label",{className:"shrink-0 flex items-center",onClick:Y=>Y.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:C.includes(H.id),onChange:()=>P(H.id),className:"w-4 h-4 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"})}),e.jsx(xr,{className:"w-4 h-4 text-gray-500 shrink-0 opacity-50"}),e.jsx("div",{className:`w-2 h-2 rounded-full shrink-0 ${H.price===0||H.isFree?"border-2 border-[#38bdac] bg-transparent":"bg-gray-500"}`}),e.jsxs("span",{className:"text-sm text-gray-200 truncate",children:[H.id," ",H.title]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",onMouseDown:Y=>Y.stopPropagation(),onClick:Y=>Y.stopPropagation(),children:[H.isNew&&e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"NEW"}),H.price===0||H.isFree?e.jsx("span",{className:"px-2 py-1 bg-[#38bdac]/20 text-[#38bdac] text-[10px] font-medium rounded",children:"免费"}):e.jsxs("span",{className:"text-xs text-gray-500",children:["¥",H.price]}),e.jsxs("span",{className:"text-[10px] text-gray-500",title:"点击次数 · 付款笔数",children:["点击 ",H.clickCount??0," · 付款 ",H.payCount??0]}),e.jsxs("span",{className:"text-[10px] text-amber-400/90",title:"热度积分与排名",children:["热度 ",(H.hotScore??0).toFixed(1)," · 第",H.hotRank&&H.hotRank>0?H.hotRank:"-","名"]}),R&&e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(H),className:"text-[10px] text-gray-500 hover:text-[#38bdac] h-7 px-1.5 shrink-0",children:"付款记录"}),e.jsxs("div",{className:"flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(yr,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>c(H),className:"text-gray-500 hover:text-[#38bdac] h-7 px-1.5",children:e.jsx(ht,{className:"w-3.5 h-3.5"})}),e.jsx(J,{draggable:!1,variant:"ghost",size:"sm",onClick:()=>d(H),className:"text-gray-500 hover:text-red-400 h-7 px-1.5",children:e.jsx(Yt,{className:"w-3.5 h-3.5"})})]}),e.jsx(Qr,{className:"w-4 h-4 text-gray-500"})]})]},H.id)})})]},O.id)})})]},_.id)})})}function zS(r){const a=new Map;for(const f of r){const p=f.partId||"part-1",y=f.partTitle||"未分类",g=f.chapterId||"chapter-1",v=f.chapterTitle||"未分类";a.has(p)||a.set(p,{id:p,title:y,chapters:new Map});const C=a.get(p);C.chapters.has(g)||C.chapters.set(g,{id:g,title:v,sections:[]}),C.chapters.get(g).sections.push({id:f.id,title:f.title,price:f.price??1,filePath:f.filePath,isFree:f.isFree,isNew:f.isNew,clickCount:f.clickCount??0,payCount:f.payCount??0,hotScore:f.hotScore??0,hotRank:f.hotRank??0})}const l="part-2026-daily",o="2026每日派对干货";Array.from(a.values()).some(f=>f.title===o||f.title.includes(o))||a.set(l,{id:l,title:o,chapters:new Map([["chapter-2026-daily",{id:"chapter-2026-daily",title:o,sections:[]}]])});const d=Array.from(a.values()).map(f=>({...f,chapters:Array.from(f.chapters.values())})),m=f=>f.includes("序言")?0:f.includes(o)?1.5:f.includes("附录")?2:f.includes("尾声")?3:1;return d.sort((f,p)=>{const y=m(f.title),g=m(p.title);return y!==g?y-g:0})}function $S(){var V,Oe,it;const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState([]),[m,f]=h.useState(null),[p,y]=h.useState(!1),[g,v]=h.useState(!1),[C,P]=h.useState(!1),[R,S]=h.useState(""),[b,N]=h.useState([]),[E,j]=h.useState(!1),[T,B]=h.useState(!1),U=h.useRef(null),[k,A]=h.useState({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),[_,re]=h.useState(null),[ae,le]=h.useState(!1),[se,G]=h.useState(!1),[q,ce]=h.useState(null),[je,$]=h.useState(!1),[oe,K]=h.useState([]),[M,L]=h.useState(!1),[O,X]=h.useState(""),[H,ue]=h.useState(""),[Y,ye]=h.useState(!1),[ve,D]=h.useState(""),[pe,we]=h.useState(!1),[$e,de]=h.useState(null),[he,We]=h.useState(!1),[Ze,xt]=h.useState(!1),[Xe,kt]=h.useState({readWeight:.5,recencyWeight:.3,payWeight:.2}),[Es,wr]=h.useState(!1),[nr,Sr]=h.useState(!1),Wt=zS(r),mn=r.length,At=async()=>{o(!0);try{const F=await Ue("/api/db/book?action=list",{cache:"no-store"});a(Array.isArray(F==null?void 0:F.sections)?F.sections:[])}catch(F){console.error(F),a([])}finally{o(!1)}};h.useEffect(()=>{At()},[]);const us=F=>{d(ne=>ne.includes(F)?ne.filter(ke=>ke!==F):[...ne,F])},zn=h.useCallback(F=>{const ne=r,ke=F.flatMap(Re=>{const pt=ne.find(js=>js.id===Re.id);return pt?[{...pt,partId:Re.partId,partTitle:Re.partTitle,chapterId:Re.chapterId,chapterTitle:Re.chapterTitle}]:[]});return a(ke),vt("/api/db/book",{action:"reorder",items:F}).then(Re=>{Re&&Re.success===!1&&(a(ne),alert("排序失败: "+(Re&&typeof Re=="object"&&"error"in Re?Re.error:"未知错误")))}).catch(Re=>{a(ne),console.error("排序失败:",Re),alert("排序失败: "+(Re instanceof Error?Re.message:"网络或服务异常"))}),Promise.resolve()},[r]),ar=async F=>{if(confirm(`确定要删除章节「${F.title}」吗?此操作不可恢复。`))try{const ne=await tn(`/api/db/book?id=${encodeURIComponent(F.id)}`);ne&&ne.success!==!1?(alert("已删除"),At()):alert("删除失败: "+(ne&&typeof ne=="object"&&"error"in ne?ne.error:"未知错误"))}catch(ne){console.error(ne),alert("删除失败")}},Us=h.useCallback(async()=>{wr(!0);try{const F=await Ue("/api/db/config/full?key=article_ranking_weights",{cache:"no-store"}),ne=F&&F.data;ne&&typeof ne.readWeight=="number"&&typeof ne.recencyWeight=="number"&&typeof ne.payWeight=="number"&&kt({readWeight:Math.max(0,Math.min(1,ne.readWeight)),recencyWeight:Math.max(0,Math.min(1,ne.recencyWeight)),payWeight:Math.max(0,Math.min(1,ne.payWeight))})}catch{}finally{wr(!1)}},[]);h.useEffect(()=>{Ze&&Us()},[Ze,Us]);const Oa=async()=>{const{readWeight:F,recencyWeight:ne,payWeight:ke}=Xe,Re=F+ne+ke;if(Math.abs(Re-1)>.001){alert("三个权重之和必须等于 1");return}Sr(!0);try{const pt=await bt("/api/db/config",{key:"article_ranking_weights",value:{readWeight:F,recencyWeight:ne,payWeight:ke},description:"文章排名算法权重"});pt&&pt.success!==!1?(alert("已保存"),At()):alert("保存失败: "+(pt&&typeof pt=="object"&&"error"in pt?pt.error:""))}catch(pt){console.error(pt),alert("保存失败")}finally{Sr(!1)}},$n=async F=>{de({section:F,orders:[]}),We(!0);try{const ne=await Ue(`/api/db/book?action=section-orders&id=${encodeURIComponent(F.id)}`),ke=ne!=null&&ne.success&&Array.isArray(ne.orders)?ne.orders:[];de(Re=>Re?{...Re,orders:ke}:null)}catch(ne){console.error(ne),de(ke=>ke?{...ke,orders:[]}:null)}finally{We(!1)}},fn=async F=>{v(!0);try{const ne=await Ue(`/api/db/book?action=read&id=${encodeURIComponent(F.id)}`);if(ne!=null&&ne.success&&ne.section){const ke=ne.section;f({id:F.id,title:ne.section.title??F.title,price:ne.section.price??F.price,content:ne.section.content??"",filePath:F.filePath,isFree:F.isFree||F.price===0,isNew:ke.isNew??F.isNew})}else f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree,isNew:F.isNew}),ne&&!ne.success&&alert("无法读取文件内容: "+(ne.error||"未知错误"))}catch(ne){console.error(ne),f({id:F.id,title:F.title,price:F.price,content:"",filePath:F.filePath,isFree:F.isFree})}finally{v(!1)}},Bn=async()=>{var F;if(m){P(!0);try{let ne=m.content||"";const ke=[new RegExp(`^#+\\s*${m.id.replace(".","\\.")}\\s+.*$`,"gm"),new RegExp(`^#+\\s*${m.id.replace(".","\\.")}[::].*$`,"gm"),new RegExp(`^#\\s+.*${(F=m.title)==null?void 0:F.slice(0,10).replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}.*$`,"gm")];for(const pt of ke)ne=ne.replace(pt,"");ne=ne.replace(/^\s*\n+/,"").trim();const Re=await vt("/api/db/book",{id:m.id,title:m.title,price:m.isFree?0:m.price,content:ne,isFree:m.isFree||m.price===0,isNew:m.isNew,saveToFile:!0});Re&&Re.success!==!1?(alert(`已保存章节: ${m.title}`),f(null),At()):alert("保存失败: "+(Re&&typeof Re=="object"&&"error"in Re?Re.error:"未知错误"))}catch(ne){console.error(ne),alert("保存失败")}finally{P(!1)}}},xn=async()=>{if(!k.id||!k.title){alert("请填写章节ID和标题");return}P(!0);try{const F=await vt("/api/db/book",{id:k.id,title:k.title,price:k.price,content:k.content,partId:k.partId,chapterId:k.chapterId,saveToFile:!1});F&&F.success!==!1?(alert(`章节创建成功: ${k.title}`),y(!1),A({id:"",title:"",price:1,partId:"part-1",chapterId:"chapter-1",content:""}),At()):alert("创建失败: "+(F&&typeof F=="object"&&"error"in F?F.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{P(!1)}},pn=F=>{A(ne=>{var ke;return{...ne,partId:F.id,chapterId:((ke=F.chapters[0])==null?void 0:ke.id)??"chapter-1"}}),y(!0)},gn=F=>{re({id:F.id,title:F.title})},Ps=async()=>{var F;if((F=_==null?void 0:_.title)!=null&&F.trim()){le(!0);try{const ne=r.map(Re=>({id:Re.id,partId:Re.partId||"part-1",partTitle:Re.partId===_.id?_.title.trim():Re.partTitle||"",chapterId:Re.chapterId||"chapter-1",chapterTitle:Re.chapterTitle||""})),ke=await vt("/api/db/book",{action:"reorder",items:ne});ke&&ke.success!==!1?(re(null),At()):alert("更新篇名失败: "+(ke&&typeof ke=="object"&&"error"in ke?ke.error:"未知错误"))}catch(ne){console.error(ne),alert("更新篇名失败")}finally{le(!1)}}},Cr=F=>{const ne=F.chapters.length+1,ke=`chapter-${F.id}-${ne}-${Date.now()}`;A({id:`${ne}.1`,title:"新章节",price:1,partId:F.id,chapterId:ke,content:""}),y(!0)},Vs=(F,ne)=>{ce({part:F,chapter:ne,title:ne.title})},Ws=async()=>{var F;if((F=q==null?void 0:q.title)!=null&&F.trim()){$(!0);try{const ne=r.map(Re=>({id:Re.id,partId:Re.partId||q.part.id,partTitle:Re.partId===q.part.id?q.part.title:Re.partTitle||"",chapterId:Re.chapterId||q.chapter.id,chapterTitle:Re.partId===q.part.id&&Re.chapterId===q.chapter.id?q.title.trim():Re.chapterTitle||""})),ke=await vt("/api/db/book",{action:"reorder",items:ne});ke&&ke.success!==!1?(ce(null),At()):alert("保存失败: "+(ke&&typeof ke=="object"&&"error"in ke?ke.error:"未知错误"))}catch(ne){console.error(ne),alert("保存失败")}finally{$(!1)}}},Un=async(F,ne)=>{const ke=ne.sections.map(Re=>Re.id);if(ke.length===0){alert("该章下无小节,无需删除");return}if(confirm(`确定要删除「第${F.chapters.indexOf(ne)+1}章 | ${ne.title}」吗?将删除共 ${ke.length} 节,此操作不可恢复。`))try{for(const Re of ke)await tn(`/api/db/book?id=${encodeURIComponent(Re)}`);At()}catch(Re){console.error(Re),alert("删除失败")}},Vn=async()=>{if(!ve.trim()){alert("请输入篇名");return}we(!0);try{const F=`part-new-${Date.now()}`,ne="chapter-1",ke=`part-placeholder-${Date.now()}`,Re=await vt("/api/db/book",{id:ke,title:"占位节(可编辑)",price:0,content:"",partId:F,partTitle:ve.trim(),chapterId:ne,chapterTitle:"第1章 | 待编辑",saveToFile:!1});Re&&Re.success!==!1?(alert(`篇「${ve}」创建成功,请编辑占位节`),G(!1),D(""),At()):alert("创建失败: "+(Re&&typeof Re=="object"&&"error"in Re?Re.error:"未知错误"))}catch(F){console.error(F),alert("创建失败")}finally{we(!1)}},yn=async()=>{if(oe.length===0){alert("请先勾选要移动的章节");return}const F=Wt.find(ke=>ke.id===O),ne=F==null?void 0:F.chapters.find(ke=>ke.id===H);if(!F||!ne||!O||!H){alert("请选择目标篇和章");return}ye(!0);try{const ke=()=>{const at=new Set(oe),Rs=r.map(Dt=>({id:Dt.id,partId:Dt.partId||"",partTitle:Dt.partTitle||"",chapterId:Dt.chapterId||"",chapterTitle:Dt.chapterTitle||""})),Al=Rs.filter(Dt=>at.has(Dt.id)).map(Dt=>({...Dt,partId:O,partTitle:F.title||O,chapterId:H,chapterTitle:ne.title||H})),jn=Rs.filter(Dt=>!at.has(Dt.id));let Hn=jn.length;for(let Dt=jn.length-1;Dt>=0;Dt-=1){const Fa=jn[Dt];if(Fa.partId===O&&Fa.chapterId===H){Hn=Dt+1;break}}return[...jn.slice(0,Hn),...Al,...jn.slice(Hn)]},Re=async()=>{const at=ke(),Rs=await vt("/api/db/book",{action:"reorder",items:at});return Rs&&Rs.success!==!1?(alert(`已移动 ${oe.length} 节到「${F.title}」-「${ne.title}」`),L(!1),K([]),await At(),!0):!1},pt={action:"move-sections",sectionIds:oe,targetPartId:O,targetChapterId:H,targetPartTitle:F.title||O,targetChapterTitle:ne.title||H},js=await vt("/api/db/book",pt);if(js&&js.success!==!1)alert(`已移动 ${js.count??oe.length} 节到「${F.title}」-「${ne.title}」`),L(!1),K([]),await At();else{const at=js&&typeof js=="object"&&"error"in js?js.error||"":"未知错误";if((at.includes("缺少 id")||at.includes("无效的 action"))&&await Re())return;alert("移动失败: "+at)}}catch(ke){console.error(ke),alert("移动失败: "+(ke instanceof Error?ke.message:"网络或服务异常"))}finally{ye(!1)}},Wn=F=>{K(ne=>ne.includes(F)?ne.filter(ke=>ke!==F):[...ne,F])},vn=async F=>{const ne=r.filter(ke=>ke.partId===F.id).map(ke=>ke.id);if(ne.length===0){alert("该篇下暂无小节可删除");return}if(confirm(`确定要删除「${F.title}」整篇吗?将删除共 ${ne.length} 节内容,此操作不可恢复。`))try{for(const ke of ne)await tn(`/api/db/book?id=${encodeURIComponent(ke)}`);At()}catch(ke){console.error(ke),alert("删除失败")}},kr=async F=>{var ke,Re;const ne=(ke=F.target.files)==null?void 0:ke[0];if(ne){B(!0);try{const pt=new FormData;pt.append("file",ne),pt.append("folder","book-images");const at=await(await fetch(Ca("/api/upload"),{method:"POST",body:pt,credentials:"include"})).json();if(at!=null&&at.success&&((Re=at==null?void 0:at.data)!=null&&Re.url)){const Rs=`![${ne.name}](${at.data.url})`;m&&f({...m,content:(m.content||"")+` + +`+Rs}),alert(`图片上传成功: ${at.data.url}`)}else alert("上传失败: "+((at==null?void 0:at.error)||"未知错误"))}catch(pt){console.error(pt),alert("上传失败")}finally{B(!1),U.current&&(U.current.value="")}}},Er=async()=>{var F;if(R.trim()){j(!0);try{const ne=await Ue(`/api/search?q=${encodeURIComponent(R)}`);ne!=null&&ne.success&&((F=ne.data)!=null&&F.results)?N(ne.data.results):(N([]),ne&&!ne.success&&alert("搜索失败: "+ne.error))}catch(ne){console.error(ne),N([]),alert("搜索失败")}finally{j(!1)}}},vs=Wt.find(F=>F.id===k.partId),lr=(vs==null?void 0:vs.chapters)??[];return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"内容管理"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["共 ",Wt.length," 篇 · ",mn," 节内容"]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(J,{onClick:()=>xt(!0),variant:"outline",className:"border-amber-500/50 text-amber-400 hover:bg-amber-500/10 bg-transparent",children:[e.jsx(Nd,{className:"w-4 h-4 mr-2"}),"排名算法"]}),e.jsxs(J,{onClick:()=>{const F=typeof window<"u"?`${window.location.origin}/api-doc`:"";F&&window.open(F,"_blank","noopener,noreferrer")},variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(en,{className:"w-4 h-4 mr-2"}),"API 接口"]})]})]}),e.jsx(wt,{open:p,onOpenChange:y,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-2xl max-h-[90vh] overflow-y-auto",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),"新建章节"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 9.15",value:k.id,onChange:F=>A({...k,id:F.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:k.price,onChange:F=>A({...k,price:Number(F.target.value)})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"输入章节标题",value:k.title,onChange:F=>A({...k,title:F.target.value})})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属篇"}),e.jsxs(jl,{value:k.partId,onValueChange:F=>A({...k,partId:F,chapterId:"chapter-1"}),children:[e.jsx(ya,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(bl,{})}),e.jsxs(va,{className:"bg-[#0f2137] border-gray-700",children:[Wt.map(F=>e.jsx(qs,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),Wt.length===0&&e.jsx(qs,{value:"part-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认篇"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"所属章"}),e.jsxs(jl,{value:k.chapterId,onValueChange:F=>A({...k,chapterId:F}),children:[e.jsx(ya,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(bl,{})}),e.jsxs(va,{className:"bg-[#0f2137] border-gray-700",children:[lr.map(F=>e.jsx(qs,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id)),lr.length===0&&e.jsx(qs,{value:"chapter-1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"默认章"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsx(rn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[300px] font-mono text-sm placeholder:text-gray-500",placeholder:"输入章节内容...",value:k.content,onChange:F=>A({...k,content:F.target.value})})]})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>y(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:xn,disabled:C||!k.id||!k.title,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建章节"]})})]})]})}),e.jsx(wt,{open:!!_,onOpenChange:F=>!F&&re(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑篇名"]})}),_&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:_.title,onChange:F=>re({..._,title:F.target.value}),placeholder:"输入篇名"})]})}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>re(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Ps,disabled:ae||!((V=_==null?void 0:_.title)!=null&&V.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:ae?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:!!q,onOpenChange:F=>!F&&ce(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节名称"]})}),q&&e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节名称(如:第8章|底层结构)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:q.title,onChange:F=>ce({...q,title:F.target.value}),placeholder:"输入章节名称"})]})}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>ce(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Ws,disabled:je||!((Oe=q==null?void 0:q.title)!=null&&Oe.trim()),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:je?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),"保存"]})})]})]})}),e.jsx(wt,{open:M,onOpenChange:F=>{var ne;if(L(F),F&&Wt.length>0){const ke=Wt[0];X(ke.id),ue(((ne=ke.chapters[0])==null?void 0:ne.id)??"")}},children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:"批量移动至指定目录"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["已选 ",e.jsx("span",{className:"text-[#38bdac] font-medium",children:oe.length})," 节,请选择目标篇与章。"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标篇"}),e.jsxs(jl,{value:O,onValueChange:F=>{var ke;X(F);const ne=Wt.find(Re=>Re.id===F);ue(((ke=ne==null?void 0:ne.chapters[0])==null?void 0:ke.id)??"")},children:[e.jsx(ya,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(bl,{placeholder:"选择篇"})}),e.jsx(va,{className:"bg-[#0f2137] border-gray-700",children:Wt.map(F=>e.jsx(qs,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目标章"}),e.jsxs(jl,{value:H,onValueChange:ue,children:[e.jsx(ya,{className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(bl,{placeholder:"选择章"})}),e.jsx(va,{className:"bg-[#0f2137] border-gray-700",children:(((it=Wt.find(F=>F.id===O))==null?void 0:it.chapters)??[]).map(F=>e.jsx(qs,{value:F.id,className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:F.title},F.id))})]})]})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>L(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:yn,disabled:Y||oe.length===0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:Y?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"移动中..."]}):"确认移动"})]})]})}),e.jsx(wt,{open:!!$e,onOpenChange:F=>!F&&de(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-3xl max-h-[85vh] overflow-hidden flex flex-col",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white",children:["付款记录 — ",($e==null?void 0:$e.section.title)??""]})}),e.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:he?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):$e&&$e.orders.length===0?e.jsx("p",{className:"text-gray-500 text-center py-6",children:"暂无付款记录"}):$e?e.jsxs("table",{className:"w-full text-sm border-collapse",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-gray-700 text-left text-gray-400",children:[e.jsx("th",{className:"py-2 pr-2",children:"订单号"}),e.jsx("th",{className:"py-2 pr-2",children:"用户ID"}),e.jsx("th",{className:"py-2 pr-2",children:"金额"}),e.jsx("th",{className:"py-2 pr-2",children:"状态"}),e.jsx("th",{className:"py-2 pr-2",children:"支付时间"})]})}),e.jsx("tbody",{children:$e.orders.map(F=>e.jsxs("tr",{className:"border-b border-gray-700/50",children:[e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.orderSn??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.userId??F.openId??"-"}),e.jsxs("td",{className:"py-2 pr-2 text-gray-300",children:["¥",F.amount??0]}),e.jsx("td",{className:"py-2 pr-2 text-gray-300",children:F.status??"-"}),e.jsx("td",{className:"py-2 pr-2 text-gray-500",children:F.payTime??F.createdAt??"-"})]},F.id??F.orderSn??""))})]}):null})]})}),e.jsx(wt,{open:Ze,onOpenChange:xt,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Nd,{className:"w-5 h-5 text-amber-400"}),"文章排名算法"]})}),e.jsxs("div",{className:"space-y-4 py-2",children:[e.jsx("p",{className:"text-sm text-gray-400",children:"热度积分 = 阅读权重×阅读排名分 + 新度权重×新度排名分 + 付款权重×付款排名分(三权重之和须为 1)"}),Es?e.jsx("p",{className:"text-gray-500",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"阅读权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:Xe.readWeight,onChange:F=>kt(ne=>({...ne,readWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"新度权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:Xe.recencyWeight,onChange:F=>kt(ne=>({...ne,recencyWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(te,{className:"text-gray-400 text-xs",children:"付款权重"}),e.jsx(ie,{type:"number",step:"0.1",min:"0",max:"1",className:"bg-[#0a1628] border-gray-700 text-white",value:Xe.payWeight,onChange:F=>kt(ne=>({...ne,payWeight:Math.max(0,Math.min(1,parseFloat(F.target.value)||0))}))})]})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["当前之和: ",(Xe.readWeight+Xe.recencyWeight+Xe.payWeight).toFixed(1)]}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 text-xs text-gray-400",children:[e.jsx("li",{children:"阅读量前 20 名:得分 20~1"}),e.jsx("li",{children:"最近更新前 30 篇:得分 30~1"}),e.jsx("li",{children:"付款数前 20 名:得分 20~1"})]}),e.jsx(J,{onClick:Oa,disabled:nr||Math.abs(Xe.readWeight+Xe.recencyWeight+Xe.payWeight-1)>.001,className:"w-full bg-amber-500 hover:bg-amber-600 text-white",children:nr?"保存中...":"保存权重"})]})]})]})}),e.jsx(wt,{open:se,onOpenChange:G,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-md",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(Rt,{className:"w-5 h-5 text-amber-400"}),"新建篇"]})}),e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"篇名(如:第六篇|真实的社会)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:ve,onChange:F=>D(F.target.value),placeholder:"输入篇名"})]})}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>{G(!1),D("")},className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsx(J,{onClick:Vn,disabled:pe||!ve.trim(),className:"bg-amber-500 hover:bg-amber-600 text-white",children:pe?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"创建中..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"创建篇"]})})]})]})}),e.jsx(wt,{open:!!m,onOpenChange:()=>f(null),children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-4xl max-h-[90vh] flex flex-col p-0 gap-0",showCloseButton:!0,children:[e.jsx(St,{className:"shrink-0 px-6 pt-6 pb-2",children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}),"编辑章节"]})}),m&&e.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 px-6 space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节ID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.id,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:m.isFree?0:m.price,onChange:F=>f({...m,price:Number(F.target.value),isFree:Number(F.target.value)===0}),disabled:m.isFree})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"免费章节(唯一入口,小程序以 is_free 或 price=0 为准)"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isFree||m.price===0,onChange:F=>f({...m,isFree:F.target.checked,price:F.target.checked?0:1}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"设为免费"})]})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最新新增"}),e.jsx("div",{className:"flex items-center h-10",children:e.jsxs("label",{className:"flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:m.isNew??!1,onChange:F=>f({...m,isNew:F.target.checked}),className:"w-5 h-5 rounded border-gray-600 bg-[#0a1628] text-[#38bdac] focus:ring-[#38bdac]"}),e.jsx("span",{className:"ml-2 text-gray-400 text-sm",children:"标记 NEW"})]})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"章节标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:m.title,onChange:F=>f({...m,title:F.target.value})})]}),m.filePath&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"文件路径"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-gray-400 text-sm",value:m.filePath,disabled:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(te,{className:"text-gray-300",children:"内容 (Markdown格式)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{ref:U,type:"file",accept:"image/*",onChange:kr,className:"hidden"}),e.jsxs(J,{variant:"outline",size:"sm",onClick:()=>{var F;return(F=U.current)==null?void 0:F.click()},disabled:T,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[T?e.jsx(Be,{className:"w-4 h-4 mr-1 animate-spin"}):e.jsx(Ux,{className:"w-4 h-4 mr-1"}),"上传图片"]})]})]}),g?e.jsxs("div",{className:"bg-[#0a1628] border border-gray-700 rounded-md min-h-[400px] flex items-center justify-center",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(rn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[400px] font-mono text-sm placeholder:text-gray-500",placeholder:"此处输入章节内容,支持Markdown格式...",value:m.content,onChange:F=>f({...m,content:F.target.value})})]})]}),e.jsxs(zt,{className:"shrink-0 px-6 py-4 border-t border-gray-700/50",children:[e.jsxs(J,{variant:"outline",onClick:()=>f(null),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsx(J,{onClick:Bn,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:C?e.jsxs(e.Fragment,{children:[e.jsx(Be,{className:"w-4 h-4 mr-2 animate-spin"}),"保存中..."]}):e.jsxs(e.Fragment,{children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),"保存修改"]})})]})]})}),e.jsxs(_l,{defaultValue:"chapters",className:"space-y-6",children:[e.jsxs(_a,{className:"bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(_t,{value:"chapters",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(tr,{className:"w-4 h-4 mr-2"}),"章节管理"]}),e.jsxs(_t,{value:"search",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(vr,{className:"w-4 h-4 mr-2"}),"内容搜索"]}),e.jsxs(_t,{value:"hooks",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400",children:[e.jsx(Nd,{className:"w-4 h-4 mr-2"}),"钩子配置"]})]}),e.jsxs(Mt,{value:"chapters",className:"space-y-4",children:[e.jsxs("div",{className:"rounded-2xl border border-gray-700/50 bg-[#1C1C1E] p-4 flex items-center justify-between shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.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:e.jsx(tr,{className:"w-6 h-6"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-base text-white leading-tight mb-1",children:"一场SOUL的创业实验场"}),e.jsx("p",{className:"text-xs text-gray-500",children:"来自Soul派对房的真实商业故事"})]})]}),e.jsxs("div",{className:"text-center shrink-0",children:[e.jsx("span",{className:"block text-2xl font-bold text-[#38bdac]",children:mn}),e.jsx("span",{className:"text-xs text-gray-500",children:"章节"})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(J,{onClick:()=>y(!0),className:"flex-1 min-w-[120px] bg-[#38bdac]/10 hover:bg-[#38bdac]/20 text-[#38bdac] border border-[#38bdac]/30",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新建章节"]}),e.jsxs(J,{onClick:()=>G(!0),className:"flex-1 min-w-[120px] bg-amber-500/10 hover:bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新建篇"]}),e.jsxs(J,{variant:"outline",onClick:()=>L(!0),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:["批量移动(已选 ",oe.length," 节)"]})]}),l?e.jsxs("div",{className:"flex items-center justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsx(FS,{parts:Wt,expandedParts:c,onTogglePart:us,onReorder:zn,onReadSection:fn,onDeleteSection:ar,onAddSectionInPart:pn,onAddChapterInPart:Cr,onDeleteChapter:Un,onEditPart:gn,onDeletePart:vn,onEditChapter:Vs,selectedSectionIds:oe,onToggleSectionSelect:Wn,onShowSectionOrders:$n})]}),e.jsx(Mt,{value:"search",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"内容搜索"})}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 flex-1",placeholder:"搜索标题或内容...",value:R,onChange:F=>S(F.target.value),onKeyDown:F=>F.key==="Enter"&&Er()}),e.jsx(J,{onClick:Er,disabled:E||!R.trim(),className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:E?e.jsx(Be,{className:"w-4 h-4 animate-spin"}):e.jsx(vr,{className:"w-4 h-4"})})]}),b.length>0&&e.jsxs("div",{className:"space-y-2 mt-4",children:[e.jsxs("p",{className:"text-gray-400 text-sm",children:["找到 ",b.length," 个结果"]}),b.map(F=>e.jsxs("div",{className:"p-3 rounded-lg bg-[#162840] hover:bg-[#1a3050] cursor-pointer transition-colors",onClick:()=>fn({id:F.id,title:F.title,price:F.price??1,filePath:""}),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[#38bdac] font-mono text-xs mr-2",children:F.id}),e.jsx("span",{className:"text-white",children:F.title})]}),e.jsx(De,{variant:"outline",className:"text-gray-400 border-gray-600 text-xs",children:F.matchType==="title"?"标题匹配":"内容匹配"})]}),F.snippet&&e.jsx("p",{className:"text-gray-500 text-xs mt-2 line-clamp-2",children:F.snippet}),(F.partTitle||F.chapterTitle)&&e.jsxs("p",{className:"text-gray-600 text-xs mt-1",children:[F.partTitle," · ",F.chapterTitle]})]},F.id))]})]})]})}),e.jsx(Mt,{value:"hooks",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"引流钩子配置"})}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx(te,{htmlFor:"hook-chapter",className:"text-gray-300",children:"触发章节"}),e.jsxs(jl,{defaultValue:"3",children:[e.jsx(ya,{id:"hook-chapter",className:"bg-[#0a1628] border-gray-700 text-white",children:e.jsx(bl,{placeholder:"选择章节"})}),e.jsxs(va,{className:"bg-[#0f2137] border-gray-700",children:[e.jsx(qs,{value:"1",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第一章"}),e.jsx(qs,{value:"2",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第二章"}),e.jsx(qs,{value:"3",className:"text-white hover:bg-[#38bdac]/20 focus:bg-[#38bdac]/20",children:"第三章 (默认)"})]})]})]}),e.jsxs("div",{className:"grid w-full gap-1.5",children:[e.jsx(te,{htmlFor:"message",className:"text-gray-300",children:"引流文案"}),e.jsx(rn,{placeholder:"输入引导用户加群的文案...",id:"message",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",defaultValue:"阅读更多精彩内容,请加入Soul创业实验派对群..."})]}),e.jsx(J,{className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:"保存配置"})]})]})})]})]})}var cg=["PageUp","PageDown"],dg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ug={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},La="Slider",[iu,BS,US]=Pu(La),[hg]=dn(La,[US]),[VS,Mo]=hg(La),mg=h.forwardRef((r,a)=>{const{name:l,min:o=0,max:c=100,step:d=1,orientation:m="horizontal",disabled:f=!1,minStepsBetweenThumbs:p=0,defaultValue:y=[o],value:g,onValueChange:v=()=>{},onValueCommit:C=()=>{},inverted:P=!1,form:R,...S}=r,b=h.useRef(new Set),N=h.useRef(0),j=m==="horizontal"?WS:HS,[T=[],B]=An({prop:g,defaultProp:y,onChange:ae=>{var se;(se=[...b.current][N.current])==null||se.focus(),v(ae)}}),U=h.useRef(T);function k(ae){const le=qS(T,ae);re(ae,le)}function A(ae){re(ae,N.current)}function _(){const ae=U.current[N.current];T[N.current]!==ae&&C(T)}function re(ae,le,{commit:se}={commit:!1}){const G=eC(d),q=tC(Math.round((ae-o)/d)*d+o,G),ce=uo(q,[o,c]);B((je=[])=>{const $=GS(je,ce,le);if(ZS($,p*d)){N.current=$.indexOf(ce);const oe=String($)!==String(je);return oe&&se&&C($),oe?$:je}else return je})}return e.jsx(VS,{scope:r.__scopeSlider,name:l,disabled:f,min:o,max:c,valueIndexToChangeRef:N,thumbs:b.current,values:T,orientation:m,form:R,children:e.jsx(iu.Provider,{scope:r.__scopeSlider,children:e.jsx(iu.Slot,{scope:r.__scopeSlider,children:e.jsx(j,{"aria-disabled":f,"data-disabled":f?"":void 0,...S,ref:a,onPointerDown:He(S.onPointerDown,()=>{f||(U.current=T)}),min:o,max:c,inverted:P,onSlideStart:f?void 0:k,onSlideMove:f?void 0:A,onSlideEnd:f?void 0:_,onHomeKeyDown:()=>!f&&re(o,0,{commit:!0}),onEndKeyDown:()=>!f&&re(c,T.length-1,{commit:!0}),onStepKeyDown:({event:ae,direction:le})=>{if(!f){const q=cg.includes(ae.key)||ae.shiftKey&&dg.includes(ae.key)?10:1,ce=N.current,je=T[ce],$=d*q*le;re(je+$,ce,{commit:!0})}}})})})})});mg.displayName=La;var[fg,xg]=hg(La,{startEdge:"left",endEdge:"right",size:"width",direction:1}),WS=h.forwardRef((r,a)=>{const{min:l,max:o,dir:c,inverted:d,onSlideStart:m,onSlideMove:f,onSlideEnd:p,onStepKeyDown:y,...g}=r,[v,C]=h.useState(null),P=st(a,j=>C(j)),R=h.useRef(void 0),S=wo(c),b=S==="ltr",N=b&&!d||!b&&d;function E(j){const T=R.current||v.getBoundingClientRect(),B=[0,T.width],k=Bu(B,N?[l,o]:[o,l]);return R.current=T,k(j-T.left)}return e.jsx(fg,{scope:r.__scopeSlider,startEdge:N?"left":"right",endEdge:N?"right":"left",direction:N?1:-1,size:"width",children:e.jsx(pg,{dir:S,"data-orientation":"horizontal",...g,ref:P,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const T=E(j.clientX);m==null||m(T)},onSlideMove:j=>{const T=E(j.clientX);f==null||f(T)},onSlideEnd:()=>{R.current=void 0,p==null||p()},onStepKeyDown:j=>{const B=ug[N?"from-left":"from-right"].includes(j.key);y==null||y({event:j,direction:B?-1:1})}})})}),HS=h.forwardRef((r,a)=>{const{min:l,max:o,inverted:c,onSlideStart:d,onSlideMove:m,onSlideEnd:f,onStepKeyDown:p,...y}=r,g=h.useRef(null),v=st(a,g),C=h.useRef(void 0),P=!c;function R(S){const b=C.current||g.current.getBoundingClientRect(),N=[0,b.height],j=Bu(N,P?[o,l]:[l,o]);return C.current=b,j(S-b.top)}return e.jsx(fg,{scope:r.__scopeSlider,startEdge:P?"bottom":"top",endEdge:P?"top":"bottom",size:"height",direction:P?1:-1,children:e.jsx(pg,{"data-orientation":"vertical",...y,ref:v,style:{...y.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:S=>{const b=R(S.clientY);d==null||d(b)},onSlideMove:S=>{const b=R(S.clientY);m==null||m(b)},onSlideEnd:()=>{C.current=void 0,f==null||f()},onStepKeyDown:S=>{const N=ug[P?"from-bottom":"from-top"].includes(S.key);p==null||p({event:S,direction:N?-1:1})}})})}),pg=h.forwardRef((r,a)=>{const{__scopeSlider:l,onSlideStart:o,onSlideMove:c,onSlideEnd:d,onHomeKeyDown:m,onEndKeyDown:f,onStepKeyDown:p,...y}=r,g=Mo(La,l);return e.jsx(qe.span,{...y,ref:a,onKeyDown:He(r.onKeyDown,v=>{v.key==="Home"?(m(v),v.preventDefault()):v.key==="End"?(f(v),v.preventDefault()):cg.concat(dg).includes(v.key)&&(p(v),v.preventDefault())}),onPointerDown:He(r.onPointerDown,v=>{const C=v.target;C.setPointerCapture(v.pointerId),v.preventDefault(),g.thumbs.has(C)?C.focus():o(v)}),onPointerMove:He(r.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&c(v)}),onPointerUp:He(r.onPointerUp,v=>{const C=v.target;C.hasPointerCapture(v.pointerId)&&(C.releasePointerCapture(v.pointerId),d(v))})})}),gg="SliderTrack",yg=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Mo(gg,l);return e.jsx(qe.span,{"data-disabled":c.disabled?"":void 0,"data-orientation":c.orientation,...o,ref:a})});yg.displayName=gg;var ou="SliderRange",vg=h.forwardRef((r,a)=>{const{__scopeSlider:l,...o}=r,c=Mo(ou,l),d=xg(ou,l),m=h.useRef(null),f=st(a,m),p=c.values.length,y=c.values.map(C=>Ng(C,c.min,c.max)),g=p>1?Math.min(...y):0,v=100-Math.max(...y);return e.jsx(qe.span,{"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,...o,ref:f,style:{...r.style,[d.startEdge]:g+"%",[d.endEdge]:v+"%"}})});vg.displayName=ou;var cu="SliderThumb",jg=h.forwardRef((r,a)=>{const l=BS(r.__scopeSlider),[o,c]=h.useState(null),d=st(a,f=>c(f)),m=h.useMemo(()=>o?l().findIndex(f=>f.ref.current===o):-1,[l,o]);return e.jsx(KS,{...r,ref:d,index:m})}),KS=h.forwardRef((r,a)=>{const{__scopeSlider:l,index:o,name:c,...d}=r,m=Mo(cu,l),f=xg(cu,l),[p,y]=h.useState(null),g=st(a,E=>y(E)),v=p?m.form||!!p.closest("form"):!0,C=Iu(p),P=m.values[o],R=P===void 0?0:Ng(P,m.min,m.max),S=QS(o,m.values.length),b=C==null?void 0:C[f.size],N=b?XS(b,R,f.direction):0;return h.useEffect(()=>{if(p)return m.thumbs.add(p),()=>{m.thumbs.delete(p)}},[p,m.thumbs]),e.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${R}% + ${N}px)`},children:[e.jsx(iu.ItemSlot,{scope:r.__scopeSlider,children:e.jsx(qe.span,{role:"slider","aria-label":r["aria-label"]||S,"aria-valuemin":m.min,"aria-valuenow":P,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...d,ref:g,style:P===void 0?{display:"none"}:r.style,onFocus:He(r.onFocus,()=>{m.valueIndexToChangeRef.current=o})})}),v&&e.jsx(bg,{name:c??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:P},o)]})});jg.displayName=cu;var YS="RadioBubbleInput",bg=h.forwardRef(({__scopeSlider:r,value:a,...l},o)=>{const c=h.useRef(null),d=st(c,o),m=Tu(a);return h.useEffect(()=>{const f=c.current;if(!f)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"value").set;if(m!==a&&g){const v=new Event("input",{bubbles:!0});g.call(f,a),f.dispatchEvent(v)}},[m,a]),e.jsx(qe.input,{style:{display:"none"},...l,ref:d,defaultValue:a})});bg.displayName=YS;function GS(r=[],a,l){const o=[...r];return o[l]=a,o.sort((c,d)=>c-d)}function Ng(r,a,l){const d=100/(l-a)*(r-a);return uo(d,[0,100])}function QS(r,a){return a>2?`Value ${r+1} of ${a}`:a===2?["Minimum","Maximum"][r]:void 0}function qS(r,a){if(r.length===1)return 0;const l=r.map(c=>Math.abs(c-a)),o=Math.min(...l);return l.indexOf(o)}function XS(r,a,l){const o=r/2,d=Bu([0,50],[0,o]);return(o-d(a)*l)*l}function JS(r){return r.slice(0,-1).map((a,l)=>r[l+1]-a)}function ZS(r,a){if(a>0){const l=JS(r);return Math.min(...l)>=a}return!0}function Bu(r,a){return l=>{if(r[0]===r[1]||a[0]===a[1])return a[0];const o=(a[1]-a[0])/(r[1]-r[0]);return a[0]+o*(l-r[0])}}function eC(r){return(String(r).split(".")[1]||"").length}function tC(r,a){const l=Math.pow(10,a);return Math.round(r*l)/l}var sC=mg,rC=yg,nC=vg,aC=jg;function lC({className:r,defaultValue:a,value:l,min:o=0,max:c=100,...d}){const m=h.useMemo(()=>Array.isArray(l)?l:Array.isArray(a)?a:[o,c],[l,a,o,c]);return e.jsxs(sC,{defaultValue:a,value:l,min:o,max:c,className:rt("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50",r),...d,children:[e.jsx(rC,{className:"bg-gray-600 relative grow overflow-hidden rounded-full h-1.5 w-full",children:e.jsx(nC,{className:"bg-[#38bdac] absolute h-full rounded-full"})}),Array.from({length:m.length},(f,p)=>e.jsx(aC,{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"},p))]})}const iC={distributorShare:90,minWithdrawAmount:10,bindingDays:30,userDiscount:5,enableAutoWithdraw:!1,vipOrderShareVip:20,vipOrderShareNonVip:10};function oC(){const[r,a]=h.useState(iC),[l,o]=h.useState(!0),[c,d]=h.useState(!1);h.useEffect(()=>{Ue("/api/admin/referral-settings").then(p=>{const y=p==null?void 0:p.data;y&&typeof y=="object"&&a({distributorShare:y.distributorShare??90,minWithdrawAmount:y.minWithdrawAmount??10,bindingDays:y.bindingDays??30,userDiscount:y.userDiscount??5,enableAutoWithdraw:y.enableAutoWithdraw??!1,vipOrderShareVip:y.vipOrderShareVip??20,vipOrderShareNonVip:y.vipOrderShareNonVip??10})}).catch(console.error).finally(()=>o(!1))},[]);const m=async()=>{d(!0);try{const p={distributorShare:Number(r.distributorShare)||0,minWithdrawAmount:Number(r.minWithdrawAmount)||0,bindingDays:Number(r.bindingDays)||0,userDiscount:Number(r.userDiscount)||0,enableAutoWithdraw:!!r.enableAutoWithdraw,vipOrderShareVip:Number(r.vipOrderShareVip)||20,vipOrderShareNonVip:Number(r.vipOrderShareNonVip)||10},y=await bt("/api/admin/referral-settings",p);if(!y||y.success===!1){alert("保存失败: "+(y&&typeof y=="object"&&"error"in y?y.error:""));return}alert(`✅ 分销配置已保存成功! + +• 小程序与网站的推广规则会一起生效 +• 绑定关系会使用新的天数配置 +• 佣金比例会立即应用到新订单 + +如有缓存,请刷新前台/小程序页面。`)}catch(p){console.error(p),alert("保存失败: "+(p instanceof Error?p.message:String(p)))}finally{d(!1)}},f=p=>y=>{const g=parseFloat(y.target.value||"0");a(v=>({...v,[p]:isNaN(g)?0:g}))};return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Sa,{className:"w-5 h-5 text-[#38bdac]"}),"推广 / 分销设置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"统一管理「好友优惠」「你得 90% 收益」「绑定期 30 天」「提现门槛」等规则,小程序和 Web 共用这套配置。"})]}),e.jsxs(J,{onClick:m,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(Vb,{className:"w-4 h-4 text-[#38bdac]"}),"推广规则"]}),e.jsx(ft,{className:"text-gray-400",children:"这三项会直接体现在小程序「推广规则」卡片上,同时影响实收佣金计算。"})]}),e.jsx(Ce,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Bi,{className:"w-3 h-3 text-[#38bdac]"}),"好友优惠(%)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.userDiscount,onChange:f("userDiscount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"例如 5 表示好友立减 5%(在价格配置基础上生效)。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Gt,{className:"w-3 h-3 text-[#38bdac]"}),"推广者分成(%)"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(lC,{className:"flex-1",min:10,max:100,step:1,value:[r.distributorShare],onValueChange:([p])=>a(y=>({...y,distributorShare:p}))}),e.jsx(ie,{type:"number",min:0,max:100,className:"w-20 bg-[#0a1628] border-gray-700 text-white text-center",value:r.distributorShare,onChange:f("distributorShare")})]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["内容订单佣金 = 订单金额 ×"," ",e.jsxs("span",{className:"text-[#38bdac] font-mono",children:[r.distributorShare,"%"]}),";会员订单见下方。"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Bi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者是会员 %)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareVip,onChange:f("vipOrderShareVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者已是会员时,会员订单佣金比例,默认 20%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Bi,{className:"w-3 h-3 text-[#38bdac]"}),"会员订单分润(推广者非会员 %)"]}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.vipOrderShareNonVip,onChange:f("vipOrderShareNonVip")}),e.jsx("p",{className:"text-xs text-gray-500",children:"推广者非会员时,会员订单佣金比例,默认 10%。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Gt,{className:"w-3 h-3 text-[#38bdac]"}),"绑定有效期(天)"]}),e.jsx(ie,{type:"number",min:1,max:365,className:"bg-[#0a1628] border-gray-700 text-white",value:r.bindingDays,onChange:f("bindingDays")}),e.jsx("p",{className:"text-xs text-gray-500",children:"好友通过你的链接进来并登录后,绑定在你名下的天数。"})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(Sa,{className:"w-4 h-4 text-[#38bdac]"}),"提现规则"]}),e.jsx(ft,{className:"text-gray-400",children:"与「提现中心」「自动提现」相关的参数,影响推广者看到的可提现金额和最低门槛。"})]}),e.jsx(Ce,{className:"space-y-6",children:e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额(元)"}),e.jsx(ie,{type:"number",min:0,step:1,className:"bg-[#0a1628] border-gray-700 text-white",value:r.minWithdrawAmount,onChange:f("minWithdrawAmount")}),e.jsx("p",{className:"text-xs text-gray-500",children:"小程序「满 X 元可提现」展示的门槛,同时用于后端接口校验。"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:["自动提现开关",e.jsx(De,{variant:"outline",className:"border-[#38bdac]/40 text-[#38bdac] text-[10px]",children:"预留"})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[e.jsx(lt,{checked:r.enableAutoWithdraw,onCheckedChange:p=>a(y=>({...y,enableAutoWithdraw:p}))}),e.jsx("span",{className:"text-sm text-gray-400",children:"开启后,可结合定时任务实现「收益自动打款到微信零钱」。"})]})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsxs(Ye,{className:"flex items-center gap-2 text-gray-200 text-sm",children:[e.jsx(Bi,{className:"w-4 h-4 text-[#38bdac]"}),"使用说明"]})}),e.jsxs(Ce,{className:"space-y-2 text-xs text-gray-400 leading-relaxed",children:[e.jsxs("p",{children:["1. 以上配置会写入"," ",e.jsx("code",{className:"font-mono text-[11px] text-[#38bdac]",children:"system_config.referral_config"}),",小程序「推广中心」、Web 推广页以及支付回调都会读取同一份配置。"]}),e.jsx("p",{children:"2. 修改后新订单立即生效;旧订单的历史佣金不会自动重算,只影响之后产生的订单。"}),e.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 gx(r){return Array.isArray(r)?r.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 yx(r){return Array.isArray(r)?r.map(a=>typeof a=="string"?a:String(a??"")).filter(Boolean):gr.highlights}function cC(){const[r,a]=h.useState(gr),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),p=h.useRef(null);h.useEffect(()=>{Ue("/api/admin/author-settings").then(N=>{const E=N==null?void 0:N.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:gx(E.stats).length?gx(E.stats):gr.stats,highlights:yx(E.highlights).length?yx(E.highlights):gr.highlights})}).catch(console.error).finally(()=>o(!1))},[]);const y=async()=>{d(!0);try{const N={name:r.name,avatar:r.avatar||"K",avatarImg:r.avatarImg,title:r.title,bio:r.bio,stats:r.stats.filter(T=>T.label||T.value),highlights:r.highlights.filter(Boolean)},E=await bt("/api/admin/author-settings",N);if(!E||E.success===!1){alert("保存失败: "+(E&&typeof E=="object"&&"error"in E?E.error:""));return}d(!1);const j=document.createElement("div");j.className="fixed top-4 right-4 z-50 px-4 py-2 rounded-lg bg-[#38bdac] text-white text-sm shadow-lg",j.textContent="作者设置已保存",document.body.appendChild(j),setTimeout(()=>j.remove(),2e3)}catch(N){console.error(N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{d(!1)}},g=async N=>{var j;const E=(j=N.target.files)==null?void 0:j[0];if(E){f(!0);try{const T=new FormData;T.append("file",E),T.append("folder","avatars");const B=yu(),U={};B&&(U.Authorization=`Bearer ${B}`);const A=await(await fetch(Ca("/api/upload"),{method:"POST",body:T,credentials:"include",headers:U})).json();A!=null&&A.success&&(A!=null&&A.url)?a(_=>({..._,avatarImg:A.url})):alert("上传失败: "+((A==null?void 0:A.error)||"未知错误"))}catch(T){console.error(T),alert("上传失败")}finally{f(!1),p.current&&(p.current.value="")}}},v=()=>a(N=>({...N,stats:[...N.stats,{label:"",value:""}]})),C=N=>a(E=>({...E,stats:E.stats.filter((j,T)=>T!==N)})),P=(N,E,j)=>a(T=>({...T,stats:T.stats.map((B,U)=>U===N?{...B,[E]:j}:B)})),R=()=>a(N=>({...N,highlights:[...N.highlights,""]})),S=N=>a(E=>({...E,highlights:E.highlights.filter((j,T)=>T!==N)})),b=(N,E)=>a(j=>({...j,highlights:j.highlights.map((T,B)=>B===N?E:T)}));return l?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ba,{className:"w-5 h-5 text-[#38bdac]"}),"作者详情"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置小程序「关于作者」页展示的作者信息,包括头像、简介、统计数据与亮点标签。"})]}),e.jsxs(J,{onClick:y,disabled:c||l,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"flex items-center gap-2 text-white",children:[e.jsx(ba,{className:"w-4 h-4 text-[#38bdac]"}),"基本信息"]}),e.jsx(ft,{className:"text-gray-400",children:"作者姓名、头像、头衔与个人简介,将展示在「关于作者」页顶部。"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.name,onChange:N=>a(E=>({...E,name:N.target.value})),placeholder:"卡若"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首字母占位(无头像时显示)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white w-20",value:r.avatar,onChange:N=>a(E=>({...E,avatar:N.target.value.slice(0,1)||"K"})),placeholder:"K"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Ux,{className:"w-3 h-3 text-[#38bdac]"}),"头像图片"]}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:r.avatarImg,onChange:N=>a(E=>({...E,avatarImg:N.target.value})),placeholder:"上传或粘贴 URL,如 /uploads/avatars/xxx.png"}),e.jsx("input",{ref:p,type:"file",accept:"image/*",className:"hidden",onChange:g}),e.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:m,onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),m?"上传中...":"上传"]})]}),r.avatarImg&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:r.avatarImg.startsWith("http")?r.avatarImg:Ca(r.avatarImg),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头衔"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:r.title,onChange:N=>a(E=>({...E,title:N.target.value})),placeholder:"Soul派对房主理人 · 私域运营专家"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"个人简介"}),e.jsx(rn,{className:"bg-[#0a1628] border-gray-700 text-white min-h-[120px]",value:r.bio,onChange:N=>a(E=>({...E,bio:N.target.value})),placeholder:"每天早上6点到9点..."})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ye,{className:"text-white",children:"统计数据"}),e.jsx(ft,{className:"text-gray-400",children:"展示在作者卡片中的数字指标,如「商业案例 62」「连续直播 365天」。第一个「商业案例」的值可由书籍统计自动更新。"})]}),e.jsxs(Ce,{className:"space-y-3",children:[r.stats.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.label,onChange:j=>P(E,"label",j.target.value),placeholder:"标签"}),e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N.value,onChange:j=>P(E,"value",j.target.value),placeholder:"数值"}),e.jsx(J,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>C(E),children:e.jsx(ys,{className:"w-4 h-4"})})]},E)),e.jsxs(J,{variant:"outline",size:"sm",onClick:v,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加统计项"]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsx(Ye,{className:"text-white",children:"亮点标签"}),e.jsx(ft,{className:"text-gray-400",children:"作者优势或成就的简短描述,以标签形式展示。"})]}),e.jsxs(Ce,{className:"space-y-3",children:[r.highlights.map((N,E)=>e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:N,onChange:j=>b(E,j.target.value),placeholder:"5年私域运营经验"}),e.jsx(J,{variant:"ghost",size:"icon",className:"text-gray-400 hover:text-red-400",onClick:()=>S(E),children:e.jsx(ys,{className:"w-4 h-4"})})]},E)),e.jsxs(J,{variant:"outline",size:"sm",onClick:R,className:"border-gray-600 text-gray-400",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"添加亮点"]})]})]})]})]})}function dC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m]=h.useState(10),[f,p]=h.useState(0),[y,g]=h.useState(""),v=co(y,300),[C,P]=h.useState(!0),[R,S]=h.useState(null),[b,N]=h.useState(!1),[E,j]=h.useState(null),[T,B]=h.useState(""),[U,k]=h.useState(""),[A,_]=h.useState(""),[re,ae]=h.useState("admin"),[le,se]=h.useState("active"),[G,q]=h.useState(!1);async function ce(){var L;P(!0),S(null);try{const O=new URLSearchParams({page:String(c),pageSize:String(m)});v.trim()&&O.set("search",v.trim());const X=await Ue(`/api/admin/users?${O}`);X!=null&&X.success?(a(X.records||[]),o(X.total??0),p(X.totalPages??0)):S(X.error||"加载失败")}catch(O){const X=O;S(X.status===403?"无权限访问":((L=X==null?void 0:X.data)==null?void 0:L.error)||"加载失败"),a([])}finally{P(!1)}}h.useEffect(()=>{ce()},[c,m,v]);const je=()=>{j(null),B(""),k(""),_(""),ae("admin"),se("active"),N(!0)},$=L=>{j(L),B(L.username),k(""),_(L.name||""),ae(L.role==="super_admin"?"super_admin":"admin"),se(L.status==="disabled"?"disabled":"active"),N(!0)},oe=async()=>{var L;if(!T.trim()){S("用户名不能为空");return}if(!E&&!U){S("新建时密码必填,至少 6 位");return}if(U&&U.length<6){S("密码至少 6 位");return}S(null),q(!0);try{if(E){const O=await vt("/api/admin/users",{id:E.id,password:U||void 0,name:A.trim(),role:re,status:le});O!=null&&O.success?(N(!1),ce()):S((O==null?void 0:O.error)||"保存失败")}else{const O=await bt("/api/admin/users",{username:T.trim(),password:U,name:A.trim(),role:re});O!=null&&O.success?(N(!1),ce()):S((O==null?void 0:O.error)||"保存失败")}}catch(O){const X=O;S(((L=X==null?void 0:X.data)==null?void 0:L.error)||"保存失败")}finally{q(!1)}},K=async L=>{var O;if(confirm("确定删除该管理员?"))try{const X=await tn(`/api/admin/users?id=${L}`);X!=null&&X.success?ce():S((X==null?void 0:X.error)||"删除失败")}catch(X){const H=X;S(((O=H==null?void 0:H.data)==null?void 0:O.error)||"删除失败")}},M=L=>{if(!L)return"-";try{const O=new Date(L);return isNaN(O.getTime())?L:O.toLocaleString("zh-CN")}catch{return L}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(pu,{className:"w-5 h-5 text-[#38bdac]"}),"管理员用户"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"后台登录账号管理,仅超级管理员可操作"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{placeholder:"搜索用户名/昵称",value:y,onChange:L=>g(L.target.value),className:"w-48 bg-[#0f2137] border-gray-700 text-white placeholder:text-gray-500"}),e.jsx(J,{variant:"outline",size:"sm",onClick:ce,disabled:C,className:"border-gray-600 text-gray-300",children:e.jsx(Be,{className:`w-4 h-4 ${C?"animate-spin":""}`})}),e.jsxs(J,{onClick:je,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增管理员"]})]})]}),R&&e.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:[e.jsx("span",{children:R}),e.jsx("button",{type:"button",onClick:()=>S(null),className:"text-red-400 hover:text-red-300",children:"×"})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-0",children:C?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(e.Fragment,{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户名"}),e.jsx(be,{className:"text-gray-400",children:"昵称"}),e.jsx(be,{className:"text-gray-400",children:"角色"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ns,{children:[r.map(L=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(fe,{className:"text-gray-300",children:L.id}),e.jsx(fe,{className:"text-white font-medium",children:L.username}),e.jsx(fe,{className:"text-gray-400",children:L.name||"-"}),e.jsx(fe,{children:e.jsx(De,{variant:"outline",className:L.role==="super_admin"?"border-amber-500/50 text-amber-400":"border-gray-600 text-gray-400",children:L.role==="super_admin"?"超级管理员":"管理员"})}),e.jsx(fe,{children:e.jsx(De,{variant:"outline",className:L.status==="active"?"border-[#38bdac]/50 text-[#38bdac]":"border-gray-500 text-gray-500",children:L.status==="active"?"正常":"已禁用"})}),e.jsx(fe,{className:"text-gray-500 text-sm",children:M(L.createdAt)}),e.jsxs(fe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>$(L),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>K(L.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Yt,{className:"w-4 h-4"})})]})]},L.id)),r.length===0&&!C&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:7,className:"text-center py-12 text-gray-500",children:R==="无权限访问"?"仅超级管理员可查看":"暂无管理员"})})]})]}),f>1&&e.jsx("div",{className:"p-4 border-t border-gray-700/50",children:e.jsx(Fs,{page:c,pageSize:m,total:l,totalPages:f,onPageChange:d})})]})})}),e.jsx(wt,{open:b,onOpenChange:N,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:E?"编辑管理员":"新增管理员"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"用户名"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"登录用户名",value:T,onChange:L=>B(L.target.value),disabled:!!E}),E&&e.jsx("p",{className:"text-xs text-gray-500",children:"用户名不可修改"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:E?"新密码(留空不改)":"密码"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:E?"留空表示不修改":"至少 6 位",value:U,onChange:L=>k(L.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"昵称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"显示名称",value:A,onChange:L=>_(L.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色"}),e.jsxs("select",{value:re,onChange:L=>ae(L.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"admin",children:"管理员"}),e.jsx("option",{value:"super_admin",children:"超级管理员"})]})]}),E&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"状态"}),e.jsxs("select",{value:le,onChange:L=>se(L.target.value),className:"w-full h-10 px-3 rounded-md bg-[#0a1628] border border-gray-700 text-white",children:[e.jsx("option",{value:"active",children:"正常"}),e.jsx("option",{value:"disabled",children:"禁用"})]})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>N(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:oe,disabled:G,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),G?"保存中...":"保存"]})]})]})})]})}const uC={appId:"wxb8bbb2b10dec74aa",withdrawSubscribeTmplId:"u3MbZGPRkrZIk-I7QdpwzFxnO_CeQPaCWF2FkiIablE",mchId:"1318592501",minWithdraw:10},hC={name:"卡若",startDate:"2025年10月15日",bio:"连续创业者,私域运营专家,每天早上6-9点在Soul派对房分享真实商业故事",liveTime:"06:00-09:00",platform:"Soul派对房",description:"连续创业者,私域运营专家"},mC={sectionPrice:1,baseBookPrice:9.9,distributorShare:90,authorInfo:{...hC}},fC={matchEnabled:!0,referralEnabled:!0,searchEnabled:!0,aboutEnabled:!0},xC=["system","author","admin"];function pC(){const[r,a]=Pj(),l=r.get("tab")??"system",o=xC.includes(l)?l:"system",[c,d]=h.useState(mC),[m,f]=h.useState(fC),[p,y]=h.useState(uC),[g,v]=h.useState(!1),[C,P]=h.useState(!0),[R,S]=h.useState(!1),[b,N]=h.useState(""),[E,j]=h.useState(""),[T,B]=h.useState(!1),[U,k]=h.useState(!1),A=(se,G,q=!1)=>{N(se),j(G),B(q),S(!0)};h.useEffect(()=>{(async()=>{try{const G=await Ue("/api/admin/settings");if(!G||G.success===!1)return;if(G.featureConfig&&Object.keys(G.featureConfig).length&&f(q=>({...q,...G.featureConfig})),G.mpConfig&&typeof G.mpConfig=="object"&&y(q=>({...q,...G.mpConfig})),G.siteSettings&&typeof G.siteSettings=="object"){const q=G.siteSettings;d(ce=>({...ce,...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:{...ce.authorInfo,...q.authorInfo}}}))}}catch(G){console.error("Load settings error:",G)}finally{P(!1)}})()},[]);const _=async(se,G)=>{k(!0);try{const q=await bt("/api/admin/settings",{featureConfig:se});if(!q||q.success===!1){G(),A("保存失败",(q==null?void 0:q.error)??"未知错误",!0);return}A("已保存","功能开关已更新,相关入口将随之显示或隐藏。")}catch(q){console.error("Save feature config error:",q),G(),A("保存失败",q instanceof Error?q.message:String(q),!0)}finally{k(!1)}},re=(se,G)=>{const q=m,ce={...q,[se]:G};f(ce),_(ce,()=>f(q))},ae=async()=>{v(!0);try{const se=await bt("/api/admin/settings",{featureConfig:m,siteSettings:{sectionPrice:c.sectionPrice,baseBookPrice:c.baseBookPrice,distributorShare:c.distributorShare,authorInfo:c.authorInfo},mpConfig:{...p,appId:p.appId||"",withdrawSubscribeTmplId:p.withdrawSubscribeTmplId||"",mchId:p.mchId||"",minWithdraw:typeof p.minWithdraw=="number"?p.minWithdraw:10}});if(!se||se.success===!1){A("保存失败",(se==null?void 0:se.error)??"未知错误",!0);return}A("已保存","设置已保存成功。")}catch(se){console.error("Save settings error:",se),A("保存失败",se instanceof Error?se.message:String(se),!0)}finally{v(!1)}},le=se=>{a(se==="system"?{}:{tab:se})};return C?e.jsx("div",{className:"p-8 text-gray-500",children:"加载中..."}):e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"系统设置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置全站基础参数与开关"})]}),o==="system"&&e.jsxs(J,{onClick:ae,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存设置"]})]}),e.jsxs(_l,{value:o,onValueChange:le,className:"w-full",children:[e.jsxs(_a,{className:"mb-6 bg-[#0f2137] border border-gray-700/50 p-1",children:[e.jsxs(_t,{value:"system",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(ja,{className:"w-4 h-4 mr-2"}),"系统设置"]}),e.jsxs(_t,{value:"author",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(bd,{className:"w-4 h-4 mr-2"}),"作者详情"]}),e.jsxs(_t,{value:"admin",className:"data-[state=active]:bg-[#38bdac]/20 data-[state=active]:text-[#38bdac] text-gray-400 data-[state=active]:font-medium",children:[e.jsx(pu,{className:"w-4 h-4 mr-2"}),"管理员"]})]}),e.jsx(Mt,{value:"system",className:"mt-0",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(bd,{className:"w-5 h-5 text-[#38bdac]"}),"关于作者"]}),e.jsx(ft,{className:"text-gray-400",children:'配置作者信息,将在"关于作者"页面显示'})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"author-name",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(bd,{className:"w-3 h-3"}),"主理人名称"]}),e.jsx(ie,{id:"author-name",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.name??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,name:se.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"start-date",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(so,{className:"w-3 h-3"}),"开播日期"]}),e.jsx(ie,{id:"start-date",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 2025年10月15日",value:c.authorInfo.startDate??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,startDate:se.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"live-time",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(so,{className:"w-3 h-3"}),"直播时间"]}),e.jsx(ie,{id:"live-time",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: 06:00-09:00",value:c.authorInfo.liveTime??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,liveTime:se.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"platform",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(Vx,{className:"w-3 h-3"}),"直播平台"]}),e.jsx(ie,{id:"platform",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"例如: Soul派对房",value:c.authorInfo.platform??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,platform:se.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{htmlFor:"description",className:"text-gray-300 flex items-center gap-1",children:[e.jsx(tr,{className:"w-3 h-3"}),"简介描述"]}),e.jsx(ie,{id:"description",className:"bg-[#0a1628] border-gray-700 text-white",value:c.authorInfo.description??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,description:se.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"bio",className:"text-gray-300",children:"详细介绍"}),e.jsx(rn,{id:"bio",className:"bg-[#0a1628] border-gray-700 text-white min-h-[100px]",placeholder:"输入作者详细介绍...",value:c.authorInfo.bio??"",onChange:se=>d(G=>({...G,authorInfo:{...G.authorInfo,bio:se.target.value}}))})]}),e.jsxs("div",{className:"mt-4 p-4 rounded-xl bg-[#0a1628] border border-[#38bdac]/30",children:[e.jsx("p",{className:"text-xs text-gray-500 mb-2",children:"预览效果"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.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:(c.authorInfo.name??"K").charAt(0)}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white font-semibold",children:c.authorInfo.name}),e.jsx("p",{className:"text-gray-400 text-xs",children:c.authorInfo.description}),e.jsxs("p",{className:"text-[#38bdac] text-xs mt-1",children:["每日 ",c.authorInfo.liveTime," · ",c.authorInfo.platform]})]})]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(ro,{className:"w-5 h-5 text-[#38bdac]"}),"价格设置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置书籍和章节的定价"})]}),e.jsx(Ce,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单节价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.sectionPrice,onChange:se=>d(G=>({...G,sectionPrice:Number.parseFloat(se.target.value)||1}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"整本价格 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:c.baseBookPrice,onChange:se=>d(G=>({...G,baseBookPrice:Number.parseFloat(se.target.value)||9.9}))})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Yd,{className:"w-5 h-5 text-[#38bdac]"}),"小程序配置"]}),e.jsx(ft,{className:"text-gray-400",children:"订阅消息模板、支付商户号等,小程序从 /api/miniprogram/config 读取(API 地址由 app.js baseUrl 控制)"})]}),e.jsx(Ce,{className:"space-y-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"小程序 AppID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"wxb8bbb2b10dec74aa",value:p.appId??"",onChange:se=>y(G=>({...G,appId:se.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提现订阅模板 ID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"用户申请提现时需授权",value:p.withdrawSubscribeTmplId??"",onChange:se=>y(G=>({...G,withdrawSubscribeTmplId:se.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信支付商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"1318592501",value:p.mchId??"",onChange:se=>y(G=>({...G,mchId:se.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"最低提现金额 (元)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.minWithdraw??10,onChange:se=>y(G=>({...G,minWithdraw:Number.parseFloat(se.target.value)||10}))})]})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(ja,{className:"w-5 h-5 text-[#38bdac]"}),"功能开关"]}),e.jsx(ft,{className:"text-gray-400",children:"控制各个功能模块的显示/隐藏"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Gt,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"match-enabled",className:"text-white font-medium cursor-pointer",children:"找伙伴功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制小程序和Web端的找伙伴功能显示"})]}),e.jsx(lt,{id:"match-enabled",checked:m.matchEnabled,disabled:U,onCheckedChange:se=>re("matchEnabled",se)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(db,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"referral-enabled",className:"text-white font-medium cursor-pointer",children:"推广功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制推广中心的显示(我的页面入口)"})]}),e.jsx(lt,{id:"referral-enabled",checked:m.referralEnabled,disabled:U,onCheckedChange:se=>re("referralEnabled",se)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(tr,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"search-enabled",className:"text-white font-medium cursor-pointer",children:"搜索功能"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制首页搜索栏的显示"})]}),e.jsx(lt,{id:"search-enabled",checked:m.searchEnabled,disabled:U,onCheckedChange:se=>re("searchEnabled",se)})]}),e.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg bg-[#0a1628] border border-gray-700/50",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ja,{className:"w-4 h-4 text-[#38bdac]"}),e.jsx(te,{htmlFor:"about-enabled",className:"text-white font-medium cursor-pointer",children:"关于页面"})]}),e.jsx("p",{className:"text-xs text-gray-400 ml-6",children:"控制关于页面的访问"})]}),e.jsx(lt,{id:"about-enabled",checked:m.aboutEnabled,disabled:U,onCheckedChange:se=>re("aboutEnabled",se)})]})]}),e.jsx("div",{className:"p-3 rounded-lg bg-blue-500/10 border border-blue-500/30",children:e.jsx("p",{className:"text-xs text-blue-300",children:"💡 关闭功能后,相关入口会自动隐藏。建议在功能开发完成后再开启。"})})]})]})]})}),e.jsx(Mt,{value:"author",className:"mt-0",children:e.jsx(cC,{})}),e.jsx(Mt,{value:"admin",className:"mt-0",children:e.jsx(dC,{})})]}),e.jsx(wt,{open:R,onOpenChange:S,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white",showCloseButton:!0,children:[e.jsxs(St,{children:[e.jsx(Ct,{className:T?"text-red-400":"text-[#38bdac]",children:b}),e.jsx(r2,{className:"text-gray-400 whitespace-pre-wrap pt-2",children:E})]}),e.jsx(zt,{className:"mt-4",children:e.jsx(J,{onClick:()=>S(!1),className:T?"bg-gray-600 hover:bg-gray-500":"bg-[#38bdac] hover:bg-[#2da396]",children:"确定"})})]})})]})}const vx={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 gC(){const[r,a]=h.useState(!1),[l,o]=h.useState(vx),[c,d]=h.useState(""),m=async()=>{a(!0);try{const N=await Ue("/api/config");N!=null&&N.paymentMethods&&o({...vx,...N.paymentMethods})}catch(N){console.error(N)}finally{a(!1)}};h.useEffect(()=>{m()},[]);const f=async()=>{a(!0);try{await bt("/api/db/config",{key:"payment_methods",value:l,description:"支付方式配置"}),alert("配置已保存!")}catch(N){console.error("保存失败:",N),alert("保存失败: "+(N instanceof Error?N.message:String(N)))}finally{a(!1)}},p=(N,E)=>{navigator.clipboard.writeText(N),d(E),setTimeout(()=>d(""),2e3)},y=(N,E)=>{o(j=>({...j,wechat:{...j.wechat,[N]:E}}))},g=(N,E)=>{o(j=>({...j,alipay:{...j.alipay,[N]:E}}))},v=(N,E)=>{o(j=>({...j,usdt:{...j.usdt,[N]:E}}))},C=(N,E)=>{o(j=>({...j,paypal:{...j.paypal,[N]:E}}))},P=l.wechat,R=l.alipay,S=l.usdt,b=l.paypal;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold mb-2 text-white",children:"支付配置"}),e.jsx("p",{className:"text-gray-400",children:"配置微信、支付宝、USDT、PayPal等支付参数"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(J,{variant:"outline",onClick:m,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${r?"animate-spin":""}`}),"同步配置"]}),e.jsxs(J,{onClick:f,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),"保存配置"]})]})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Fx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"如何获取微信群跳转链接?"}),e.jsxs("ol",{className:"text-[#07C160]/80 space-y-1 list-decimal list-inside",children:[e.jsx("li",{children:"打开微信,进入目标微信群"}),e.jsx("li",{children:'点击右上角"..." → "群二维码"'}),e.jsx("li",{children:'点击右上角"..." → "发送到电脑"'}),e.jsx("li",{children:"在电脑上保存二维码图片,上传到图床获取URL"}),e.jsx("li",{children:"或使用草料二维码等工具解析二维码获取链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"提示:微信群二维码7天后失效,建议使用活码工具"})]})]})}),e.jsxs(_l,{defaultValue:"wechat",className:"space-y-6",children:[e.jsxs(_a,{className:"bg-[#0f2137] border border-gray-700/50 p-1 grid grid-cols-4 w-full",children:[e.jsxs(_t,{value:"wechat",className:"data-[state=active]:bg-[#07C160]/20 data-[state=active]:text-[#07C160] text-gray-400",children:[e.jsx(Yd,{className:"w-4 h-4 mr-2"}),"微信"]}),e.jsxs(_t,{value:"alipay",className:"data-[state=active]:bg-[#1677FF]/20 data-[state=active]:text-[#1677FF] text-gray-400",children:[e.jsx(Wd,{className:"w-4 h-4 mr-2"}),"支付宝"]}),e.jsxs(_t,{value:"usdt",className:"data-[state=active]:bg-[#26A17B]/20 data-[state=active]:text-[#26A17B] text-gray-400",children:[e.jsx(Af,{className:"w-4 h-4 mr-2"}),"USDT"]}),e.jsxs(_t,{value:"paypal",className:"data-[state=active]:bg-[#003087]/20 data-[state=active]:text-[#169BD7] text-gray-400",children:[e.jsx(Hd,{className:"w-4 h-4 mr-2"}),"PayPal"]})]}),e.jsx(Mt,{value:"wechat",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Yd,{className:"w-5 h-5"}),"微信支付配置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置微信支付参数和跳转链接"})]}),e.jsx(lt,{checked:!!P.enabled,onCheckedChange:N=>y("enabled",N)})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网站AppID"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.websiteAppId??""),onChange:N=>y("websiteAppId",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"商户号"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(P.merchantId??""),onChange:N=>y("merchantId",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(no,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置(核心功能)"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"微信收款码/支付链接"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://收款码图片URL 或 weixin://支付链接",value:String(P.qrCode??""),onChange:N=>y("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击微信支付后显示的二维码图片URL"})]}),e.jsxs("div",{className:"space-y-2 bg-[#07C160]/5 p-4 rounded-xl border border-[#07C160]/20",children:[e.jsx(te,{className:"text-[#07C160] font-medium",children:"微信群跳转链接(支付成功后跳转)"}),e.jsx(ie,{className:"bg-[#0a1628] border-[#07C160]/30 text-white placeholder:text-gray-500",placeholder:"https://weixin.qq.com/g/... 或微信群二维码图片URL",value:String(P.groupQrCode??""),onChange:N=>y("groupQrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-[#07C160]/70",children:"用户支付成功后将自动跳转到此链接,进入指定微信群"})]})]})]})]})}),e.jsx(Mt,{value:"alipay",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#1677FF] flex items-center gap-2",children:[e.jsx(Wd,{className:"w-5 h-5"}),"支付宝配置"]}),e.jsx(ft,{className:"text-gray-400",children:"已加载真实支付宝参数"})]}),e.jsx(lt,{checked:!!R.enabled,onCheckedChange:N=>g("enabled",N)})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"合作者身份 (PID)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.partnerId??""),onChange:N=>g("partnerId",N.target.value)}),e.jsx(J,{size:"icon",variant:"outline",className:"border-gray-700 bg-transparent",onClick:()=>p(String(R.partnerId??""),"pid"),children:c==="pid"?e.jsx(vo,{className:"w-4 h-4 text-green-500"}):e.jsx($x,{className:"w-4 h-4 text-gray-400"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"安全校验码 (Key)"}),e.jsx(ie,{type:"password",className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",value:String(R.securityKey??""),onChange:N=>g("securityKey",N.target.value)})]})]}),e.jsxs("div",{className:"border-t border-gray-700/50 pt-4 space-y-4",children:[e.jsxs("h4",{className:"text-white font-medium flex items-center gap-2",children:[e.jsx(no,{className:"w-4 h-4 text-[#38bdac]"}),"跳转链接配置"]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"支付宝收款码/跳转链接"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500",placeholder:"https://qr.alipay.com/... 或收款码图片URL",value:String(R.qrCode??""),onChange:N=>g("qrCode",N.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户点击支付宝支付后显示的二维码"})]})]})]})]})}),e.jsx(Mt,{value:"usdt",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#26A17B] flex items-center gap-2",children:[e.jsx(Af,{className:"w-5 h-5"}),"USDT配置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置加密货币收款地址"})]}),e.jsx(lt,{checked:!!S.enabled,onCheckedChange:N=>v("enabled",N)})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"网络类型"}),e.jsxs("select",{className:"w-full bg-[#0a1628] border border-gray-700 text-white rounded-md p-2",value:String(S.network??"TRC20"),onChange:N=>v("network",N.target.value),children:[e.jsx("option",{value:"TRC20",children:"TRC20 (波场)"}),e.jsx("option",{value:"ERC20",children:"ERC20 (以太坊)"}),e.jsx("option",{value:"BEP20",children:"BEP20 (币安链)"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"收款地址"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white font-mono text-sm",placeholder:"T... (TRC20地址)",value:String(S.address??""),onChange:N=>v("address",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(S.exchangeRate)??7.2,onChange:N=>v("exchangeRate",Number.parseFloat(N.target.value)||7.2)})]})]})]})}),e.jsx(Mt,{value:"paypal",className:"space-y-4",children:e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(Ye,{className:"text-[#169BD7] flex items-center gap-2",children:[e.jsx(Hd,{className:"w-5 h-5"}),"PayPal配置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置PayPal收款账户"})]}),e.jsx(lt,{checked:!!b.enabled,onCheckedChange:N=>C("enabled",N)})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"PayPal邮箱"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"your@email.com",value:String(b.email??""),onChange:N=>C("email",N.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"汇率 (1 USD = ? CNY)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:Number(b.exchangeRate)??7.2,onChange:N=>C("exchangeRate",Number(N.target.value)||7.2)})]})]})]})})]})]})}const yC={siteName:"卡若日记",siteTitle:"一场SOUL的创业实验场",siteDescription:"来自Soul派对房的真实商业故事",logo:"/logo.png",favicon:"/favicon.ico",primaryColor:"#00CED1"},vC={home:{enabled:!0,label:"首页"},chapters:{enabled:!0,label:"目录"},match:{enabled:!0,label:"匹配"},my:{enabled:!0,label:"我的"}},jC={homeTitle:"一场SOUL的创业实验场",homeSubtitle:"来自Soul派对房的真实商业故事",chaptersTitle:"我要看",matchTitle:"语音匹配",myTitle:"我的",aboutTitle:"关于作者"};function bC(){const[r,a]=h.useState({siteConfig:{...yC},menuConfig:{...vC},pageConfig:{...jC}}),[l,o]=h.useState(!1),[c,d]=h.useState(!1);h.useEffect(()=>{Ue("/api/config").then(g=>{g!=null&&g.siteConfig&&a(v=>({...v,siteConfig:{...v.siteConfig,...g.siteConfig}})),g!=null&&g.menuConfig&&a(v=>({...v,menuConfig:{...v.menuConfig,...g.menuConfig}})),g!=null&&g.pageConfig&&a(v=>({...v,pageConfig:{...v.pageConfig,...g.pageConfig}}))}).catch(console.error)},[]);const m=async()=>{d(!0);try{await bt("/api/db/config",{key:"site_config",value:r.siteConfig,description:"网站基础配置"}),await bt("/api/db/config",{key:"menu_config",value:r.menuConfig,description:"底部菜单配置"}),await bt("/api/db/config",{key:"page_config",value:r.pageConfig,description:"页面标题配置"}),o(!0),setTimeout(()=>o(!1),2e3),alert("配置已保存")}catch(g){console.error(g),alert("保存失败: "+(g instanceof Error?g.message:String(g)))}finally{d(!1)}},f=r.siteConfig,p=r.menuConfig,y=r.pageConfig;return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"网站配置"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置网站名称、图标、菜单和页面标题"})]}),e.jsxs(J,{onClick:m,disabled:c,className:`${l?"bg-green-500":"bg-[#00CED1]"} hover:bg-[#20B2AA] text-white transition-colors`,children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),c?"保存中...":l?"已保存":"保存设置"]})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Hd,{className:"w-5 h-5 text-[#00CED1]"}),"网站基础信息"]}),e.jsx(ft,{className:"text-gray-400",children:"配置网站名称、标题和描述"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-name",className:"text-gray-300",children:"网站名称"}),e.jsx(ie,{id:"site-name",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteName??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteName:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-title",className:"text-gray-300",children:"网站标题"}),e.jsx(ie,{id:"site-title",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteTitle??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"site-desc",className:"text-gray-300",children:"网站描述"}),e.jsx(ie,{id:"site-desc",className:"bg-[#0a1628] border-gray-700 text-white",value:f.siteDescription??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,siteDescription:g.target.value}}))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"logo",className:"text-gray-300",children:"Logo地址"}),e.jsx(ie,{id:"logo",className:"bg-[#0a1628] border-gray-700 text-white",value:f.logo??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,logo:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{htmlFor:"favicon",className:"text-gray-300",children:"Favicon地址"}),e.jsx(ie,{id:"favicon",className:"bg-[#0a1628] border-gray-700 text-white",value:f.favicon??"",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,favicon:g.target.value}}))})]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx($b,{className:"w-5 h-5 text-[#00CED1]"}),"主题颜色"]}),e.jsx(ft,{className:"text-gray-400",children:"配置网站主题色"})]}),e.jsx(Ce,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(te,{htmlFor:"primary-color",className:"text-gray-300",children:"主色调"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ie,{id:"primary-color",type:"color",className:"w-16 h-10 bg-[#0a1628] border-gray-700 cursor-pointer p-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white flex-1",value:f.primaryColor??"#00CED1",onChange:g=>a(v=>({...v,siteConfig:{...v.siteConfig,primaryColor:g.target.value}}))})]})]}),e.jsx("div",{className:"w-24 h-24 rounded-xl flex items-center justify-center text-white font-bold",style:{backgroundColor:f.primaryColor??"#00CED1"},children:"预览"})]})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Db,{className:"w-5 h-5 text-[#00CED1]"}),"底部菜单配置"]}),e.jsx(ft,{className:"text-gray-400",children:"控制底部导航栏菜单的显示和名称"})]}),e.jsx(Ce,{className:"space-y-4",children:Object.entries(p).map(([g,v])=>e.jsxs("div",{className:"flex items-center justify-between p-4 bg-[#0a1628] rounded-lg",children:[e.jsxs("div",{className:"flex items-center gap-4 flex-1",children:[e.jsx(lt,{checked:(v==null?void 0:v.enabled)??!0,onCheckedChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,enabled:C}}}))}),e.jsx("span",{className:"text-gray-300 w-16 capitalize",children:g}),e.jsx(ie,{className:"bg-[#0f2137] border-gray-700 text-white max-w-[200px]",value:(v==null?void 0:v.label)??"",onChange:C=>a(P=>({...P,menuConfig:{...P.menuConfig,[g]:{...v,label:C.target.value}}}))})]}),e.jsx("span",{className:`text-sm ${v!=null&&v.enabled?"text-green-400":"text-gray-500"}`,children:v!=null&&v.enabled?"显示":"隐藏"})]},g))})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(lb,{className:"w-5 h-5 text-[#00CED1]"}),"页面标题配置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置各个页面的标题和副标题"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"首页副标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.homeSubtitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,homeSubtitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"目录页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.chaptersTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,chaptersTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.matchTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,matchTitle:g.target.value}}))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"我的页标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.myTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,myTitle:g.target.value}}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"关于作者标题"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",value:y.aboutTitle??"",onChange:g=>a(v=>({...v,pageConfig:{...v.pageConfig,aboutTitle:g.target.value}}))})]})]})]})]})]})]})}function NC(){const[r,a]=h.useState(""),[l,o]=h.useState(""),[c,d]=h.useState(""),[m,f]=h.useState({}),p=async()=>{var P,R,S,b;try{const N=await Ue("/api/config"),E=(R=(P=N==null?void 0:N.liveQRCodes)==null?void 0:P[0])==null?void 0:R.urls;Array.isArray(E)&&a(E.join(` +`));const j=(b=(S=N==null?void 0:N.paymentMethods)==null?void 0:S.wechat)==null?void 0:b.groupQrCode;j&&o(j),f({paymentMethods:N==null?void 0:N.paymentMethods,liveQRCodes:N==null?void 0:N.liveQRCodes})}catch(N){console.error(N)}};h.useEffect(()=>{p()},[]);const y=(P,R)=>{navigator.clipboard.writeText(P),d(R),setTimeout(()=>d(""),2e3)},g=async()=>{try{const P=r.split(` +`).map(S=>S.trim()).filter(Boolean),R=[...m.liveQRCodes||[]];R[0]?R[0].urls=P:R.push({id:"live-1",name:"微信群活码",urls:P,clickCount:0}),await bt("/api/db/config",{key:"live_qr_codes",value:R,description:"群活码配置"}),alert("群活码配置已保存!"),await p()}catch(P){console.error(P),alert("保存失败: "+(P instanceof Error?P.message:String(P)))}},v=async()=>{var P;try{await bt("/api/db/config",{key:"payment_methods",value:{...m.paymentMethods||{},wechat:{...((P=m.paymentMethods)==null?void 0:P.wechat)||{},groupQrCode:l}},description:"支付方式配置"}),alert("微信群链接已保存!用户支付成功后将自动跳转"),await p()}catch(R){console.error(R),alert("保存失败: "+(R instanceof Error?R.message:String(R)))}},C=()=>{l?window.open(l,"_blank"):alert("请先配置微信群链接")};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"微信群活码管理"}),e.jsx("p",{className:"text-gray-400 mt-1",children:"配置微信群跳转链接,用户支付后自动跳转加群"})]}),e.jsx("div",{className:"mb-6 bg-[#07C160]/10 border border-[#07C160]/30 rounded-xl p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Fx,{className:"w-5 h-5 text-[#07C160] flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"text-sm",children:[e.jsx("p",{className:"font-medium mb-2 text-[#07C160]",children:"微信群活码配置指南"}),e.jsxs("div",{className:"text-[#07C160]/80 space-y-2",children:[e.jsx("p",{className:"font-medium",children:"方法一:使用草料活码(推荐)"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:"访问草料二维码创建活码"}),e.jsx("li",{children:"上传微信群二维码图片,生成永久链接"}),e.jsx("li",{children:"复制生成的短链接填入下方配置"}),e.jsx("li",{children:"群满后可直接在草料后台更换新群码,链接不变"})]}),e.jsx("p",{className:"font-medium mt-3",children:"方法二:直接使用微信群链接"}),e.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-2",children:[e.jsx("li",{children:'微信打开目标群 → 右上角"..." → 群二维码'}),e.jsx("li",{children:"长按二维码 → 识别二维码 → 复制链接"})]}),e.jsx("p",{className:"text-[#07C160]/60 mt-2",children:"注意:微信原生群二维码7天后失效,建议使用草料活码"})]})]})]})}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-[#07C160] flex items-center gap-2",children:[e.jsx(Ff,{className:"w-5 h-5"}),"支付成功跳转链接(核心配置)"]}),e.jsx(ft,{className:"text-gray-400",children:"用户支付完成后自动跳转到此链接,进入指定微信群"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Of,{className:"w-4 h-4"}),"微信群链接 / 活码链接"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(ie,{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:P=>o(P.target.value)}),e.jsx(J,{variant:"outline",size:"icon",className:"border-gray-700 bg-transparent hover:bg-gray-700/50",onClick:()=>y(l,"group"),children:c==="group"?e.jsx(vo,{className:"w-4 h-4 text-green-500"}):e.jsx($x,{className:"w-4 h-4 text-gray-400"})})]}),e.jsxs("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[e.jsx(no,{className:"w-3 h-3"}),"支持格式:草料短链、微信群链接(https://weixin.qq.com/g/...)、企业微信链接等"]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(J,{onClick:v,className:"flex-1 bg-[#07C160] hover:bg-[#06AD51] text-white",children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),"保存配置"]}),e.jsxs(J,{onClick:C,variant:"outline",className:"border-[#07C160] text-[#07C160] hover:bg-[#07C160]/10 bg-transparent",children:[e.jsx(no,{className:"w-4 h-4 mr-2"}),"测试跳转"]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl md:col-span-2",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Ff,{className:"w-5 h-5 text-[#38bdac]"}),"多群轮换(高级配置)"]}),e.jsx(ft,{className:"text-gray-400",children:"配置多个群链接,系统自动轮换分配,避免单群满员"})]}),e.jsxs(Ce,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(te,{className:"text-gray-300 flex items-center gap-2",children:[e.jsx(Of,{className:"w-4 h-4"}),"多个群链接(每行一个)"]}),e.jsx(rn,{placeholder:"https://cli.im/group1\\nhttps://cli.im/group2",className:"bg-[#0a1628] border-gray-700 text-white placeholder:text-gray-500 min-h-[120px] font-mono text-sm",value:r,onChange:P=>a(P.target.value)}),e.jsx("p",{className:"text-xs text-gray-500",children:"每行填写一个群链接,系统将按顺序或随机分配"})]}),e.jsxs("div",{className:"flex items-center justify-between p-3 bg-[#0a1628] rounded-lg border border-gray-700/50",children:[e.jsx("span",{className:"text-sm text-gray-400",children:"已配置群数量"}),e.jsxs("span",{className:"font-bold text-[#38bdac]",children:[r.split(` +`).filter(Boolean).length," 个"]})]}),e.jsxs(J,{onClick:g,className:"w-full bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),"保存多群配置"]})]})]})]}),e.jsxs("div",{className:"mt-6 bg-[#0f2137] rounded-xl p-4 border border-gray-700/50",children:[e.jsx("h4",{className:"text-white font-medium mb-3",children:"常见问题"}),e.jsxs("div",{className:"space-y-3 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 为什么推荐使用草料活码?"}),e.jsx("p",{className:"text-gray-400",children:"A: 草料活码是永久链接,群满后可直接在后台更换新群码,无需修改网站配置。微信原生群码7天失效。"})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[#38bdac]",children:"Q: 支付后没有跳转怎么办?"}),e.jsx("p",{className:"text-gray-400",children:"A: 1) 检查链接是否正确填写 2) 部分浏览器可能拦截弹窗,用户需手动允许 3) 建议使用https开头的链接"})]})]})]})]})}const jx={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}},wC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function SC(){const[r,a]=h.useState(jx),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[p,y]=h.useState(null),[g,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Ue("/api/db/config/full?key=match_config"),T=(j==null?void 0:j.data)??(j==null?void 0:j.config);T&&a({...jx,...T})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await bt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});j&&j.success!==!1?alert("配置保存成功!"):alert("保存失败: "+(j&&typeof j=="object"&&"error"in j?j.error:"未知错误"))}catch(j){console.error("保存配置失败:",j),alert("保存失败")}finally{d(!1)}},R=j=>{y(j),v({id:j.id,label:j.label,matchLabel:j.matchLabel,icon:j.icon,matchFromDB:j.matchFromDB,showJoinAfterMatch:j.showJoinAfterMatch,price:j.price,enabled:j.enabled}),f(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const T=j.findIndex(B=>B.id===p.id);T!==-1&&(j[T]={...g})}else{if(j.some(T=>T.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(T=>T.id!==j)})},E=j=>{a({...r,matchTypes:r.matchTypes.map(T=>T.id===j?{...T,enabled:!T.enabled}:T)})};return e.jsxs("div",{className:"p-8 w-full space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(ja,{className:"w-6 h-6 text-[#38bdac]"}),"匹配功能配置"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理找伙伴功能的匹配类型和价格"})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(J,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]}),e.jsxs(J,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),c?"保存中...":"保存配置"]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Jr,{className:"w-5 h-5 text-yellow-400"}),"基础设置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(Ce,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})}),e.jsx("p",{className:"text-xs text-gray-500",children:"用户每天可免费匹配的次数"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})}),e.jsx("p",{className:"text-xs text-gray-500",children:"免费次数用完后的单次匹配价格"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ie,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})}),e.jsx("p",{className:"text-xs text-gray-500",children:"包含免费和付费的总次数"})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-[#38bdac]"}),"匹配类型管理"]}),e.jsx(ft,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"}),"添加类型"]})]}),e.jsx(Ce,{children:e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(ns,{children:r.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(fe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(fe,{className:"text-white font-medium",children:j.label}),e.jsx(fe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(fe,{children:e.jsxs(De,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(fe,{children:j.matchFromDB?e.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(De,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(fe,{children:e.jsx(lt,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(fe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Yt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:wC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业合伙",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 创业伙伴",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(J,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),"保存"]})]})]})})]})}const bx={partner:"找伙伴",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function CC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[C,P]=h.useState(null);async function R(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const N=await Ue(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch(b){console.error("加载匹配记录失败",b),P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{R()},[c,p]);const S=Math.ceil(l/m)||1;return e.jsxs("div",{className:"p-8 w-full",children:[C&&e.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:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-white",children:"匹配记录"}),e.jsxs("p",{className:"text-gray-400 mt-1",children:["找伙伴匹配统计,共 ",l," 条记录"]})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(bx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:R,disabled:g,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:[e.jsx(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(ns,{children:[r.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none";const E=N.currentTarget.nextElementSibling;E&&E.classList.remove("hidden")}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(fe,{children:e.jsx(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:bx[b.matchType]||b.matchType})}),e.jsxs(fe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(fe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Fs,{page:c,totalPages:S,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}function kC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState(""),[g,v]=h.useState(0),[C,P]=h.useState(!1);async function R(){o(!0);try{const j=await Ue("/api/db/vip-roles");j!=null&&j.success&&j.data&&a(j.data)}catch(j){console.error("Load roles error:",j)}finally{o(!1)}}h.useEffect(()=>{R()},[]);const S=()=>{f(null),y(""),v(r.length>0?Math.max(...r.map(j=>j.sort))+1:0),d(!0)},b=j=>{f(j),y(j.name),v(j.sort),d(!0)},N=async()=>{if(!p.trim()){alert("角色名称不能为空");return}P(!0);try{if(m){const j=await vt("/api/db/vip-roles",{id:m.id,name:p.trim(),sort:g});j!=null&&j.success?(d(!1),R()):alert("更新失败: "+(j==null?void 0:j.error))}else{const j=await bt("/api/db/vip-roles",{name:p.trim(),sort:g});j!=null&&j.success?(d(!1),R()):alert("新增失败: "+(j==null?void 0:j.error))}}catch(j){console.error("Save error:",j),alert("保存失败")}finally{P(!1)}},E=async j=>{if(confirm("确定删除该角色?已设置该角色的 VIP 用户将保留角色名称。"))try{const T=await tn(`/api/db/vip-roles?id=${j}`);T!=null&&T.success?R():alert("删除失败: "+(T==null?void 0:T.error))}catch(T){console.error("Delete error:",T),alert("删除失败")}};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Rl,{className:"w-5 h-5 text-amber-400"}),"VIP 角色管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"超级个体固定角色,在「设置 VIP」时可选择或手动填写"})]}),e.jsxs(J,{onClick:S,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增角色"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"角色名称"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ns,{children:[r.map(j=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(fe,{className:"text-gray-300",children:j.id}),e.jsx(fe,{className:"text-white",children:j.name}),e.jsx(fe,{className:"text-gray-400",children:j.sort}),e.jsxs(fe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>b(j),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>E(j.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Yt,{className:"w-4 h-4"})})]})]},j.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无角色,点击「新增角色」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-sm",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:m?"编辑角色":"新增角色"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"角色名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:创始人、投资人",value:p,onChange:j=>y(j.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序(下拉展示顺序,越小越前)"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:g,onChange:j=>v(parseInt(j.target.value,10)||0)})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:N,disabled:C,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),C?"保存中...":"保存"]})]})]})})]})}function EC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(null),[p,y]=h.useState({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:0,enabled:!0}),[g,v]=h.useState(!1),[C,P]=h.useState(!1),R=h.useRef(null),S=async k=>{var _;const A=(_=k.target.files)==null?void 0:_[0];if(A){P(!0);try{const re=new FormData;re.append("file",A),re.append("folder","mentors");const ae=yu(),le={};ae&&(le.Authorization=`Bearer ${ae}`);const G=await(await fetch(Ca("/api/upload"),{method:"POST",body:re,credentials:"include",headers:le})).json();G!=null&&G.success&&(G!=null&&G.url)?y(q=>({...q,avatar:G.url})):alert("上传失败: "+((G==null?void 0:G.error)||"未知错误"))}catch(re){console.error(re),alert("上传失败")}finally{P(!1),R.current&&(R.current.value="")}}};async function b(){o(!0);try{const k=await Ue("/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 N=()=>{y({name:"",avatar:"",intro:"",tags:"",priceSingle:"",priceHalfYear:"",priceYear:"",quote:"",whyFind:"",offering:"",judgmentStyle:"",sort:r.length>0?Math.max(...r.map(k=>k.sort))+1:0,enabled:!0})},E=()=>{f(null),N(),d(!0)},j=k=>{f(k),y({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}),d(!0)},T=async()=>{if(!p.name.trim()){alert("导师姓名不能为空");return}v(!0);try{const k=_=>_===""?void 0:parseFloat(_),A={name:p.name.trim(),avatar:p.avatar.trim()||void 0,intro:p.intro.trim()||void 0,tags:p.tags.trim()||void 0,priceSingle:k(p.priceSingle),priceHalfYear:k(p.priceHalfYear),priceYear:k(p.priceYear),quote:p.quote.trim()||void 0,whyFind:p.whyFind.trim()||void 0,offering:p.offering.trim()||void 0,judgmentStyle:p.judgmentStyle.trim()||void 0,sort:p.sort,enabled:p.enabled};if(m){const _=await vt("/api/db/mentors",{id:m.id,...A});_!=null&&_.success?(d(!1),b()):alert("更新失败: "+(_==null?void 0:_.error))}else{const _=await bt("/api/db/mentors",A);_!=null&&_.success?(d(!1),b()):alert("新增失败: "+(_==null?void 0:_.error))}}catch(k){console.error("Save error:",k),alert("保存失败")}finally{v(!1)}},B=async k=>{if(confirm("确定删除该导师?"))try{const A=await tn(`/api/db/mentors?id=${k}`);A!=null&&A.success?b():alert("删除失败: "+(A==null?void 0:A.error))}catch(A){console.error("Delete error:",A),alert("删除失败")}},U=k=>k!=null?`¥${k}`:"-";return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-[#38bdac]"}),"导师管理"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师列表,支持每个导师独立配置单次/半年/年度价格"})]}),e.jsxs(J,{onClick:E,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-2"}),"新增导师"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"姓名"}),e.jsx(be,{className:"text-gray-400",children:"简介"}),e.jsx(be,{className:"text-gray-400",children:"单次"}),e.jsx(be,{className:"text-gray-400",children:"半年"}),e.jsx(be,{className:"text-gray-400",children:"年度"}),e.jsx(be,{className:"text-gray-400",children:"排序"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsxs(ns,{children:[r.map(k=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(fe,{className:"text-gray-300",children:k.id}),e.jsx(fe,{className:"text-white",children:k.name}),e.jsx(fe,{className:"text-gray-400 max-w-[200px] truncate",children:k.intro||"-"}),e.jsx(fe,{className:"text-gray-400",children:U(k.priceSingle)}),e.jsx(fe,{className:"text-gray-400",children:U(k.priceHalfYear)}),e.jsx(fe,{className:"text-gray-400",children:U(k.priceYear)}),e.jsx(fe,{className:"text-gray-400",children:k.sort}),e.jsxs(fe,{className:"text-right",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>j(k),className:"text-gray-400 hover:text-[#38bdac]",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>B(k.id),className:"text-gray-400 hover:text-red-400",children:e.jsx(Yt,{className:"w-4 h-4"})})]})]},k.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:8,className:"text-center py-12 text-gray-500",children:"暂无导师,点击「新增导师」添加"})})]})]})})}),e.jsx(wt,{open:c,onOpenChange:d,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg max-h-[90vh] overflow-y-auto",children:[e.jsx(St,{children:e.jsx(Ct,{className:"text-white",children:m?"编辑导师":"新增导师"})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"姓名 *"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:卡若",value:p.name,onChange:k=>y(A=>({...A,name:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"排序"}),e.jsx(ie,{type:"number",className:"bg-[#0a1628] border-gray-700 text-white",value:p.sort,onChange:k=>y(A=>({...A,sort:parseInt(k.target.value,10)||0}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"头像"}),e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(ie,{className:"flex-1 bg-[#0a1628] border-gray-700 text-white",value:p.avatar,onChange:k=>y(A=>({...A,avatar:k.target.value})),placeholder:"点击上传或粘贴图片地址"}),e.jsx("input",{ref:R,type:"file",accept:"image/*",className:"hidden",onChange:S}),e.jsxs(J,{type:"button",variant:"outline",size:"sm",className:"border-gray-600 text-gray-400 shrink-0",disabled:C,onClick:()=>{var k;return(k=R.current)==null?void 0:k.click()},children:[e.jsx(ao,{className:"w-4 h-4 mr-2"}),C?"上传中...":"上传"]})]}),p.avatar&&e.jsx("div",{className:"mt-2",children:e.jsx("img",{src:p.avatar.startsWith("http")?p.avatar:Ca(p.avatar),alt:"头像预览",className:"w-20 h-20 rounded-full object-cover border border-gray-600"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"简介"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:结构判断型咨询 · Decision > Execution",value:p.intro,onChange:k=>y(A=>({...A,intro:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"技能标签(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:项目结构判断、风险止损、人×项目匹配",value:p.tags,onChange:k=>y(A=>({...A,tags:k.target.value}))})]}),e.jsxs("div",{className:"border-t border-gray-700 pt-4",children:[e.jsx(te,{className:"text-gray-300 block mb-2",children:"价格配置(每个导师独立)"}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"单次咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"980",value:p.priceSingle,onChange:k=>y(A=>({...A,priceSingle:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"半年咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"19800",value:p.priceHalfYear,onChange:k=>y(A=>({...A,priceHalfYear:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-500 text-xs",children:"年度咨询 ¥"}),e.jsx(ie,{type:"number",step:"0.01",className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"29800",value:p.priceYear,onChange:k=>y(A=>({...A,priceYear:k.target.value}))})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"引言"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:大多数人失败,不是因为不努力...",value:p.quote,onChange:k=>y(A=>({...A,quote:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"为什么找(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.whyFind,onChange:k=>y(A=>({...A,whyFind:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"提供什么(文本)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"",value:p.offering,onChange:k=>y(A=>({...A,offering:k.target.value}))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"判断风格(逗号分隔)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如:冷静、克制、偏风险视角",value:p.judgmentStyle,onChange:k=>y(A=>({...A,judgmentStyle:k.target.value}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"checkbox",id:"enabled",checked:p.enabled,onChange:k=>y(A=>({...A,enabled:k.target.checked})),className:"rounded border-gray-600 bg-[#0a1628]"}),e.jsx(te,{htmlFor:"enabled",className:"text-gray-300 cursor-pointer",children:"上架(小程序可见)"})]})]}),e.jsxs(zt,{children:[e.jsxs(J,{variant:"outline",onClick:()=>d(!1),className:"border-gray-600 text-gray-300",children:[e.jsx(ys,{className:"w-4 h-4 mr-2"}),"取消"]}),e.jsxs(J,{onClick:T,disabled:g,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"}),g?"保存中...":"保存"]})]})]})})]})}function PC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const y=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",g=await Ue(y);g!=null&&g.success&&g.data&&a(g.data)}catch(y){console.error("Load consultations error:",y)}finally{o(!1)}}h.useEffect(()=>{m()},[c]);const f={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},p={single:"单次",half_year:"半年",year:"年度"};return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-8",children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(so,{className:"w-5 h-5 text-[#38bdac]"}),"导师预约列表"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"stitch_soul 导师咨询预约记录"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:y=>d(y.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(f).map(([y,g])=>e.jsx("option",{value:y,children:g},y))]}),e.jsxs(J,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`}),"刷新"]})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(ns,{children:[r.map(y=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(fe,{className:"text-gray-300",children:y.id}),e.jsx(fe,{className:"text-gray-400",children:y.userId}),e.jsx(fe,{className:"text-gray-400",children:y.mentorId}),e.jsx(fe,{className:"text-gray-400",children:p[y.consultationType]||y.consultationType}),e.jsxs(fe,{className:"text-white",children:["¥",y.amount]}),e.jsx(fe,{className:"text-gray-400",children:f[y.status]||y.status}),e.jsx(fe,{className:"text-gray-500 text-sm",children:y.createdAt})]},y.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}const Nx={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}},RC=["⭐","👥","❤️","🎮","💼","🚀","💡","🎯","🔥","✨"];function TC(){const[r,a]=h.useState(Nx),[l,o]=h.useState(!0),[c,d]=h.useState(!1),[m,f]=h.useState(!1),[p,y]=h.useState(null),[g,v]=h.useState({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),C=async()=>{o(!0);try{const j=await Ue("/api/db/config/full?key=match_config"),T=(j==null?void 0:j.data)??(j==null?void 0:j.config);T&&a({...Nx,...T})}catch(j){console.error("加载匹配配置失败:",j)}finally{o(!1)}};h.useEffect(()=>{C()},[]);const P=async()=>{d(!0);try{const j=await bt("/api/db/config",{key:"match_config",value:r,description:"匹配功能配置"});alert((j==null?void 0:j.success)!==!1?"配置保存成功!":"保存失败: "+((j==null?void 0:j.error)||"未知错误"))}catch(j){console.error(j),alert("保存失败")}finally{d(!1)}},R=j=>{y(j),v({...j}),f(!0)},S=()=>{y(null),v({id:"",label:"",matchLabel:"",icon:"⭐",matchFromDB:!1,showJoinAfterMatch:!0,price:1,enabled:!0}),f(!0)},b=()=>{if(!g.id||!g.label){alert("请填写类型ID和名称");return}const j=[...r.matchTypes];if(p){const T=j.findIndex(B=>B.id===p.id);T!==-1&&(j[T]={...g})}else{if(j.some(T=>T.id===g.id)){alert("类型ID已存在");return}j.push({...g})}a({...r,matchTypes:j}),f(!1)},N=j=>{confirm("确定要删除这个匹配类型吗?")&&a({...r,matchTypes:r.matchTypes.filter(T=>T.id!==j)})},E=j=>{a({...r,matchTypes:r.matchTypes.map(T=>T.id===j?{...T,enabled:!T.enabled}:T)})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsxs(J,{variant:"outline",onClick:C,disabled:l,className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]}),e.jsxs(J,{onClick:P,disabled:c,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"})," ",c?"保存中...":"保存配置"]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Jr,{className:"w-5 h-5 text-yellow-400"})," 基础设置"]}),e.jsx(ft,{className:"text-gray-400",children:"配置免费匹配次数和付费规则"})]}),e.jsxs(Ce,{className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日免费匹配次数"}),e.jsx(ie,{type:"number",min:0,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.freeMatchLimit,onChange:j=>a({...r,freeMatchLimit:parseInt(j.target.value,10)||0})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"付费匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:r.matchPrice,onChange:j=>a({...r,matchPrice:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"每日最大匹配次数"}),e.jsx(ie,{type:"number",min:1,max:100,className:"bg-[#0a1628] border-gray-700 text-white",value:r.settings.maxMatchesPerDay,onChange:j=>a({...r,settings:{...r.settings,maxMatchesPerDay:parseInt(j.target.value,10)||10}})})]})]}),e.jsxs("div",{className:"flex gap-8 pt-4 border-t border-gray-700/50",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:r.settings.enableFreeMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enableFreeMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用免费匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:r.settings.enablePaidMatches,onCheckedChange:j=>a({...r,settings:{...r.settings,enablePaidMatches:j}})}),e.jsx(te,{className:"text-gray-300",children:"启用付费匹配"})]})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-5 h-5 text-[#38bdac]"})," 匹配类型管理"]}),e.jsx(ft,{className:"text-gray-400",children:"配置不同的匹配类型及其价格"})]}),e.jsxs(J,{onClick:S,size:"sm",className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Rt,{className:"w-4 h-4 mr-1"})," 添加类型"]})]}),e.jsx(Ce,{children:e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"图标"}),e.jsx(be,{className:"text-gray-400",children:"类型ID"}),e.jsx(be,{className:"text-gray-400",children:"显示名称"}),e.jsx(be,{className:"text-gray-400",children:"匹配标签"}),e.jsx(be,{className:"text-gray-400",children:"价格"}),e.jsx(be,{className:"text-gray-400",children:"数据库匹配"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-right text-gray-400",children:"操作"})]})}),e.jsx(ns,{children:r.matchTypes.map(j=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsx("span",{className:"text-2xl",children:j.icon})}),e.jsx(fe,{className:"font-mono text-gray-300",children:j.id}),e.jsx(fe,{className:"text-white font-medium",children:j.label}),e.jsx(fe,{className:"text-gray-300",children:j.matchLabel}),e.jsx(fe,{children:e.jsxs(De,{className:"bg-yellow-500/20 text-yellow-400 hover:bg-yellow-500/20 border-0",children:["¥",j.price]})}),e.jsx(fe,{children:j.matchFromDB?e.jsx(De,{className:"bg-green-500/20 text-green-400 hover:bg-green-500/20 border-0",children:"是"}):e.jsx(De,{variant:"outline",className:"text-gray-500 border-gray-600",children:"否"})}),e.jsx(fe,{children:e.jsx(lt,{checked:j.enabled,onCheckedChange:()=>E(j.id)})}),e.jsx(fe,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>R(j),className:"text-gray-400 hover:text-[#38bdac] hover:bg-[#38bdac]/10",children:e.jsx(ht,{className:"w-4 h-4"})}),e.jsx(J,{variant:"ghost",size:"sm",onClick:()=>N(j.id),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:e.jsx(Yt,{className:"w-4 h-4"})})]})})]},j.id))})]})})]}),e.jsx(wt,{open:m,onOpenChange:f,children:e.jsxs(jt,{className:"bg-[#0f2137] border-gray-700 text-white max-w-lg",showCloseButton:!0,children:[e.jsx(St,{children:e.jsxs(Ct,{className:"text-white flex items-center gap-2",children:[p?e.jsx(ht,{className:"w-5 h-5 text-[#38bdac]"}):e.jsx(Rt,{className:"w-5 h-5 text-[#38bdac]"}),p?"编辑匹配类型":"添加匹配类型"]})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"类型ID(英文)"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: partner",value:g.id,onChange:j=>v({...g,id:j.target.value}),disabled:!!p})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"图标"}),e.jsx("div",{className:"flex gap-1 flex-wrap",children:RC.map(j=>e.jsx("button",{type:"button",className:`w-8 h-8 text-lg rounded ${g.icon===j?"bg-[#38bdac]/30 ring-1 ring-[#38bdac]":"bg-[#0a1628]"}`,onClick:()=>v({...g,icon:j}),children:j},j))})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"显示名称"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.label,onChange:j=>v({...g,label:j.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"匹配标签"}),e.jsx(ie,{className:"bg-[#0a1628] border-gray-700 text-white",placeholder:"如: 超级个体",value:g.matchLabel,onChange:j=>v({...g,matchLabel:j.target.value})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(te,{className:"text-gray-300",children:"单次匹配价格(元)"}),e.jsx(ie,{type:"number",min:.01,step:.01,className:"bg-[#0a1628] border-gray-700 text-white",value:g.price,onChange:j=>v({...g,price:parseFloat(j.target.value)||1})})]}),e.jsxs("div",{className:"flex gap-6 pt-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.matchFromDB,onCheckedChange:j=>v({...g,matchFromDB:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"从数据库匹配"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.showJoinAfterMatch,onCheckedChange:j=>v({...g,showJoinAfterMatch:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"匹配后显示加入"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(lt,{checked:g.enabled,onCheckedChange:j=>v({...g,enabled:j})}),e.jsx(te,{className:"text-gray-300 text-sm",children:"启用"})]})]})]}),e.jsxs(zt,{children:[e.jsx(J,{variant:"outline",onClick:()=>f(!1),className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:"取消"}),e.jsxs(J,{onClick:b,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx($t,{className:"w-4 h-4 mr-2"})," 保存"]})]})]})})]})}const wx={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"};function IC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(""),[g,v]=h.useState(!0),[C,P]=h.useState(null);async function R(){v(!0),P(null);try{const b=new URLSearchParams({page:String(c),pageSize:String(m)});p&&b.set("matchType",p);const N=await Ue(`/api/db/match-records?${b}`);N!=null&&N.success?(a(N.records||[]),o(N.total??0)):P("加载匹配记录失败")}catch{P("加载失败,请检查网络后重试")}finally{v(!1)}}h.useEffect(()=>{R()},[c,p]);const S=Math.ceil(l/m)||1;return e.jsxs("div",{children:[C&&e.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:[e.jsx("span",{children:C}),e.jsx("button",{type:"button",onClick:()=>P(null),className:"hover:text-red-300",children:"×"})]}),e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("p",{className:"text-gray-400",children:["共 ",l," 条匹配记录"]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("select",{value:p,onChange:b=>{y(b.target.value),d(1)},className:"bg-[#0f2137] border border-gray-700 text-white rounded-lg px-3 py-2 text-sm",children:[e.jsx("option",{value:"",children:"全部类型"}),Object.entries(wx).map(([b,N])=>e.jsx("option",{value:b,children:N},b))]}),e.jsxs("button",{type:"button",onClick:R,disabled:g,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:[e.jsx(Be,{className:`w-4 h-4 ${g?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:g?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"匹配时间"})]})}),e.jsxs(ns,{children:[r.map(b=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.userAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.userAvatar?"hidden":"",children:(b.userNickname||b.userId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.userNickname||b.userId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.userId.slice(0,16),"..."]})]})]})}),e.jsx(fe,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.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?e.jsx("img",{src:b.matchedUserAvatar,alt:"",className:"w-full h-full object-cover",onError:N=>{N.currentTarget.style.display="none"}}):null,e.jsx("span",{className:b.matchedUserAvatar?"hidden":"",children:(b.matchedNickname||b.matchedUserId||"?").charAt(0)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-white",children:b.matchedNickname||b.matchedUserId}),e.jsxs("div",{className:"text-xs text-gray-500 font-mono",children:[b.matchedUserId.slice(0,16),"..."]})]})]})}),e.jsx(fe,{children:e.jsx(De,{className:"bg-[#38bdac]/20 text-[#38bdac] border-0",children:wx[b.matchType]||b.matchType})}),e.jsxs(fe,{className:"text-gray-400 text-sm",children:[b.phone&&e.jsxs("div",{children:["📱 ",b.phone]}),b.wechatId&&e.jsxs("div",{children:["💬 ",b.wechatId]}),!b.phone&&!b.wechatId&&"-"]}),e.jsx(fe,{className:"text-gray-400",children:b.createdAt?new Date(b.createdAt).toLocaleString():"-"})]},b.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:5,className:"text-center py-12 text-gray-500",children:"暂无匹配记录"})})]})]}),e.jsx(Fs,{page:c,totalPages:S,total:l,pageSize:m,onPageChange:d,onPageSizeChange:b=>{f(b),d(1)}})]})})})]})}function _C(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"investor"}),P=await Ue(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{g()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["资源对接匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户填写「我能帮到你什么」和「我需要什么帮助」后提交到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,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:[e.jsx(Be,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(ns,{children:[r.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(fe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(fe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(fe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无资源对接记录"})})]})]}),e.jsx(Fs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:C=>{f(C),d(1)}})]})})})]})}const Sx={created:"已创建",pending_pay:"待支付",paid:"已支付",completed:"已完成",cancelled:"已取消"},MC={single:"单次",half_year:"半年",year:"年度"};function AC(){const[r,a]=h.useState([]),[l,o]=h.useState(!0),[c,d]=h.useState("");async function m(){o(!0);try{const f=c?`/api/db/mentor-consultations?status=${c}`:"/api/db/mentor-consultations",p=await Ue(f);p!=null&&p.success&&p.data&&a(p.data)}catch(f){console.error(f)}finally{o(!1)}}return h.useEffect(()=>{m()},[c]),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("p",{className:"text-gray-400",children:"导师咨询预约记录"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("select",{value:c,onChange:f=>d(f.target.value),className:"bg-[#0f2137] border border-gray-700 rounded-lg px-3 py-2 text-gray-300 text-sm",children:[e.jsx("option",{value:"",children:"全部状态"}),Object.entries(Sx).map(([f,p])=>e.jsx("option",{value:f,children:p},f))]}),e.jsxs(J,{onClick:m,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新"]})]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50",children:e.jsx(Ce,{className:"p-0",children:l?e.jsx("div",{className:"py-12 text-center text-gray-400",children:"加载中..."}):e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"ID"}),e.jsx(be,{className:"text-gray-400",children:"用户ID"}),e.jsx(be,{className:"text-gray-400",children:"导师ID"}),e.jsx(be,{className:"text-gray-400",children:"类型"}),e.jsx(be,{className:"text-gray-400",children:"金额"}),e.jsx(be,{className:"text-gray-400",children:"状态"}),e.jsx(be,{className:"text-gray-400",children:"创建时间"})]})}),e.jsxs(ns,{children:[r.map(f=>e.jsxs(Ge,{className:"border-gray-700/50",children:[e.jsx(fe,{className:"text-gray-300",children:f.id}),e.jsx(fe,{className:"text-gray-400",children:f.userId}),e.jsx(fe,{className:"text-gray-400",children:f.mentorId}),e.jsx(fe,{className:"text-gray-400",children:MC[f.consultationType]||f.consultationType}),e.jsxs(fe,{className:"text-white",children:["¥",f.amount]}),e.jsx(fe,{className:"text-gray-400",children:Sx[f.status]||f.status}),e.jsx(fe,{className:"text-gray-500 text-sm",children:f.createdAt?new Date(f.createdAt).toLocaleString():"-"})]},f.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:7,className:"text-center py-12 text-gray-500",children:"暂无预约记录"})})]})]})})})]})}function DC(){const[r,a]=h.useState([]),[l,o]=h.useState(0),[c,d]=h.useState(1),[m,f]=h.useState(10),[p,y]=h.useState(!0);async function g(){y(!0);try{const C=new URLSearchParams({page:String(c),pageSize:String(m),matchType:"team"}),P=await Ue(`/api/db/match-records?${C}`);P!=null&&P.success&&(a(P.records||[]),o(P.total??0))}catch(C){console.error(C)}finally{y(!1)}}h.useEffect(()=>{g()},[c]);const v=Math.ceil(l/m)||1;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-gray-400",children:["团队招募匹配记录,共 ",l," 条"]}),e.jsx("p",{className:"text-gray-500 text-xs mt-1",children:"用户通过「团队招募」提交联系方式到存客宝"})]}),e.jsxs("button",{type:"button",onClick:g,disabled:p,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:[e.jsx(Be,{className:`w-4 h-4 ${p?"animate-spin":""}`})," 刷新"]})]}),e.jsx(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl",children:e.jsx(Ce,{className:"p-0",children:p?e.jsxs("div",{className:"flex justify-center py-12",children:[e.jsx(Be,{className:"w-6 h-6 text-[#38bdac] animate-spin"}),e.jsx("span",{className:"ml-2 text-gray-400",children:"加载中..."})]}):e.jsxs(e.Fragment,{children:[e.jsxs(ss,{children:[e.jsx(rs,{children:e.jsxs(Ge,{className:"bg-[#0a1628] hover:bg-[#0a1628] border-gray-700",children:[e.jsx(be,{className:"text-gray-400",children:"发起人"}),e.jsx(be,{className:"text-gray-400",children:"匹配到"}),e.jsx(be,{className:"text-gray-400",children:"联系方式"}),e.jsx(be,{className:"text-gray-400",children:"时间"})]})}),e.jsxs(ns,{children:[r.map(C=>e.jsxs(Ge,{className:"hover:bg-[#0a1628] border-gray-700/50",children:[e.jsx(fe,{className:"text-white",children:C.userNickname||C.userId}),e.jsx(fe,{className:"text-white",children:C.matchedNickname||C.matchedUserId}),e.jsxs(fe,{className:"text-gray-400 text-sm",children:[C.phone&&e.jsxs("div",{children:["📱 ",C.phone]}),C.wechatId&&e.jsxs("div",{children:["💬 ",C.wechatId]}),!C.phone&&!C.wechatId&&"-"]}),e.jsx(fe,{className:"text-gray-400",children:C.createdAt?new Date(C.createdAt).toLocaleString():"-"})]},C.id)),r.length===0&&e.jsx(Ge,{children:e.jsx(fe,{colSpan:4,className:"text-center py-12 text-gray-500",children:"暂无团队招募记录"})})]})]}),e.jsx(Fs,{page:c,totalPages:v,total:l,pageSize:m,onPageChange:d,onPageSizeChange:C=>{f(C),d(1)}})]})})})]})}function LC(){const[r,a]=h.useState(null),[l,o]=h.useState(!0),[c,d]=h.useState([{endpoint:"/api/ckb/join",label:"CKB 加入(ckb/join)",status:"idle"},{endpoint:"/api/ckb/match",label:"CKB 匹配上报(ckb/match)",status:"idle"},{endpoint:"/api/miniprogram/ckb/lead",label:"CKB 链接卡若(ckb/lead)",status:"idle"},{endpoint:"/api/match/config",label:"匹配配置(match/config)",status:"idle"}]),m={partner:"超级个体",investor:"资源对接",mentor:"导师顾问",team:"团队招募"},f=h.useCallback(async()=>{o(!0);try{const g=await Ue("/api/db/match-records?stats=true");if(g!=null&&g.success&&g.data)a(g.data);else{const v=await Ue("/api/db/match-records?page=1&pageSize=1");v!=null&&v.success&&a({totalMatches:v.total??0,todayMatches:0,byType:[],uniqueUsers:0})}}catch(g){console.error("加载统计失败:",g)}finally{o(!1)}},[]);h.useEffect(()=>{f()},[f]);const p=async g=>{const v=c[g],C=[...c];C[g]={...v,status:"testing",message:void 0,responseTime:void 0},d(C);const P=performance.now();try{let R;v.endpoint.includes("match/config")?R=await Ue(v.endpoint):R=await bt(v.endpoint,{type:"partner",phone:"00000000000",wechat:"test_ping",userId:"test_admin_ping",matchType:"partner",name:"接口测试"});const S=Math.round(performance.now()-P),b=[...c],N=(R==null?void 0:R.success)!==void 0||(R==null?void 0:R.code)===200||(R==null?void 0:R.code)===400;b[g]={...v,status:N?"success":"error",message:(R==null?void 0:R.message)||(N?"接口可用":"响应异常"),responseTime:S},d(b)}catch(R){const S=Math.round(performance.now()-P),b=[...c];b[g]={...v,status:"error",message:R instanceof Error?R.message:"请求失败",responseTime:S},d(b)}},y=async()=>{for(let g=0;g0&&e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white text-lg",children:"按类型分布"})}),e.jsx(Ce,{children:e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:r.byType.map(g=>e.jsxs("div",{className:"bg-[#0a1628] rounded-lg p-4 text-center",children:[e.jsx("p",{className:"text-gray-400 text-sm",children:m[g.matchType]||g.matchType}),e.jsx("p",{className:"text-2xl font-bold text-white mt-2",children:g.count}),e.jsxs("p",{className:"text-gray-500 text-xs mt-1",children:[r.totalMatches>0?(g.count/r.totalMatches*100).toFixed(1):0,"%"]})]},g.matchType))})})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50",children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(Ye,{className:"text-white flex items-center gap-2",children:[e.jsx(en,{className:"w-5 h-5 text-[#38bdac]"}),"存客宝接口连通性测试"]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"测试所有找伙伴相关的 CKB 接口是否正常可用"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(J,{onClick:f,disabled:l,variant:"outline",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent",children:[e.jsx(Be,{className:`w-4 h-4 mr-2 ${l?"animate-spin":""}`})," 刷新统计"]}),e.jsxs(J,{onClick:y,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:[e.jsx(Jr,{className:"w-4 h-4 mr-2"})," 全部测试"]})]})]}),e.jsx(Ce,{children:e.jsx("div",{className:"space-y-3",children:c.map((g,v)=>e.jsxs("div",{className:"flex items-center justify-between bg-[#0a1628] rounded-lg px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[g.status==="idle"&&e.jsx("div",{className:"w-3 h-3 rounded-full bg-gray-500"}),g.status==="testing"&&e.jsx(Be,{className:"w-4 h-4 text-yellow-400 animate-spin"}),g.status==="success"&&e.jsx(Ud,{className:"w-4 h-4 text-green-400"}),g.status==="error"&&e.jsx(zx,{className:"w-4 h-4 text-red-400"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-white text-sm font-medium",children:g.label}),e.jsx("p",{className:"text-gray-500 text-xs font-mono",children:g.endpoint})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[g.message&&e.jsx("span",{className:`text-xs ${g.status==="success"?"text-green-400":g.status==="error"?"text-red-400":"text-gray-400"}`,children:g.message}),g.responseTime!==void 0&&e.jsxs(De,{className:"bg-gray-700 text-gray-300 border-0",children:[g.responseTime,"ms"]}),e.jsx(J,{size:"sm",variant:"outline",onClick:()=>p(v),disabled:g.status==="testing",className:"border-gray-600 text-gray-300 hover:bg-gray-700/50 bg-transparent text-xs",children:"测试"})]})]},g.endpoint))})})]})]})}const OC=[{id:"pool",label:"匹配池",icon:Gt},{id:"records",label:"匹配记录",icon:Pb},{id:"resource",label:"资源对接",icon:gb},{id:"mentor",label:"导师预约",icon:Bx},{id:"team",label:"团队招募",icon:Gd},{id:"stats",label:"存客宝统计",icon:Fj}];function FC(){const[r,a]=h.useState("pool");return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("h2",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[e.jsx(Gt,{className:"w-6 h-6 text-[#38bdac]"}),"找伙伴"]}),e.jsx("p",{className:"text-gray-400 mt-1",children:"管理匹配池、匹配记录、资源对接、导师预约、团队招募及存客宝数据统计"})]}),e.jsx("div",{className:"flex gap-1 mb-6 bg-[#0f2137] rounded-lg p-1 border border-gray-700/50",children:OC.map(l=>{const o=r===l.id;return e.jsxs("button",{type:"button",onClick:()=>a(l.id),className:`flex items-center gap-2 px-4 py-2.5 rounded-md text-sm font-medium transition-all ${o?"bg-[#38bdac] text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:[e.jsx(l.icon,{className:"w-4 h-4"}),l.label]},l.id)})}),r==="pool"&&e.jsx(TC,{}),r==="records"&&e.jsx(IC,{}),r==="resource"&&e.jsx(_C,{}),r==="mentor"&&e.jsx(AC,{}),r==="team"&&e.jsx(DC,{}),r==="stats"&&e.jsx(LC,{})]})}function zC(){return e.jsxs("div",{className:"p-8 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[e.jsx(en,{className:"w-8 h-8 text-[#38bdac]"}),e.jsx("h1",{className:"text-2xl font-bold text-white",children:"API 接口文档"})]}),e.jsx("p",{className:"text-gray-400 mb-6",children:"API 风格:RESTful · 版本 v1.0 · 基础路径 /api · 简单、清晰、易用。"}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"1. 接口总览"})}),e.jsxs(Ce,{className:"space-y-4 text-sm",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"接口分类"}),e.jsxs("ul",{className:"space-y-1 text-gray-300 font-mono",children:[e.jsx("li",{children:"/api/book — 书籍内容(章节列表、内容获取、同步)"}),e.jsx("li",{children:"/api/payment — 支付系统(订单创建、回调、状态查询)"}),e.jsx("li",{children:"/api/referral — 分销系统(邀请码、收益、提现)"}),e.jsx("li",{children:"/api/user — 用户系统(登录、注册、信息更新)"}),e.jsx("li",{children:"/api/match — 匹配系统(寻找匹配、匹配历史)"}),e.jsx("li",{children:"/api/admin — 管理后台(内容/订单/用户/分销管理)"}),e.jsx("li",{children:"/api/config — 配置系统"})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-gray-400 mb-2",children:"认证方式"}),e.jsx("p",{className:"text-gray-300",children:"用户:Cookie session_id(可选)"}),e.jsx("p",{className:"text-gray-300",children:"管理端:Authorization: Bearer admin-token-secret"})]})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"2. 书籍内容"})}),e.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET /api/book/all-chapters — 获取所有章节"}),e.jsx("p",{children:"GET /api/book/chapter/:id — 获取单章内容"}),e.jsx("p",{children:"POST /api/book/sync — 同步章节(需管理员认证)"})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"3. 支付"})}),e.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"POST /api/payment/create-order — 创建订单"}),e.jsx("p",{children:"POST /api/payment/alipay/notify — 支付宝回调"}),e.jsx("p",{children:"POST /api/payment/wechat/notify — 微信回调"})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"4. 分销与用户"})}),e.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"/api/referral/* — 邀请码、收益查询、提现"}),e.jsx("p",{children:"/api/user/* — 登录、注册、信息更新"}),e.jsx("p",{children:"/api/match/* — 匹配、匹配历史"})]})]}),e.jsxs(Se,{className:"bg-[#0f2137] border-gray-700/50 shadow-xl mb-6",children:[e.jsx(Ke,{children:e.jsx(Ye,{className:"text-white",children:"5. 管理后台"})}),e.jsxs(Ce,{className:"space-y-2 text-sm text-gray-300 font-mono",children:[e.jsx("p",{children:"GET/POST /api/admin/referral-settings — 推广/分销设置(含 VIP 配置)"}),e.jsx("p",{children:"GET /api/db/users、/api/db/book — 用户与章节数据"}),e.jsx("p",{children:"GET /api/orders — 订单列表"})]})]}),e.jsx("p",{className:"text-gray-500 text-xs",children:"完整说明见项目内 开发文档/5、接口/API接口完整文档.md"})]})}function $C(){const r=cn();return e.jsx("div",{className:"min-h-screen bg-[#0a1628] flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.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:e.jsx(Wj,{className:"w-10 h-10"})}),e.jsx("h1",{className:"text-4xl font-bold text-white mb-2",children:"404"}),e.jsx("p",{className:"text-gray-400 mb-1",children:"页面不存在"}),e.jsx("p",{className:"text-sm text-gray-500 font-mono mb-8 break-all",children:r.pathname}),e.jsx(J,{asChild:!0,className:"bg-[#38bdac] hover:bg-[#2da396] text-white",children:e.jsxs(Xi,{to:"/",children:[e.jsx(vb,{className:"w-4 h-4 mr-2"}),"返回首页"]})})]})})}function BC(){return e.jsxs(pj,{children:[e.jsx(ut,{path:"/login",element:e.jsx(gw,{})}),e.jsxs(ut,{path:"/",element:e.jsx(jN,{}),children:[e.jsx(ut,{index:!0,element:e.jsx(jd,{to:"/dashboard",replace:!0})}),e.jsx(ut,{path:"dashboard",element:e.jsx(vw,{})}),e.jsx(ut,{path:"orders",element:e.jsx(n2,{})}),e.jsx(ut,{path:"users",element:e.jsx(I2,{})}),e.jsx(ut,{path:"distribution",element:e.jsx(_2,{})}),e.jsx(ut,{path:"withdrawals",element:e.jsx(M2,{})}),e.jsx(ut,{path:"content",element:e.jsx($S,{})}),e.jsx(ut,{path:"referral-settings",element:e.jsx(oC,{})}),e.jsx(ut,{path:"author-settings",element:e.jsx(jd,{to:"/settings?tab=author",replace:!0})}),e.jsx(ut,{path:"admin-users",element:e.jsx(jd,{to:"/settings?tab=admin",replace:!0})}),e.jsx(ut,{path:"vip-roles",element:e.jsx(kC,{})}),e.jsx(ut,{path:"mentors",element:e.jsx(EC,{})}),e.jsx(ut,{path:"mentor-consultations",element:e.jsx(PC,{})}),e.jsx(ut,{path:"settings",element:e.jsx(pC,{})}),e.jsx(ut,{path:"payment",element:e.jsx(gC,{})}),e.jsx(ut,{path:"site",element:e.jsx(bC,{})}),e.jsx(ut,{path:"qrcodes",element:e.jsx(NC,{})}),e.jsx(ut,{path:"find-partner",element:e.jsx(FC,{})}),e.jsx(ut,{path:"match",element:e.jsx(SC,{})}),e.jsx(ut,{path:"match-records",element:e.jsx(CC,{})}),e.jsx(ut,{path:"api-doc",element:e.jsx(zC,{})})]}),e.jsx(ut,{path:"*",element:e.jsx($C,{})})]})}jv.createRoot(document.getElementById("root")).render(e.jsx(h.StrictMode,{children:e.jsx(Sj,{future:{v7_startTransition:!0,v7_relativeSplatPath:!0},children:e.jsx(BC,{})})})); diff --git a/soul-admin/dist/index.html b/soul-admin/dist/index.html index d5435e0d..3bb0b036 100644 --- a/soul-admin/dist/index.html +++ b/soul-admin/dist/index.html @@ -4,8 +4,8 @@ 管理后台 - Soul创业派对 - - + +
diff --git a/soul-admin/tsconfig.tsbuildinfo b/soul-admin/tsconfig.tsbuildinfo index d14335b1..0e0b0f9c 100644 --- a/soul-admin/tsconfig.tsbuildinfo +++ b/soul-admin/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/chapters/chapterspage.tsx","./src/pages/content/chaptertree.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/auth.ts","./src/api/client.ts","./src/components/modules/user/setvipmodal.tsx","./src/components/modules/user/userdetailmodal.tsx","./src/components/ui/pagination.tsx","./src/components/ui/badge.tsx","./src/components/ui/button.tsx","./src/components/ui/card.tsx","./src/components/ui/dialog.tsx","./src/components/ui/input.tsx","./src/components/ui/label.tsx","./src/components/ui/select.tsx","./src/components/ui/slider.tsx","./src/components/ui/switch.tsx","./src/components/ui/table.tsx","./src/components/ui/tabs.tsx","./src/components/ui/textarea.tsx","./src/hooks/usedebounce.ts","./src/layouts/adminlayout.tsx","./src/lib/utils.ts","./src/pages/admin-users/adminuserspage.tsx","./src/pages/api-doc/apidocpage.tsx","./src/pages/author-settings/authorsettingspage.tsx","./src/pages/chapters/chapterspage.tsx","./src/pages/content/chaptertree.tsx","./src/pages/content/contentpage.tsx","./src/pages/dashboard/dashboardpage.tsx","./src/pages/distribution/distributionpage.tsx","./src/pages/find-partner/findpartnerpage.tsx","./src/pages/find-partner/tabs/ckbstatstab.tsx","./src/pages/find-partner/tabs/matchpooltab.tsx","./src/pages/find-partner/tabs/matchrecordstab.tsx","./src/pages/find-partner/tabs/mentorbookingtab.tsx","./src/pages/find-partner/tabs/resourcedockingtab.tsx","./src/pages/find-partner/tabs/teamrecruittab.tsx","./src/pages/login/loginpage.tsx","./src/pages/match/matchpage.tsx","./src/pages/match-records/matchrecordspage.tsx","./src/pages/mentor-consultations/mentorconsultationspage.tsx","./src/pages/mentors/mentorspage.tsx","./src/pages/not-found/notfoundpage.tsx","./src/pages/orders/orderspage.tsx","./src/pages/payment/paymentpage.tsx","./src/pages/qrcodes/qrcodespage.tsx","./src/pages/referral-settings/referralsettingspage.tsx","./src/pages/settings/settingspage.tsx","./src/pages/site/sitepage.tsx","./src/pages/users/userspage.tsx","./src/pages/vip-roles/viprolespage.tsx","./src/pages/withdrawals/withdrawalspage.tsx"],"version":"5.6.3"} \ No newline at end of file