From 3ed6b764eac3d1ef5537c59d97d035624eca85eb Mon Sep 17 00:00:00 2001 From: xboard Date: Mon, 13 Jan 2025 21:41:04 +0800 Subject: [PATCH] feat(admin): add version number display in admin interface --- public/assets/admin/assets/index.css | 2 +- public/assets/admin/assets/index.js | 2 +- resources/views/admin.blade.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/public/assets/admin/assets/index.css b/public/assets/admin/assets/index.css index c96de98..8d5746d 100644 --- a/public/assets/admin/assets/index.css +++ b/public/assets/admin/assets/index.css @@ -1 +1 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--header-height: 4rem;--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%}.collapsibleDropdown{overflow:hidden}.collapsibleDropdown[data-state=open]{animation:slideDown .2s ease-out}.collapsibleDropdown[data-state=closed]{animation:slideUp .2s ease-out}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}*{border-color:hsl(var(--border))}body{min-height:100svh;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-right-5{right:-1.25rem}.-top-1\/2{top:-50%}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-4{left:1rem}.left-5{left:1.25rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-4{top:1rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.-m-0\.5{margin:-.125rem}.m-1{margin:.25rem}.m-auto{margin:auto}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-3{margin-left:-.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[90vh\]{height:90vh}.h-\[calc\(100\%-var\(--header-height\)\)\]{height:calc(100% - var(--header-height))}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[var\(--header-height\)\]{height:var(--header-height)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-0{max-height:0px}.max-h-12{max-height:3rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[95\%\]{max-height:95%}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-6{min-height:1.5rem}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.min-h-\[60px\]{min-height:60px}.w-0{width:0px}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-\[400px\]{width:400px}.w-\[50px\]{width:50px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-0{min-width:0px}.min-w-20{min-width:5rem}.min-w-\[10em\]{min-width:10em}.min-w-\[300px\]{min-width:300px}.min-w-\[40px\]{min-width:40px}.min-w-\[4rem\]{min-width:4rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-32{max-width:8rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-80{max-width:20rem}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[500px\]{max-width:500px}.max-w-\[60\%\]{max-width:60%}.max-w-\[600px\]{max-width:600px}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-none{max-width:none}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[1\.2\]{flex:1.2}.flex-\[1\]{flex:1}.flex-\[2\]{flex:2}.flex-\[4\]{flex:4}.flex-\[5\]{flex:5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-2{row-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.625rem * var(--tw-space-x-reverse));margin-left:calc(.625rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-lg{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-lg{border-top-right-radius:var(--radius)}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-500\/50{border-color:#3b82f680}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-foreground\/10{border-color:hsl(var(--foreground) / .1)}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/25{border-color:hsl(var(--muted-foreground) / .25)}.border-orange-500\/50{border-color:#f9731680}.border-primary{border-color:hsl(var(--primary))}.border-primary\/40{border-color:hsl(var(--primary) / .4)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-l-slate-500{--tw-border-opacity: 1;border-left-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-muted{border-right-color:hsl(var(--muted))}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/80{background-color:#000c}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\/15{background-color:hsl(var(--destructive) / .15)}.bg-destructive\/80{background-color:hsl(var(--destructive) / .8)}.bg-emerald-500\/80{background-color:#10b981cc}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-100\/80{background-color:#f1f5f9cc}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/80{background-color:#eab308cc}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-background\/95{--tw-gradient-from: hsl(var(--background) / .95) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background\/80{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-background\/60{--tw-gradient-to: hsl(var(--background) / .6) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-0\.5{padding-bottom:.125rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.625rem\]{font-size:.625rem}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[7rem\]{font-size:7rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.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)}.leading-10{line-height:2.5rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/30{color:hsl(var(--muted-foreground) / .3)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/90{color:hsl(var(--primary) / .9)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-destructive\/50{--tw-shadow-color: hsl(var(--destructive) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-emerald-500\/50{--tw-shadow-color: rgb(16 185 129 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-yellow-500\/50{--tw-shadow-color: rgb(234 179 8 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity, 1))}.ring-gray-300\/20{--tw-ring-color: rgb(209 213 219 / .2)}.ring-green-500\/20{--tw-ring-color: rgb(34 197 94 / .2)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.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)}.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)}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[max-height\,padding\]{transition-property:max-height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[opacity\]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-100{transition-delay:.1s}.delay-150{transition-delay:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.delay-100{animation-delay:.1s}.delay-150{animation-delay:.15s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}html{overflow-y:scroll}.sticky{position:sticky!important;z-index:2;background-color:hsl(var(--card))}.sticky.before\:right-0:before,.sticky.before\:left-0:before{content:"";position:absolute;top:0;bottom:0;width:2px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent);opacity:1;transition:opacity .3s ease}.sticky.before\:right-0:before{right:-1px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent)}.sticky.before\:right-0:after{content:"";position:absolute;top:0;right:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to right,rgba(0,0,0,.05),transparent)}.sticky.before\:left-0:before{left:-1px;background:linear-gradient(to left,rgba(0,0,0,.08),transparent)}.sticky.before\:left-0:after{content:"";position:absolute;top:0;left:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to left,rgba(0,0,0,.05),transparent)}.sticky:hover:before{opacity:.8}.dark .sticky.before\:right-0:before,.dark .sticky.before\:left-0:before{background:linear-gradient(to right,rgba(255,255,255,.05),transparent)}.dark .sticky.before\:right-0:after,.dark .sticky.before\:left-0:after{background:linear-gradient(to right,rgba(255,255,255,.03),transparent)}.\*\:\!inline-block>*{display:inline-block!important}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-0:before{content:var(--tw-content);bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-0:before{content:var(--tw-content);top:0}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:bg-border:before{content:var(--tw-content);background-color:hsl(var(--border))}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-0:after{content:var(--tw-content);bottom:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:hidden:after{content:var(--tw-content);display:none}.after\:h-32:after{content:var(--tw-content);height:8rem}.after\:w-full:after{content:var(--tw-content);width:100%}.after\:bg-\[linear-gradient\(180deg\,_transparent_10\%\,_hsl\(var\(--background\)\)_70\%\)\]:after{content:var(--tw-content);background-image:linear-gradient(180deg,transparent 10%,hsl(var(--background)) 70%)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-ring:focus-within{--tw-ring-color: hsl(var(--ring))}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-180:hover{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-background:hover{background-color:hsl(var(--background))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-card\/80:hover{background-color:hsl(var(--card) / .8)}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/25:hover{background-color:hsl(var(--destructive) / .25)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/40:hover{background-color:hsl(var(--muted) / .4)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-muted\/60:hover{background-color:hsl(var(--muted) / .6)}.hover\:bg-muted\/70:hover{background-color:hsl(var(--muted) / .7)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary-foreground\/10:hover{background-color:hsl(var(--secondary-foreground) / .1)}.hover\:bg-secondary\/70:hover{background-color:hsl(var(--secondary) / .7)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-200\/80:hover{background-color:#e2e8f0cc}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.hover\:bg-opacity-80:hover{--tw-bg-opacity: .8}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-foreground\/70:hover{color:hsl(var(--foreground) / .7)}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-black\/30:hover{--tw-shadow-color: rgb(0 0 0 / .3);--tw-shadow: var(--tw-shadow-colored)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:via-background\/90{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .9) var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-background\/70{--tw-gradient-to: hsl(var(--background) / .7) var(--tw-gradient-to-position)}.group\/id:hover .group-hover\/id\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:justify-center{justify-content:center}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:px-2{padding-left:.5rem;padding-right:.5rem}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\:focus-visible\]\:outline-none:has(:focus-visible){outline:2px solid transparent;outline-offset:2px}.has-\[\:focus-visible\]\:ring-1:has(:focus-visible){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.has-\[\:focus-visible\]\:ring-neutral-950:has(:focus-visible){--tw-ring-opacity: 1;--tw-ring-color: rgb(10 10 10 / var(--tw-ring-opacity, 1))}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[state\=dragging\]\:cursor-grabbing[data-state=dragging]{cursor:grabbing}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[disabled\]\:bg-muted-foreground[data-disabled],.data-\[fixed\]\:bg-muted-foreground[data-fixed]{background-color:hsl(var(--muted-foreground))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[collapsed\=true\]\:py-2[data-collapsed=true]{padding-top:.5rem;padding-bottom:.5rem}.data-\[disabled\]\:text-muted[data-disabled],.data-\[fixed\]\:text-muted[data-fixed]{color:hsl(var(--muted))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{transition-duration:.3s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{animation-duration:.3s}.data-\[disabled\]\:hover\:bg-muted-foreground:hover[data-disabled],.data-\[fixed\]\:hover\:bg-muted-foreground:hover[data-fixed]{background-color:hsl(var(--muted-foreground))}.group[data-state=open] .group-data-\[state\=\"open\"\]\:-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-green-500\/10:is(.dark *){background-color:#22c55e1a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-yellow-500\/10:is(.dark *){background-color:#eab3081a}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:ring-gray-700:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity, 1))}.dark\:ring-gray-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:has-\[\:focus-visible\]\:ring-neutral-300:has(:focus-visible):is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:absolute{position:absolute}.sm\:inset-auto{inset:auto}.sm\:bottom-\[calc\(100\%\+10px\)\]{bottom:calc(100% + 10px)}.sm\:left-0{left:0}.sm\:right-0{right:0}.sm\:my-0{margin-top:0;margin-bottom:0}.sm\:my-4{margin-top:1rem;margin-bottom:1rem}.sm\:mt-0{margin-top:0}.sm\:hidden{display:none}.sm\:h-\[80vh\]{height:80vh}.sm\:h-full{height:100%}.sm\:max-h-\[500px\]{max-height:500px}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-h-\[700px\]{max-height:700px}.sm\:max-h-\[800px\]{max-height:800px}.sm\:w-48{width:12rem}.sm\:w-\[480px\]{width:480px}.sm\:w-\[540px\]{width:540px}.sm\:w-\[90vw\]{width:90vw}.sm\:w-full{width:100%}.sm\:max-w-72{max-width:18rem}.sm\:max-w-\[1025px\]{max-width:1025px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[700px\]{max-width:700px}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-5{--tw-translate-y: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:bottom-0{bottom:0}.md\:right-auto{right:auto}.md\:col-span-1{grid-column:span 1 / span 1}.md\:ml-14{margin-left:3.5rem}.md\:ml-64{margin-left:16rem}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:h-svh{height:100svh}.md\:max-h-screen{max-height:100vh}.md\:w-14{width:3.5rem}.md\:w-32{width:8rem}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[31rem\]{max-width:31rem}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:overflow-y-hidden{overflow-y:hidden}.md\:border-none{border-style:none}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.after\:md\:block:after{content:var(--tw-content);display:block}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-1\/5{width:20%}.lg\:w-\[250px\]{width:250px}.lg\:max-w-none{max-width:none}.lg\:max-w-xl{max-width:36rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:gap-8{gap:2rem}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.lg\:p-8{padding:2rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}}@media (min-width: 1280px){.xl\:mr-2{margin-right:.5rem}.xl\:flex{display:flex}.xl\:inline-flex{display:inline-flex}.xl\:h-10{height:2.5rem}.xl\:w-60{width:15rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:justify-start{justify-content:flex-start}.xl\:px-3{padding-left:.75rem;padding-right:.75rem}.xl\:py-2{padding-top:.5rem;padding-bottom:.5rem}}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}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;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--header-height: 4rem;--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%}.collapsibleDropdown{overflow:hidden}.collapsibleDropdown[data-state=open]{animation:slideDown .2s ease-out}.collapsibleDropdown[data-state=closed]{animation:slideUp .2s ease-out}@keyframes slideDown{0%{height:0}to{height:var(--radix-collapsible-content-height)}}@keyframes slideUp{0%{height:var(--radix-collapsible-content-height)}to{height:0}}*{border-color:hsl(var(--border))}body{min-height:100svh;width:100%;background-color:hsl(var(--background));color:hsl(var(--foreground))}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-left-1{left:-.25rem}.-right-1{right:-.25rem}.-right-5{right:-1.25rem}.-top-1\/2{top:-50%}.bottom-0{bottom:0}.bottom-5{bottom:1.25rem}.bottom-full{bottom:100%}.left-0{left:0}.left-1{left:.25rem}.left-1\/2{left:50%}.left-2{left:.5rem}.left-4{left:1rem}.left-5{left:1.25rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-1\.5{right:.375rem}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.right-5{right:1.25rem}.top-0{top:0}.top-1{top:.25rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-2\.5{top:.625rem}.top-4{top:1rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[-1\]{z-index:-1}.z-\[1\]{z-index:1}.col-span-2{grid-column:span 2 / span 2}.-m-0\.5{margin:-.125rem}.m-1{margin:.25rem}.m-auto{margin:auto}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-6{margin-top:1.5rem;margin-bottom:1.5rem}.-ml-3{margin-left:-.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-2{margin-right:.5rem}.mr-auto{margin-right:auto}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-24{margin-top:6rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-\[16\/9\]{aspect-ratio:16/9}.aspect-square{aspect-ratio:1 / 1}.size-10{width:2.5rem;height:2.5rem}.size-2\.5{width:.625rem;height:.625rem}.size-3{width:.75rem;height:.75rem}.size-3\.5{width:.875rem;height:.875rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-40{height:10rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[1px\]{height:1px}.h-\[200px\]{height:200px}.h-\[300px\]{height:300px}.h-\[400px\]{height:400px}.h-\[90vh\]{height:90vh}.h-\[calc\(100\%-var\(--header-height\)\)\]{height:calc(100% - var(--header-height))}.h-\[calc\(100vh-280px\)\]{height:calc(100vh - 280px)}.h-\[var\(--header-height\)\]{height:var(--header-height)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-svh{height:100svh}.max-h-0{max-height:0px}.max-h-12{max-height:3rem}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-\[90vh\]{max-height:90vh}.max-h-\[95\%\]{max-height:95%}.max-h-screen{max-height:100vh}.min-h-10{min-height:2.5rem}.min-h-6{min-height:1.5rem}.min-h-\[120px\]{min-height:120px}.min-h-\[200px\]{min-height:200px}.min-h-\[60px\]{min-height:60px}.w-0{width:0px}.w-1\.5{width:.375rem}.w-1\/2{width:50%}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[1px\]{width:1px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-\[400px\]{width:400px}.w-\[50px\]{width:50px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-auto{width:auto}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-0{min-width:0px}.min-w-20{min-width:5rem}.min-w-\[10em\]{min-width:10em}.min-w-\[300px\]{min-width:300px}.min-w-\[40px\]{min-width:40px}.min-w-\[4rem\]{min-width:4rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-32{max-width:8rem}.max-w-4xl{max-width:56rem}.max-w-52{max-width:13rem}.max-w-80{max-width:20rem}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[500px\]{max-width:500px}.max-w-\[60\%\]{max-width:60%}.max-w-\[600px\]{max-width:600px}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-none{max-width:none}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.flex-\[1\.2\]{flex:1.2}.flex-\[1\]{flex:1}.flex-\[2\]{flex:2}.flex-\[4\]{flex:4}.flex-\[5\]{flex:5}.flex-none{flex:none}.flex-shrink-0,.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x: -100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-125{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.animate-bounce{animation:bounce 1s infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-help{cursor:help}.cursor-move{cursor:move}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[100px_1fr\]{grid-template-columns:100px 1fr}.flex-row{flex-direction:row}.flex-row-reverse{flex-direction:row-reverse}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-x-1{-moz-column-gap:.25rem;column-gap:.25rem}.gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.gap-y-0\.5{row-gap:.125rem}.gap-y-2{row-gap:.5rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.625rem * var(--tw-space-x-reverse));margin-left:calc(.625rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.75rem * var(--tw-space-x-reverse));margin-left:calc(.75rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-start{align-self:flex-start}.self-end{align-self:flex-end}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-wrap{text-wrap:wrap}.text-nowrap{text-wrap:nowrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-lg{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius)}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-t-\[10px\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-bl-none{border-bottom-left-radius:0}.rounded-br-none{border-bottom-right-radius:0}.rounded-tl-lg{border-top-left-radius:var(--radius)}.rounded-tl-none{border-top-left-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-lg{border-top-right-radius:var(--radius)}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-x-0{border-left-width:0px;border-right-width:0px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-l-0{border-left-width:0px}.border-l-2{border-left-width:2px}.border-r{border-right-width:1px}.border-r-0{border-right-width:0px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-blue-500\/50{border-color:#3b82f680}.border-border{border-color:hsl(var(--border))}.border-border\/50{border-color:hsl(var(--border) / .5)}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-foreground\/10{border-color:hsl(var(--foreground) / .1)}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-input{border-color:hsl(var(--input))}.border-muted{border-color:hsl(var(--muted))}.border-muted-foreground\/25{border-color:hsl(var(--muted-foreground) / .25)}.border-orange-500\/50{border-color:#f9731680}.border-primary{border-color:hsl(var(--primary))}.border-primary\/40{border-color:hsl(var(--primary) / .4)}.border-primary\/50{border-color:hsl(var(--primary) / .5)}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-l-slate-500{--tw-border-opacity: 1;border-left-color:rgb(100 116 139 / var(--tw-border-opacity, 1))}.border-l-transparent{border-left-color:transparent}.border-r-muted{border-right-color:hsl(var(--muted))}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-background\/80{background-color:hsl(var(--background) / .8)}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/80{background-color:#000c}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-destructive\/10{background-color:hsl(var(--destructive) / .1)}.bg-destructive\/15{background-color:hsl(var(--destructive) / .15)}.bg-destructive\/80{background-color:hsl(var(--destructive) / .8)}.bg-emerald-500\/80{background-color:#10b981cc}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-green-500\/70{background-color:#22c55eb3}.bg-inherit{background-color:inherit}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/20{background-color:hsl(var(--muted) / .2)}.bg-muted\/30{background-color:hsl(var(--muted) / .3)}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-foreground{background-color:hsl(var(--primary-foreground))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-secondary\/50{background-color:hsl(var(--secondary) / .5)}.bg-slate-100\/80{background-color:#f1f5f9cc}.bg-transparent{background-color:transparent}.bg-yellow-100{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500\/80{background-color:#eab308cc}.bg-gradient-to-t{background-image:linear-gradient(to top,var(--tw-gradient-stops))}.from-background\/95{--tw-gradient-from: hsl(var(--background) / .95) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-background\/80{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .8) var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-background\/60{--tw-gradient-to: hsl(var(--background) / .6) var(--tw-gradient-to-position)}.fill-current{fill:currentColor}.fill-primary{fill:hsl(var(--primary))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-0\.5{padding-bottom:.125rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pl-2{padding-left:.5rem}.pl-2\.5{padding-left:.625rem}.pl-3{padding-left:.75rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-4{padding-right:1rem}.pr-7{padding-right:1.75rem}.pr-8{padding-right:2rem}.pr-9{padding-right:2.25rem}.pt-0{padding-top:0}.pt-1{padding-top:.25rem}.pt-1\.5{padding-top:.375rem}.pt-16{padding-top:4rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.625rem\]{font-size:.625rem}.text-\[0\.7rem\]{font-size:.7rem}.text-\[0\.8rem\]{font-size:.8rem}.text-\[10px\]{font-size:10px}.text-\[7rem\]{font-size:7rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.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)}.leading-10{line-height:2.5rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-current{color:currentColor}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-500{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/70{color:hsl(var(--foreground) / .7)}.text-foreground\/90{color:hsl(var(--foreground) / .9)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-muted-foreground\/30{color:hsl(var(--muted-foreground) / .3)}.text-muted-foreground\/40{color:hsl(var(--muted-foreground) / .4)}.text-muted-foreground\/50{color:hsl(var(--muted-foreground) / .5)}.text-muted-foreground\/70{color:hsl(var(--muted-foreground) / .7)}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/90{color:hsl(var(--primary) / .9)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-yellow-800{--tw-text-opacity: 1;color:rgb(133 77 14 / var(--tw-text-opacity, 1))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-destructive\/50{--tw-shadow-color: hsl(var(--destructive) / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-emerald-500\/50{--tw-shadow-color: rgb(16 185 129 / .5);--tw-shadow: var(--tw-shadow-colored)}.shadow-yellow-500\/50{--tw-shadow-color: rgb(234 179 8 / .5);--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-2{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-gray-200{--tw-ring-opacity: 1;--tw-ring-color: rgb(229 231 235 / var(--tw-ring-opacity, 1))}.ring-gray-300\/20{--tw-ring-color: rgb(209 213 219 / .2)}.ring-green-500\/20{--tw-ring-color: rgb(34 197 94 / .2)}.ring-primary\/20{--tw-ring-color: hsl(var(--primary) / .2)}.ring-offset-2{--tw-ring-offset-width: 2px}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.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)}.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)}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-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,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\]{transition-property:margin;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[max-height\,padding\]{transition-property:max-height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[opacity\]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.delay-100{transition-delay:.1s}.delay-150{transition-delay:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.duration-700{transition-duration:.7s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-150{animation-duration:.15s}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.duration-500{animation-duration:.5s}.duration-700{animation-duration:.7s}.delay-100{animation-delay:.1s}.delay-150{animation-delay:.15s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}html{overflow-y:scroll}.sticky{position:sticky!important;z-index:2;background-color:hsl(var(--card))}.sticky.before\:right-0:before,.sticky.before\:left-0:before{content:"";position:absolute;top:0;bottom:0;width:2px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent);opacity:1;transition:opacity .3s ease}.sticky.before\:right-0:before{right:-1px;background:linear-gradient(to right,rgba(0,0,0,.08),transparent)}.sticky.before\:right-0:after{content:"";position:absolute;top:0;right:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to right,rgba(0,0,0,.05),transparent)}.sticky.before\:left-0:before{left:-1px;background:linear-gradient(to left,rgba(0,0,0,.08),transparent)}.sticky.before\:left-0:after{content:"";position:absolute;top:0;left:-8px;bottom:0;width:8px;pointer-events:none;background:linear-gradient(to left,rgba(0,0,0,.05),transparent)}.sticky:hover:before{opacity:.8}.dark .sticky.before\:right-0:before,.dark .sticky.before\:left-0:before{background:linear-gradient(to right,rgba(255,255,255,.05),transparent)}.dark .sticky.before\:right-0:after,.dark .sticky.before\:left-0:after{background:linear-gradient(to right,rgba(255,255,255,.03),transparent)}.\*\:\!inline-block>*{display:inline-block!important}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.before\:absolute:before{content:var(--tw-content);position:absolute}.before\:bottom-0:before{content:var(--tw-content);bottom:0}.before\:left-0:before{content:var(--tw-content);left:0}.before\:right-0:before{content:var(--tw-content);right:0}.before\:top-0:before{content:var(--tw-content);top:0}.before\:w-\[1px\]:before{content:var(--tw-content);width:1px}.before\:bg-border:before{content:var(--tw-content);background-color:hsl(var(--border))}.after\:pointer-events-none:after{content:var(--tw-content);pointer-events:none}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:bottom-0:after{content:var(--tw-content);bottom:0}.after\:left-0:after{content:var(--tw-content);left:0}.after\:hidden:after{content:var(--tw-content);display:none}.after\:h-32:after{content:var(--tw-content);height:8rem}.after\:w-full:after{content:var(--tw-content);width:100%}.after\:bg-\[linear-gradient\(180deg\,_transparent_10\%\,_hsl\(var\(--background\)\)_70\%\)\]:after{content:var(--tw-content);background-image:linear-gradient(180deg,transparent 10%,hsl(var(--background)) 70%)}.focus-within\:relative:focus-within{position:relative}.focus-within\:z-20:focus-within{z-index:20}.focus-within\:ring-1:focus-within{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-within\:ring-ring:focus-within{--tw-ring-color: hsl(var(--ring))}.hover\:-translate-y-1:hover{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:rotate-180:hover{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-background:hover{background-color:hsl(var(--background))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-card\/80:hover{background-color:hsl(var(--card) / .8)}.hover\:bg-destructive\/10:hover{background-color:hsl(var(--destructive) / .1)}.hover\:bg-destructive\/25:hover{background-color:hsl(var(--destructive) / .25)}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-green-100:hover{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.hover\:bg-inherit:hover{background-color:inherit}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-muted\/40:hover{background-color:hsl(var(--muted) / .4)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-muted\/60:hover{background-color:hsl(var(--muted) / .6)}.hover\:bg-muted\/70:hover{background-color:hsl(var(--muted) / .7)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.hover\:bg-secondary-foreground\/10:hover{background-color:hsl(var(--secondary-foreground) / .1)}.hover\:bg-secondary\/70:hover{background-color:hsl(var(--secondary) / .7)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-slate-200\/80:hover{background-color:#e2e8f0cc}.hover\:bg-transparent:hover{background-color:transparent}.hover\:bg-yellow-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.hover\:bg-opacity-80:hover{--tw-bg-opacity: .8}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-foreground\/70:hover{color:hsl(var(--foreground) / .7)}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:opacity-80:hover{opacity:.8}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-black\/30:hover{--tw-shadow-color: rgb(0 0 0 / .3);--tw-shadow: var(--tw-shadow-colored)}.hover\:ring-primary:hover{--tw-ring-color: hsl(var(--primary))}.focus\:z-10:focus{z-index:10}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:bg-primary:focus{background-color:hsl(var(--primary))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:text-primary-foreground:focus{color:hsl(var(--primary-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-red-500:focus-visible{--tw-ring-opacity: 1;--tw-ring-color: rgb(239 68 68 / var(--tw-ring-opacity, 1))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:via-background\/90{--tw-gradient-to: hsl(var(--background) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), hsl(var(--background) / .9) var(--tw-gradient-via-position), var(--tw-gradient-to)}.group:hover .group-hover\:to-background\/70{--tw-gradient-to: hsl(var(--background) / .7) var(--tw-gradient-to-position)}.group\/id:hover .group-hover\/id\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:justify-center{justify-content:center}.group[data-collapsed=true] .group-\[\[data-collapsed\=true\]\]\:px-2{padding-left:.5rem;padding-right:.5rem}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\:focus-visible\]\:outline-none:has(:focus-visible){outline:2px solid transparent;outline-offset:2px}.has-\[\:focus-visible\]\:ring-1:has(:focus-visible){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.has-\[\:focus-visible\]\:ring-neutral-950:has(:focus-visible){--tw-ring-opacity: 1;--tw-ring-color: rgb(10 10 10 / var(--tw-ring-opacity, 1))}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:bg-accent\/50[aria-selected=true]{background-color:hsl(var(--accent) / .5)}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}.aria-selected\:text-muted-foreground[aria-selected=true]{color:hsl(var(--muted-foreground))}.aria-selected\:opacity-100[aria-selected=true]{opacity:1}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes accordion-up{0%{height:var(--radix-accordion-content-height)}to{height:0}}.data-\[state\=closed\]\:animate-accordion-up[data-state=closed]{animation:accordion-up .2s ease-out}@keyframes accordion-down{0%{height:0}to{height:var(--radix-accordion-content-height)}}.data-\[state\=open\]\:animate-accordion-down[data-state=open]{animation:accordion-down .2s ease-out}.data-\[state\=dragging\]\:cursor-grabbing[data-state=dragging]{cursor:grabbing}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[disabled\]\:bg-muted-foreground[data-disabled],.data-\[fixed\]\:bg-muted-foreground[data-fixed]{background-color:hsl(var(--muted-foreground))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[collapsed\=true\]\:py-2[data-collapsed=true]{padding-top:.5rem;padding-bottom:.5rem}.data-\[disabled\]\:text-muted[data-disabled],.data-\[fixed\]\:text-muted[data-fixed]{color:hsl(var(--muted))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{transition-duration:.3s}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed],.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=closed\]\:duration-300[data-state=closed],.data-\[state\=open\]\:duration-300[data-state=open]{animation-duration:.3s}.data-\[disabled\]\:hover\:bg-muted-foreground:hover[data-disabled],.data-\[fixed\]\:hover\:bg-muted-foreground:hover[data-fixed]{background-color:hsl(var(--muted-foreground))}.group[data-state=open] .group-data-\[state\=\"open\"\]\:-rotate-180{--tw-rotate: -180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(29 78 216 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1f293780}.dark\:bg-green-500\/10:is(.dark *){background-color:#22c55e1a}.dark\:bg-red-500\/10:is(.dark *){background-color:#ef44441a}.dark\:bg-yellow-500\/10:is(.dark *){background-color:#eab3081a}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:ring-gray-700:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(55 65 81 / var(--tw-ring-opacity, 1))}.dark\:ring-gray-800:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(31 41 55 / var(--tw-ring-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:placeholder\:text-gray-500:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-red-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-red-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:has-\[\:focus-visible\]\:ring-neutral-300:has(:focus-visible):is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(212 212 212 / var(--tw-ring-opacity, 1))}@media (min-width: 640px){.sm\:absolute{position:absolute}.sm\:inset-auto{inset:auto}.sm\:bottom-\[calc\(100\%\+10px\)\]{bottom:calc(100% + 10px)}.sm\:left-0{left:0}.sm\:right-0{right:0}.sm\:my-0{margin-top:0;margin-bottom:0}.sm\:my-4{margin-top:1rem;margin-bottom:1rem}.sm\:mt-0{margin-top:0}.sm\:hidden{display:none}.sm\:h-\[80vh\]{height:80vh}.sm\:h-full{height:100%}.sm\:max-h-\[500px\]{max-height:500px}.sm\:max-h-\[600px\]{max-height:600px}.sm\:max-h-\[700px\]{max-height:700px}.sm\:max-h-\[800px\]{max-height:800px}.sm\:w-48{width:12rem}.sm\:w-\[480px\]{width:480px}.sm\:w-\[540px\]{width:540px}.sm\:w-\[90vw\]{width:90vw}.sm\:w-full{width:100%}.sm\:max-w-72{max-width:18rem}.sm\:max-w-\[1025px\]{max-width:1025px}.sm\:max-w-\[425px\]{max-width:425px}.sm\:max-w-\[700px\]{max-width:700px}.sm\:max-w-lg{max-width:32rem}.sm\:max-w-md{max-width:28rem}.sm\:max-w-sm{max-width:24rem}.sm\:max-w-xl{max-width:36rem}.sm\:translate-y-5{--tw-translate-y: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:justify-between{justify-content:space-between}.sm\:gap-6{gap:1.5rem}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:bottom-0{bottom:0}.md\:right-auto{right:auto}.md\:col-span-1{grid-column:span 1 / span 1}.md\:ml-14{margin-left:3.5rem}.md\:ml-64{margin-left:16rem}.md\:block{display:block}.md\:flex{display:flex}.md\:inline-flex{display:inline-flex}.md\:hidden{display:none}.md\:h-svh{height:100svh}.md\:max-h-screen{max-height:100vh}.md\:w-14{width:3.5rem}.md\:w-32{width:8rem}.md\:w-64{width:16rem}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[31rem\]{max-width:31rem}.md\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:overflow-y-hidden{overflow-y:hidden}.md\:border-none{border-style:none}.md\:px-4{padding-left:1rem;padding-right:1rem}.md\:px-8{padding-left:2rem;padding-right:2rem}.md\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\:pt-0{padding-top:0}.md\:text-3xl{font-size:1.875rem;line-height:2.25rem}.after\:md\:block:after{content:var(--tw-content);display:block}}@media (min-width: 1024px){.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-1\/5{width:20%}.lg\:w-\[250px\]{width:250px}.lg\:max-w-none{max-width:none}.lg\:max-w-xl{max-width:36rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:gap-8{gap:2rem}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.lg\:p-8{padding:2rem}.lg\:px-0{padding-left:0;padding-right:0}.lg\:px-3{padding-left:.75rem;padding-right:.75rem}}@media (min-width: 1280px){.xl\:mr-2{margin-right:.5rem}.xl\:flex{display:flex}.xl\:inline-flex{display:inline-flex}.xl\:h-10{height:2.5rem}.xl\:w-60{width:15rem}.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:justify-start{justify-content:flex-start}.xl\:px-3{padding-left:.75rem;padding-right:.75rem}.xl\:py-2{padding-top:.5rem;padding-bottom:.5rem}}.\[\&\:\:-webkit-calendar-picker-indicator\]\:hidden::-webkit-calendar-picker-indicator{display:none}.\[\&\:has\(\>\.day-range-end\)\]\:rounded-r-md:has(>.day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\>\.day-range-start\)\]\:rounded-l-md:has(>.day-range-start){border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:rounded-md:has([aria-selected]){border-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\)\]\:bg-accent:has([aria-selected]){background-color:hsl(var(--accent))}.first\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-l-md:has([aria-selected]):first-child{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.last\:\[\&\:has\(\[aria-selected\]\)\]\:rounded-r-md:has([aria-selected]):last-child{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[aria-selected\]\.day-outside\)\]\:bg-accent\/50:has([aria-selected].day-outside){background-color:hsl(var(--accent) / .5)}.\[\&\:has\(\[aria-selected\]\.day-range-end\)\]\:rounded-r-md:has([aria-selected].day-range-end){border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&\[data-state\=open\]\>svg\]\:rotate-180[data-state=open]>svg{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:invisible svg{visibility:hidden}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/public/assets/admin/assets/index.js b/public/assets/admin/assets/index.js index 40d7ce7..c627a85 100644 --- a/public/assets/admin/assets/index.js +++ b/public/assets/admin/assets/index.js @@ -1,4 +1,4 @@ -import{r as c,j as e,t as xl,c as ml,I as Na,a as Ss,S as Qt,u as ns,b as Zt,d as hl,O as Xt,e as jl,f as A,g as gl,h as fl,i as pl,Q as vl,k as bl,R as yl,l as Nl,P as wl,m as _l,B as Cl,n as Ua,F as Sl,C as kl,o as Tl,p as Dl,q as Pl,s as Vl,v as Il,z as u,w as Ba,x as ae,y as ie,A as Ga,D as _t,E as Ct,G as ea,H as Fe,T as St,J as kt,K as Ya,L as Wa,M as Rl,N as El,U as Fl,V as Ml,W as Ja,X as sa,Y as Qa,Z as zl,_ as Za,$ as Xa,a0 as en,a1 as sn,a2 as ks,a3 as tn,a4 as Ol,a5 as an,a6 as nn,a7 as Ll,a8 as $l,a9 as Al,aa as Hl,ab as rn,ac as Kl,ad as ql,ae as Ts,af as ln,ag as Ul,ah as Bl,ai as on,aj as Gl,ak as Yl,al as wa,am as Wl,an as cn,ao as Jl,ap as dn,aq as Ql,ar as Zl,as as Xl,at as ei,au as si,av as ti,aw as un,ax as ai,ay as ni,az as ri,aA as we,aB as li,aC as ii,aD as oi,aE as ci,aF as xn,aG as mn,aH as hn,aI as di,aJ as jn,aK as gn,aL as fn,aM as ui,aN as xi,aO as mi,aP as pn,aQ as hi,aR as ta,aS as vn,aT as ji,aU as bn,aV as gi,aW as yn,aX as fi,aY as Nn,aZ as wn,a_ as pi,a$ as vi,b0 as _n,b1 as bi,b2 as yi,b3 as Cn,b4 as Ni,b5 as Sn,b6 as wi,b7 as _i,b8 as Le,b9 as Q,ba as Pe,bb as lt,bc as Ci,bd as Si,be as ki,bf as Ti,bg as Di,bh as Pi,bi as _a,bj as Ca,bk as Vi,bl as Ii,bm as Ri,bn as Ei,bo as Fi,bp as At,bq as Ht,br as Mi,bs as zi,bt as kn,bu as Oi,bv as Li,bw as Tn,bx as $i,by as de,bz as Ai,bA as Sa,bB as Kt,bC as qt,bD as Hi,bE as Ki,bF as Dn,bG as qi,bH as aa,bI as Ui,bJ as Bi,bK as Gi,bL as Pn,bM as Vn,bN as In,bO as Yi,bP as Wi,bQ as Ji,bR as Qi,bS as Rn,bT as Zi,bU as We,bV as Xi,bW as eo,bX as vt,bY as ve,bZ as ka,b_ as so,b$ as En,c0 as Fn,c1 as Mn,c2 as zn,c3 as On,c4 as Ln,c5 as to,c6 as ao,c7 as no,c8 as Tt,c9 as Ds,ca as rs,cb as Me,cc as ze,cd as Ae,ce as He,cf as Ke,cg as ro,ch as lo,ci as io,cj as Ut,ck as na,cl as ra,cm as oo,cn as ls,co as is,cp as it,cq as co,cr as uo,cs as Ta,ct as Da,cu as $n,cv as Pa,cw as bt,cx as xo,cy as mo,cz as An,cA as ho,cB as jo,cC as Hn,cD as Bt,cE as Kn,cF as go,cG as qn,cH as Un,cI as fo,cJ as po,cK as vo,cL as bo,cM as yo}from"./vendor.js";import"./index.js";var fh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ph(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function No(s){if(s.__esModule)return s;var t=s.default;if(typeof t=="function"){var a=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var l=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(a,n,l.get?l:{enumerable:!0,get:function(){return s[n]}})}),a}const wo={theme:"system",setTheme:()=>null},Bn=c.createContext(wo);function _o({children:s,defaultTheme:t="system",storageKey:a="vite-ui-theme",...n}){const[l,o]=c.useState(()=>localStorage.getItem(a)||t);c.useEffect(()=>{const x=window.document.documentElement;if(x.classList.remove("light","dark"),l==="system"){const r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";x.classList.add(r);return}x.classList.add(l)},[l]);const d={theme:l,setTheme:x=>{localStorage.setItem(a,x),o(x)}};return e.jsx(Bn.Provider,{...n,value:d,children:s})}const Co=()=>{const s=c.useContext(Bn);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},So=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),ko=function(s,t){return new URL(s,t).href},Va={},X=function(t,a,n){let l=Promise.resolve();if(a&&a.length>0){const d=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),r=x?.nonce||x?.getAttribute("nonce");l=Promise.allSettled(a.map(i=>{if(i=ko(i,n),i in Va)return;Va[i]=!0;const h=i.endsWith(".css"),D=h?'[rel="stylesheet"]':"";if(!!n)for(let w=d.length-1;w>=0;w--){const _=d[w];if(_.href===i&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${D}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":So,h||(m.as="script"),m.crossOrigin="",m.href=i,r&&m.setAttribute("nonce",r),document.head.appendChild(m),h)return new Promise((w,_)=>{m.addEventListener("load",w),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${i}`)))})}))}function o(d){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=d,window.dispatchEvent(x),!x.defaultPrevented)throw d}return l.then(d=>{for(const x of d||[])x.status==="rejected"&&o(x.reason);return t().catch(o)})};function v(...s){return xl(ml(s))}const As=Ss("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm 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",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),T=c.forwardRef(({className:s,variant:t,size:a,asChild:n=!1,children:l,disabled:o,loading:d=!1,leftSection:x,rightSection:r,...i},h)=>{const D=n?Qt:"button";return e.jsxs(D,{className:v(As({variant:t,size:a,className:s})),disabled:d||o,ref:h,...i,children:[(x&&d||!x&&!r&&d)&&e.jsx(Na,{className:"mr-2 h-4 w-4 animate-spin"}),!d&&x&&e.jsx("div",{className:"mr-2",children:x}),l,!d&&r&&e.jsx("div",{className:"ml-2",children:r}),r&&d&&e.jsx(Na,{className:"ml-2 h-4 w-4 animate-spin"})]})});T.displayName="Button";function Es({className:s,minimal:t=!1}){const a=ns();return e.jsx("div",{className:v("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!t&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{})," Please try again later."]}),!t&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(T,{variant:"outline",onClick:()=>a(-1),children:"Go Back"}),e.jsx(T,{onClick:()=>a("/"),children:"Back to Home"})]})]})})}function Ia(){const s=ns();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(T,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(T,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function To(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(T,{variant:"outline",children:"Learn more"})})]})})}function Do(s){return typeof s>"u"}function Po(s){return s===null}function Vo(s){return Po(s)||Do(s)}class Io{storage;prefixKey;constructor(t){this.storage=t.storage,this.prefixKey=t.prefixKey}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,a,n=null){const l=JSON.stringify({value:a,time:Date.now(),expire:n!==null?new Date().getTime()+n*1e3:null});this.storage.setItem(this.getKey(t),l)}get(t,a=null){const n=this.storage.getItem(this.getKey(t));if(!n)return{value:a,time:0};try{const l=JSON.parse(n),{value:o,time:d,expire:x}=l;return Vo(x)||x>new Date().getTime()?{value:o,time:d}:(this.remove(t),{value:a,time:0})}catch{return this.remove(t),{value:a,time:0}}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}}function Gn({prefixKey:s="",storage:t=sessionStorage}){return new Io({prefixKey:s,storage:t})}const Yn="Xboard_",Ro=function(s={}){return Gn({prefixKey:s.prefixKey||"",storage:localStorage})},Eo=function(s={}){return Gn({prefixKey:s.prefixKey||"",storage:sessionStorage})},Dt=Ro({prefixKey:Yn});Eo({prefixKey:Yn});const Wn="access_token";function Zs(){return Dt.get(Wn)}function Jn(){Dt.remove(Wn)}const Ra=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function Fo({children:s}){const t=ns(),a=Zt(),n=Zs();return c.useEffect(()=>{if(!n.value&&!Ra.includes(a.pathname)){const l=encodeURIComponent(a.pathname+a.search);t(`/sign-in?redirect=${l}`)}},[n.value,a.pathname,a.search,t]),Ra.includes(a.pathname)||n.value?e.jsx(e.Fragment,{children:s}):null}const Mo=()=>e.jsx(Fo,{children:e.jsx(Xt,{})}),zo=hl([{path:"/sign-in",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>nc);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(Mo,{}),children:[{path:"/",lazy:async()=>({Component:(await X(()=>Promise.resolve().then(()=>pc),void 0,import.meta.url)).default}),errorElement:e.jsx(Es,{}),children:[{index:!0,lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Ud);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(Es,{}),children:[{path:"system",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Yd);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Xd);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>nu);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>cu);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>hu);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>vu);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>_u);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Du);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Eu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Lu);return{default:s}},void 0,import.meta.url)).default})}]},{path:"payment",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qu);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>ex);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>ix);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>jx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(Es,{}),children:[{path:"manage",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>$x);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Ux);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(Es,{}),children:[{path:"plan",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>lm);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>vm);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Tm);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(Es,{}),children:[{path:"manage",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qm);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>hh);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:Es},{path:"/404",Component:Ia},{path:"/503",Component:To},{path:"*",Component:Ia}]),Oo="locale";function Lo(){return Dt.get(Oo)}function Qn(){Jn();const s=window.location.pathname,t=s&&!["/404","/sign-in"].includes(s),a=new URL(window.location.href),l=`${a.pathname.split("/")[1]?`/${a.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=l+(t?`?redirect=${s}`:"")}const $o=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function Ao(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const I=jl.create({baseURL:Ao(),timeout:12e3,headers:{"Content-Type":"application/json"}});I.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const t=Zs();if(!$o.includes(s.url?.split("?")[0]||"")){if(!t.value)return Qn(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=t.value}return s.headers["Content-Language"]=Lo().value||"zh-CN",s},s=>Promise.reject(s));I.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const t=s.response?.status,a=s.response?.data?.message;return(t===401||t===403)&&Qn(),A.error(a||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[t]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});function Ho(){return I.get("/user/info")}const Mt={token:Zs()?.value||"",userInfo:null,isLoggedIn:!!Zs()?.value,loading:!1,error:null},Js=gl("user/fetchUserInfo",async()=>(await Ho()).data,{condition:(s,{getState:t})=>{const{user:a}=t();return!!a.token&&!a.loading}}),Zn=fl({name:"user",initialState:Mt,reducers:{setToken(s,t){s.token=t.payload,s.isLoggedIn=!!t.payload},resetUserState:()=>Mt},extraReducers:s=>{s.addCase(Js.pending,t=>{t.loading=!0,t.error=null}).addCase(Js.fulfilled,(t,a)=>{t.loading=!1,t.userInfo=a.payload,t.error=null}).addCase(Js.rejected,(t,a)=>{if(t.loading=!1,t.error=a.error.message||"Failed to fetch user info",!t.token)return Mt})}}),{setToken:Ko,resetUserState:qo}=Zn.actions,Uo=s=>s.user.userInfo,Bo=Zn.reducer,Xn=pl({reducer:{user:Bo}});Zs()?.value&&Xn.dispatch(Js());const Go=new vl;bl.createRoot(document.getElementById("root")).render(e.jsx(yl.StrictMode,{children:e.jsx(Nl,{client:Go,children:e.jsx(wl,{store:Xn,children:e.jsxs(_o,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(_l,{router:zo}),e.jsx(Cl,{richColors:!0,position:"top-right"})]})})})}));const $e=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("rounded-xl border bg-card text-card-foreground shadow",s),...t}));$e.displayName="Card";const Je=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex flex-col space-y-1.5 p-6",s),...t}));Je.displayName="CardHeader";const gs=c.forwardRef(({className:s,...t},a)=>e.jsx("h3",{ref:a,className:v("font-semibold leading-none tracking-tight",s),...t}));gs.displayName="CardTitle";const Xs=c.forwardRef(({className:s,...t},a)=>e.jsx("p",{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Xs.displayName="CardDescription";const Qe=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("p-6 pt-0",s),...t}));Qe.displayName="CardContent";const Yo=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex items-center p-6 pt-0",s),...t}));Yo.displayName="CardFooter";const Wo=Ss("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yt=c.forwardRef(({className:s,...t},a)=>e.jsx(Ua,{ref:a,className:v(Wo(),s),...t}));yt.displayName=Ua.displayName;const oe=Sl,er=c.createContext({}),g=({...s})=>e.jsx(er.Provider,{value:{name:s.name},children:e.jsx(kl,{...s})}),Pt=()=>{const s=c.useContext(er),t=c.useContext(sr),{getFieldState:a,formState:n}=Tl(),l=a(s.name,n);if(!s)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:s.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...l}},sr=c.createContext({}),j=c.forwardRef(({className:s,...t},a)=>{const n=c.useId();return e.jsx(sr.Provider,{value:{id:n},children:e.jsx("div",{ref:a,className:v("space-y-2",s),...t})})});j.displayName="FormItem";const p=c.forwardRef(({className:s,...t},a)=>{const{error:n,formItemId:l}=Pt();return e.jsx(yt,{ref:a,className:v(n&&"text-destructive",s),htmlFor:l,...t})});p.displayName="FormLabel";const y=c.forwardRef(({...s},t)=>{const{error:a,formItemId:n,formDescriptionId:l,formMessageId:o}=Pt();return e.jsx(Qt,{ref:t,id:n,"aria-describedby":a?`${l} ${o}`:`${l}`,"aria-invalid":!!a,...s})});y.displayName="FormControl";const F=c.forwardRef(({className:s,...t},a)=>{const{formDescriptionId:n}=Pt();return e.jsx("p",{ref:a,id:n,className:v("text-[0.8rem] text-muted-foreground",s),...t})});F.displayName="FormDescription";const k=c.forwardRef(({className:s,children:t,...a},n)=>{const{error:l,formMessageId:o}=Pt(),d=l?String(l?.message):t;return d?e.jsx("p",{ref:n,id:o,className:v("text-[0.8rem] font-medium text-destructive",s),...a,children:d}):null});k.displayName="FormMessage";const S=c.forwardRef(({className:s,type:t,...a},n)=>e.jsx("input",{type:t,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:n,...a}));S.displayName="Input";const tr=c.forwardRef(({className:s,...t},a)=>{const[n,l]=c.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:n?"text":"password",className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:a,...t}),e.jsx(T,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>l(o=>!o),children:n?e.jsx(Dl,{size:18}):e.jsx(Pl,{size:18})})]})});tr.displayName="PasswordInput";const Jo=s=>I({url:"/passport/auth/login",method:"post",data:s}),Gt=s=>s;function re(s=void 0,t="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Il(s).format(t))}function Qo(s=void 0,t="YYYY-MM-DD"){return re(s,t)}function zs(s){const t=typeof s=="string"?parseFloat(s):s;return isNaN(t)?"0.00":t.toFixed(2)}function Ns(s,t=!0){if(s==null)return t?"¥0.00":"0.00";const a=typeof s=="string"?parseFloat(s):s;if(isNaN(a))return t?"¥0.00":"0.00";const l=(a/100).toFixed(2).replace(/\.?0+$/,o=>o.includes(".")?".00":o);return t?`¥${l}`:l}function Nt(s){navigator.clipboard?navigator.clipboard.writeText(s).then(()=>{A.success(Gt("复制成功"))}).catch(t=>{console.error("复制到剪贴板时出错:",t),Ea(s)}):Ea(s)}function Ea(s){const t=document.createElement("button"),a=new Vl(t,{text:()=>s});a.on("success",()=>{A.success(Gt("复制成功")),a.destroy()}),a.on("error",()=>{A.error(Gt("复制失败")),a.destroy()}),t.click()}function Ye(s){const t=s/1024,a=t/1024,n=a/1024,l=n/1024;return l>=1?zs(l)+" TB":n>=1?zs(n)+" GB":a>=1?zs(a)+" MB":zs(t)+" KB"}const Zo="access_token";function Xo(s){Dt.set(Zo,s)}const ec=u.object({email:u.string().min(1,{message:"请输入邮箱地址"}).email({message:"邮箱地址格式不正确"}),password:u.string().min(1,{message:"请输入密码"}).min(7,{message:"密码长度至少为7个字符"})});function sc({className:s,onForgotPassword:t,...a}){const n=ns(),l=Ba(),o=ae({resolver:ie(ec),defaultValues:{email:"",password:""}});async function d(x){Jo(x).then(({data:r})=>{Xo(r.auth_data),l(Ko(r.auth_data)),l(Js()).unwrap(),n("/")})}return e.jsx("div",{className:v("grid gap-6",s),...a,children:e.jsx(oe,{...o,children:e.jsx("form",{onSubmit:o.handleSubmit(d),children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{control:o.control,name:"email",render:({field:x})=>e.jsxs(j,{className:"space-y-1",children:[e.jsx(p,{children:"邮箱地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"name@example.com",...x})}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"password",render:({field:x})=>e.jsxs(j,{className:"space-y-1",children:[e.jsx(p,{children:"密码"}),e.jsx(y,{children:e.jsx(tr,{placeholder:"请输入密码",...x})}),e.jsx(k,{})]})}),e.jsx(T,{className:"mt-2",loading:o.formState.isSubmitting,children:"登录"}),e.jsx(T,{variant:"link",type:"button",className:"mt-1 text-sm text-muted-foreground hover:text-primary",onClick:t,children:"忘记密码?"})]})})})})}const ue=Ga,Ie=Ya,tc=Wa,ot=ea,ar=c.forwardRef(({className:s,...t},a)=>e.jsx(_t,{ref:a,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t}));ar.displayName=_t.displayName;const ce=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(tc,{children:[e.jsx(ar,{}),e.jsxs(Ct,{ref:n,className:v("max-h-[95%] overflow-auto fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...a,children:[t,e.jsxs(ea,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ce.displayName=Ct.displayName;const he=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",s),...t});he.displayName="DialogHeader";const Re=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});Re.displayName="DialogFooter";const xe=c.forwardRef(({className:s,...t},a)=>e.jsx(St,{ref:a,className:v("text-lg font-semibold leading-none tracking-tight",s),...t}));xe.displayName=St.displayName;const Se=c.forwardRef(({className:s,...t},a)=>e.jsx(kt,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Se.displayName=kt.displayName;const $s=Ss("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm 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",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),W=c.forwardRef(({className:s,variant:t,size:a,asChild:n=!1,...l},o)=>{const d=n?Qt:"button";return e.jsx(d,{className:v($s({variant:t,size:a,className:s})),ref:o,...l})});W.displayName="Button";function ac(){const[s,t]=c.useState(!1),a="php artisan reset:password 管理员邮箱";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"container grid h-svh flex-col items-center justify-center bg-primary-foreground lg:max-w-none lg:px-0",children:e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-2 sm:w-[480px] lg:p-8",children:[e.jsx("div",{className:"mb-4 flex items-center justify-center",children:e.jsx("h1",{className:"text-3xl font-medium",children:window?.settings?.title})}),e.jsxs($e,{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"登录"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"请输入您的邮箱和密码登录系统"})]}),e.jsx(sc,{onForgotPassword:()=>t(!0)})]})]})}),e.jsx(ue,{open:s,onOpenChange:t,children:e.jsx(ce,{children:e.jsxs(he,{children:[e.jsx(xe,{children:"忘记密码"}),e.jsx(Se,{children:"在站点目录下执行以下命令找回密码"}),e.jsx("div",{className:"mt-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"rounded-md bg-secondary p-4 pr-12",children:a}),e.jsx(W,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>Nt(a),children:e.jsx(Rl,{className:"h-4 w-4"})})]})})]})})})]})}const nc=Object.freeze(Object.defineProperty({__proto__:null,default:ac},Symbol.toStringTag,{value:"Module"})),ye=c.forwardRef(({className:s,fadedBelow:t=!1,fixedHeight:a=!1,...n},l)=>e.jsx("div",{ref:l,className:v("relative flex h-full w-full flex-col",t&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",a&&"md:h-svh",s),...n}));ye.displayName="Layout";const Ne=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...t}));Ne.displayName="LayoutHeader";const _e=c.forwardRef(({className:s,fixedHeight:t,...a},n)=>e.jsx("div",{ref:n,className:v("flex-1 overflow-hidden px-4 py-6 md:px-8",t&&"h-[calc(100%-var(--header-height))]",s),...a}));_e.displayName="LayoutBody";const nr=El,rr=Fl,lr=Ml,_s=Ll,Cs=$l,rc=Al,lc=c.forwardRef(({className:s,inset:t,children:a,...n},l)=>e.jsxs(Ja,{ref:l,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",s),...n,children:[a,e.jsx(sa,{className:"ml-auto h-4 w-4"})]}));lc.displayName=Ja.displayName;const ic=c.forwardRef(({className:s,...t},a)=>e.jsx(Qa,{ref:a,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t}));ic.displayName=Qa.displayName;const fs=c.forwardRef(({className:s,sideOffset:t=4,...a},n)=>e.jsx(zl,{children:e.jsx(Za,{ref:n,sideOffset:t,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a})}));fs.displayName=Za.displayName;const me=c.forwardRef(({className:s,inset:t,...a},n)=>e.jsx(Xa,{ref:n,className:v("relative flex cursor-default cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",s),...a}));me.displayName=Xa.displayName;const oc=c.forwardRef(({className:s,children:t,checked:a,...n},l)=>e.jsxs(en,{ref:l,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:a,...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(sn,{children:e.jsx(ks,{className:"h-4 w-4"})})}),t]}));oc.displayName=en.displayName;const cc=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(tn,{ref:n,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(sn,{children:e.jsx(Ol,{className:"h-4 w-4 fill-current"})})}),t]}));cc.displayName=tn.displayName;const la=c.forwardRef(({className:s,inset:t,...a},n)=>e.jsx(an,{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",s),...a}));la.displayName=an.displayName;const et=c.forwardRef(({className:s,...t},a)=>e.jsx(nn,{ref:a,className:v("-mx-1 my-1 h-px bg-muted",s),...t}));et.displayName=nn.displayName;const Yt=({className:s,...t})=>e.jsx("span",{className:v("ml-auto text-xs tracking-widest opacity-60",s),...t});Yt.displayName="DropdownMenuShortcut";const le=Hl,se=Kl,te=ql,ee=c.forwardRef(({className:s,sideOffset:t=4,...a},n)=>e.jsx(rn,{ref:n,sideOffset:t,className:v("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a}));ee.displayName=rn.displayName;function Vt(){const{pathname:s}=Zt();return{checkActiveNav:a=>{if(a==="/"&&s==="/")return!0;const n=a.replace(/^\//,""),l=s.replace(/^\//,"");return n?l.startsWith(n):!1}}}function ir({key:s,defaultValue:t}){const[a,n]=c.useState(()=>{const l=localStorage.getItem(s);return l!==null?JSON.parse(l):t});return c.useEffect(()=>{localStorage.setItem(s,JSON.stringify(a))},[a,s]),[a,n]}function dc(){const[s,t]=ir({key:"expanded-sidebar-items",defaultValue:["仪表盘","系统管理","节点管理","订阅管理","用户管理"]});return{expandedItems:s,toggleItem:n=>{t(l=>l.includes(n)?l.filter(o=>o!==n):[...l,n])},isExpanded:n=>s.includes(n)}}function uc({links:s,isCollapsed:t,className:a,closeNav:n}){const l=({sub:o,...d})=>{const x=`${d.title}-${d.href}`;return t&&o?c.createElement(hc,{...d,sub:o,key:x,closeNav:n}):t?c.createElement(mc,{...d,key:x,closeNav:n}):o?c.createElement(xc,{...d,sub:o,key:x,closeNav:n}):c.createElement(or,{...d,key:x,closeNav:n})};return e.jsx("div",{"data-collapsed":t,className:v("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",a),children:e.jsx(le,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(l)})})})}function or({title:s,icon:t,label:a,href:n,closeNav:l,subLink:o=!1}){const{checkActiveNav:d}=Vt();return e.jsxs(Ts,{to:n,onClick:l,className:v(As({variant:d(n)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",o&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":d(n)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:t}),s,a&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:a})]})}function xc({title:s,icon:t,label:a,sub:n,closeNav:l}){const{checkActiveNav:o}=Vt(),{isExpanded:d,toggleItem:x}=dc(),r=!!n?.find(h=>o(h.href)),i=d(s)||r;return e.jsxs(nr,{open:i,onOpenChange:()=>x(s),children:[e.jsxs(rr,{className:v(As({variant:"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:t}),s,a&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:a}),e.jsx("span",{className:v('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(ln,{stroke:1})})]}),e.jsx(lr,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:n.map(h=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(or,{...h,subLink:!0,closeNav:l})},h.title))})})]})}function mc({title:s,icon:t,label:a,href:n}){const{checkActiveNav:l}=Vt();return e.jsxs(se,{delayDuration:0,children:[e.jsx(te,{asChild:!0,children:e.jsxs(Ts,{to:n,className:v(As({variant:l(n)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[t,e.jsx("span",{className:"sr-only",children:s})]})}),e.jsxs(ee,{side:"right",className:"flex items-center gap-4",children:[s,a&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:a})]})]})}function hc({title:s,icon:t,label:a,sub:n}){const{checkActiveNav:l}=Vt(),o=!!n?.find(d=>l(d.href));return e.jsxs(_s,{children:[e.jsxs(se,{delayDuration:0,children:[e.jsx(te,{asChild:!0,children:e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:o?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:t})})}),e.jsxs(ee,{side:"right",className:"flex items-center gap-4",children:[s," ",a&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:a}),e.jsx(ln,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(fs,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(la,{children:[s," ",a?`(${a})`:""]}),e.jsx(et,{}),n.map(({title:d,icon:x,label:r,href:i})=>e.jsx(me,{asChild:!0,children:e.jsxs(Ts,{to:i,className:`${l(i)?"bg-secondary":""}`,children:[x," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:d}),r&&e.jsx("span",{className:"ml-auto text-xs",children:r})]})},`${d}-${i}`))]})]})}const cr=[{title:"仪表盘",label:"",href:"/",icon:e.jsx(Ul,{size:18})},{title:"系统管理",label:"",href:"",icon:e.jsx(Bl,{size:18}),sub:[{title:"系统配置",label:"",href:"/config/system",icon:e.jsx(on,{size:18})},{title:"主题配置",label:"",href:"/config/theme",icon:e.jsx(Gl,{size:18})},{title:"公告管理",label:"",href:"/config/notice",icon:e.jsx(Yl,{size:18})},{title:"支付配置",label:"",href:"/config/payment",icon:e.jsx(wa,{size:18})},{title:"知识库管理",label:"",href:"/config/knowledge",icon:e.jsx(Wl,{size:18})}]},{title:"节点管理",label:"",href:"",icon:e.jsx(cn,{size:18}),sub:[{title:"节点管理",label:"",href:"/server/manage",icon:e.jsx(Jl,{size:18})},{title:"权限组管理",label:"",href:"/server/group",icon:e.jsx(dn,{size:18})},{title:"路由管理",label:"",href:"/server/route",icon:e.jsx(Ql,{size:18})}]},{title:"订阅管理",label:"",href:"",icon:e.jsx(Zl,{size:18}),sub:[{title:"套餐管理",label:"",href:"/finance/plan",icon:e.jsx(Xl,{size:18})},{title:"订单管理",label:"",href:"/finance/order",icon:e.jsx(wa,{size:18})},{title:"优惠券管理",label:"",href:"/finance/coupon",icon:e.jsx(ei,{size:18})}]},{title:"用户管理",label:"",href:"",icon:e.jsx(si,{size:18}),sub:[{title:"用户管理",label:"",href:"/user/manage",icon:e.jsx(ti,{size:18})},{title:"工单管理",label:"",href:"/user/ticket",icon:e.jsx(un,{size:18})}]}];function jc({className:s,isCollapsed:t,setIsCollapsed:a}){const[n,l]=c.useState(!1);return c.useEffect(()=>{n?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[n]),e.jsxs("aside",{className:v(`fixed left-0 right-0 top-0 z-50 w-full border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${t?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>l(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${n?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(ye,{children:[e.jsxs(Ne,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${t?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${t?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${t?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Toggle Navigation","aria-controls":"sidebar-menu","aria-expanded":n,onClick:()=>l(o=>!o),children:n?e.jsx(ai,{}):e.jsx(ni,{})})]}),e.jsx(uc,{id:"sidebar-menu",className:`h-full flex-1 overflow-auto ${n?"max-h-screen":"max-h-0 py-0 md:max-h-screen md:py-2"}`,closeNav:()=>l(!1),isCollapsed:t,links:cr}),e.jsx(T,{onClick:()=>a(o=>!o),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex",children:e.jsx(ri,{stroke:1.5,className:`h-5 w-5 ${t?"rotate-180":""}`})})]})]})}function gc(){const[s,t]=ir({key:"collapsed-sidebar",defaultValue:!1});return c.useEffect(()=>{const a=()=>{t(window.innerWidth<768?!1:s)};return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[s,t]),[s,t]}function fc(){const[s,t]=gc();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(jc,{isCollapsed:s,setIsCollapsed:t}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(Xt,{})})]})}const pc=Object.freeze(Object.defineProperty({__proto__:null,default:fc},Symbol.toStringTag,{value:"Module"})),ps=c.forwardRef(({className:s,...t},a)=>e.jsx(we,{ref:a,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...t}));ps.displayName=we.displayName;const vc=({children:s,...t})=>e.jsx(ue,{...t,children:e.jsx(ce,{className:"overflow-hidden p-0",children:e.jsx(ps,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),Ps=c.forwardRef(({className:s,...t},a)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(li,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(we.Input,{ref:a,className:v("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...t})]}));Ps.displayName=we.Input.displayName;const vs=c.forwardRef(({className:s,...t},a)=>e.jsx(we.List,{ref:a,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...t}));vs.displayName=we.List.displayName;const Vs=c.forwardRef((s,t)=>e.jsx(we.Empty,{ref:t,className:"py-6 text-center text-sm",...s}));Vs.displayName=we.Empty.displayName;const Ve=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Group,{ref:a,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",s),...t}));Ve.displayName=we.Group.displayName;const Hs=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Separator,{ref:a,className:v("-mx-1 h-px bg-border",s),...t}));Hs.displayName=we.Separator.displayName;const be=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Item,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t}));be.displayName=we.Item.displayName;function bc(){const s=[];for(const t of cr)if(t.href&&s.push(t),t.sub)for(const a of t.sub)s.push({...a,parent:t.title});return s}function ke(){const[s,t]=c.useState(!1),a=ns(),n=bc();c.useEffect(()=>{const o=d=>{d.key==="k"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),t(x=>!x))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[]);const l=c.useCallback(o=>{t(!1),a(o)},[a]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>t(!0),children:[e.jsx(ii,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:"搜索..."}),e.jsx("span",{className:"sr-only",children:"搜索"}),e.jsxs("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsxs(vc,{open:s,onOpenChange:t,children:[e.jsx(Ps,{placeholder:"搜索所有菜单和功能..."}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"未找到相关结果"}),e.jsx(Ve,{heading:"菜单导航",children:n.map(o=>e.jsxs(be,{value:`${o.parent?o.parent+" ":""}${o.title}`,onSelect:()=>l(o.href),children:[e.jsx("div",{className:"mr-2",children:o.icon}),e.jsx("span",{children:o.title}),o.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:o.parent})]},o.href))})]})]})]})}function Te(){const{theme:s,setTheme:t}=Co();return c.useEffect(()=>{const a=s==="dark"?"#020817":"#fff",n=document.querySelector("meta[name='theme-color']");n&&n.setAttribute("content",a)},[s]),e.jsx(T,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>t(s==="light"?"dark":"light"),children:s==="light"?e.jsx(oi,{size:20}):e.jsx(ci,{size:20})})}const dr=c.forwardRef(({className:s,...t},a)=>e.jsx(xn,{ref:a,className:v("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...t}));dr.displayName=xn.displayName;const ur=c.forwardRef(({className:s,...t},a)=>e.jsx(mn,{ref:a,className:v("aspect-square h-full w-full",s),...t}));ur.displayName=mn.displayName;const xr=c.forwardRef(({className:s,...t},a)=>e.jsx(hn,{ref:a,className:v("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...t}));xr.displayName=hn.displayName;function De(){const s=ns(),t=Ba(),a=di(Uo),n=()=>{Jn(),t(qo()),s("/sign-in")},l=a?.email?.split("@")[0]||"User",o=l.substring(0,2).toUpperCase();return e.jsxs(_s,{children:[e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(dr,{className:"h-8 w-8",children:[e.jsx(ur,{src:a?.avatar_url,alt:l}),e.jsx(xr,{children:o})]})})}),e.jsxs(fs,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(la,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:l}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:a?.email||"user@example.com"})]})}),e.jsx(et,{}),e.jsx(me,{asChild:!0,children:e.jsxs(Ts,{to:"/config/system",children:["设置",e.jsx(Yt,{children:"⌘S"})]})}),e.jsx(et,{}),e.jsxs(me,{onClick:n,children:["退出登录",e.jsx(Yt,{children:"⇧⌘Q"})]})]})]})}const Ge=window?.settings?.secure_path,mr=5*60*1e3,Wt=new Map,yc=s=>{const t=Wt.get(s);return t?Date.now()-t.timestamp>mr?(Wt.delete(s),null):t.data:null},Nc=(s,t)=>{Wt.set(s,{data:t,timestamp:Date.now()})},wc=async(s,t=mr)=>{const a=yc(s);if(a)return a;const n=await I.get(s);return Nc(s,n),n},_c={getList:()=>wc(`${Ge}/notice/fetch`),save:s=>I.post(`${Ge}/notice/save`,s),drop:s=>I.post(`${Ge}/notice/drop`,{id:s}),updateStatus:s=>I.post(`${Ge}/notice/show`,{id:s}),sort:s=>I.post(`${Ge}/notice/sort`,{ids:s})},Fa={getSystemStatus:()=>I.get(`${Ge}/system/getSystemStatus`),getQueueStats:()=>I.get(`${Ge}/system/getQueueStats`),getQueueWorkload:()=>I.get(`${Ge}/system/getQueueWorkload`),getQueueMasters:()=>I.get(`${Ge}/system/getQueueMasters`),getSystemLog:s=>I.get(`${Ge}/system/getSystemLog`,{params:s})},M=window?.settings?.secure_path,Cc=s=>I.get(M+"/stat/getOrder",{params:s}),Sc=()=>I.get(M+"/stat/getStats"),Ma=s=>I.get(M+"/stat/getTrafficRank",{params:s}),kc=()=>I.get(M+"/theme/getThemes"),Tc=s=>I.post(M+"/theme/getThemeConfig",{name:s}),Dc=(s,t)=>I.post(M+"/theme/saveThemeConfig",{name:s,config:t}),Pc=s=>{const t=new FormData;return t.append("file",s),I.post(M+"/theme/upload",t,{headers:{"Content-Type":"multipart/form-data"}})},Vc=s=>I.post(M+"/theme/delete",{name:s}),Ic=s=>I.post(M+"/config/save",s),hr=()=>I.get(M+"/server/manage/getNodes"),Rc=s=>I.post(M+"/server/manage/save",s),Ec=s=>I.post(M+"/server/manage/drop",s),Fc=s=>I.post(M+"/server/manage/copy",s),Mc=s=>I.post(M+"/server/manage/update",s),zc=s=>I.post(M+"/server/manage/sort",s),It=()=>I.get(M+"/server/group/fetch"),Oc=s=>I.post(M+"/server/group/save",s),Lc=s=>I.post(M+"/server/group/drop",s),jr=()=>I.get(M+"/server/route/fetch"),$c=s=>I.post(M+"/server/route/save",s),Ac=s=>I.post(M+"/server/route/drop",s),Hc=()=>I.get(M+"/payment/fetch"),Kc=()=>I.get(M+"/payment/getPaymentMethods"),qc=s=>I.post(M+"/payment/getPaymentForm",s),Uc=s=>I.post(M+"/payment/save",s),Bc=s=>I.post(M+"/payment/drop",s),Gc=s=>I.post(M+"/payment/show",s),Yc=s=>I.post(M+"/payment/sort",s),Wc=()=>I.get(M+"/notice/fetch"),Jc=s=>I.post(M+"/notice/save",s),Qc=s=>I.post(M+"/notice/drop",s),Zc=s=>I.post(M+"/notice/show",s),Xc=()=>I.get(M+"/knowledge/fetch"),ed=s=>I.get(M+"/knowledge/fetch?id="+s),sd=s=>I.post(M+"/knowledge/save",s),td=s=>I.post(M+"/knowledge/drop",s),ad=s=>I.post(M+"/knowledge/show",s),nd=s=>I.post(M+"/knowledge/sort",s),Is=()=>I.get(M+"/plan/fetch"),rd=s=>I.post(M+"/plan/save",s),zt=s=>I.post(M+"/plan/update",s),ld=s=>I.post(M+"/plan/drop",s),id=s=>I.post(M+"/plan/sort",{ids:s}),od=async s=>I.post(M+"/order/fetch",s),cd=s=>I.post(M+"/order/detail",s),dd=s=>I.post(M+"/order/paid",s),ud=s=>I.post(M+"/order/cancel",s),za=s=>I.post(M+"/order/update",s),xd=s=>I.post(M+"/order/assign",s),md=s=>I.post(M+"/coupon/fetch",s),hd=s=>I.post(M+"/coupon/generate",s),jd=s=>I.post(M+"/coupon/drop",s),gd=s=>I.post(M+"/coupon/update",s),fd=s=>I.post(M+"/user/fetch",s),pd=s=>I.post(M+"/user/update",s),vd=s=>I.post(M+"/user/resetSecret",s),bd=s=>I.post(M+"/user/generate",s),yd=s=>I.post(M+"/stat/getStatUser",s),Nd=s=>I.post(M+"/ticket/fetch",s),wd=s=>I.get(M+"/ticket/fetch?id= "+s),_d=s=>I.post(M+"/ticket/reply",s),gr=s=>I.post(M+"/ticket/close",{id:s}),os=(s="")=>I.get(M+"/config/fetch?key="+s),cs=s=>I.post(M+"/config/save",s),Cd=()=>I.get(M+"/config/getEmailTemplate"),Sd=()=>I.post(M+"/config/testSendMail"),kd=()=>I.post(M+"/config/setTelegramWebhook"),Td=_c.sort,fr=ui,ia=c.forwardRef(({className:s,...t},a)=>e.jsx(jn,{ref:a,className:v("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...t}));ia.displayName=jn.displayName;const st=c.forwardRef(({className:s,...t},a)=>e.jsx(gn,{ref:a,className:v("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),...t}));st.displayName=gn.displayName;const Dd=c.forwardRef(({className:s,...t},a)=>e.jsx(fn,{ref:a,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...t}));Dd.displayName=fn.displayName;const G=xi,xs=bi,Y=mi,U=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(pn,{ref:n,className:v("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...a,children:[t,e.jsx(hi,{asChild:!0,children:e.jsx(ta,{className:"h-4 w-4 opacity-50"})})]}));U.displayName=pn.displayName;const pr=c.forwardRef(({className:s,...t},a)=>e.jsx(vn,{ref:a,className:v("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ji,{className:"h-4 w-4"})}));pr.displayName=vn.displayName;const vr=c.forwardRef(({className:s,...t},a)=>e.jsx(bn,{ref:a,className:v("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ta,{className:"h-4 w-4"})}));vr.displayName=bn.displayName;const B=c.forwardRef(({className:s,children:t,position:a="popper",...n},l)=>e.jsx(gi,{children:e.jsxs(yn,{ref:l,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:a,...n,children:[e.jsx(pr,{}),e.jsx(fi,{className:v("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(vr,{})]})}));B.displayName=yn.displayName;const Pd=c.forwardRef(({className:s,...t},a)=>e.jsx(Nn,{ref:a,className:v("px-2 py-1.5 text-sm font-semibold",s),...t}));Pd.displayName=Nn.displayName;const O=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(wn,{ref:n,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(pi,{children:e.jsx(ks,{className:"h-4 w-4"})})}),e.jsx(vi,{children:t})]}));O.displayName=wn.displayName;const Vd=c.forwardRef(({className:s,...t},a)=>e.jsx(_n,{ref:a,className:v("-mx-1 my-1 h-px bg-muted",s),...t}));Vd.displayName=_n.displayName;function Rs({className:s,classNames:t,showOutsideDays:a=!0,...n}){return e.jsx(yi,{showOutsideDays:a,className:v("p-3",s),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:v($s({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:v("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:v($s({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({className:l,...o})=>e.jsx(Cn,{className:v("h-4 w-4",l),...o}),IconRight:({className:l,...o})=>e.jsx(sa,{className:v("h-4 w-4",l),...o})},...n})}Rs.displayName="Calendar";const Ze=wi,Xe=_i,qe=c.forwardRef(({className:s,align:t="center",sideOffset:a=4,...n},l)=>e.jsx(Ni,{children:e.jsx(Sn,{ref:l,align:t,sideOffset:a,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n})}));qe.displayName=Sn.displayName;const ms={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},Ws=s=>(s/100).toFixed(2),Id=({active:s,payload:t,label:a})=>s&&t&&t.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:a}),t.map((n,l)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[n.name,":"]}),e.jsx("span",{className:"font-medium",children:n.name.includes("金额")?`¥${Ws(n.value)}`:`${n.value}笔`})]},l))]}):null,Rd=[{value:"7d",label:"最近7天"},{value:"30d",label:"最近30天"},{value:"90d",label:"最近90天"},{value:"180d",label:"最近180天"},{value:"365d",label:"最近一年"},{value:"custom",label:"自定义范围"}],Ed=(s,t)=>{const a=new Date;if(s==="custom"&&t)return{startDate:t.from,endDate:t.to};let n;switch(s){case"7d":n=Le(a,7);break;case"30d":n=Le(a,30);break;case"90d":n=Le(a,90);break;case"180d":n=Le(a,180);break;case"365d":n=Le(a,365);break;default:n=Le(a,30)}return{startDate:n,endDate:a}};function Fd(){const[s,t]=c.useState("amount"),[a,n]=c.useState("30d"),[l,o]=c.useState({from:Le(new Date,7),to:new Date}),{startDate:d,endDate:x}=Ed(a,l),{data:r}=Q({queryKey:["orderStat",{start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(x,"yyyy-MM-dd")}],queryFn:async()=>{const{data:i}=await Cc({start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(x,"yyyy-MM-dd")});return i},refetchInterval:3e4});return e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(gs,{children:"收入趋势"}),e.jsx(Xs,{children:`${r?.summary.start_date||""} 至 ${r?.summary.end_date||""}`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(G,{value:a,onValueChange:i=>n(i),children:[e.jsx(U,{className:"w-[120px]",children:e.jsx(Y,{placeholder:"选择时间范围"})}),e.jsx(B,{children:Rd.map(i=>e.jsx(O,{value:i.value,children:i.label},i.value))})]}),a==="custom"&&e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(W,{variant:"outline",className:v("min-w-0 justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(lt,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:l?.from?l.to?e.jsxs(e.Fragment,{children:[Pe(l.from,"yyyy-MM-dd")," -"," ",Pe(l.to,"yyyy-MM-dd")]}):Pe(l.from,"yyyy-MM-dd"):e.jsx("span",{children:"选择日期范围"})})]})}),e.jsx(qe,{className:"w-auto p-0",align:"end",children:e.jsx(Rs,{mode:"range",defaultMonth:l?.from,selected:{from:l?.from,to:l?.to},onSelect:i=>{i?.from&&i?.to&&o({from:i.from,to:i.to})},numberOfMonths:2})})]})]}),e.jsx(fr,{value:s,onValueChange:i=>t(i),children:e.jsxs(ia,{children:[e.jsx(st,{value:"amount",children:"金额"}),e.jsx(st,{value:"count",children:"笔数"})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总收入"}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ws(r?.summary?.paid_total||0)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["共 ",r?.summary?.paid_count||0," 笔"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["平均订单金额 ¥",Ws(r?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总佣金"}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ws(r?.summary?.commission_total||0)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["共 ",r?.summary?.commission_count||0," 笔"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["佣金比率 ",r?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]})]}),e.jsx(Qe,{children:e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(Ci,{width:"100%",height:"100%",children:e.jsxs(Si,{data:r?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ms.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:ms.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ms.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:ms.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(ki,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:i=>Pe(new Date(i),"MM-dd",{locale:Vi})}),e.jsx(Ti,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:i=>s==="amount"?`¥${Ws(i)}`:`${i}笔`}),e.jsx(Di,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(Pi,{content:e.jsx(Id,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(_a,{type:"monotone",dataKey:"paid_total",name:"收款金额",stroke:ms.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(_a,{type:"monotone",dataKey:"commission_total",name:"佣金金额",stroke:ms.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ca,{dataKey:"paid_count",name:"收款笔数",fill:ms.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Ca,{dataKey:"commission_count",name:"佣金笔数",fill:ms.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})})]})}function Ee({className:s,...t}){return e.jsx("div",{className:v("animate-pulse rounded-md bg-primary/10",s),...t})}function Md(){return e.jsxs($e,{children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ee,{className:"h-4 w-[100px]"}),e.jsx(Ee,{className:"h-4 w-4"})]}),e.jsxs(Qe,{children:[e.jsx(Ee,{className:"h-8 w-[120px]"}),e.jsx("div",{className:"flex items-center pt-1",children:e.jsx(Ee,{className:"h-4 w-[100px]"})})]})]})}function zd(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((s,t)=>e.jsx(Md,{},t))})}var ge=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(ge||{});const Ms={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Gs={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var as=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(as||{});const br={1:"新购",2:"续费",3:"升级",4:"流量重置"};var pe=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(pe||{});const dt={0:"待确认",1:"发放中",2:"有效",3:"无效"},ut={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var ne=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(ne||{});const tt={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var fe=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s))(fe||{});const ws=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"}],ts={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a"};var Rt=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(Rt||{});const oa={1:"按金额优惠",2:"按比例优惠"},Od={0:"正常",1:"锁定"};var Os=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Os||{});const Ld={0:"开启",1:"已关闭"};var ss=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(ss||{});const Qs={0:"低",1:"中",2:"高"};function hs({title:s,value:t,icon:a,trend:n,description:l,onClick:o,highlight:d,className:x}){return e.jsxs($e,{className:v("transition-colors",o&&"cursor-pointer hover:bg-muted/50",d&&"border-primary/50",x),onClick:o,children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gs,{className:"text-sm font-medium",children:s}),a]}),e.jsxs(Qe,{children:[e.jsx("div",{className:"text-2xl font-bold",children:t}),n?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(zi,{className:v("h-4 w-4",n.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:v("ml-1 text-xs",n.isPositive?"text-emerald-500":"text-red-500"),children:[n.isPositive?"+":"-",Math.abs(n.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:n.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:l})]})]})}function $d({className:s}){const t=ns(),{data:a,isLoading:n}=Q({queryKey:["dashboardStats"],queryFn:async()=>(await Sc()).data,refetchInterval:1e3*60*5});if(n||!a)return e.jsx(zd,{});const l=()=>{const o=new URLSearchParams;o.set("commission_status",pe.PENDING.toString()),o.set("status",ge.COMPLETED.toString()),o.set("commission_balance","gt:0"),t(`/finance/order?${o.toString()}`)};return e.jsxs("div",{className:v("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx(hs,{title:"今日收入",value:Ns(a.todayIncome),icon:e.jsx(Ii,{className:"h-4 w-4 text-emerald-500"}),trend:{value:a.dayIncomeGrowth,label:"vs 昨日",isPositive:a.dayIncomeGrowth>0}}),e.jsx(hs,{title:"本月收入",value:Ns(a.currentMonthIncome),icon:e.jsx(Ri,{className:"h-4 w-4 text-blue-500"}),trend:{value:a.monthIncomeGrowth,label:"vs 上月",isPositive:a.monthIncomeGrowth>0}}),e.jsx(hs,{title:"待处理工单",value:a.ticketPendingTotal,icon:e.jsx(Ei,{className:v("h-4 w-4",a.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:a.ticketPendingTotal>0?"有待处理的工单需要关注":"暂无待处理工单",onClick:()=>t("/user/ticket"),highlight:a.ticketPendingTotal>0}),e.jsx(hs,{title:"待处理佣金",value:a.commissionPendingTotal,icon:e.jsx(Fi,{className:v("h-4 w-4",a.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:a.commissionPendingTotal>0?"有待处理的佣金需要确认":"暂无待处理佣金",onClick:l,highlight:a.commissionPendingTotal>0}),e.jsx(hs,{title:"本月新增用户",value:a.currentMonthNewUsers,icon:e.jsx(At,{className:"h-4 w-4 text-blue-500"}),trend:{value:a.userGrowth,label:"vs 上月",isPositive:a.userGrowth>0}}),e.jsx(hs,{title:"总用户数",value:a.totalUsers,icon:e.jsx(At,{className:"h-4 w-4 text-muted-foreground"}),description:`有效用户: ${a.activeUsers}`}),e.jsx(hs,{title:"本月上行流量",value:Ye(a.monthTraffic.upload),icon:e.jsx(Ht,{className:"h-4 w-4 text-emerald-500"}),description:`今日: ${Ye(a.todayTraffic.upload)}`}),e.jsx(hs,{title:"本月下行流量",value:Ye(a.monthTraffic.download),icon:e.jsx(Mi,{className:"h-4 w-4 text-blue-500"}),description:`今日: ${Ye(a.todayTraffic.download)}`})]})}const at=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(kn,{ref:n,className:v("relative overflow-hidden",s),...a,children:[e.jsx(Oi,{className:"h-full w-full rounded-[inherit]",children:t}),e.jsx(wt,{}),e.jsx(Li,{})]}));at.displayName=kn.displayName;const wt=c.forwardRef(({className:s,orientation:t="vertical",...a},n)=>e.jsx(Tn,{ref:n,orientation:t,className:v("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...a,children:e.jsx($i,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=Tn.displayName;const Jt={today:{label:"今天",getValue:()=>{const s=Hi();return{start:s,end:Ki(s,1)}}},last7days:{label:"最近7天",getValue:()=>{const s=new Date;return{start:Le(s,7),end:s}}},last30days:{label:"最近30天",getValue:()=>{const s=new Date;return{start:Le(s,30),end:s}}},custom:{label:"自定义范围",getValue:()=>null}};function Oa({selectedRange:s,customDateRange:t,onRangeChange:a,onCustomRangeChange:n}){return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(G,{value:s,onValueChange:a,children:[e.jsx(U,{className:"w-[120px]",children:e.jsx(Y,{placeholder:"选择时间范围"})}),e.jsx(B,{position:"popper",className:"z-50",children:Object.entries(Jt).map(([l,{label:o}])=>e.jsx(O,{value:l,children:o},l))})]}),s==="custom"&&e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(W,{variant:"outline",className:v("min-w-0 justify-start text-left font-normal",!t&&"text-muted-foreground"),children:[e.jsx(lt,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:t?.from?t.to?e.jsxs(e.Fragment,{children:[Pe(t.from,"yyyy-MM-dd")," -"," ",Pe(t.to,"yyyy-MM-dd")]}):Pe(t.from,"yyyy-MM-dd"):e.jsx("span",{children:"选择日期范围"})})]})}),e.jsx(qe,{className:"w-auto p-0",align:"end",children:e.jsx(Rs,{mode:"range",defaultMonth:t?.from,selected:{from:t?.from,to:t?.to},onSelect:l=>{l?.from&&l?.to&&n({from:l.from,to:l.to})},numberOfMonths:2})})]})]})}const Fs=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function Ad({className:s}){const[t,a]=c.useState("today"),[n,l]=c.useState({from:Le(new Date,7),to:new Date}),[o,d]=c.useState("today"),[x,r]=c.useState({from:Le(new Date,7),to:new Date}),i=c.useMemo(()=>t==="custom"?{start:n.from,end:n.to}:Jt[t].getValue(),[t,n]),h=c.useMemo(()=>o==="custom"?{start:x.from,end:x.to}:Jt[o].getValue(),[o,x]),{data:D}=Q({queryKey:["nodeTrafficRank",i.start,i.end],queryFn:()=>Ma({type:"node",start_time:de.round(i.start.getTime()/1e3),end_time:de.round(i.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=Q({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>Ma({type:"user",start_time:de.round(h.start.getTime()/1e3),end_time:de.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:v("grid gap-4 md:grid-cols-2",s),children:[e.jsxs($e,{children:[e.jsx(Je,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(gs,{className:"flex items-center text-base font-medium",children:[e.jsx(Ai,{className:"mr-2 h-4 w-4"}),"节点流量排行"]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(Oa,{selectedRange:t,customDateRange:n,onRangeChange:a,onCustomRangeChange:l}),e.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Qe,{className:"flex-1",children:D?.data?e.jsxs(at,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:D.data.map(m=>e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:m.name}),e.jsxs("span",{className:v("ml-2 flex items-center text-xs font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?e.jsx(Kt,{className:"mr-1 h-3 w-3"}):e.jsx(qt,{className:"mr-1 h-3 w-3"}),Math.abs(m.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${m.value/D.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:Fs(m.value)})]})]})})}),e.jsx(ee,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"当前流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.value)}),e.jsx("span",{className:"text-muted-foreground",children:"上期流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.previousValue)}),e.jsx("span",{className:"text-muted-foreground",children:"变化率:"}),e.jsxs("span",{className:v("font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?"+":"",m.change,"%"]}),e.jsx("span",{className:"text-muted-foreground",children:"记录时间:"}),e.jsx("span",{className:"font-medium",children:Pe(new Date(m.timestamp),"yyyy-MM-dd HH:mm")})]})})]})},m.id))}),e.jsx(wt,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:"Loading..."})})})]}),e.jsxs($e,{children:[e.jsx(Je,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(gs,{className:"flex items-center text-base font-medium",children:[e.jsx(At,{className:"mr-2 h-4 w-4"}),"用户流量排行"]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(Oa,{selectedRange:o,customDateRange:x,onRangeChange:d,onCustomRangeChange:r}),e.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Qe,{className:"flex-1",children:C?.data?e.jsxs(at,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(m=>e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:m.name}),e.jsxs("span",{className:v("ml-2 flex items-center text-xs font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?e.jsx(Kt,{className:"mr-1 h-3 w-3"}):e.jsx(qt,{className:"mr-1 h-3 w-3"}),Math.abs(m.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${m.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:Fs(m.value)})]})]})})}),e.jsx(ee,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"当前流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.value)}),e.jsx("span",{className:"text-muted-foreground",children:"上期流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.previousValue)}),e.jsx("span",{className:"text-muted-foreground",children:"变化率:"}),e.jsxs("span",{className:v("font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?"+":"",m.change,"%"]}),e.jsx("span",{className:"text-muted-foreground",children:"记录时间:"}),e.jsx("span",{className:"font-medium",children:Pe(new Date(m.timestamp),"yyyy-MM-dd HH:mm")})]})})]})},m.id))}),e.jsx(wt,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:"Loading..."})})})]})]})}const Hd=Ss("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function L({className:s,variant:t,...a}){return e.jsx("div",{className:v(Hd({variant:t}),s),...a})}const pt=c.forwardRef(({className:s,value:t,...a},n)=>e.jsx(Dn,{ref:n,className:v("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...a,children:e.jsx(qi,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));pt.displayName=Dn.displayName;function Kd(){const[s,t]=c.useState(null),[a,n]=c.useState(null),[l,o]=c.useState(!0),[d,x]=c.useState(!1),r=async()=>{try{x(!0);const[D,C]=await Promise.all([Fa.getSystemStatus(),Fa.getQueueStats()]);t(D.data),n(C.data)}catch(D){console.error("Error fetching system data:",D)}finally{o(!1),x(!1)}};c.useEffect(()=>{r();const D=setInterval(r,3e4);return()=>clearInterval(D)},[]);const i=()=>{r()};if(l)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(aa,{className:"h-6 w-6 animate-spin"})});const h=D=>D?e.jsx(Pn,{className:"h-5 w-5 text-green-500"}):e.jsx(Vn,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs($e,{children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(gs,{className:"flex items-center gap-2",children:[e.jsx(Ui,{className:"h-5 w-5"}),"队列状态"]}),e.jsx(Xs,{children:"当前队列运行状态"})]}),e.jsx(W,{variant:"outline",size:"icon",onClick:i,disabled:d,children:e.jsx(Bi,{className:v("h-4 w-4",d&&"animate-spin")})})]}),e.jsx(Qe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[h(a?.status||!1),e.jsx("span",{className:"font-medium",children:"运行状态"})]}),e.jsx(L,{variant:a?.status?"secondary":"destructive",children:a?.status?"正常":"异常"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["当前等待时间:",a?.wait?.default||0," 秒"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"近期任务数"}),e.jsx("p",{className:"text-2xl font-bold",children:a?.recentJobs||0}),e.jsx(pt,{value:(a?.recentJobs||0)/(a?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ee,{children:e.jsxs("p",{children:["统计时间范围: ",a?.periods?.recentJobs||0," 小时"]})})]})}),e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"每分钟处理量"}),e.jsx("p",{className:"text-2xl font-bold",children:a?.jobsPerMinute||0}),e.jsx(pt,{value:(a?.jobsPerMinute||0)/(a?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ee,{children:e.jsxs("p",{children:["最高吞吐量:"," ",a?.queueWithMaxThroughput?.throughput||0]})})]})})]})]})})]}),e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsxs(gs,{className:"flex items-center gap-2",children:[e.jsx(Gi,{className:"h-5 w-5"}),"作业详情"]}),e.jsx(Xs,{children:"队列处理详细信息"})]}),e.jsx(Qe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"7日报错数量"}),e.jsx("p",{className:"text-2xl font-bold text-destructive",children:a?.failedJobs||0}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["保留 ",a?.periods?.failedJobs||0," 小时"]})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"最长运行队列"}),e.jsxs("p",{className:"text-2xl font-bold",children:[a?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"活跃进程"}),e.jsxs("span",{className:"font-medium",children:[a?.processes||0," /"," ",(a?.processes||0)+(a?.pausedMasters||0)]})]}),e.jsx(pt,{value:(a?.processes||0)/((a?.processes||0)+(a?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]})}function qd(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:"仪表盘"})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(ke,{}),e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsx(_e,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx($d,{}),e.jsx(Fd,{}),e.jsx(Ad,{}),e.jsx(Kd,{})]})})})]})}const Ud=Object.freeze(Object.defineProperty({__proto__:null,default:qd},Symbol.toStringTag,{value:"Module"})),je=c.forwardRef(({className:s,orientation:t="horizontal",decorative:a=!0,...n},l)=>e.jsx(In,{ref:l,decorative:a,orientation:t,className:v("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...n}));je.displayName=In.displayName;function Bd({className:s,items:t,...a}){const{pathname:n}=Zt(),l=ns(),[o,d]=c.useState(n??"/settings"),x=r=>{d(r),l(r)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(G,{value:o,onValueChange:x,children:[e.jsx(U,{className:"h-12 sm:w-48",children:e.jsx(Y,{placeholder:"Theme"})}),e.jsx(B,{children:t.map(r=>e.jsx(O,{value:r.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:r.icon}),e.jsx("span",{className:"text-md",children:r.title})]})},r.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:v("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...a,children:t.map(r=>e.jsxs(Ts,{to:r.href,className:v(As({variant:"ghost"}),n===r.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:r.icon}),r.title]},r.href))})})]})}const yr=[{title:"站点设置",key:"site",icon:e.jsx(Yi,{size:18}),href:"/config/system",description:"配置站点基本信息,包括站点名称、描述、货币单位等核心设置。"},{title:"安全设置",key:"safe",icon:e.jsx(dn,{size:18}),href:"/config/system/safe",description:"配置系统安全相关选项,包括登录验证、密码策略、API访问等安全设置。"},{title:"订阅设置",key:"subscribe",icon:e.jsx(un,{size:18}),href:"/config/system/subscribe",description:"管理用户订阅相关配置,包括订阅链接格式、更新频率、流量统计等设置。"},{title:"邀请&佣金",key:"invite",icon:e.jsx(Wi,{size:18}),href:"/config/system/invite",description:"管理用户邀请和佣金系统,配置邀请奖励、分销规则等。"},{title:"节点配置",key:"server",icon:e.jsx(cn,{size:18}),href:"/config/system/server",description:"配置节点通信和同步设置,包括通信密钥、轮询间隔、负载均衡等高级选项。"},{title:"邮件设置",key:"email",icon:e.jsx(Ji,{size:18}),href:"/config/system/email",description:"配置系统邮件服务,用于发送验证码、密码重置、通知等邮件,支持多种SMTP服务商。"},{title:"Telegram设置",key:"telegram",icon:e.jsx(Qi,{size:18}),href:"/config/system/telegram",description:"配置Telegram机器人功能,实现用户通知、账户绑定、指令交互等自动化服务。"},{title:"APP设置",key:"app",icon:e.jsx(on,{size:18}),href:"/config/system/app",description:"管理移动应用程序相关配置,包括API接口、版本控制、推送通知等功能设置。"}];function Gd(){return e.jsxs(ye,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:"系统设置"}),e.jsx("div",{className:"text-muted-foreground",children:"管理系统核心配置,包括站点、安全、订阅、邀请佣金、节点、邮件和通知等设置"})]}),e.jsx(je,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(Bd,{items:yr})}),e.jsx("div",{className:"w-full p-1 pr-4 lg:max-w-xl",children:e.jsx("div",{className:"pb-16",children:e.jsx(Xt,{})})})]})]})]})}const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Gd},Symbol.toStringTag,{value:"Module"}));function Wd({title:s,description:t,children:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),e.jsx(je,{}),a]})}const H=c.forwardRef(({className:s,...t},a)=>e.jsx(Rn,{className:v("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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...t,ref:a,children:e.jsx(Zi,{className:v("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));H.displayName=Rn.displayName;const bs=c.forwardRef(({className:s,...t},a)=>e.jsx("textarea",{className:v("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:a,...t}));bs.displayName="Textarea";const Jd=u.object({logo:u.string().nullable().default(""),force_https:u.number().nullable().default(0),stop_register:u.number().nullable().default(0),app_name:u.string().nullable().default(""),app_description:u.string().nullable().default(""),app_url:u.string().nullable().default(""),subscribe_url:u.string().nullable().default(""),try_out_plan_id:u.number().nullable().default(0),try_out_hour:u.coerce.number().nullable().default(0),tos_url:u.string().nullable().default(""),currency:u.string().nullable().default(""),currency_symbol:u.string().nullable().default("")});function Qd(){const[s,t]=c.useState(!1),a=c.useRef(null),{data:n}=Q({queryKey:["settings","site"],queryFn:()=>os("site")}),{data:l}=Q({queryKey:["plans"],queryFn:()=>Is()}),o=ae({resolver:ie(Jd),defaultValues:{},mode:"onBlur"}),{mutateAsync:d}=We({mutationFn:cs,onSuccess:i=>{i.data&&A.success("已自动保存")}});c.useEffect(()=>{if(n?.data?.site){const i=n?.data?.site;Object.entries(i).forEach(([h,D])=>{o.setValue(h,D)}),a.current=i}},[n]);const x=c.useCallback(de.debounce(async i=>{if(!de.isEqual(i,a.current)){t(!0);try{const h=Object.entries(i).reduce((D,[C,m])=>(D[C]=m===null?"":m,D),{});await d(h),a.current=i}finally{t(!1)}}},1e3),[d]),r=c.useCallback(i=>{x(i)},[x]);return c.useEffect(()=>{const i=o.watch(h=>{r(h)});return()=>i.unsubscribe()},[o.watch,r]),e.jsx(oe,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:o.control,name:"app_name",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点名称",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要站点名称的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"app_description",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点描述"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点描述",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要站点描述的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"app_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点网址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"当前网站最新网址,将会在邮件等需要用于网址处体现。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"force_https",render:({field:i})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"强制HTTPS"}),e.jsx(F,{children:"当站点没有使用HTTPS,CDN或反代开启强制HTTPS时需要开启。"})]}),e.jsx(y,{children:e.jsx(H,{checked:!!i.value,onCheckedChange:h=>{i.onChange(Number(h)),r(o.getValues())}})})]})}),e.jsx(g,{control:o.control,name:"logo",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"LOGO"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入LOGO URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要LOGO的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"subscribe_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"订阅URL"}),e.jsx(y,{children:e.jsx(bs,{placeholder:"用于订阅所使用,多个订阅地址用','隔开.留空则为站点URL。",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于订阅所使用,留空则为站点URL。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"tos_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"用户条款(TOS)URL"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入用户条款URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于跳转到用户条款(TOS)"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"stop_register",render:({field:i})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"停止新用户注册"}),e.jsx(F,{children:"开启后任何人都将无法进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:!!i.value,onCheckedChange:h=>{i.onChange(Number(h)),r(o.getValues())}})})]})}),e.jsx(g,{control:o.control,name:"try_out_plan_id",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"注册试用"}),e.jsx(y,{children:e.jsxs(G,{value:i.value?.toString(),onValueChange:h=>{i.onChange(Number(h)),r(o.getValues())},children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"关闭"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"关闭"}),l?.data?.map(h=>e.jsx(O,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(F,{children:"选择需要试用的订阅,如果没有选项请先前往订阅管理添加。"}),e.jsx(k,{})]})}),!!o.watch("try_out_plan_id")&&e.jsx(g,{control:o.control,name:"try_out_hour",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"",children:"注册试用时长"}),e.jsx(y,{children:e.jsx(S,{placeholder:"0",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"注册试用时长,单位为小时。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"currency",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"货币单位"}),e.jsx(y,{children:e.jsx(S,{placeholder:"CNY",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"仅用于展示使用,更改后系统中所有的货币单位都将发生变更。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"currency_symbol",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"货币符号"}),e.jsx(y,{children:e.jsx(S,{placeholder:"¥",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"仅用于展示使用,更改后系统中所有的货币单位都将发生变更。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Zd(){const s=yr.find(t=>t.key==="site");return e.jsx(Wd,{title:s.title,description:s.description,children:e.jsx(Qd,{})})}const Xd=Object.freeze(Object.defineProperty({__proto__:null,default:Zd},Symbol.toStringTag,{value:"Module"})),eu=u.object({email_verify:u.boolean().nullable(),safe_mode_enable:u.boolean().nullable(),secure_path:u.string().nullable(),email_whitelist_enable:u.boolean().nullable(),email_whitelist_suffix:u.array(u.string().nullable()).nullable(),email_gmail_limit_enable:u.boolean().nullable(),recaptcha_enable:u.boolean().nullable(),recaptcha_key:u.string().nullable(),recaptcha_site_key:u.string().nullable(),register_limit_by_ip_enable:u.boolean().nullable(),register_limit_count:u.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:u.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:u.boolean().nullable(),password_limit_count:u.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:u.coerce.string().transform(s=>s===""?null:s).nullable()}),su={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function tu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(eu),defaultValues:su,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","safe"],queryFn:()=>os("safe")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.safe){const r=l.data.safe;Object.entries(r).forEach(([i,h])=>{typeof h=="number"?n.setValue(i,String(h)):n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"email_verify",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮箱验证"}),e.jsx(F,{children:"开启后将会强制要求用户进行邮箱验证。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"email_gmail_limit_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"禁止使用Gmail多别名"}),e.jsx(F,{children:"开启后Gmail多别名将无法注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"safe_mode_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"安全模式"}),e.jsx(F,{children:"开启后除了站点URL以外的绑定本站点的域名访问都将会被403。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"secure_path",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"后台路径"}),e.jsx(y,{children:e.jsx(S,{placeholder:"admin",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(F,{children:"后台管理路径,修改后将会改变原有的admin路径"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"email_whitelist_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮箱后缀白名单"}),e.jsx(F,{children:"开启后在名单中的邮箱后缀才允许进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("email_whitelist_enable")&&e.jsx(g,{control:n.control,name:"email_whitelist_suffix",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"白名单后缀"}),e.jsx(y,{children:e.jsx(bs,{placeholder:"请输入后缀域名,逗号分割 如:qq.com,gmail.com",value:r.value?.length?r.value.join(","):"",onChange:i=>{const h=i.target.value?i.target.value.split(","):[];r.onChange(h),x(n.getValues())}})}),e.jsx(F,{children:"请使用逗号进行分割,如:qq.com,gmail.com。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"recaptcha_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"防机器人"}),e.jsx(F,{children:"开启后将会使用Google reCAPTCHA防止机器人。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"recaptcha_key",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入密钥",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"recaptcha_site_key",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"站点密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点密钥",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:n.control,name:"register_limit_by_ip_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"IP注册限制"}),e.jsx(F,{children:"开启后同一IP将会被限制注册次数。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"register_limit_count",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制次数"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制次数",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"register_limit_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制时长(分钟)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制时长",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:n.control,name:"password_limit_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"密码错误限制"}),e.jsx(F,{children:"开启后密码错误将会被限制登录。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"password_limit_count",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制次数"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制次数",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"password_limit_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制时长(分钟)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制时长",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function au(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"安全设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置系统安全相关选项,包括登录验证、密码策略、API访问等安全设置。"})]}),e.jsx(je,{}),e.jsx(tu,{})]})}const nu=Object.freeze(Object.defineProperty({__proto__:null,default:au},Symbol.toStringTag,{value:"Module"})),ru=u.object({plan_change_enable:u.boolean().nullable().default(!1),reset_traffic_method:u.coerce.number().nullable().default(0),surplus_enable:u.boolean().nullable().default(!1),new_order_event_id:u.coerce.number().nullable().default(0),renew_order_event_id:u.coerce.number().nullable().default(0),change_order_event_id:u.coerce.number().nullable().default(0),show_info_to_server_enable:u.boolean().nullable().default(!1),show_protocol_to_server_enable:u.boolean().nullable().default(!1),default_remind_expire:u.boolean().nullable().default(!1),default_remind_traffic:u.boolean().nullable().default(!1),remind_mail_enable:u.boolean().nullable().default(!1),subscribe_path:u.string().nullable().default("s")}),lu={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,remind_mail_enable:!1,subscribe_path:"s"};function iu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(ru),defaultValues:lu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","subscribe"],queryFn:()=>os("subscribe")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data?.subscribe){const r=l?.data?.subscribe;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"plan_change_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"允许用户更改订阅"}),e.jsx(F,{children:"开启后用户将会可以对订阅计划进行变更。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"reset_traffic_method",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"月流量重置方式"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"每月1号"}),e.jsx(O,{value:"1",children:"按月重置"}),e.jsx(O,{value:"2",children:"不重置"}),e.jsx(O,{value:"3",children:"每年1月1号"}),e.jsx(O,{value:"4",children:"按年重置"})]})]})})}),e.jsx(F,{children:"全局流量重置方式,默认每月1号。可以在订阅管理为订阅单独设置。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"surplus_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"开启折抵方案"}),e.jsx(F,{children:"开启后用户更换订阅将会由系统对原有订阅进行折抵,方案参考文档。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"new_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅新购时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"新购订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"renew_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅续费时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"续费订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"change_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅变更时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"变更订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"subscribe_path",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"订阅路径"}),e.jsx(y,{children:e.jsx(S,{placeholder:"subscribe",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["订阅路径,修改后将会改变原有的subscribe路径",e.jsx("br",{}),"当前订阅路径格式:",r.value?`${r.value}/xxxxxxxxxx`:"s/xxxxxxxxxx"]}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"show_info_to_server_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"在订阅中展示订阅信息"}),e.jsx(F,{children:"开启后将会在用户订阅节点时输出订阅信息。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"show_protocol_to_server_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"在订阅中线路名称中显示协议名称"}),e.jsx(F,{children:"开启后订阅线路会附带协议名称(例如: [Hy2]香港)"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"remind_mail_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮件提醒"}),e.jsx(F,{children:"开启后用户订阅即将到期时和流量告急时时将发送邮件通知。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function ou(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"订阅设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"管理用户订阅相关配置,包括订阅链接格式、更新频率、流量统计等设置。"})]}),e.jsx(je,{}),e.jsx(iu,{})]})}const cu=Object.freeze(Object.defineProperty({__proto__:null,default:ou},Symbol.toStringTag,{value:"Module"})),du=u.object({invite_force:u.boolean().default(!1),invite_commission:u.coerce.string().default("0"),invite_gen_limit:u.coerce.string().default("0"),invite_never_expire:u.boolean().default(!1),commission_first_time_enable:u.boolean().default(!1),commission_auto_check_enable:u.boolean().default(!1),commission_withdraw_limit:u.coerce.string().default("0"),commission_withdraw_method:u.array(u.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:u.boolean().default(!1),commission_distribution_enable:u.boolean().default(!1),commission_distribution_l1:u.coerce.number().default(0),commission_distribution_l2:u.coerce.number().default(0),commission_distribution_l3:u.coerce.number().default(0)}),uu={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function xu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(du),defaultValues:uu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","invite"],queryFn:()=>os("invite")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data?.invite){const r=l?.data?.invite;Object.entries(r).forEach(([i,h])=>{typeof h=="number"?n.setValue(i,String(h)):n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"invite_force",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"开启强制邀请"}),e.jsx(F,{children:"开启后只有被邀请的用户才可以进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"invite_commission",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:" 邀请佣金百分比"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"默认全局的佣金分配比例,你可以在用户管理单独配置单个比例。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"invite_gen_limit",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"用户可创建邀请码上限"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"用户可创建邀请码上限"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"invite_never_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邀请码永不失效"}),e.jsx(F,{children:"开启后邀请码被使用后将不会失效,否则使用过后即失效。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_first_time_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"佣金仅首次发放"}),e.jsx(F,{children:"开启后被邀请人首次支付时才会产生佣金,可以在用户管理对用户进行单独配置。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_auto_check_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"佣金自动确认"}),e.jsx(F,{children:"开启后佣金将会在订单完成3日后自动进行确认。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_withdraw_limit",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"提现单申请门槛(元)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"小于门槛金额的提现单将不会被提交。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_withdraw_method",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"提现方式"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:Array.isArray(r.value)?r.value.join(","):"",onChange:i=>{const h=i.target.value.split(",").filter(Boolean);r.onChange(h),x(n.getValues())}})}),e.jsx(F,{children:"可以支持的提现方式,多个用逗号分隔。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"withdraw_close_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"关闭提现"}),e.jsx(F,{children:"关闭后将禁止用户申请提现,且邀请佣金将会直接进入用户余额。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"三级分销"}),e.jsx(F,{children:"开启后将佣金将按照设置的3成比例进行分成,三成比例合计请不要大于100%。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"commission_distribution_l1",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"一级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_l2",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"二级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_l3",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"三级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function mu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"邀请&佣金设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"邀请注册、佣金相关设置。"})]}),e.jsx(je,{}),e.jsx(xu,{})]})}const hu=Object.freeze(Object.defineProperty({__proto__:null,default:mu},Symbol.toStringTag,{value:"Module"})),ju=u.object({frontend_theme:u.string().nullable(),frontend_theme_sidebar:u.string().nullable(),frontend_theme_header:u.string().nullable(),frontend_theme_color:u.string().nullable(),frontend_background_url:u.string().url().nullable()}),gu={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function fu(){const{data:s}=Q({queryKey:["settings","frontend"],queryFn:()=>os("frontend")}),t=ae({resolver:ie(ju),defaultValues:gu,mode:"onChange"});c.useEffect(()=>{if(s?.data?.frontend){const n=s?.data?.frontend;Object.entries(n).forEach(([l,o])=>{t.setValue(l,o)})}},[s]);function a(n){cs(n).then(({data:l})=>{l&&A.success("更新成功")})}return e.jsx(oe,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(a),className:"space-y-8",children:[e.jsx(g,{control:t.control,name:"frontend_theme_sidebar",render:({field:n})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"边栏风格"}),e.jsx(F,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(H,{checked:n.value,onCheckedChange:n.onChange})})]})}),e.jsx(g,{control:t.control,name:"frontend_theme_header",render:({field:n})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"头部风格"}),e.jsx(F,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(H,{checked:n.value,onCheckedChange:n.onChange})})]})}),e.jsx(g,{control:t.control,name:"frontend_theme_color",render:({field:n})=>e.jsxs(j,{children:[e.jsx(p,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(y,{children:e.jsxs("select",{className:v(As({variant:"outline"}),"w-[200px] appearance-none font-normal"),...n,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(ta,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(F,{children:"主题色"}),e.jsx(k,{})]})}),e.jsx(g,{control:t.control,name:"frontend_background_url",render:({field:n})=>e.jsxs(j,{children:[e.jsx(p,{children:"背景"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入图片地址",...n})}),e.jsx(F,{children:"将会在后台登录页面进行展示。"}),e.jsx(k,{})]})}),e.jsx(T,{type:"submit",children:"保存设置"})]})})}function pu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(je,{}),e.jsx(fu,{})]})}const vu=Object.freeze(Object.defineProperty({__proto__:null,default:pu},Symbol.toStringTag,{value:"Module"})),bu=u.object({server_pull_interval:u.coerce.number().nullable(),server_push_interval:u.coerce.number().nullable(),server_token:u.string().nullable(),device_limit_mode:u.coerce.number().nullable()}),yu={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function Nu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(bu),defaultValues:yu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","server"],queryFn:()=>os("server")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.server){const r=l.data.server;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"server_token",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"通讯密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"Xboard与节点通讯的密钥,以便数据不会被他人获取。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"server_pull_interval",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"节点拉取动作轮询间隔"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):null;r.onChange(h)}})}),e.jsx(F,{children:"节点从面板获取数据的间隔频率。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"server_push_interval",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"节点推送动作轮询间隔"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):null;r.onChange(h)}})}),e.jsx(F,{children:"节点推送数据到面板的间隔频率。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"device_limit_mode",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"设备限制模式"}),e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择设备限制模式"})})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"严格模式"}),e.jsx(O,{value:"1",children:"宽松模式"})]})]}),e.jsx(F,{children:"宽松模式下,同一IP地址使用多个节点只统计为一个设备。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function wu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"节点配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置节点通信和同步设置,包括通信密钥、轮询间隔、负载均衡等高级选项。"})]}),e.jsx(je,{}),e.jsx(Nu,{})]})}const _u=Object.freeze(Object.defineProperty({__proto__:null,default:wu},Symbol.toStringTag,{value:"Module"}));function Cu({open:s,onOpenChange:t,result:a}){const n=!a.error;return e.jsx(ue,{open:s,onOpenChange:t,children:e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[n?e.jsx(Pn,{className:"h-5 w-5 text-green-500"}):e.jsx(Vn,{className:"h-5 w-5 text-destructive"}),e.jsx(xe,{children:n?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Se,{children:n?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:a.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:a.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:a.template_name})]})]}),a.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:a.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(at,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:a.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:a.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:a.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:a.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:a.config.from.address?`${a.config.from.address}${a.config.from.name?` (${a.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:a.config.username||"未设置"})]})})})]})]})]})})}const Su=u.object({email_template:u.string().nullable().default("classic"),email_host:u.string().nullable().default(""),email_port:u.string().regex(/^\d+$/).nullable().default("465"),email_username:u.string().nullable().default(""),email_password:u.string().nullable().default(""),email_encryption:u.string().nullable().default(""),email_from_address:u.string().email().nullable().default("")});function ku(){const[s,t]=c.useState(null),[a,n]=c.useState(!1),l=c.useRef(null),[o,d]=c.useState(!1),x=ae({resolver:ie(Su),defaultValues:{},mode:"onBlur"}),{data:r}=Q({queryKey:["settings","email"],queryFn:()=>os("email")}),{data:i}=Q({queryKey:["emailTemplate"],queryFn:()=>Cd()}),{mutateAsync:h}=We({mutationFn:cs,onSuccess:_=>{_.data&&A.success("已自动保存")}}),{mutate:D,isPending:C}=We({mutationFn:Sd,onMutate:()=>{t(null),n(!1)},onSuccess:_=>{t(_.data),n(!0),_.data.error||A.success("发送成功")}});c.useEffect(()=>{if(r?.data.email){const _=r.data.email;Object.entries(_).forEach(([b,N])=>{x.setValue(b,N)}),l.current=_}},[r]);const m=c.useCallback(de.debounce(async _=>{if(!de.isEqual(_,l.current)){d(!0);try{await h(_),l.current=_}finally{d(!1)}}},1e3),[h]),w=c.useCallback(_=>{m(_)},[m]);return c.useEffect(()=>{const _=x.watch(b=>{w(b)});return()=>_.unsubscribe()},[x.watch,w]),e.jsxs(e.Fragment,{children:[e.jsx(oe,{...x,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:x.control,name:"email_host",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP服务器地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的服务地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_port",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP服务端口"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"常见的端口有25, 465, 587"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_encryption",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP加密方式"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"465端口加密方式一般为SSL,587端口加密方式一般为TLS"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_username",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP账号"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的账号"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_password",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP密码"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||"",type:"password"})}),e.jsx(F,{children:"由邮件服务商提供的密码"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_from_address",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"发件地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的发件地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_template",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"邮件模板"}),e.jsxs(G,{onValueChange:b=>{_.onChange(b),w(x.getValues())},value:_.value||void 0,children:[e.jsx(y,{children:e.jsx(U,{className:"w-[200px]",children:e.jsx(Y,{placeholder:"选择邮件模板"})})}),e.jsx(B,{children:i?.data?.map(b=>e.jsx(O,{value:b,children:b},b))})]}),e.jsx(F,{children:"你可以在文档查看如何自定义邮件模板"}),e.jsx(k,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(T,{onClick:()=>D(),loading:C,disabled:C,children:C?"发送中...":"发送测试邮件"})})]})}),o&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."}),s&&e.jsx(Cu,{open:a,onOpenChange:n,result:s})]})}function Tu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"邮件设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置系统邮件服务,用于发送验证码、密码重置、通知等邮件,支持多种SMTP服务商。"})]}),e.jsx(je,{}),e.jsx(ku,{})]})}const Du=Object.freeze(Object.defineProperty({__proto__:null,default:Tu},Symbol.toStringTag,{value:"Module"})),Pu=u.object({telegram_bot_enable:u.boolean().nullable(),telegram_bot_token:u.string().nullable(),telegram_discuss_link:u.string().nullable()}),Vu={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function Iu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(Pu),defaultValues:Vu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","telegram"],queryFn:()=>os("telegram")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:h=>{h.data&&A.success("已自动保存")}}),{mutate:d,isPending:x}=We({mutationFn:kd,onSuccess:h=>{h.data&&A.success("Webhook设置成功")}});c.useEffect(()=>{if(l?.data.telegram){const h=l.data.telegram;Object.entries(h).forEach(([D,C])=>{n.setValue(D,C)}),a.current=h}},[l]);const r=c.useCallback(de.debounce(async h=>{if(!de.isEqual(h,a.current)){t(!0);try{await o(h),a.current=h}finally{t(!1)}}},1e3),[o]),i=c.useCallback(h=>{r(h)},[r]);return c.useEffect(()=>{const h=n.watch(D=>{i(D)});return()=>h.unsubscribe()},[n.watch,i]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"机器人Token"}),e.jsx(y,{children:e.jsx(S,{placeholder:"0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",...h,value:h.value||""})}),e.jsx(F,{children:"请输入由Botfather提供的token。"}),e.jsx(k,{})]})}),n.watch("telegram_bot_token")&&e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"设置Webhook"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(T,{loading:x,disabled:x,onClick:()=>d(),children:x?"Webhook设置中...":"一键设置"}),s&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"保存中..."})]}),e.jsx(F,{children:"对机器人进行Webhook设置,不设置将无法收到Telegram通知。"}),e.jsx(k,{})]}),e.jsx(g,{control:n.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"开启机器人通知"}),e.jsx(F,{children:"开启后bot将会对绑定了telegram的管理员和用户进行基础通知。"}),e.jsx(y,{children:e.jsx(H,{checked:h.value||!1,onCheckedChange:D=>{h.onChange(D),i(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"群组地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://t.me/xxxxxx",...h,value:h.value||""})}),e.jsx(F,{children:"填写后将会在用户端展示,或者被用于需要的地方。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Ru(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Telegram设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置Telegram机器人功能,实现用户通知、账户绑定、指令交互等自动化服务。"})]}),e.jsx(je,{}),e.jsx(Iu,{})]})}const Eu=Object.freeze(Object.defineProperty({__proto__:null,default:Ru},Symbol.toStringTag,{value:"Module"})),Fu=u.object({windows_version:u.string().nullable(),windows_download_url:u.string().nullable(),macos_version:u.string().nullable(),macos_download_url:u.string().nullable(),android_version:u.string().nullable(),android_download_url:u.string().nullable()}),Mu={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function zu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(Fu),defaultValues:Mu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","app"],queryFn:()=>os("app")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.app){const r=l.data.app;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Windows"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"Windows端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"windows_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"windows_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.exe",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"macOS"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"macOS端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"macos_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"macos_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.dmg",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Android"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"Android端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"android_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"android_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.apk",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Ou(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"APP设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"管理移动应用程序相关配置,包括API接口、版本控制、推送通知等功能设置。"})]}),e.jsx(je,{}),e.jsx(zu,{})]})}const Lu=Object.freeze(Object.defineProperty({__proto__:null,default:Ou},Symbol.toStringTag,{value:"Module"})),ca=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:a,className:v("w-full caption-bottom text-sm",s),...t})}));ca.displayName="Table";const da=c.forwardRef(({className:s,...t},a)=>e.jsx("thead",{ref:a,className:v("[&_tr]:border-b",s),...t}));da.displayName="TableHeader";const ua=c.forwardRef(({className:s,...t},a)=>e.jsx("tbody",{ref:a,className:v("[&_tr:last-child]:border-0",s),...t}));ua.displayName="TableBody";const $u=c.forwardRef(({className:s,...t},a)=>e.jsx("tfoot",{ref:a,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...t}));$u.displayName="TableFooter";const js=c.forwardRef(({className:s,...t},a)=>e.jsx("tr",{ref:a,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...t}));js.displayName="TableRow";const xa=c.forwardRef(({className:s,...t},a)=>e.jsx("th",{ref:a,className:v("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t}));xa.displayName="TableHead";const Ls=c.forwardRef(({className:s,...t},a)=>e.jsx("td",{ref:a,className:v("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t}));Ls.displayName="TableCell";const Au=c.forwardRef(({className:s,...t},a)=>e.jsx("caption",{ref:a,className:v("mt-4 text-sm text-muted-foreground",s),...t}));Au.displayName="TableCaption";function Hu({table:s}){const[t,a]=c.useState("");c.useEffect(()=>{a((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const n=l=>{const o=parseInt(l);!isNaN(o)&&o>=1&&o<=s.getPageCount()?s.setPageIndex(o-1):a((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:["已选择 ",s.getFilteredSelectedRowModel().rows.length," 项, 共"," ",s.getFilteredRowModel().rows.length," 项"]}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"每页显示"}),e.jsxs(G,{value:`${s.getState().pagination.pageSize}`,onValueChange:l=>{s.setPageSize(Number(l))},children:[e.jsx(U,{className:"h-8 w-[70px]",children:e.jsx(Y,{placeholder:s.getState().pagination.pageSize})}),e.jsx(B,{side:"top",children:[10,20,30,40,50,100,500].map(l=>e.jsx(O,{value:`${l}`,children:l},l))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:"第"}),e.jsx(S,{type:"text",value:t,onChange:l=>a(l.target.value),onBlur:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&n(l.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsxs("span",{children:["页,共 ",s.getPageCount()," 页"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(T,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"跳转到第一页"}),e.jsx(Xi,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"上一页"}),e.jsx(Cn,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"下一页"}),e.jsx(sa,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"跳转到最后一页"}),e.jsx(eo,{className:"h-4 w-4"})]})]})]})]})}function Ue({table:s,toolbar:t,draggable:a=!1,onDragStart:n,onDragEnd:l,onDragOver:o,onDragLeave:d,onDrop:x,showPagination:r=!0,isLoading:i=!1}){const h=c.useRef(null),D=s.getAllColumns().filter(_=>_.getIsPinned()==="left"),C=s.getAllColumns().filter(_=>_.getIsPinned()==="right"),m=_=>D.slice(0,_).reduce((b,N)=>b+(N.getSize()??0),0),w=_=>C.slice(_+1).reduce((b,N)=>b+(N.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof t=="function"?t(s):t,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(ca,{children:[e.jsx(da,{children:s.getHeaderGroups().map(_=>e.jsx(js,{className:"hover:bg-transparent",children:_.headers.map((b,N)=>{const P=b.column.getIsPinned()==="left",f=b.column.getIsPinned()==="right",R=P?m(D.indexOf(b.column)):void 0,z=f?w(C.indexOf(b.column)):void 0;return e.jsx(xa,{colSpan:b.colSpan,style:{width:b.getSize(),...P&&{left:R},...f&&{right:z}},className:v("h-11 bg-card px-4 text-muted-foreground",(P||f)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",P&&"before:right-0",f&&"before:left-0"]),children:b.isPlaceholder?null:vt(b.column.columnDef.header,b.getContext())},b.id)})},_.id))}),e.jsx(ua,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((_,b)=>e.jsx(js,{"data-state":_.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:a,onDragStart:N=>n?.(N,b),onDragEnd:l,onDragOver:o,onDragLeave:d,onDrop:N=>x?.(N,b),children:_.getVisibleCells().map((N,P)=>{const f=N.column.getIsPinned()==="left",R=N.column.getIsPinned()==="right",z=f?m(D.indexOf(N.column)):void 0,$=R?w(C.indexOf(N.column)):void 0;return e.jsx(Ls,{style:{width:N.column.getSize(),...f&&{left:z},...R&&{right:$}},className:v("bg-card",(f||R)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",f&&"before:right-0",R&&"before:left-0"]),children:vt(N.column.columnDef.cell,N.getContext())},N.id)})},_.id)):e.jsx(js,{children:e.jsx(Ls,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:"暂无数据"})})})]})})}),r&&e.jsx(Hu,{table:s})]})}const Nr=(s,t)=>{let a=null;switch(s.field_type){case"input":a=e.jsx(S,{placeholder:s.placeholder,...t});break;case"textarea":a=e.jsx(bs,{placeholder:s.placeholder,...t});break;case"select":a=e.jsx("select",{className:v($s({variant:"outline"}),"w-full appearance-none font-normal"),...t,children:s.select_options&&Object.keys(s.select_options).map(n=>e.jsx("option",{value:n,children:s.select_options?.[n]},n))});break;default:a=null;break}return a},Ku=u.object({id:u.number().nullable(),name:u.string().min(2,"名称至少需要2个字符").max(30,"名称不能超过30个字符"),icon:u.string().optional().nullable(),notify_domain:u.string().refine(s=>!s||/^https?:\/\/\S+/.test(s),"请输入有效的URL").optional().nullable(),handling_fee_fixed:u.coerce.number().min(0).optional().nullable(),handling_fee_percent:u.coerce.number().min(0).max(100).optional().nullable(),payment:u.string().min(1,"请选择支付接口"),config:u.record(u.string(),u.string())}),La={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function wr({refetch:s,dialogTrigger:t,type:a="add",defaultFormValues:n=La}){const[l,o]=c.useState(!1),[d,x]=c.useState(!1),[r,i]=c.useState([]),[h,D]=c.useState([]),C=ae({resolver:ie(Ku),defaultValues:n,mode:"onChange"}),m=C.watch("payment");c.useEffect(()=>{l&&(async()=>{const{data:b}=await Kc();i(b)})()},[l]),c.useEffect(()=>{if(!m||!l)return;(async()=>{const b={payment:m,...a==="edit"&&{id:Number(C.getValues("id"))}};qc(b).then(({data:N})=>{D(N);const P=N.reduce((f,R)=>(R.field_name&&(f[R.field_name]=R.value??""),f),{});C.setValue("config",P)})})()},[m,l,C,a]);const w=async _=>{x(!0),(await Uc(_)).data&&(A.success("保存成功"),C.reset(La),s(),o(!1)),x(!1)};return e.jsxs(ue,{open:l,onOpenChange:o,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加支付方式"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsx(he,{children:e.jsx(xe,{children:a==="add"?"添加支付方式":"编辑支付方式"})}),e.jsx(oe,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(w),className:"space-y-4",children:[e.jsx(g,{control:C.control,name:"name",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入支付名称",..._})}),e.jsx(F,{children:"用于前端显示"}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"icon",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"图标URL"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://example.com/icon.svg",..._})}),e.jsx(F,{children:"用于前端显示的图标地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"notify_domain",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"通知域名"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://example.com",..._})}),e.jsx(F,{children:"网关通知将发送到该域名"}),e.jsx(k,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(g,{control:C.control,name:"handling_fee_percent",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"百分比手续费(%)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0-100",..._})}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"handling_fee_fixed",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"固定手续费"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0",..._})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:C.control,name:"payment",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"支付接口"}),e.jsxs(G,{value:_.value,onValueChange:_.onChange,children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择支付接口"})})}),e.jsx(B,{children:r.map(b=>e.jsx(O,{value:b,children:b},b))})]}),e.jsx(k,{})]})}),h.map(_=>e.jsx(g,{control:C.control,name:`config.${_.field_name}`,render:({field:b})=>e.jsxs(j,{children:[e.jsx(p,{children:_.label}),e.jsx(y,{children:Nr(_,b)}),e.jsx(k,{})]})},_.field_name)),e.jsxs(Re,{className:"gap-2",children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",disabled:d,className:v(d&&"cursor-not-allowed opacity-50"),children:d?"保存中...":"提交"})]})]})})]})]})}function V({column:s,title:t,tooltip:a,className:n}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(T,{variant:"ghost",size:"default",className:v("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",n),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:t}),a&&e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ka,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(ee,{children:a})]})}),s.getIsSorted()==="asc"?e.jsx(Kt,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(qt,{className:"h-4 w-4 text-foreground/70"}):e.jsx(so,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:v("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",n),children:[e.jsx("span",{children:t}),a&&e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{children:e.jsx(ka,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(ee,{children:a})]})})]})}const qu=to,Uu=ao,Bu=no,_r=c.forwardRef(({className:s,...t},a)=>e.jsx(En,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));_r.displayName=En.displayName;const Cr=c.forwardRef(({className:s,...t},a)=>e.jsxs(Bu,{children:[e.jsx(_r,{}),e.jsx(Fn,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...t})]}));Cr.displayName=Fn.displayName;const Sr=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",s),...t});Sr.displayName="AlertDialogHeader";const kr=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});kr.displayName="AlertDialogFooter";const Tr=c.forwardRef(({className:s,...t},a)=>e.jsx(Mn,{ref:a,className:v("text-lg font-semibold",s),...t}));Tr.displayName=Mn.displayName;const Dr=c.forwardRef(({className:s,...t},a)=>e.jsx(zn,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Dr.displayName=zn.displayName;const Pr=c.forwardRef(({className:s,...t},a)=>e.jsx(On,{ref:a,className:v($s(),s),...t}));Pr.displayName=On.displayName;const Vr=c.forwardRef(({className:s,...t},a)=>e.jsx(Ln,{ref:a,className:v($s({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));Vr.displayName=Ln.displayName;function Be({onConfirm:s,children:t,title:a="确认操作",description:n="确定要执行此操作吗?",cancelText:l="取消",confirmText:o="确认",variant:d="default",className:x}){return e.jsxs(qu,{children:[e.jsx(Uu,{asChild:!0,children:t}),e.jsxs(Cr,{className:v("sm:max-w-[425px]",x),children:[e.jsxs(Sr,{children:[e.jsx(Tr,{children:a}),e.jsx(Dr,{children:n})]}),e.jsxs(kr,{children:[e.jsx(Vr,{asChild:!0,children:e.jsx(T,{variant:"outline",children:l})}),e.jsx(Pr,{asChild:!0,children:e.jsx(T,{variant:d,onClick:s,children:o})})]})]})]})}const Ir=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),Gu=({refetch:s,isSortMode:t=!1})=>[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:t?"cursor-move":"opacity-0",children:e.jsx(Tt,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:a})=>e.jsx(V,{column:a,title:"ID"}),cell:({row:a})=>e.jsx(L,{variant:"outline",children:a.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:a})=>e.jsx(V,{column:a,title:"启用"}),cell:({row:a})=>e.jsx(H,{defaultChecked:a.getValue("enable"),onCheckedChange:async()=>{const{data:n}=await Gc({id:a.original.id});n||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:a})=>e.jsx(V,{column:a,title:"显示名称"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:a.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:a})=>e.jsx(V,{column:a,title:"支付接口"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:a.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:a})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(V,{column:a,title:"通知地址"}),e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{className:"ml-1",children:e.jsx(Ir,{className:"h-4 w-4"})}),e.jsx(ee,{children:"支付网关将会把数据通知到本地址,请通过防火墙放行本地址。"})]})})]}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:a.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:a})=>e.jsx(V,{className:"justify-end",column:a,title:"操作"}),cell:({row:a})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(wr,{refetch:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:a.original}),e.jsx(Be,{title:"删除确认",description:"确定要删除该支付方式吗?此操作无法撤销。",onConfirm:async()=>{const{data:n}=await Bc({id:a.original.id});n&&s()},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function Yu({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽支付方式进行排序,完成后点击保存"}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wr,{refetch:t}),e.jsx(S,{placeholder:"搜索支付方式...",value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,size:"sm",children:n?"保存排序":"编辑排序"})})]})}function Wu(){const[s,t]=c.useState([]),[a,n]=c.useState([]),[l,o]=c.useState(!1),[d,x]=c.useState([]),[r,i]=c.useState({"drag-handle":!1}),[h,D]=c.useState({pageSize:20,pageIndex:0}),{refetch:C}=Q({queryKey:["paymentList"],queryFn:async()=>{const{data:N}=await Hc();return x(N?.map(P=>({...P,enable:!!P.enable}))||[]),N}});c.useEffect(()=>{i({"drag-handle":l}),D({pageSize:l?99999:10,pageIndex:0})},[l]);const m=(N,P)=>{l&&(N.dataTransfer.setData("text/plain",P.toString()),N.currentTarget.classList.add("opacity-50"))},w=(N,P)=>{if(!l)return;N.preventDefault(),N.currentTarget.classList.remove("bg-muted");const f=parseInt(N.dataTransfer.getData("text/plain"));if(f===P)return;const R=[...d],[z]=R.splice(f,1);R.splice(P,0,z),x(R)},_=async()=>{l?Yc({ids:d.map(N=>N.id)}).then(()=>{C(),o(!1),A.success("排序保存成功")}):o(!0)},b=Me({data:d,columns:Gu({refetch:C,isSortMode:l}),state:{sorting:a,columnFilters:s,columnVisibility:r,pagination:h},onSortingChange:n,onColumnFiltersChange:t,onColumnVisibilityChange:i,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),initialState:{columnPinning:{right:["actions"]}},pageCount:l?1:void 0});return e.jsx(Ue,{table:b,toolbar:N=>e.jsx(Yu,{table:N,refetch:C,saveOrder:_,isSortMode:l}),draggable:l,onDragStart:m,onDragEnd:N=>N.currentTarget.classList.remove("opacity-50"),onDragOver:N=>{N.preventDefault(),N.currentTarget.classList.add("bg-muted")},onDragLeave:N=>N.currentTarget.classList.remove("bg-muted"),onDrop:w,showPagination:!l})}function Ju(){return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"支付配置"})}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置支付方式,包括支付宝、微信等。"})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Wu,{})})]})]})}const Qu=Object.freeze(Object.defineProperty({__proto__:null,default:Ju},Symbol.toStringTag,{value:"Module"}));function Zu({themeKey:s,themeInfo:t}){const[a,n]=c.useState(!1),[l,o]=c.useState(!1),[d,x]=c.useState(!1),r=ae({defaultValues:t.configs.reduce((D,C)=>(D[C.field_name]="",D),{})}),i=async()=>{o(!0),Tc(s).then(({data:D})=>{Object.entries(D).forEach(([C,m])=>{r.setValue(C,m)})}).finally(()=>{o(!1)})},h=async D=>{x(!0),Dc(s,D).then(()=>{A.success("保存成功"),n(!1)}).finally(()=>{x(!1)})};return e.jsxs(ue,{open:a,onOpenChange:D=>{n(D),D?i():r.reset()},children:[e.jsx(Ie,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"主题设置"})}),e.jsxs(ce,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsxs(xe,{children:["配置",t.name,"主题"]}),e.jsx(Se,{children:"修改主题的样式、布局和其他显示选项。"})]}),l?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(aa,{className:"h-6 w-6 animate-spin"})}):e.jsx(oe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(h),className:"space-y-4",children:[t.configs.map(D=>e.jsx(g,{control:r.control,name:D.field_name,render:({field:C})=>e.jsxs(j,{children:[e.jsx(p,{children:D.label}),e.jsx(y,{children:Nr(D,C)}),e.jsx(k,{})]})},D.field_name)),e.jsxs(Re,{className:"mt-6 gap-2",children:[e.jsx(T,{type:"button",variant:"secondary",onClick:()=>n(!1),children:"取消"}),e.jsx(T,{type:"submit",loading:d,children:"保存"})]})]})})]})]})}function Xu(){const[s,t]=c.useState(null),[a,n]=c.useState(!1),[l,o]=c.useState(!1),[d,x]=c.useState(!1),[r,i]=c.useState(null),h=c.useRef(null),[D,C]=c.useState(0),{data:m,isLoading:w,refetch:_}=Q({queryKey:["themeList"],queryFn:async()=>{const{data:E}=await kc();return E}}),b=async E=>{t(E),Ic({frontend_theme:E}).then(()=>{A.success("主题切换成功"),_()}).finally(()=>{t(null)})},N=async E=>{if(!E.name.endsWith(".zip")){A.error("只支持上传 ZIP 格式的主题文件");return}n(!0),Pc(E).then(()=>{A.success("主题上传成功"),o(!1),_()}).finally(()=>{n(!1),h.current&&(h.current.value="")})},P=E=>{E.preventDefault(),E.stopPropagation(),E.type==="dragenter"||E.type==="dragover"?x(!0):E.type==="dragleave"&&x(!1)},f=E=>{E.preventDefault(),E.stopPropagation(),x(!1),E.dataTransfer.files&&E.dataTransfer.files[0]&&N(E.dataTransfer.files[0])},R=()=>{r&&C(E=>E===0?r.images.length-1:E-1)},z=()=>{r&&C(E=>E===r.images.length-1?0:E+1)},$=(E,K)=>{C(0),i({name:E,images:K})};return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"主题配置"})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:"主题配置,包括主题色、字体大小等。如果你采用前后分离的方式部署V2board,那么主题配置将不会生效。"}),e.jsxs(T,{onClick:()=>o(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(Ht,{className:"mr-2 h-4 w-4"}),"上传主题"]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:w?e.jsxs(e.Fragment,{children:[e.jsx($a,{}),e.jsx($a,{})]}):m?.themes&&Object.entries(m.themes).map(([E,K])=>e.jsx($e,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:K.background_url?`url(${K.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:v("relative z-10 h-full transition-colors",K.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!K.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(Be,{title:"删除主题",description:"确定要删除该主题吗?删除后无法恢复。",confirmText:"删除",variant:"destructive",onConfirm:async()=>{if(E===m?.active){A.error("不能删除当前使用的主题");return}t(E),Vc(E).then(()=>{A.success("主题删除成功"),_()}).finally(()=>{t(null)})},children:e.jsx(T,{disabled:s===E,loading:s===E,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(rs,{className:"h-4 w-4"})})})}),e.jsxs(Je,{children:[e.jsx(gs,{children:K.name}),e.jsx(Xs,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:K.description}),K.version&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:["版本: ",K.version]})]})})]}),e.jsxs(Qe,{className:"flex items-center justify-end space-x-3",children:[K.images&&Array.isArray(K.images)&&K.images.length>0&&e.jsx(T,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>$(K.name,K.images),children:e.jsx(ro,{className:"h-4 w-4"})}),e.jsx(Zu,{themeKey:E,themeInfo:K}),e.jsx(T,{onClick:()=>b(E),disabled:s===E||E===m.active,loading:s===E,variant:E===m.active?"secondary":"default",children:E===m.active?"当前主题":"激活主题"})]})]})},E))}),e.jsx(ue,{open:l,onOpenChange:o,children:e.jsxs(ce,{className:"sm:max-w-md",children:[e.jsxs(he,{children:[e.jsx(xe,{children:"上传主题"}),e.jsx(Se,{children:"请上传一个有效的主题压缩包(.zip 格式)。主题包应包含完整的主题文件结构。"})]}),e.jsxs("div",{className:v("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",d&&"border-primary/50 bg-muted/50"),onDragEnter:P,onDragLeave:P,onDragOver:P,onDrop:f,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:E=>{const K=E.target.files?.[0];K&&N(K)}}),a?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"正在上传..."})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Ht,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:["将主题文件拖放到此处,或者",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:"点击选择"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"支持 .zip 格式的主题包"})]})]})})]})]})}),e.jsx(ue,{open:!!r,onOpenChange:E=>{E||(i(null),C(0))},children:e.jsxs(ce,{className:"max-w-4xl",children:[e.jsxs(he,{children:[e.jsxs(xe,{children:[r?.name," 主题预览"]}),e.jsx(Se,{className:"text-center",children:r&&`${D+1} / ${r.images.length}`})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:r?.images[D]&&e.jsx("img",{src:r.images[D],alt:`${r.name} 预览图 ${D+1}`,className:"h-full w-full object-contain"})}),r&&r.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(T,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:R,children:e.jsx(lo,{className:"h-4 w-4"})}),e.jsx(T,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:z,children:e.jsx(io,{className:"h-4 w-4"})})]})]}),r&&r.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:r.images.map((E,K)=>e.jsx("button",{onClick:()=>C(K),className:v("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",D===K?"border-primary":"border-transparent"),children:e.jsx("img",{src:E,alt:`缩略图 ${K+1}`,className:"h-full w-full object-cover"})},K))})]})})]})]})}function $a(){return e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsx(Ee,{className:"h-6 w-[200px]"}),e.jsx(Ee,{className:"h-4 w-[300px]"})]}),e.jsxs(Qe,{className:"flex items-center justify-end space-x-3",children:[e.jsx(Ee,{className:"h-10 w-[100px]"}),e.jsx(Ee,{className:"h-10 w-[100px]"})]})]})}const ex=Object.freeze(Object.defineProperty({__proto__:null,default:Xu},Symbol.toStringTag,{value:"Module"})),ma=c.forwardRef(({className:s,value:t,onChange:a,...n},l)=>{const[o,d]=c.useState("");c.useEffect(()=>{if(o.includes(",")){const r=new Set([...t,...o.split(",").map(i=>i.trim())]);a(Array.from(r)),d("")}},[o,a,t]);const x=()=>{if(o){const r=new Set([...t,o]);a(Array.from(r)),d("")}};return e.jsxs("div",{className:v(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[t.map(r=>e.jsxs(L,{variant:"secondary",children:[r,e.jsx(W,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{a(t.filter(i=>i!==r))},children:e.jsx(Ut,{className:"w-3"})})]},r)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:o,onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"||r.key===","?(r.preventDefault(),x()):r.key==="Backspace"&&o.length===0&&t.length>0&&(r.preventDefault(),a(t.slice(0,-1)))},...n,ref:l})]})});ma.displayName="InputTags";const sx=u.object({id:u.number().nullable(),title:u.string().min(1).max(250),content:u.string().min(1),show:u.boolean(),tags:u.array(u.string()),img_url:u.string().nullable()}),tx={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Rr({refetch:s,dialogTrigger:t,type:a="add",defaultFormValues:n=tx}){const[l,o]=c.useState(!1),d=ae({resolver:ie(sx),defaultValues:n,mode:"onChange",shouldFocusError:!0}),x=new na({html:!0});return e.jsx(oe,{...d,children:e.jsxs(ue,{onOpenChange:o,open:l,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加公告"})]})}),e.jsxs(ce,{className:"sm:max-w-[1025px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a==="add"?"添加公告":"编辑公告"}),e.jsx(Se,{})]}),e.jsx(g,{control:d.control,name:"title",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"标题"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入公告标题",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"content",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"公告内容"}),e.jsx(y,{children:e.jsx(ra,{style:{height:"500px"},value:r.value,renderHTML:i=>x.render(i),onChange:({text:i})=>{r.onChange(i)}})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"img_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"公告背景"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"请输入公告背景图片URL",...r,value:r.value||""})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"show",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示"}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:r.onChange})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"tags",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点标签"}),e.jsx(y,{children:e.jsx(ma,{value:r.value,onChange:r.onChange,placeholder:"输入后回车添加标签",className:"w-full"})}),e.jsx(k,{})]})}),e.jsxs(Re,{children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",onClick:r=>{r.preventDefault(),d.handleSubmit(async i=>{Jc(i).then(({data:h})=>{h&&(A.success("提交成功"),s(),o(!1))})})()},children:"提交"})]})]})]})})}function ax({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!n&&e.jsx(Rr,{refetch:t}),!n&&e.jsx(S,{placeholder:"搜索公告标题...",value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),l&&!n&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,className:"h-8",size:"sm",children:n?"保存排序":"编辑排序"})})]})}const nx=s=>[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(oo,{className:"h-4 w-4 text-muted-foreground cursor-move"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"ID"}),cell:({row:t})=>e.jsx(L,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(V,{column:t,title:"显示状态"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(H,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:a}=await Zc({id:t.original.id});a||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(V,{column:t,title:"标题"}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Rr,{refetch:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:t.original}),e.jsx(Be,{title:"删除确认",description:"确定要删除该条公告吗?此操作无法撤销。",onConfirm:async()=>{Qc({id:t.original.id}).then(()=>{A.success("删除成功"),s()})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function rx(){const[s,t]=c.useState({}),[a,n]=c.useState({}),[l,o]=c.useState([]),[d,x]=c.useState([]),[r,i]=c.useState(!1),[h,D]=c.useState({}),[C,m]=c.useState({pageSize:50,pageIndex:0}),[w,_]=c.useState([]),{refetch:b}=Q({queryKey:["notices"],queryFn:async()=>{const{data:z}=await Wc();return _(z),z}});c.useEffect(()=>{n({"drag-handle":r,content:!r,created_at:!r,actions:!r}),m({pageSize:r?99999:50,pageIndex:0})},[r]);const N=(z,$)=>{r&&(z.dataTransfer.setData("text/plain",$.toString()),z.currentTarget.classList.add("opacity-50"))},P=(z,$)=>{if(!r)return;z.preventDefault(),z.currentTarget.classList.remove("bg-muted");const E=parseInt(z.dataTransfer.getData("text/plain"));if(E===$)return;const K=[...w],[ds]=K.splice(E,1);K.splice($,0,ds),_(K)},f=async()=>{if(!r){i(!0);return}Td(w.map(z=>z.id)).then(()=>{A.success("排序保存成功"),i(!1),b()}).finally(()=>{i(!1)})},R=Me({data:w??[],columns:nx(b),state:{sorting:d,columnVisibility:a,rowSelection:s,columnFilters:l,columnSizing:h,pagination:C},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:x,onColumnFiltersChange:o,onColumnVisibilityChange:n,onColumnSizingChange:D,onPaginationChange:m,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(Ue,{table:R,toolbar:z=>e.jsx(ax,{table:z,refetch:b,saveOrder:f,isSortMode:r}),draggable:r,onDragStart:N,onDragEnd:z=>z.currentTarget.classList.remove("opacity-50"),onDragOver:z=>{z.preventDefault(),z.currentTarget.classList.add("bg-muted")},onDragLeave:z=>z.currentTarget.classList.remove("bg-muted"),onDrop:P,showPagination:!r})})}function lx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"公告管理"})}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置公告,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(rx,{})})]})]})}const ix=Object.freeze(Object.defineProperty({__proto__:null,default:lx},Symbol.toStringTag,{value:"Module"})),ox=u.object({id:u.number().nullable(),language:u.string().max(250),category:u.string().max(250),title:u.string().min(1).max(250),body:u.string().min(1),show:u.boolean()}),cx={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function Er({refreshData:s,dialogTrigger:t,type:a="add",defaultFormValues:n=cx}){const[l,o]=c.useState(!1),d=ae({resolver:ie(ox),defaultValues:n,mode:"onChange",shouldFocusError:!0}),x=new na({html:!0});return c.useEffect(()=>{l&&n.id&&ed(n.id).then(({data:r})=>{d.reset(r)})},[n.id,d,l]),e.jsxs(ue,{onOpenChange:o,open:l,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加知识"})]})}),e.jsxs(ce,{className:"sm:max-w-[1025px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a==="add"?"添加知识":"编辑知识"}),e.jsx(Se,{})]}),e.jsxs(oe,{...d,children:[e.jsx(g,{control:d.control,name:"title",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"标题"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入知识标题",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"category",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"分类"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入分类,分类将会自动归类",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"language",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"语言"}),e.jsx(y,{children:e.jsxs(G,{value:r.value,onValueChange:r.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择语言"})}),e.jsx(B,{children:[{field:"English",value:"en-US"},{field:"日本語",value:"ja-JP"},{field:"한국어",value:"ko-KR"},{field:"Tiếng Việt",value:"vi-VN"},{field:"简体中文",value:"zh-CN"},{field:"繁體中文",value:"zh-TW"}].map(i=>e.jsx(O,{value:i.value,className:"cursor-pointer",children:i.field},i.value))})]})})]})}),e.jsx(g,{control:d.control,name:"body",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"内容"}),e.jsx(y,{children:e.jsx(ra,{style:{height:"500px"},value:r.value,renderHTML:i=>x.render(i),onChange:({text:i})=>{r.onChange(i)}})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"show",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示"}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:r.onChange})})}),e.jsx(k,{})]})}),e.jsxs(Re,{children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",onClick:()=>{d.handleSubmit(r=>{sd(r).then(({data:i})=>{i&&(d.reset(),A.success("操作成功"),o(!1),s())})})()},children:"提交"})]})]})]})]})}function dx({column:s,title:t,options:a}){const n=s?.getFacetedUniqueValues(),l=new Set(s?.getFilterValue());return e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(it,{className:"mr-2 h-4 w-4"}),t,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(je,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):a.filter(o=>l.has(o.value)).map(o=>e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(qe,{className:"w-[200px] p-0",align:"start",children:e.jsxs(ps,{children:[e.jsx(Ps,{placeholder:t}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"No results found."}),e.jsx(Ve,{children:a.map(o=>{const d=l.has(o.value);return e.jsxs(be,{onSelect:()=>{d?l.delete(o.value):l.add(o.value);const x=Array.from(l);s?.setFilterValue(x.length?x:void 0)},children:[e.jsx("div",{className:v("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ks,{className:v("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:o.label}),n?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:n.get(o.value)})]},o.value)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Hs,{}),e.jsx(Ve,{children:e.jsx(be,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function ux({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽知识条目进行排序,完成后点击保存"}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Er,{refreshData:t}),e.jsx(S,{placeholder:"搜索知识...",value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(dx,{column:s.getColumn("category"),title:"分类",options:Array.from(new Set(s.getCoreRowModel().rows.map(o=>o.getValue("category")))).map(o=>({label:o,value:o}))}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,size:"sm",children:n?"保存排序":"编辑排序"})})]})}const xx=({refetch:s,isSortMode:t=!1})=>[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:t?"cursor-move":"opacity-0",children:e.jsx(Tt,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:a})=>e.jsx(V,{column:a,title:"ID"}),cell:({row:a})=>e.jsx(L,{variant:"outline",className:"justify-center",children:a.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:a})=>e.jsx(V,{column:a,title:"状态"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx(H,{defaultChecked:a.getValue("show"),onCheckedChange:async()=>{ad({id:a.original.id}).then(({data:n})=>{n||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:a})=>e.jsx(V,{column:a,title:"标题"}),cell:({row:a})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:a.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:a})=>e.jsx(V,{column:a,title:"分类"}),cell:({row:a})=>e.jsx(L,{variant:"secondary",className:"max-w-[180px] truncate",children:a.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:a})=>e.jsx(V,{className:"justify-end",column:a,title:"操作"}),cell:({row:a})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(Er,{refreshData:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:a.original}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该知识库记录,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{td({id:a.original.id}).then(({data:n})=>{n&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function mx(){const[s,t]=c.useState([]),[a,n]=c.useState([]),[l,o]=c.useState(!1),[d,x]=c.useState([]),[r,i]=c.useState({"drag-handle":!1}),[h,D]=c.useState({pageSize:20,pageIndex:0}),{refetch:C,isLoading:m,data:w}=Q({queryKey:["knowledge"],queryFn:async()=>{const{data:f}=await Xc();return x(f||[]),f}});c.useEffect(()=>{i({"drag-handle":l}),D({pageSize:l?99999:10,pageIndex:0})},[l]);const _=(f,R)=>{l&&(f.dataTransfer.setData("text/plain",R.toString()),f.currentTarget.classList.add("opacity-50"))},b=(f,R)=>{if(!l)return;f.preventDefault(),f.currentTarget.classList.remove("bg-muted");const z=parseInt(f.dataTransfer.getData("text/plain"));if(z===R)return;const $=[...d],[E]=$.splice(z,1);$.splice(R,0,E),x($)},N=async()=>{l?nd({ids:d.map(f=>f.id)}).then(()=>{C(),o(!1),A.success("排序保存成功")}):o(!0)},P=Me({data:d,columns:xx({refetch:C,isSortMode:l}),state:{sorting:a,columnFilters:s,columnVisibility:r,pagination:h},onSortingChange:n,onColumnFiltersChange:t,onColumnVisibilityChange:i,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Ue,{table:P,toolbar:f=>e.jsx(ux,{table:f,refetch:C,saveOrder:N,isSortMode:l}),draggable:l,onDragStart:_,onDragEnd:f=>f.currentTarget.classList.remove("opacity-50"),onDragOver:f=>{f.preventDefault(),f.currentTarget.classList.add("bg-muted")},onDragLeave:f=>f.currentTarget.classList.remove("bg-muted"),onDrop:b,showPagination:!l})}function hx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:"知识库管理"}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置知识库,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(mx,{})})]})]})}const jx=Object.freeze(Object.defineProperty({__proto__:null,default:hx},Symbol.toStringTag,{value:"Module"}));function gx(s,t){const[a,n]=c.useState(s);return c.useEffect(()=>{const l=setTimeout(()=>n(s),t);return()=>{clearTimeout(l)}},[s,t]),a}function Ot(s,t){if(s.length===0)return{};if(!t)return{"":s};const a={};return s.forEach(n=>{const l=n[t]||"";a[l]||(a[l]=[]),a[l].push(n)}),a}function fx(s,t){const a=JSON.parse(JSON.stringify(s));for(const[n,l]of Object.entries(a))a[n]=l.filter(o=>!t.find(d=>d.value===o.value));return a}function px(s,t){for(const[,a]of Object.entries(s))if(a.some(n=>t.find(l=>l.value===n.value)))return!0;return!1}const Fr=c.forwardRef(({className:s,...t},a)=>co(l=>l.filtered.count===0)?e.jsx("div",{ref:a,className:v("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...t}):null);Fr.displayName="CommandEmpty";const nt=c.forwardRef(({value:s,onChange:t,placeholder:a,defaultOptions:n=[],options:l,delay:o,onSearch:d,loadingIndicator:x,emptyIndicator:r,maxSelected:i=Number.MAX_SAFE_INTEGER,onMaxSelected:h,hidePlaceholderWhenSelected:D,disabled:C,groupBy:m,className:w,badgeClassName:_,selectFirstItem:b=!0,creatable:N=!1,triggerSearchOnFocus:P=!1,commandProps:f,inputProps:R,hideClearAllButton:z=!1},$)=>{const E=c.useRef(null),[K,ds]=c.useState(!1),Ks=c.useRef(!1),[va,ba]=c.useState(!1),[J,qs]=c.useState(s||[]),[ys,ya]=c.useState(Ot(n,m)),[us,Ft]=c.useState(""),Us=gx(us,o||500);c.useImperativeHandle($,()=>({selectedValue:[...J],input:E.current,focus:()=>E.current?.focus()}),[J]);const ct=c.useCallback(q=>{const Z=J.filter(Ce=>Ce.value!==q.value);qs(Z),t?.(Z)},[t,J]),ll=c.useCallback(q=>{const Z=E.current;Z&&((q.key==="Delete"||q.key==="Backspace")&&Z.value===""&&J.length>0&&(J[J.length-1].fixed||ct(J[J.length-1])),q.key==="Escape"&&Z.blur())},[ct,J]);c.useEffect(()=>{s&&qs(s)},[s]),c.useEffect(()=>{if(!l||d)return;const q=Ot(l||[],m);JSON.stringify(q)!==JSON.stringify(ys)&&ya(q)},[n,l,m,d,ys]),c.useEffect(()=>{const q=async()=>{ba(!0);const Ce=await d?.(Us);ya(Ot(Ce||[],m)),ba(!1)};(async()=>{!d||!K||(P&&await q(),Us&&await q())})()},[Us,m,K,P]);const il=()=>{if(!N||px(ys,[{value:us,label:us}])||J.find(Z=>Z.value===us))return;const q=e.jsx(be,{value:us,className:"cursor-pointer",onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation()},onSelect:Z=>{if(J.length>=i){h?.(J.length);return}Ft("");const Ce=[...J,{value:Z,label:Z}];qs(Ce),t?.(Ce)},children:`Create "${us}"`});if(!d&&us.length>0||d&&Us.length>0&&!va)return q},ol=c.useCallback(()=>{if(r)return d&&!N&&Object.keys(ys).length===0?e.jsx(be,{value:"-",disabled:!0,children:r}):e.jsx(Fr,{children:r})},[N,r,d,ys]),cl=c.useMemo(()=>fx(ys,J),[ys,J]),dl=c.useCallback(()=>{if(f?.filter)return f.filter;if(N)return(q,Z)=>q.toLowerCase().includes(Z.toLowerCase())?1:-1},[N,f?.filter]),ul=c.useCallback(()=>{const q=J.filter(Z=>Z.fixed);qs(q),t?.(q)},[t,J]);return e.jsxs(ps,{...f,onKeyDown:q=>{ll(q),f?.onKeyDown?.(q)},className:v("h-auto overflow-visible bg-transparent",f?.className),shouldFilter:f?.shouldFilter!==void 0?f.shouldFilter:!d,filter:dl(),children:[e.jsx("div",{className:v("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":J.length!==0,"cursor-text":!C&&J.length!==0},w),onClick:()=>{C||E.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[J.map(q=>e.jsxs(L,{className:v("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",_),"data-fixed":q.fixed,"data-disabled":C||void 0,children:[q.label,e.jsx("button",{className:v("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(C||q.fixed)&&"hidden"),onKeyDown:Z=>{Z.key==="Enter"&&ct(q)},onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation()},onClick:()=>ct(q),children:e.jsx(Ut,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},q.value)),e.jsx(we.Input,{...R,ref:E,value:us,disabled:C,onValueChange:q=>{Ft(q),R?.onValueChange?.(q)},onBlur:q=>{Ks.current===!1&&ds(!1),R?.onBlur?.(q)},onFocus:q=>{ds(!0),P&&d?.(Us),R?.onFocus?.(q)},placeholder:D&&J.length!==0?"":a,className:v("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":D,"px-3 py-2":J.length===0,"ml-1":J.length!==0},R?.className)}),e.jsx("button",{type:"button",onClick:ul,className:v((z||C||J.length<1||J.filter(q=>q.fixed).length===J.length)&&"hidden"),children:e.jsx(Ut,{})})]})}),e.jsx("div",{className:"relative",children:K&&e.jsx(vs,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{Ks.current=!1},onMouseEnter:()=>{Ks.current=!0},onMouseUp:()=>{E.current?.focus()},children:va?e.jsx(e.Fragment,{children:x}):e.jsxs(e.Fragment,{children:[ol(),il(),!b&&e.jsx(be,{value:"-",className:"hidden"}),Object.entries(cl).map(([q,Z])=>e.jsx(Ve,{heading:q,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:Z.map(Ce=>e.jsx(be,{value:Ce.value,disabled:Ce.disable,onMouseDown:Bs=>{Bs.preventDefault(),Bs.stopPropagation()},onSelect:()=>{if(J.length>=i){h?.(J.length);return}Ft("");const Bs=[...J,Ce];qs(Bs),t?.(Bs)},className:v("cursor-pointer",Ce.disable&&"cursor-default text-muted-foreground"),children:Ce.label},Ce.value))})},q))]})})})]})});nt.displayName="MultipleSelector";const vx=u.object({id:u.number().optional(),name:u.string().min(2,"组名至少需要2个字符").max(50,"组名不能超过50个字符").regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,"组名只能包含字母、数字、中文、下划线和连字符")});function Et({refetch:s,dialogTrigger:t,defaultValues:a={name:""},type:n="add"}){const l=ae({resolver:ie(vx),defaultValues:a,mode:"onChange"}),[o,d]=c.useState(!1),[x,r]=c.useState(!1),i=async h=>{r(!0),Oc(h).then(()=>{A.success(n==="edit"?"更新成功":"创建成功"),s&&s(),l.reset(),d(!1)}).finally(()=>{r(!1)})};return e.jsxs(ue,{open:o,onOpenChange:d,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"}),e.jsx("span",{children:"添加权限组"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:n==="edit"?"编辑权限组":"创建权限组"}),e.jsx(Se,{children:n==="edit"?"修改权限组信息,更新后会立即生效。":"创建新的权限组,可以为不同的用户分配不同的权限。"})]}),e.jsx(oe,{...l,children:e.jsxs("form",{onSubmit:l.handleSubmit(i),className:"space-y-4",children:[e.jsx(g,{control:l.control,name:"name",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{children:"组名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入权限组名称",...h,className:"w-full"})}),e.jsx(F,{children:"权限组名称用于标识不同的用户组,建议使用有意义的名称。"}),e.jsx(k,{})]})}),e.jsxs(Re,{className:"gap-2",children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsxs(T,{type:"submit",disabled:x||!l.formState.isValid,children:[x&&e.jsx(aa,{className:"mr-2 h-4 w-4 animate-spin"}),n==="edit"?"更新":"创建"]})]})]})})]})]})}const Mr=c.createContext(void 0);function bx({children:s,refetch:t}){const[a,n]=c.useState(!1),[l,o]=c.useState(null),[d,x]=c.useState(fe.Shadowsocks);return e.jsx(Mr.Provider,{value:{isOpen:a,setIsOpen:n,editingServer:l,setEditingServer:o,serverType:d,setServerType:x,refetch:t},children:s})}function zr(){const s=c.useContext(Mr);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function Lt({dialogTrigger:s,value:t,setValue:a,templateType:n}){c.useEffect(()=>{console.log(t)},[t]);const[l,o]=c.useState(!1),[d,x]=c.useState(()=>{if(!t||Object.keys(t).length===0)return"";try{return JSON.stringify(t,null,2)}catch{return""}}),[r,i]=c.useState(null),h=b=>{if(!b)return null;try{const N=JSON.parse(b);return typeof N!="object"||N===null?"配置必须是一个JSON对象":null}catch{return"无效的JSON格式"}},D={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}}},C=()=>{switch(n){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];default:return[]}},m=()=>{const b=h(d||"");if(b){A.error(b);return}try{if(!d){a(null),o(!1);return}a(JSON.parse(d)),o(!1)}catch{A.error("保存时发生错误")}},w=b=>{x(b),i(h(b))},_=b=>{const N=D[b];if(N){const P=JSON.stringify(N.content,null,2);x(P),i(null)}};return c.useEffect(()=>{l&&console.log(t)},[l,t]),c.useEffect(()=>{l&&t&&Object.keys(t).length>0&&x(JSON.stringify(t,null,2))},[l,t]),e.jsxs(ue,{open:l,onOpenChange:b=>{!b&&l&&m(),o(b)},children:[e.jsx(Ie,{asChild:!0,children:s??e.jsx(W,{variant:"link",children:"编辑协议"})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsx(he,{children:e.jsx(xe,{children:"编辑协议配置"})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(b=>e.jsxs(W,{variant:"outline",size:"sm",onClick:()=>_(b),children:["使用",D[b].label,"模板"]},b))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(bs,{className:`min-h-[200px] font-mono text-sm ${r?"border-red-500 focus-visible:ring-red-500":""}`,value:d,placeholder:`请输入JSON配置${C().length>0?"或选择上方模板":""}`,onChange:b=>w(b.target.value)}),r&&e.jsx("p",{className:"text-sm text-red-500",children:r})]})]}),e.jsxs(Re,{className:"gap-2",children:[e.jsx(W,{variant:"outline",onClick:()=>o(!1),children:"取消"}),e.jsx(W,{onClick:m,disabled:!!r,children:"确定"})]})]})]})}function vh(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const yx={},Nx=Object.freeze(Object.defineProperty({__proto__:null,default:yx},Symbol.toStringTag,{value:"Module"})),bh=No(Nx),Aa=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),wx=()=>{try{const s=uo.box.keyPair(),t=Aa(Ta.encodeBase64(s.secretKey)),a=Aa(Ta.encodeBase64(s.publicKey));return{privateKey:t,publicKey:a}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},_x=()=>{try{return wx()}catch(s){throw console.error("Error generating key pair:",s),s}},Cx=s=>{const t=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(t),Array.from(t).map(a=>a.toString(16).padStart(2,"0")).join("").substring(0,s)},Sx=()=>{const s=Math.floor(Math.random()*8)*2+2;return Cx(s)},kx=u.object({cipher:u.string().default("aes-128-gcm"),obfs:u.string().default("0"),obfs_settings:u.object({path:u.string().default(""),host:u.string().default("")}).default({})}),Tx=u.object({tls:u.coerce.number().default(0),tls_settings:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({})}),Dx=u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({})}),Px=u.object({version:u.coerce.number().default(2),alpn:u.string().default("h2"),obfs:u.object({open:u.coerce.boolean().default(!1),type:u.string().default("salamander"),password:u.string().default("")}).default({}),tls:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),bandwidth:u.object({up:u.string().default(""),down:u.string().default("")}).default({})}),Vx=u.object({tls:u.coerce.number().default(0),tls_settings:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),reality_settings:u.object({server_port:u.coerce.number().default(443),server_name:u.string().default(""),allow_insecure:u.boolean().default(!1),public_key:u.string().default(""),private_key:u.string().default(""),short_id:u.string().default("")}).default({}),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({}),flow:u.string().default("")}),es={shadowsocks:{schema:kx,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"]},vmess:{schema:Tx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:Dx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:Px,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:Vx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]}},Ix=({serverType:s,value:t,onChange:a})=>{const n=s?es[s]:null,l=n?.schema||u.record(u.any()),o=s?l.parse({}):{},d=ae({resolver:ie(l),defaultValues:o,mode:"onChange"});return c.useEffect(()=>{if(!t||Object.keys(t).length===0){if(s){const m=l.parse({});d.reset(m)}}else d.reset(t)},[s,t,a,d,l]),c.useEffect(()=>{const m=d.watch(w=>{a(w)});return()=>m.unsubscribe()},[d,a]),!s||!n?null:{shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"cipher",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"加密算法"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择加密算法"})}),e.jsx(B,{children:e.jsx(xs,{children:es.shadowsocks.ciphers.map(w=>e.jsx(O,{value:w,children:w},w))})})]})})]})}),e.jsx(g,{control:d.control,name:"obfs",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"混淆"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择混淆方式"})}),e.jsx(B,{children:e.jsxs(xs,{children:[e.jsx(O,{value:"0",children:"无"}),e.jsx(O,{value:"http",children:"HTTP"})]})})]})})]})}),d.watch("obfs")==="http"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"obfs_settings.path",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"路径",...m})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"obfs_settings.host",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"Host",...m})}),e.jsx(k,{})]})})]})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"tls",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"TLS"}),e.jsx(y,{children:e.jsxs(G,{value:m.value?.toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择安全性"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不支持"}),e.jsx(O,{value:"1",children:"支持"})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"不使用请留空",...m})})]})}),e.jsx(g,{control:d.control,name:"tls_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.vmess.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"当节点地址于证书不一致时用于证书验证",...m,value:m.value||""})})]})}),e.jsx(g,{control:d.control,name:"allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings")||{},setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")||"tcp"})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value||"tcp",children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.trojan.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"version",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"协议版本"}),e.jsx(y,{children:e.jsxs(G,{value:(m.value||2).toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"协议版本"})}),e.jsx(B,{children:e.jsx(xs,{children:es.hysteria.versions.map(w=>e.jsxs(O,{value:w,className:"cursor-pointer",children:["V",w]},w))})})]})})]})}),d.watch("version")==1&&e.jsx(g,{control:d.control,name:"alpn",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"ALPN"}),e.jsx(y,{children:e.jsxs(G,{value:m.value||"h2",onValueChange:m.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"ALPN"})}),e.jsx(B,{children:e.jsx(xs,{children:es.hysteria.alpnOptions.map(w=>e.jsx(O,{value:w,children:w},w))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"obfs.open",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"混淆"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})}),!!d.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[d.watch("version")=="2"&&e.jsx(g,{control:d.control,name:"obfs.type",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"混淆实现"}),e.jsx(y,{children:e.jsxs(G,{value:m.value||"salamander",onValueChange:m.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择混淆实现"})}),e.jsx(B,{children:e.jsx(xs,{children:e.jsx(O,{value:"salamander",children:"Salamander"})})})]})})]})}),e.jsx(g,{control:d.control,name:"obfs.password",render:({field:m})=>e.jsxs(j,{className:d.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(p,{children:"混淆密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(S,{placeholder:"请输入混淆密码",...m,value:m.value||"",className:"pr-9"})}),e.jsx(W,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",_=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(b=>w[b%w.length]).join("");d.setValue("obfs.password",_),A.success("混淆密码生成成功")},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ve,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"当节点地址于证书不一致时用于证书验证",...m,value:m.value||""})})]})}),e.jsx(g,{control:d.control,name:"tls.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"bandwidth.up",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"上行宽带"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入上行宽带"+(d.watch("version")==2?",留空则使用BBR":""),className:"rounded-br-none rounded-tr-none",...m,value:m.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:"Mbps"})})]})]})}),e.jsx(g,{control:d.control,name:"bandwidth.down",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"下行宽带"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入下行宽带"+(d.watch("version")==2?",留空则使用BBR":""),className:"rounded-br-none rounded-tr-none",...m,value:m.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:"Mbps"})})]})]})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"tls",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"安全性"}),e.jsx(y,{children:e.jsxs(G,{value:m.value?.toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择安全性"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"无"}),e.jsx(O,{value:"1",children:"TLS"}),e.jsx(O,{value:"2",children:"Reality"})]})]})})]})}),d.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"不使用请留空",...m})})]})}),e.jsx(g,{control:d.control,name:"tls_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),d.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"reality_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"伪装站点(dest)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"例如:example.com",...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.server_port",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"端口(port)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"例如:443",...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx(g,{control:d.control,name:"reality_settings.private_key",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"私钥(Private key)"}),e.jsx(y,{children:e.jsx(S,{...m})})]})}),e.jsxs(W,{variant:"outline",className:"",onClick:()=>{try{const m=_x();d.setValue("reality_settings.private_key",m.privateKey),d.setValue("reality_settings.public_key",m.publicKey),A.success("密钥对生成成功")}catch{A.error("生成密钥对失败")}},children:[e.jsx(ve,{icon:"ion:key-outline",className:"mr-2 h-4 w-4"}),"生成密钥对"]})]}),e.jsx(g,{control:d.control,name:"reality_settings.public_key",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"公钥(Public key)"}),e.jsx(y,{children:e.jsx(S,{...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.short_id",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"Short ID"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(y,{children:e.jsx(S,{...m,placeholder:"可留空,长度为2的倍数,最长16位"})}),e.jsxs(W,{variant:"outline",onClick:()=>{const w=Sx();d.setValue("reality_settings.short_id",w),A.success("Short ID 生成成功")},children:[e.jsx(ve,{icon:"ion:refresh-outline",className:"mr-2 h-4 w-4"}),"生成"]})]}),e.jsx(F,{className:"text-xs text-muted-foreground",children:"客户端可用的 shortId 列表,可用于区分不同的客户端,使用0-f的十六进制字符"})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.vless.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})}),e.jsx(g,{control:d.control,name:"flow",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"流控"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:w=>m.onChange(w==="none"?null:w),value:m.value||"none",children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择流控"})}),e.jsx(B,{children:es.vless.flowOptions.map(w=>e.jsx(O,{value:w,children:w},w))})]})})]})})]})}[s]?.()},Rx=u.object({id:u.number().optional().nullable(),code:u.string().optional(),name:u.string().min(1,"Please enter a valid name."),rate:u.string().min(1,"Please enter a valid rate."),tags:u.array(u.string()).default([]),excludes:u.array(u.string()).default([]),ips:u.array(u.string()).default([]),group_ids:u.array(u.string()).default([]),host:u.string().min(1,"Please enter a valid host."),port:u.string().min(1,"Please enter a valid port."),server_port:u.string().min(1,"Please enter a valid server port."),parent_id:u.string().default("0").nullable(),route_ids:u.array(u.string()).default([]),protocol_settings:u.record(u.any()).default({}).nullable()}),xt={id:null,code:"",name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null};function Ex(){const{isOpen:s,setIsOpen:t,editingServer:a,setEditingServer:n,serverType:l,setServerType:o,refetch:d}=zr(),[x,r]=c.useState([]),[i,h]=c.useState([]),[D,C]=c.useState([]),m=ae({resolver:ie(Rx),defaultValues:xt,mode:"onChange"});c.useEffect(()=>{w()},[s]),c.useEffect(()=>{a?.type&&a.type!==l&&o(a.type)},[a,l,o]),c.useEffect(()=>{a?a.type===l&&m.reset({...xt,...a}):m.reset({...xt,protocol_settings:es[l].schema.parse({})})},[a,m,l]);const w=async()=>{if(!s)return;const[f,R,z]=await Promise.all([It(),jr(),hr()]);r(f.data?.map($=>({label:$.name,value:$.id.toString()}))||[]),h(R.data?.map($=>({label:$.remarks,value:$.id.toString()}))||[]),C(z.data||[])},_=c.useMemo(()=>D?.filter(f=>(f.parent_id===0||f.parent_id===null)&&f.type===l&&f.id!==m.watch("id")),[l,D,m]),b=()=>e.jsxs(_s,{children:[e.jsx(Cs,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"}),e.jsx("div",{children:"添加节点"})]})}),e.jsx(fs,{align:"start",children:e.jsx(rc,{children:ws.map(({type:f,label:R})=>e.jsx(me,{onClick:()=>{o(f),t(!0)},className:"cursor-pointer",children:e.jsx(L,{variant:"outline",className:"text-white",style:{background:ts[f]},children:R})},f))})})]}),N=()=>{t(!1),n(null),m.reset(xt)},P=async()=>{const f=m.getValues();(await Rc({...f,type:l})).data&&(N(),A.success("提交成功"),d())};return e.jsxs(ue,{open:s,onOpenChange:N,children:[b(),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a?"编辑节点":"新建节点"}),e.jsx(Se,{})]}),e.jsxs(oe,{...m,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:m.control,name:"name",render:({field:f})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"节点名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入节点名称",...f})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"rate",render:({field:f})=>e.jsxs(j,{className:"flex-[1]",children:[e.jsx(p,{children:"倍率"}),e.jsx("div",{className:"relative flex",children:e.jsx(y,{children:e.jsx(S,{type:"number",min:"0",step:"0.1",...f})})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:m.control,name:"code",render:({field:f})=>e.jsxs(j,{children:[e.jsxs(p,{children:["自定义节点ID",e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(选填)"})]}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入自定义节点ID",...f,value:f.value||""})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"tags",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点标签"}),e.jsx(y,{children:e.jsx(ma,{value:f.value,onChange:f.onChange,placeholder:"输入后回车添加标签",className:"w-full"})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"group_ids",render:({field:f})=>e.jsxs(j,{children:[e.jsxs(p,{className:"flex items-center justify-between",children:["权限组",e.jsx(Et,{dialogTrigger:e.jsx(T,{variant:"link",children:"添加权限组"}),refetch:w})]}),e.jsx(y,{children:e.jsx(nt,{options:x,onChange:R=>f.onChange(R.map(z=>z.value)),value:x?.filter(R=>f.value.includes(R.value)),placeholder:"请选择权限组",emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:"no results found."})})}),e.jsx(k,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:m.control,name:"host",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入节点域名或者IP",...f})}),e.jsx(k,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(g,{control:m.control,name:"port",render:({field:f})=>e.jsxs(j,{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-1.5",children:["连接端口",e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ve,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Da,{children:e.jsx(ee,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:"用户实际连接使用的端口,这是客户端配置中需要填写的端口号。如果使用了中转或隧道,这个端口可能与服务器实际监听的端口不同。"})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{children:e.jsx(S,{placeholder:"用户连接端口",...f})}),e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const R=f.value;R&&m.setValue("server_port",R)},children:e.jsx(ve,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(ee,{side:"right",children:e.jsx("p",{children:"同步到服务端口"})})]})})]}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"server_port",render:({field:f})=>e.jsxs(j,{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-1.5",children:["服务端口",e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ve,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Da,{children:e.jsx(ee,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:"服务器实际监听的端口,这是在服务器上开放的真实端口。如果使用了中转或隧道,这个端口可能与用户连接端口不同。"})})})]})})]}),e.jsx(y,{children:e.jsx(S,{placeholder:"服务端开放端口",...f})}),e.jsx(k,{})]})})]})]}),s&&e.jsx(Ix,{serverType:l,value:m.watch("protocol_settings"),onChange:f=>m.setValue("protocol_settings",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(g,{control:m.control,name:"parent_id",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"父节点"}),e.jsxs(G,{onValueChange:f.onChange,value:f.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"选择父节点"})})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"无"}),_?.map(R=>e.jsx(O,{value:R.id.toString(),className:"cursor-pointer",children:R.name},R.id))]})]}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"route_ids",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"路由组"}),e.jsx(y,{children:e.jsx(nt,{options:i,onChange:R=>f.onChange(R.map(z=>z.value)),value:i?.filter(R=>f.value.includes(R.value)),placeholder:"选择路由组",emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:"no results found."})})}),e.jsx(k,{})]})})]}),e.jsxs(Re,{className:"mt-6",children:[e.jsx(T,{type:"button",variant:"outline",onClick:N,children:"取消"}),e.jsx(T,{type:"submit",onClick:P,children:"提交"})]})]})]})]})}function Ha({column:s,title:t,options:a}){const n=s?.getFacetedUniqueValues(),l=new Set(s?.getFilterValue());return e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(it,{className:"mr-2 h-4 w-4"}),t,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(je,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):a.filter(o=>l.has(o.value)).map(o=>e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(qe,{className:"w-[200px] p-0",align:"start",children:e.jsxs(ps,{children:[e.jsx(Ps,{placeholder:t}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"No results found."}),e.jsx(Ve,{children:a.map(o=>{const d=l.has(o.value);return e.jsxs(be,{onSelect:()=>{d?l.delete(o.value):l.add(o.value);const x=Array.from(l);s?.setFilterValue(x.length?x:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:v("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ks,{className:v("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${o.color}`}),e.jsx("span",{children:o.label}),n?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:n.get(o.value)})]},o.value)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Hs,{}),e.jsx(Ve,{children:e.jsx(be,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const Fx=[{value:fe.Shadowsocks,label:ws.find(s=>s.type===fe.Shadowsocks)?.label,color:ts[fe.Shadowsocks]},{value:fe.Vmess,label:ws.find(s=>s.type===fe.Vmess)?.label,color:ts[fe.Vmess]},{value:fe.Trojan,label:ws.find(s=>s.type===fe.Trojan)?.label,color:ts[fe.Trojan]},{value:fe.Hysteria,label:ws.find(s=>s.type===fe.Hysteria)?.label,color:ts[fe.Hysteria]},{value:fe.Vless,label:ws.find(s=>s.type===fe.Vless)?.label,color:ts[fe.Vless]}];function Mx({table:s,saveOrder:t,isSortMode:a,groups:n}){const l=s.getState().columnFilters.length>0,o=n.map(d=>({label:d,value:d}));return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!a&&e.jsxs(e.Fragment,{children:[e.jsx(Ex,{}),e.jsx(S,{placeholder:"搜索节点...",value:s.getColumn("name")?.getFilterValue()??"",onChange:d=>s.getColumn("name")?.setFilterValue(d.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(Ha,{column:s.getColumn("type"),title:"类型",options:Fx}),s.getColumn("groups")&&e.jsx(Ha,{column:s.getColumn("groups"),title:"权限组",options:o})]}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),a&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽节点进行排序,完成后点击保存"})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:a?"default":"outline",onClick:t,size:"sm",children:a?"保存排序":"编辑排序"})})]})}const rt=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),mt={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},ht={0:"未运行",1:"无人使用或异常",2:"运行正常"},zx=s=>[{id:"drag-handle",header:({column:t})=>e.jsx(V,{column:t,title:"排序"}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Tt,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"节点ID"}),cell:({row:t})=>{const a=t.getValue("id"),n=t.original.code;return e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:v("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:ts[t.original.type]},children:[e.jsx($n,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:n??a}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:l=>{l.stopPropagation(),Nt(n||a.toString())},children:e.jsx(Pa,{className:"size-3"})})]})}),e.jsxs(ee,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[ws.find(l=>l.type===t.original.type)?.label,t.original.parent_id?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:200,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(V,{column:t,title:"显隐"}),cell:({row:t})=>{const[a,n]=c.useState(!!t.getValue("show"));return e.jsx(H,{checked:a,onCheckedChange:async l=>{n(l),Mc({id:t.original.id,type:t.original.type,show:l?1:0}).catch(()=>{n(!l),s()})},style:{backgroundColor:a?ts[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(V,{column:t,title:"节点",tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[0])}),e.jsx("span",{className:"text-sm font-medium",children:ht[0]})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[1])}),e.jsx("span",{className:"text-sm font-medium",children:ht[1]})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[2])}),e.jsx("span",{className:"text-sm font-medium",children:ht[2]})]})]})})}),cell:({row:t})=>e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",mt[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(ee,{children:e.jsx("p",{className:"font-medium",children:ht[t.original.available_status]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(V,{column:t,title:"地址"}),cell:({row:t})=>{const a=`${t.original.host}:${t.original.port}`,n=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),n&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(内部端口 ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(le,{delayDuration:0,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:l=>{l.stopPropagation(),Nt(a)},children:e.jsx(Pa,{className:"size-3"})})}),e.jsx(ee,{side:"top",sideOffset:10,children:"复制连接地址"})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(V,{column:t,title:"在线人数",tooltip:"在线人数根据服务端上报频率而定"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(rt,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(V,{column:t,title:"倍率",tooltip:"流量扣费倍率"}),cell:({row:t})=>e.jsxs(L,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"groups",header:({column:t})=>e.jsx(V,{column:t,title:"权限组",tooltip:"可订阅到该节点的权限组"}),cell:({row:t})=>{const a=t.getValue("groups")||[];return e.jsx("div",{className:"flex min-w-[300px] max-w-[600px] flex-wrap items-center gap-1.5",children:a.length>0?a.map((n,l)=>e.jsx(L,{variant:"secondary",className:v("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:n.name},l)):e.jsx("span",{className:"text-sm text-muted-foreground",children:"--"})})},enableSorting:!1,size:600,filterFn:(t,a,n)=>{const l=t.getValue(a);return l?n.some(o=>l.includes(o)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(V,{column:t,title:"类型"}),cell:({row:t})=>{const a=t.getValue("type");return e.jsx(L,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:ts[a]},children:a})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>{const{setIsOpen:a,setEditingServer:n,setServerType:l}=zr();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(_s,{modal:!1,children:[e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":"打开操作菜单",children:e.jsx(bt,{className:"size-4"})})}),e.jsxs(fs,{align:"end",className:"w-40",children:[e.jsx(me,{className:"cursor-pointer",onClick:()=>{l(t.original.type),n(t.original),a(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(xo,{className:"mr-2 size-4"}),"编辑"]})}),e.jsxs(me,{className:"cursor-pointer",onClick:async()=>{Fc({id:t.original.id}).then(({data:o})=>{o&&(A.success("复制成功"),s())})},children:[e.jsx(mo,{className:"mr-2 size-4"}),"复制"]}),e.jsx(et,{}),e.jsx(me,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:o=>o.preventDefault(),children:e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该节点,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{Ec({id:t.original.id}).then(({data:o})=>{o&&(A.success("删除成功"),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(rs,{className:"mr-2 size-4"}),"删除"]})})})]})]})})},size:50}];function Ox(){const[s,t]=c.useState({}),[a,n]=c.useState({"drag-handle":!1}),[l,o]=c.useState([]),[d,x]=c.useState({pageSize:500,pageIndex:0}),[r,i]=c.useState([]),[h,D]=c.useState(!1),[C,m]=c.useState({}),[w,_]=c.useState([]),{refetch:b}=Q({queryKey:["nodeList"],queryFn:async()=>{const{data:$}=await hr();return _($),$}}),N=c.useMemo(()=>{const $=new Set;return w.forEach(E=>{E.groups&&E.groups.forEach(K=>$.add(K.name))}),Array.from($).sort()},[w]);c.useEffect(()=>{n({"drag-handle":h,show:!h,host:!h,online:!h,rate:!h,groups:!h,type:!1,actions:!h}),m({name:h?2e3:200}),x({pageSize:h?99999:500,pageIndex:0})},[h]);const P=($,E)=>{h&&($.dataTransfer.setData("text/plain",E.toString()),$.currentTarget.classList.add("opacity-50"))},f=($,E)=>{if(!h)return;$.preventDefault(),$.currentTarget.classList.remove("bg-muted");const K=parseInt($.dataTransfer.getData("text/plain"));if(K===E)return;const ds=[...w],[Ks]=ds.splice(K,1);ds.splice(E,0,Ks),_(ds)},R=async()=>{if(!h){D(!0);return}const $=w?.map((E,K)=>({id:E.id,order:K+1}));zc($).then(()=>{A.success("排序保存成功"),D(!1),b()}).finally(()=>{D(!1)})},z=Me({data:w||[],columns:zx(b),state:{sorting:r,columnVisibility:a,rowSelection:s,columnFilters:l,columnSizing:C,pagination:d},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:i,onColumnFiltersChange:o,onColumnVisibilityChange:n,onColumnSizingChange:m,onPaginationChange:x,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(bx,{refetch:b,children:e.jsx("div",{className:"space-y-4",children:e.jsx(Ue,{table:z,toolbar:$=>e.jsx(Mx,{table:$,refetch:b,saveOrder:R,isSortMode:h,groups:N}),draggable:h,onDragStart:P,onDragEnd:$=>$.currentTarget.classList.remove("opacity-50"),onDragOver:$=>{$.preventDefault(),$.currentTarget.classList.add("bg-muted")},onDragLeave:$=>$.currentTarget.classList.remove("bg-muted"),onDrop:f,showPagination:!h})})})}function Lx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"节点管理"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"管理所有节点,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ox,{})})]})]})}const $x=Object.freeze(Object.defineProperty({__proto__:null,default:Lx},Symbol.toStringTag,{value:"Module"}));function Ax({table:s,refetch:t}){const a=s.getState().columnFilters.length>0;return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(Et,{refetch:t}),e.jsx(S,{placeholder:"搜索权限组...",value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:v("h-8 w-[150px] lg:w-[250px]",a&&"border-primary/50 ring-primary/20")}),a&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]})})}const Hx=s=>[{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"组ID"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(V,{column:t,title:"组名称"}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(V,{column:t,title:"用户数量"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(rt,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(V,{column:t,title:"节点数量"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx($n,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Et,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]})}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该权限组,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{Lc({id:t.original.id}).then(({data:a})=>{a&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]})}];function Kx(){const[s,t]=c.useState({}),[a,n]=c.useState({}),[l,o]=c.useState([]),[d,x]=c.useState([]),{data:r,refetch:i,isLoading:h}=Q({queryKey:["serverGroupList"],queryFn:async()=>{const{data:C}=await It();return C}}),D=Me({data:r||[],columns:Hx(i),state:{sorting:d,columnVisibility:a,rowSelection:s,columnFilters:l},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:x,onColumnFiltersChange:o,onColumnVisibilityChange:n,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Ue,{table:D,toolbar:C=>e.jsx(Ax,{table:C,refetch:i}),isLoading:h})}function qx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"权限组管理"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"管理所有权限组,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Kx,{})})]})]})}const Ux=Object.freeze(Object.defineProperty({__proto__:null,default:qx},Symbol.toStringTag,{value:"Module"})),Bx=u.object({remarks:u.string().min(1,"Please enter a valid remarks."),match:u.array(u.string()),action:u.enum(["block","dns"]),action_value:u.string().optional()});function Or({refetch:s,dialogTrigger:t,defaultValues:a={remarks:"",match:[],action:"block",action_value:""},type:n="add"}){const l=ae({resolver:ie(Bx),defaultValues:a,mode:"onChange"}),[o,d]=c.useState(!1);return e.jsxs(ue,{open:o,onOpenChange:d,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加路由"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:n==="edit"?"编辑路由":"创建路由"}),e.jsx(Se,{})]}),e.jsxs(oe,{...l,children:[e.jsx(g,{control:l.control,name:"remarks",render:({field:x})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"备注"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"请输入备注",...x})})}),e.jsx(k,{})]})}),e.jsx(g,{control:l.control,name:"match",render:({field:x})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"备注"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(bs,{className:"min-h-[120px]",placeholder:`example.com +import{r as c,j as e,t as xl,c as ml,I as Na,a as Ss,S as Qt,u as ns,b as Zt,d as hl,O as Xt,e as jl,f as A,g as gl,h as fl,i as pl,Q as vl,k as bl,R as yl,l as Nl,P as wl,m as _l,B as Cl,n as Ua,F as Sl,C as kl,o as Tl,p as Dl,q as Pl,s as Vl,v as Il,z as u,w as Ba,x as ae,y as ie,A as Ga,D as _t,E as Ct,G as ea,H as Fe,T as St,J as kt,K as Ya,L as Wa,M as Rl,N as El,U as Fl,V as Ml,W as Ja,X as sa,Y as Qa,Z as zl,_ as Za,$ as Xa,a0 as en,a1 as sn,a2 as ks,a3 as tn,a4 as Ol,a5 as an,a6 as nn,a7 as Ll,a8 as $l,a9 as Al,aa as Hl,ab as rn,ac as Kl,ad as ql,ae as Ts,af as ln,ag as Ul,ah as Bl,ai as on,aj as Gl,ak as Yl,al as wa,am as Wl,an as cn,ao as Jl,ap as dn,aq as Ql,ar as Zl,as as Xl,at as ei,au as si,av as ti,aw as un,ax as ai,ay as ni,az as ri,aA as we,aB as li,aC as ii,aD as oi,aE as ci,aF as xn,aG as mn,aH as hn,aI as di,aJ as jn,aK as gn,aL as fn,aM as ui,aN as xi,aO as mi,aP as pn,aQ as hi,aR as ta,aS as vn,aT as ji,aU as bn,aV as gi,aW as yn,aX as fi,aY as Nn,aZ as wn,a_ as pi,a$ as vi,b0 as _n,b1 as bi,b2 as yi,b3 as Cn,b4 as Ni,b5 as Sn,b6 as wi,b7 as _i,b8 as Le,b9 as Q,ba as Pe,bb as lt,bc as Ci,bd as Si,be as ki,bf as Ti,bg as Di,bh as Pi,bi as _a,bj as Ca,bk as Vi,bl as Ii,bm as Ri,bn as Ei,bo as Fi,bp as At,bq as Ht,br as Mi,bs as zi,bt as kn,bu as Oi,bv as Li,bw as Tn,bx as $i,by as de,bz as Ai,bA as Sa,bB as Kt,bC as qt,bD as Hi,bE as Ki,bF as Dn,bG as qi,bH as aa,bI as Ui,bJ as Bi,bK as Gi,bL as Pn,bM as Vn,bN as In,bO as Yi,bP as Wi,bQ as Ji,bR as Qi,bS as Rn,bT as Zi,bU as We,bV as Xi,bW as eo,bX as vt,bY as ve,bZ as ka,b_ as so,b$ as En,c0 as Fn,c1 as Mn,c2 as zn,c3 as On,c4 as Ln,c5 as to,c6 as ao,c7 as no,c8 as Tt,c9 as Ds,ca as rs,cb as Me,cc as ze,cd as Ae,ce as He,cf as Ke,cg as ro,ch as lo,ci as io,cj as Ut,ck as na,cl as ra,cm as oo,cn as ls,co as is,cp as it,cq as co,cr as uo,cs as Ta,ct as Da,cu as $n,cv as Pa,cw as bt,cx as xo,cy as mo,cz as An,cA as ho,cB as jo,cC as Hn,cD as Bt,cE as Kn,cF as go,cG as qn,cH as Un,cI as fo,cJ as po,cK as vo,cL as bo,cM as yo}from"./vendor.js";import"./index.js";var fh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ph(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function No(s){if(s.__esModule)return s;var t=s.default;if(typeof t=="function"){var a=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};a.prototype=t.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(s).forEach(function(n){var l=Object.getOwnPropertyDescriptor(s,n);Object.defineProperty(a,n,l.get?l:{enumerable:!0,get:function(){return s[n]}})}),a}const wo={theme:"system",setTheme:()=>null},Bn=c.createContext(wo);function _o({children:s,defaultTheme:t="system",storageKey:a="vite-ui-theme",...n}){const[l,o]=c.useState(()=>localStorage.getItem(a)||t);c.useEffect(()=>{const x=window.document.documentElement;if(x.classList.remove("light","dark"),l==="system"){const r=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";x.classList.add(r);return}x.classList.add(l)},[l]);const d={theme:l,setTheme:x=>{localStorage.setItem(a,x),o(x)}};return e.jsx(Bn.Provider,{...n,value:d,children:s})}const Co=()=>{const s=c.useContext(Bn);if(s===void 0)throw new Error("useTheme must be used within a ThemeProvider");return s},So=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),ko=function(s,t){return new URL(s,t).href},Va={},X=function(t,a,n){let l=Promise.resolve();if(a&&a.length>0){const d=document.getElementsByTagName("link"),x=document.querySelector("meta[property=csp-nonce]"),r=x?.nonce||x?.getAttribute("nonce");l=Promise.allSettled(a.map(i=>{if(i=ko(i,n),i in Va)return;Va[i]=!0;const h=i.endsWith(".css"),D=h?'[rel="stylesheet"]':"";if(!!n)for(let w=d.length-1;w>=0;w--){const _=d[w];if(_.href===i&&(!h||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${D}`))return;const m=document.createElement("link");if(m.rel=h?"stylesheet":So,h||(m.as="script"),m.crossOrigin="",m.href=i,r&&m.setAttribute("nonce",r),document.head.appendChild(m),h)return new Promise((w,_)=>{m.addEventListener("load",w),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${i}`)))})}))}function o(d){const x=new Event("vite:preloadError",{cancelable:!0});if(x.payload=d,window.dispatchEvent(x),!x.defaultPrevented)throw d}return l.then(d=>{for(const x of d||[])x.status==="rejected"&&o(x.reason);return t().catch(o)})};function v(...s){return xl(ml(s))}const As=Ss("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm 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",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),T=c.forwardRef(({className:s,variant:t,size:a,asChild:n=!1,children:l,disabled:o,loading:d=!1,leftSection:x,rightSection:r,...i},h)=>{const D=n?Qt:"button";return e.jsxs(D,{className:v(As({variant:t,size:a,className:s})),disabled:d||o,ref:h,...i,children:[(x&&d||!x&&!r&&d)&&e.jsx(Na,{className:"mr-2 h-4 w-4 animate-spin"}),!d&&x&&e.jsx("div",{className:"mr-2",children:x}),l,!d&&r&&e.jsx("div",{className:"ml-2",children:r}),r&&d&&e.jsx(Na,{className:"ml-2 h-4 w-4 animate-spin"})]})});T.displayName="Button";function Es({className:s,minimal:t=!1}){const a=ns();return e.jsx("div",{className:v("h-svh w-full",s),children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[!t&&e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"500"}),e.jsxs("span",{className:"font-medium",children:["Oops! Something went wrong ",":')"]}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["We apologize for the inconvenience. ",e.jsx("br",{})," Please try again later."]}),!t&&e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(T,{variant:"outline",onClick:()=>a(-1),children:"Go Back"}),e.jsx(T,{onClick:()=>a("/"),children:"Back to Home"})]})]})})}function Ia(){const s=ns();return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"404"}),e.jsx("span",{className:"font-medium",children:"Oops! Page Not Found!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["It seems like the page you're looking for ",e.jsx("br",{}),"does not exist or might have been removed."]}),e.jsxs("div",{className:"mt-6 flex gap-4",children:[e.jsx(T,{variant:"outline",onClick:()=>s(-1),children:"Go Back"}),e.jsx(T,{onClick:()=>s("/"),children:"Back to Home"})]})]})})}function To(){return e.jsx("div",{className:"h-svh",children:e.jsxs("div",{className:"m-auto flex h-full w-full flex-col items-center justify-center gap-2",children:[e.jsx("h1",{className:"text-[7rem] font-bold leading-tight",children:"503"}),e.jsx("span",{className:"font-medium",children:"Website is under maintenance!"}),e.jsxs("p",{className:"text-center text-muted-foreground",children:["The site is not available at the moment. ",e.jsx("br",{}),"We'll be back online shortly."]}),e.jsx("div",{className:"mt-6 flex gap-4",children:e.jsx(T,{variant:"outline",children:"Learn more"})})]})})}function Do(s){return typeof s>"u"}function Po(s){return s===null}function Vo(s){return Po(s)||Do(s)}class Io{storage;prefixKey;constructor(t){this.storage=t.storage,this.prefixKey=t.prefixKey}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,a,n=null){const l=JSON.stringify({value:a,time:Date.now(),expire:n!==null?new Date().getTime()+n*1e3:null});this.storage.setItem(this.getKey(t),l)}get(t,a=null){const n=this.storage.getItem(this.getKey(t));if(!n)return{value:a,time:0};try{const l=JSON.parse(n),{value:o,time:d,expire:x}=l;return Vo(x)||x>new Date().getTime()?{value:o,time:d}:(this.remove(t),{value:a,time:0})}catch{return this.remove(t),{value:a,time:0}}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}}function Gn({prefixKey:s="",storage:t=sessionStorage}){return new Io({prefixKey:s,storage:t})}const Yn="Xboard_",Ro=function(s={}){return Gn({prefixKey:s.prefixKey||"",storage:localStorage})},Eo=function(s={}){return Gn({prefixKey:s.prefixKey||"",storage:sessionStorage})},Dt=Ro({prefixKey:Yn});Eo({prefixKey:Yn});const Wn="access_token";function Zs(){return Dt.get(Wn)}function Jn(){Dt.remove(Wn)}const Ra=["/sign-in","/sign-in-2","/sign-up","/forgot-password","/otp"];function Fo({children:s}){const t=ns(),a=Zt(),n=Zs();return c.useEffect(()=>{if(!n.value&&!Ra.includes(a.pathname)){const l=encodeURIComponent(a.pathname+a.search);t(`/sign-in?redirect=${l}`)}},[n.value,a.pathname,a.search,t]),Ra.includes(a.pathname)||n.value?e.jsx(e.Fragment,{children:s}):null}const Mo=()=>e.jsx(Fo,{children:e.jsx(Xt,{})}),zo=hl([{path:"/sign-in",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>nc);return{default:s}},void 0,import.meta.url)).default})},{element:e.jsx(Mo,{}),children:[{path:"/",lazy:async()=>({Component:(await X(()=>Promise.resolve().then(()=>pc),void 0,import.meta.url)).default}),errorElement:e.jsx(Es,{}),children:[{index:!0,lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Ud);return{default:s}},void 0,import.meta.url)).default})},{path:"config",errorElement:e.jsx(Es,{}),children:[{path:"system",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Yd);return{default:s}},void 0,import.meta.url)).default}),children:[{index:!0,lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Xd);return{default:s}},void 0,import.meta.url)).default})},{path:"safe",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>nu);return{default:s}},void 0,import.meta.url)).default})},{path:"subscribe",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>cu);return{default:s}},void 0,import.meta.url)).default})},{path:"invite",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>hu);return{default:s}},void 0,import.meta.url)).default})},{path:"frontend",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>vu);return{default:s}},void 0,import.meta.url)).default})},{path:"server",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>_u);return{default:s}},void 0,import.meta.url)).default})},{path:"email",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Du);return{default:s}},void 0,import.meta.url)).default})},{path:"telegram",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Eu);return{default:s}},void 0,import.meta.url)).default})},{path:"APP",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Lu);return{default:s}},void 0,import.meta.url)).default})}]},{path:"payment",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qu);return{default:s}},void 0,import.meta.url)).default})},{path:"theme",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>ex);return{default:s}},void 0,import.meta.url)).default})},{path:"notice",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>ix);return{default:s}},void 0,import.meta.url)).default})},{path:"knowledge",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>jx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"server",errorElement:e.jsx(Es,{}),children:[{path:"manage",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>$x);return{default:s}},void 0,import.meta.url)).default})},{path:"group",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Ux);return{default:s}},void 0,import.meta.url)).default})},{path:"route",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qx);return{default:s}},void 0,import.meta.url)).default})}]},{path:"finance",errorElement:e.jsx(Es,{}),children:[{path:"plan",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>lm);return{default:s}},void 0,import.meta.url)).default})},{path:"order",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>vm);return{default:s}},void 0,import.meta.url)).default})},{path:"coupon",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Tm);return{default:s}},void 0,import.meta.url)).default})}]},{path:"user",errorElement:e.jsx(Es,{}),children:[{path:"manage",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>Qm);return{default:s}},void 0,import.meta.url)).default})},{path:"ticket",lazy:async()=>({Component:(await X(async()=>{const{default:s}=await Promise.resolve().then(()=>hh);return{default:s}},void 0,import.meta.url)).default})}]}]}]},{path:"/500",Component:Es},{path:"/404",Component:Ia},{path:"/503",Component:To},{path:"*",Component:Ia}]),Oo="locale";function Lo(){return Dt.get(Oo)}function Qn(){Jn();const s=window.location.pathname,t=s&&!["/404","/sign-in"].includes(s),a=new URL(window.location.href),l=`${a.pathname.split("/")[1]?`/${a.pathname.split("/")[1]}`:""}#/sign-in`;window.location.href=l+(t?`?redirect=${s}`:"")}const $o=["/passport/auth/login","/passport/auth/token2Login","/passport/auth/register","/guest/comm/config","/passport/comm/sendEmailVerify","/passport/auth/forget"];function Ao(){const s=window.settings?.base_url||"/";return s.endsWith("/")?s+"api/v2":s+"/api/v2"}const I=jl.create({baseURL:Ao(),timeout:12e3,headers:{"Content-Type":"application/json"}});I.interceptors.request.use(s=>{s.method?.toLowerCase()==="get"&&(s.params={...s.params,t:Date.now()});const t=Zs();if(!$o.includes(s.url?.split("?")[0]||"")){if(!t.value)return Qn(),Promise.reject({code:-1,message:"未登录"});s.headers.Authorization=t.value}return s.headers["Content-Language"]=Lo().value||"zh-CN",s},s=>Promise.reject(s));I.interceptors.response.use(s=>s?.data||{code:-1,message:"未知错误"},s=>{const t=s.response?.status,a=s.response?.data?.message;return(t===401||t===403)&&Qn(),A.error(a||{401:"登录已过期",403:"没有权限",404:"资源或接口不存在"}[t]||"未知异常"),Promise.reject(s.response?.data||{data:null,code:-1,message:"未知错误"})});function Ho(){return I.get("/user/info")}const Mt={token:Zs()?.value||"",userInfo:null,isLoggedIn:!!Zs()?.value,loading:!1,error:null},Js=gl("user/fetchUserInfo",async()=>(await Ho()).data,{condition:(s,{getState:t})=>{const{user:a}=t();return!!a.token&&!a.loading}}),Zn=fl({name:"user",initialState:Mt,reducers:{setToken(s,t){s.token=t.payload,s.isLoggedIn=!!t.payload},resetUserState:()=>Mt},extraReducers:s=>{s.addCase(Js.pending,t=>{t.loading=!0,t.error=null}).addCase(Js.fulfilled,(t,a)=>{t.loading=!1,t.userInfo=a.payload,t.error=null}).addCase(Js.rejected,(t,a)=>{if(t.loading=!1,t.error=a.error.message||"Failed to fetch user info",!t.token)return Mt})}}),{setToken:Ko,resetUserState:qo}=Zn.actions,Uo=s=>s.user.userInfo,Bo=Zn.reducer,Xn=pl({reducer:{user:Bo}});Zs()?.value&&Xn.dispatch(Js());const Go=new vl;bl.createRoot(document.getElementById("root")).render(e.jsx(yl.StrictMode,{children:e.jsx(Nl,{client:Go,children:e.jsx(wl,{store:Xn,children:e.jsxs(_o,{defaultTheme:"light",storageKey:"vite-ui-theme",children:[e.jsx(_l,{router:zo}),e.jsx(Cl,{richColors:!0,position:"top-right"})]})})})}));const $e=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("rounded-xl border bg-card text-card-foreground shadow",s),...t}));$e.displayName="Card";const Je=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex flex-col space-y-1.5 p-6",s),...t}));Je.displayName="CardHeader";const gs=c.forwardRef(({className:s,...t},a)=>e.jsx("h3",{ref:a,className:v("font-semibold leading-none tracking-tight",s),...t}));gs.displayName="CardTitle";const Xs=c.forwardRef(({className:s,...t},a)=>e.jsx("p",{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Xs.displayName="CardDescription";const Qe=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("p-6 pt-0",s),...t}));Qe.displayName="CardContent";const Yo=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex items-center p-6 pt-0",s),...t}));Yo.displayName="CardFooter";const Wo=Ss("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),yt=c.forwardRef(({className:s,...t},a)=>e.jsx(Ua,{ref:a,className:v(Wo(),s),...t}));yt.displayName=Ua.displayName;const oe=Sl,er=c.createContext({}),g=({...s})=>e.jsx(er.Provider,{value:{name:s.name},children:e.jsx(kl,{...s})}),Pt=()=>{const s=c.useContext(er),t=c.useContext(sr),{getFieldState:a,formState:n}=Tl(),l=a(s.name,n);if(!s)throw new Error("useFormField should be used within ");const{id:o}=t;return{id:o,name:s.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...l}},sr=c.createContext({}),j=c.forwardRef(({className:s,...t},a)=>{const n=c.useId();return e.jsx(sr.Provider,{value:{id:n},children:e.jsx("div",{ref:a,className:v("space-y-2",s),...t})})});j.displayName="FormItem";const p=c.forwardRef(({className:s,...t},a)=>{const{error:n,formItemId:l}=Pt();return e.jsx(yt,{ref:a,className:v(n&&"text-destructive",s),htmlFor:l,...t})});p.displayName="FormLabel";const y=c.forwardRef(({...s},t)=>{const{error:a,formItemId:n,formDescriptionId:l,formMessageId:o}=Pt();return e.jsx(Qt,{ref:t,id:n,"aria-describedby":a?`${l} ${o}`:`${l}`,"aria-invalid":!!a,...s})});y.displayName="FormControl";const F=c.forwardRef(({className:s,...t},a)=>{const{formDescriptionId:n}=Pt();return e.jsx("p",{ref:a,id:n,className:v("text-[0.8rem] text-muted-foreground",s),...t})});F.displayName="FormDescription";const k=c.forwardRef(({className:s,children:t,...a},n)=>{const{error:l,formMessageId:o}=Pt(),d=l?String(l?.message):t;return d?e.jsx("p",{ref:n,id:o,className:v("text-[0.8rem] font-medium text-destructive",s),...a,children:d}):null});k.displayName="FormMessage";const S=c.forwardRef(({className:s,type:t,...a},n)=>e.jsx("input",{type:t,className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:n,...a}));S.displayName="Input";const tr=c.forwardRef(({className:s,...t},a)=>{const[n,l]=c.useState(!1);return e.jsxs("div",{className:"relative rounded-md",children:[e.jsx("input",{type:n?"text":"password",className:v("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:a,...t}),e.jsx(T,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1/2 h-6 w-6 -translate-y-1/2 rounded-md text-muted-foreground",onClick:()=>l(o=>!o),children:n?e.jsx(Dl,{size:18}):e.jsx(Pl,{size:18})})]})});tr.displayName="PasswordInput";const Jo=s=>I({url:"/passport/auth/login",method:"post",data:s}),Gt=s=>s;function re(s=void 0,t="YYYY-MM-DD HH:mm:ss"){return s==null?"":(Math.floor(s).toString().length===10&&(s=s*1e3),Il(s).format(t))}function Qo(s=void 0,t="YYYY-MM-DD"){return re(s,t)}function zs(s){const t=typeof s=="string"?parseFloat(s):s;return isNaN(t)?"0.00":t.toFixed(2)}function Ns(s,t=!0){if(s==null)return t?"¥0.00":"0.00";const a=typeof s=="string"?parseFloat(s):s;if(isNaN(a))return t?"¥0.00":"0.00";const l=(a/100).toFixed(2).replace(/\.?0+$/,o=>o.includes(".")?".00":o);return t?`¥${l}`:l}function Nt(s){navigator.clipboard?navigator.clipboard.writeText(s).then(()=>{A.success(Gt("复制成功"))}).catch(t=>{console.error("复制到剪贴板时出错:",t),Ea(s)}):Ea(s)}function Ea(s){const t=document.createElement("button"),a=new Vl(t,{text:()=>s});a.on("success",()=>{A.success(Gt("复制成功")),a.destroy()}),a.on("error",()=>{A.error(Gt("复制失败")),a.destroy()}),t.click()}function Ye(s){const t=s/1024,a=t/1024,n=a/1024,l=n/1024;return l>=1?zs(l)+" TB":n>=1?zs(n)+" GB":a>=1?zs(a)+" MB":zs(t)+" KB"}const Zo="access_token";function Xo(s){Dt.set(Zo,s)}const ec=u.object({email:u.string().min(1,{message:"请输入邮箱地址"}).email({message:"邮箱地址格式不正确"}),password:u.string().min(1,{message:"请输入密码"}).min(7,{message:"密码长度至少为7个字符"})});function sc({className:s,onForgotPassword:t,...a}){const n=ns(),l=Ba(),o=ae({resolver:ie(ec),defaultValues:{email:"",password:""}});async function d(x){Jo(x).then(({data:r})=>{Xo(r.auth_data),l(Ko(r.auth_data)),l(Js()).unwrap(),n("/")})}return e.jsx("div",{className:v("grid gap-6",s),...a,children:e.jsx(oe,{...o,children:e.jsx("form",{onSubmit:o.handleSubmit(d),children:e.jsxs("div",{className:"grid gap-2",children:[e.jsx(g,{control:o.control,name:"email",render:({field:x})=>e.jsxs(j,{className:"space-y-1",children:[e.jsx(p,{children:"邮箱地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"name@example.com",...x})}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"password",render:({field:x})=>e.jsxs(j,{className:"space-y-1",children:[e.jsx(p,{children:"密码"}),e.jsx(y,{children:e.jsx(tr,{placeholder:"请输入密码",...x})}),e.jsx(k,{})]})}),e.jsx(T,{className:"mt-2",loading:o.formState.isSubmitting,children:"登录"}),e.jsx(T,{variant:"link",type:"button",className:"mt-1 text-sm text-muted-foreground hover:text-primary",onClick:t,children:"忘记密码?"})]})})})})}const ue=Ga,Ie=Ya,tc=Wa,ot=ea,ar=c.forwardRef(({className:s,...t},a)=>e.jsx(_t,{ref:a,className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t}));ar.displayName=_t.displayName;const ce=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(tc,{children:[e.jsx(ar,{}),e.jsxs(Ct,{ref:n,className:v("max-h-[95%] overflow-auto fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...a,children:[t,e.jsxs(ea,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(Fe,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ce.displayName=Ct.displayName;const he=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-1.5 text-center sm:text-left",s),...t});he.displayName="DialogHeader";const Re=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});Re.displayName="DialogFooter";const xe=c.forwardRef(({className:s,...t},a)=>e.jsx(St,{ref:a,className:v("text-lg font-semibold leading-none tracking-tight",s),...t}));xe.displayName=St.displayName;const Se=c.forwardRef(({className:s,...t},a)=>e.jsx(kt,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Se.displayName=kt.displayName;const $s=Ss("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm 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",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),W=c.forwardRef(({className:s,variant:t,size:a,asChild:n=!1,...l},o)=>{const d=n?Qt:"button";return e.jsx(d,{className:v($s({variant:t,size:a,className:s})),ref:o,...l})});W.displayName="Button";function ac(){const[s,t]=c.useState(!1),a="php artisan reset:password 管理员邮箱";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"container grid h-svh flex-col items-center justify-center bg-primary-foreground lg:max-w-none lg:px-0",children:e.jsxs("div",{className:"mx-auto flex w-full flex-col justify-center space-y-2 sm:w-[480px] lg:p-8",children:[e.jsx("div",{className:"mb-4 flex items-center justify-center",children:e.jsx("h1",{className:"text-3xl font-medium",children:window?.settings?.title})}),e.jsxs($e,{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-left",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"登录"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"请输入您的邮箱和密码登录系统"})]}),e.jsx(sc,{onForgotPassword:()=>t(!0)})]})]})}),e.jsx(ue,{open:s,onOpenChange:t,children:e.jsx(ce,{children:e.jsxs(he,{children:[e.jsx(xe,{children:"忘记密码"}),e.jsx(Se,{children:"在站点目录下执行以下命令找回密码"}),e.jsx("div",{className:"mt-2",children:e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"rounded-md bg-secondary p-4 pr-12",children:a}),e.jsx(W,{variant:"ghost",size:"icon",className:"absolute right-2 top-2 h-8 w-8 hover:bg-secondary-foreground/10",onClick:()=>Nt(a),children:e.jsx(Rl,{className:"h-4 w-4"})})]})})]})})})]})}const nc=Object.freeze(Object.defineProperty({__proto__:null,default:ac},Symbol.toStringTag,{value:"Module"})),ye=c.forwardRef(({className:s,fadedBelow:t=!1,fixedHeight:a=!1,...n},l)=>e.jsx("div",{ref:l,className:v("relative flex h-full w-full flex-col",t&&"after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:hidden after:h-32 after:w-full after:bg-[linear-gradient(180deg,_transparent_10%,_hsl(var(--background))_70%)] after:md:block",a&&"md:h-svh",s),...n}));ye.displayName="Layout";const Ne=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{ref:a,className:v("flex h-[var(--header-height)] flex-none items-center gap-4 bg-background p-4 md:px-8",s),...t}));Ne.displayName="LayoutHeader";const _e=c.forwardRef(({className:s,fixedHeight:t,...a},n)=>e.jsx("div",{ref:n,className:v("flex-1 overflow-hidden px-4 py-6 md:px-8",t&&"h-[calc(100%-var(--header-height))]",s),...a}));_e.displayName="LayoutBody";const nr=El,rr=Fl,lr=Ml,_s=Ll,Cs=$l,rc=Al,lc=c.forwardRef(({className:s,inset:t,children:a,...n},l)=>e.jsxs(Ja,{ref:l,className:v("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",s),...n,children:[a,e.jsx(sa,{className:"ml-auto h-4 w-4"})]}));lc.displayName=Ja.displayName;const ic=c.forwardRef(({className:s,...t},a)=>e.jsx(Qa,{ref:a,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...t}));ic.displayName=Qa.displayName;const fs=c.forwardRef(({className:s,sideOffset:t=4,...a},n)=>e.jsx(zl,{children:e.jsx(Za,{ref:n,sideOffset:t,className:v("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a})}));fs.displayName=Za.displayName;const me=c.forwardRef(({className:s,inset:t,...a},n)=>e.jsx(Xa,{ref:n,className:v("relative flex cursor-default cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",s),...a}));me.displayName=Xa.displayName;const oc=c.forwardRef(({className:s,children:t,checked:a,...n},l)=>e.jsxs(en,{ref:l,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:a,...n,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(sn,{children:e.jsx(ks,{className:"h-4 w-4"})})}),t]}));oc.displayName=en.displayName;const cc=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(tn,{ref:n,className:v("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(sn,{children:e.jsx(Ol,{className:"h-4 w-4 fill-current"})})}),t]}));cc.displayName=tn.displayName;const la=c.forwardRef(({className:s,inset:t,...a},n)=>e.jsx(an,{ref:n,className:v("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",s),...a}));la.displayName=an.displayName;const et=c.forwardRef(({className:s,...t},a)=>e.jsx(nn,{ref:a,className:v("-mx-1 my-1 h-px bg-muted",s),...t}));et.displayName=nn.displayName;const Yt=({className:s,...t})=>e.jsx("span",{className:v("ml-auto text-xs tracking-widest opacity-60",s),...t});Yt.displayName="DropdownMenuShortcut";const le=Hl,se=Kl,te=ql,ee=c.forwardRef(({className:s,sideOffset:t=4,...a},n)=>e.jsx(rn,{ref:n,sideOffset:t,className:v("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a}));ee.displayName=rn.displayName;function Vt(){const{pathname:s}=Zt();return{checkActiveNav:a=>{if(a==="/"&&s==="/")return!0;const n=a.replace(/^\//,""),l=s.replace(/^\//,"");return n?l.startsWith(n):!1}}}function ir({key:s,defaultValue:t}){const[a,n]=c.useState(()=>{const l=localStorage.getItem(s);return l!==null?JSON.parse(l):t});return c.useEffect(()=>{localStorage.setItem(s,JSON.stringify(a))},[a,s]),[a,n]}function dc(){const[s,t]=ir({key:"expanded-sidebar-items",defaultValue:["仪表盘","系统管理","节点管理","订阅管理","用户管理"]});return{expandedItems:s,toggleItem:n=>{t(l=>l.includes(n)?l.filter(o=>o!==n):[...l,n])},isExpanded:n=>s.includes(n)}}function uc({links:s,isCollapsed:t,className:a,closeNav:n}){const l=({sub:o,...d})=>{const x=`${d.title}-${d.href}`;return t&&o?c.createElement(hc,{...d,sub:o,key:x,closeNav:n}):t?c.createElement(mc,{...d,key:x,closeNav:n}):o?c.createElement(xc,{...d,sub:o,key:x,closeNav:n}):c.createElement(or,{...d,key:x,closeNav:n})};return e.jsx("div",{"data-collapsed":t,className:v("group border-b bg-background py-2 transition-[max-height,padding] duration-500 data-[collapsed=true]:py-2 md:border-none",a),children:e.jsx(le,{delayDuration:0,children:e.jsx("nav",{className:"grid gap-1 group-[[data-collapsed=true]]:justify-center group-[[data-collapsed=true]]:px-2",children:s.map(l)})})})}function or({title:s,icon:t,label:a,href:n,closeNav:l,subLink:o=!1}){const{checkActiveNav:d}=Vt();return e.jsxs(Ts,{to:n,onClick:l,className:v(As({variant:d(n)?"secondary":"ghost",size:"sm"}),"h-12 justify-start text-wrap rounded-none px-6",o&&"h-10 w-full border-l border-l-slate-500 px-2"),"aria-current":d(n)?"page":void 0,children:[e.jsx("div",{className:"mr-2",children:t}),s,a&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:a})]})}function xc({title:s,icon:t,label:a,sub:n,closeNav:l}){const{checkActiveNav:o}=Vt(),{isExpanded:d,toggleItem:x}=dc(),r=!!n?.find(h=>o(h.href)),i=d(s)||r;return e.jsxs(nr,{open:i,onOpenChange:()=>x(s),children:[e.jsxs(rr,{className:v(As({variant:"ghost",size:"sm"}),"group h-12 w-full justify-start rounded-none px-6"),children:[e.jsx("div",{className:"mr-2",children:t}),s,a&&e.jsx("div",{className:"ml-2 rounded-lg bg-primary px-1 text-[0.625rem] text-primary-foreground",children:a}),e.jsx("span",{className:v('ml-auto transition-all group-data-[state="open"]:-rotate-180'),children:e.jsx(ln,{stroke:1})})]}),e.jsx(lr,{className:"collapsibleDropdown",asChild:!0,children:e.jsx("ul",{children:n.map(h=>e.jsx("li",{className:"my-1 ml-8",children:e.jsx(or,{...h,subLink:!0,closeNav:l})},h.title))})})]})}function mc({title:s,icon:t,label:a,href:n}){const{checkActiveNav:l}=Vt();return e.jsxs(se,{delayDuration:0,children:[e.jsx(te,{asChild:!0,children:e.jsxs(Ts,{to:n,className:v(As({variant:l(n)?"secondary":"ghost",size:"icon"}),"h-12 w-12"),children:[t,e.jsx("span",{className:"sr-only",children:s})]})}),e.jsxs(ee,{side:"right",className:"flex items-center gap-4",children:[s,a&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:a})]})]})}function hc({title:s,icon:t,label:a,sub:n}){const{checkActiveNav:l}=Vt(),o=!!n?.find(d=>l(d.href));return e.jsxs(_s,{children:[e.jsxs(se,{delayDuration:0,children:[e.jsx(te,{asChild:!0,children:e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:o?"secondary":"ghost",size:"icon",className:"h-12 w-12",children:t})})}),e.jsxs(ee,{side:"right",className:"flex items-center gap-4",children:[s," ",a&&e.jsx("span",{className:"ml-auto text-muted-foreground",children:a}),e.jsx(ln,{size:18,className:"-rotate-90 text-muted-foreground"})]})]}),e.jsxs(fs,{side:"right",align:"start",sideOffset:4,children:[e.jsxs(la,{children:[s," ",a?`(${a})`:""]}),e.jsx(et,{}),n.map(({title:d,icon:x,label:r,href:i})=>e.jsx(me,{asChild:!0,children:e.jsxs(Ts,{to:i,className:`${l(i)?"bg-secondary":""}`,children:[x," ",e.jsx("span",{className:"ml-2 max-w-52 text-wrap",children:d}),r&&e.jsx("span",{className:"ml-auto text-xs",children:r})]})},`${d}-${i}`))]})]})}const cr=[{title:"仪表盘",label:"",href:"/",icon:e.jsx(Ul,{size:18})},{title:"系统管理",label:"",href:"",icon:e.jsx(Bl,{size:18}),sub:[{title:"系统配置",label:"",href:"/config/system",icon:e.jsx(on,{size:18})},{title:"主题配置",label:"",href:"/config/theme",icon:e.jsx(Gl,{size:18})},{title:"公告管理",label:"",href:"/config/notice",icon:e.jsx(Yl,{size:18})},{title:"支付配置",label:"",href:"/config/payment",icon:e.jsx(wa,{size:18})},{title:"知识库管理",label:"",href:"/config/knowledge",icon:e.jsx(Wl,{size:18})}]},{title:"节点管理",label:"",href:"",icon:e.jsx(cn,{size:18}),sub:[{title:"节点管理",label:"",href:"/server/manage",icon:e.jsx(Jl,{size:18})},{title:"权限组管理",label:"",href:"/server/group",icon:e.jsx(dn,{size:18})},{title:"路由管理",label:"",href:"/server/route",icon:e.jsx(Ql,{size:18})}]},{title:"订阅管理",label:"",href:"",icon:e.jsx(Zl,{size:18}),sub:[{title:"套餐管理",label:"",href:"/finance/plan",icon:e.jsx(Xl,{size:18})},{title:"订单管理",label:"",href:"/finance/order",icon:e.jsx(wa,{size:18})},{title:"优惠券管理",label:"",href:"/finance/coupon",icon:e.jsx(ei,{size:18})}]},{title:"用户管理",label:"",href:"",icon:e.jsx(si,{size:18}),sub:[{title:"用户管理",label:"",href:"/user/manage",icon:e.jsx(ti,{size:18})},{title:"工单管理",label:"",href:"/user/ticket",icon:e.jsx(un,{size:18})}]}];function jc({className:s,isCollapsed:t,setIsCollapsed:a}){const[n,l]=c.useState(!1);return c.useEffect(()=>{n?document.body.classList.add("overflow-hidden"):document.body.classList.remove("overflow-hidden")},[n]),e.jsxs("aside",{className:v(`fixed left-0 right-0 top-0 z-50 w-full border-r-2 border-r-muted transition-[width] md:bottom-0 md:right-auto md:h-svh ${t?"md:w-14":"md:w-64"}`,s),children:[e.jsx("div",{onClick:()=>l(!1),className:`absolute inset-0 transition-[opacity] delay-100 duration-700 ${n?"h-svh opacity-50":"h-0 opacity-0"} w-full bg-black md:hidden`}),e.jsxs(ye,{children:[e.jsxs(Ne,{className:"sticky top-0 justify-between px-4 py-3 shadow md:px-4",children:[e.jsxs("div",{className:`flex items-center ${t?"":"gap-2"}`,children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",className:`transition-all ${t?"h-6 w-6":"h-8 w-8"}`,children:[e.jsx("rect",{width:"256",height:"256",fill:"none"}),e.jsx("line",{x1:"208",y1:"128",x2:"128",y2:"208",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("line",{x1:"192",y1:"40",x2:"40",y2:"192",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"}),e.jsx("span",{className:"sr-only",children:"Website Name"})]}),e.jsx("div",{className:`flex flex-col justify-end truncate ${t?"invisible w-0":"visible w-auto"}`,children:e.jsx("span",{className:"font-medium",children:window?.settings?.title})})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Toggle Navigation","aria-controls":"sidebar-menu","aria-expanded":n,onClick:()=>l(o=>!o),children:n?e.jsx(ai,{}):e.jsx(ni,{})})]}),e.jsx(uc,{id:"sidebar-menu",className:`h-full flex-1 overflow-auto ${n?"max-h-screen":"max-h-0 py-0 md:max-h-screen md:py-2"}`,closeNav:()=>l(!1),isCollapsed:t,links:cr}),e.jsx("div",{className:v("px-4 py-3 text-xs text-muted-foreground/70 border-t border-border/50 bg-muted/20","transition-all duration-200 ease-in-out",t?"text-center":"text-left"),children:e.jsxs("div",{className:v("flex items-center gap-1.5",t?"justify-center":"justify-start"),children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500/70"}),e.jsxs("span",{className:"tracking-wide",children:["v",window?.settings?.version]})]})}),e.jsx(T,{onClick:()=>a(o=>!o),size:"icon",variant:"outline",className:"absolute -right-5 top-1/2 hidden rounded-full md:inline-flex",children:e.jsx(ri,{stroke:1.5,className:`h-5 w-5 ${t?"rotate-180":""}`})})]})]})}function gc(){const[s,t]=ir({key:"collapsed-sidebar",defaultValue:!1});return c.useEffect(()=>{const a=()=>{t(window.innerWidth<768?!1:s)};return a(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[s,t]),[s,t]}function fc(){const[s,t]=gc();return e.jsxs("div",{className:"relative h-full overflow-hidden bg-background",children:[e.jsx(jc,{isCollapsed:s,setIsCollapsed:t}),e.jsx("main",{id:"content",className:`overflow-x-hidden pt-16 transition-[margin] md:overflow-y-hidden md:pt-0 ${s?"md:ml-14":"md:ml-64"} h-full`,children:e.jsx(Xt,{})})]})}const pc=Object.freeze(Object.defineProperty({__proto__:null,default:fc},Symbol.toStringTag,{value:"Module"})),ps=c.forwardRef(({className:s,...t},a)=>e.jsx(we,{ref:a,className:v("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",s),...t}));ps.displayName=we.displayName;const vc=({children:s,...t})=>e.jsx(ue,{...t,children:e.jsx(ce,{className:"overflow-hidden p-0",children:e.jsx(ps,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:s})})}),Ps=c.forwardRef(({className:s,...t},a)=>e.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[e.jsx(li,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(we.Input,{ref:a,className:v("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",s),...t})]}));Ps.displayName=we.Input.displayName;const vs=c.forwardRef(({className:s,...t},a)=>e.jsx(we.List,{ref:a,className:v("max-h-[300px] overflow-y-auto overflow-x-hidden",s),...t}));vs.displayName=we.List.displayName;const Vs=c.forwardRef((s,t)=>e.jsx(we.Empty,{ref:t,className:"py-6 text-center text-sm",...s}));Vs.displayName=we.Empty.displayName;const Ve=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Group,{ref:a,className:v("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",s),...t}));Ve.displayName=we.Group.displayName;const Hs=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Separator,{ref:a,className:v("-mx-1 h-px bg-border",s),...t}));Hs.displayName=we.Separator.displayName;const be=c.forwardRef(({className:s,...t},a)=>e.jsx(we.Item,{ref:a,className:v("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...t}));be.displayName=we.Item.displayName;function bc(){const s=[];for(const t of cr)if(t.href&&s.push(t),t.sub)for(const a of t.sub)s.push({...a,parent:t.title});return s}function ke(){const[s,t]=c.useState(!1),a=ns(),n=bc();c.useEffect(()=>{const o=d=>{d.key==="k"&&(d.metaKey||d.ctrlKey)&&(d.preventDefault(),t(x=>!x))};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[]);const l=c.useCallback(o=>{t(!1),a(o)},[a]);return e.jsxs(e.Fragment,{children:[e.jsxs(W,{variant:"outline",className:"relative h-9 w-9 p-0 xl:h-10 xl:w-60 xl:justify-start xl:px-3 xl:py-2",onClick:()=>t(!0),children:[e.jsx(ii,{className:"h-4 w-4 xl:mr-2"}),e.jsx("span",{className:"hidden xl:inline-flex",children:"搜索..."}),e.jsx("span",{className:"sr-only",children:"搜索"}),e.jsxs("kbd",{className:"pointer-events-none absolute right-1.5 top-2 hidden h-6 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium opacity-100 xl:flex",children:[e.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]}),e.jsxs(vc,{open:s,onOpenChange:t,children:[e.jsx(Ps,{placeholder:"搜索所有菜单和功能..."}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"未找到相关结果"}),e.jsx(Ve,{heading:"菜单导航",children:n.map(o=>e.jsxs(be,{value:`${o.parent?o.parent+" ":""}${o.title}`,onSelect:()=>l(o.href),children:[e.jsx("div",{className:"mr-2",children:o.icon}),e.jsx("span",{children:o.title}),o.parent&&e.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:o.parent})]},o.href))})]})]})]})}function Te(){const{theme:s,setTheme:t}=Co();return c.useEffect(()=>{const a=s==="dark"?"#020817":"#fff",n=document.querySelector("meta[name='theme-color']");n&&n.setAttribute("content",a)},[s]),e.jsx(T,{size:"icon",variant:"ghost",className:"rounded-full",onClick:()=>t(s==="light"?"dark":"light"),children:s==="light"?e.jsx(oi,{size:20}):e.jsx(ci,{size:20})})}const dr=c.forwardRef(({className:s,...t},a)=>e.jsx(xn,{ref:a,className:v("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",s),...t}));dr.displayName=xn.displayName;const ur=c.forwardRef(({className:s,...t},a)=>e.jsx(mn,{ref:a,className:v("aspect-square h-full w-full",s),...t}));ur.displayName=mn.displayName;const xr=c.forwardRef(({className:s,...t},a)=>e.jsx(hn,{ref:a,className:v("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...t}));xr.displayName=hn.displayName;function De(){const s=ns(),t=Ba(),a=di(Uo),n=()=>{Jn(),t(qo()),s("/sign-in")},l=a?.email?.split("@")[0]||"User",o=l.substring(0,2).toUpperCase();return e.jsxs(_s,{children:[e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:e.jsxs(dr,{className:"h-8 w-8",children:[e.jsx(ur,{src:a?.avatar_url,alt:l}),e.jsx(xr,{children:o})]})})}),e.jsxs(fs,{className:"w-56",align:"end",forceMount:!0,children:[e.jsx(la,{className:"font-normal",children:e.jsxs("div",{className:"flex flex-col space-y-1",children:[e.jsx("p",{className:"text-sm font-medium leading-none",children:l}),e.jsx("p",{className:"text-xs leading-none text-muted-foreground",children:a?.email||"user@example.com"})]})}),e.jsx(et,{}),e.jsx(me,{asChild:!0,children:e.jsxs(Ts,{to:"/config/system",children:["设置",e.jsx(Yt,{children:"⌘S"})]})}),e.jsx(et,{}),e.jsxs(me,{onClick:n,children:["退出登录",e.jsx(Yt,{children:"⇧⌘Q"})]})]})]})}const Ge=window?.settings?.secure_path,mr=5*60*1e3,Wt=new Map,yc=s=>{const t=Wt.get(s);return t?Date.now()-t.timestamp>mr?(Wt.delete(s),null):t.data:null},Nc=(s,t)=>{Wt.set(s,{data:t,timestamp:Date.now()})},wc=async(s,t=mr)=>{const a=yc(s);if(a)return a;const n=await I.get(s);return Nc(s,n),n},_c={getList:()=>wc(`${Ge}/notice/fetch`),save:s=>I.post(`${Ge}/notice/save`,s),drop:s=>I.post(`${Ge}/notice/drop`,{id:s}),updateStatus:s=>I.post(`${Ge}/notice/show`,{id:s}),sort:s=>I.post(`${Ge}/notice/sort`,{ids:s})},Fa={getSystemStatus:()=>I.get(`${Ge}/system/getSystemStatus`),getQueueStats:()=>I.get(`${Ge}/system/getQueueStats`),getQueueWorkload:()=>I.get(`${Ge}/system/getQueueWorkload`),getQueueMasters:()=>I.get(`${Ge}/system/getQueueMasters`),getSystemLog:s=>I.get(`${Ge}/system/getSystemLog`,{params:s})},M=window?.settings?.secure_path,Cc=s=>I.get(M+"/stat/getOrder",{params:s}),Sc=()=>I.get(M+"/stat/getStats"),Ma=s=>I.get(M+"/stat/getTrafficRank",{params:s}),kc=()=>I.get(M+"/theme/getThemes"),Tc=s=>I.post(M+"/theme/getThemeConfig",{name:s}),Dc=(s,t)=>I.post(M+"/theme/saveThemeConfig",{name:s,config:t}),Pc=s=>{const t=new FormData;return t.append("file",s),I.post(M+"/theme/upload",t,{headers:{"Content-Type":"multipart/form-data"}})},Vc=s=>I.post(M+"/theme/delete",{name:s}),Ic=s=>I.post(M+"/config/save",s),hr=()=>I.get(M+"/server/manage/getNodes"),Rc=s=>I.post(M+"/server/manage/save",s),Ec=s=>I.post(M+"/server/manage/drop",s),Fc=s=>I.post(M+"/server/manage/copy",s),Mc=s=>I.post(M+"/server/manage/update",s),zc=s=>I.post(M+"/server/manage/sort",s),It=()=>I.get(M+"/server/group/fetch"),Oc=s=>I.post(M+"/server/group/save",s),Lc=s=>I.post(M+"/server/group/drop",s),jr=()=>I.get(M+"/server/route/fetch"),$c=s=>I.post(M+"/server/route/save",s),Ac=s=>I.post(M+"/server/route/drop",s),Hc=()=>I.get(M+"/payment/fetch"),Kc=()=>I.get(M+"/payment/getPaymentMethods"),qc=s=>I.post(M+"/payment/getPaymentForm",s),Uc=s=>I.post(M+"/payment/save",s),Bc=s=>I.post(M+"/payment/drop",s),Gc=s=>I.post(M+"/payment/show",s),Yc=s=>I.post(M+"/payment/sort",s),Wc=()=>I.get(M+"/notice/fetch"),Jc=s=>I.post(M+"/notice/save",s),Qc=s=>I.post(M+"/notice/drop",s),Zc=s=>I.post(M+"/notice/show",s),Xc=()=>I.get(M+"/knowledge/fetch"),ed=s=>I.get(M+"/knowledge/fetch?id="+s),sd=s=>I.post(M+"/knowledge/save",s),td=s=>I.post(M+"/knowledge/drop",s),ad=s=>I.post(M+"/knowledge/show",s),nd=s=>I.post(M+"/knowledge/sort",s),Is=()=>I.get(M+"/plan/fetch"),rd=s=>I.post(M+"/plan/save",s),zt=s=>I.post(M+"/plan/update",s),ld=s=>I.post(M+"/plan/drop",s),id=s=>I.post(M+"/plan/sort",{ids:s}),od=async s=>I.post(M+"/order/fetch",s),cd=s=>I.post(M+"/order/detail",s),dd=s=>I.post(M+"/order/paid",s),ud=s=>I.post(M+"/order/cancel",s),za=s=>I.post(M+"/order/update",s),xd=s=>I.post(M+"/order/assign",s),md=s=>I.post(M+"/coupon/fetch",s),hd=s=>I.post(M+"/coupon/generate",s),jd=s=>I.post(M+"/coupon/drop",s),gd=s=>I.post(M+"/coupon/update",s),fd=s=>I.post(M+"/user/fetch",s),pd=s=>I.post(M+"/user/update",s),vd=s=>I.post(M+"/user/resetSecret",s),bd=s=>I.post(M+"/user/generate",s),yd=s=>I.post(M+"/stat/getStatUser",s),Nd=s=>I.post(M+"/ticket/fetch",s),wd=s=>I.get(M+"/ticket/fetch?id= "+s),_d=s=>I.post(M+"/ticket/reply",s),gr=s=>I.post(M+"/ticket/close",{id:s}),os=(s="")=>I.get(M+"/config/fetch?key="+s),cs=s=>I.post(M+"/config/save",s),Cd=()=>I.get(M+"/config/getEmailTemplate"),Sd=()=>I.post(M+"/config/testSendMail"),kd=()=>I.post(M+"/config/setTelegramWebhook"),Td=_c.sort,fr=ui,ia=c.forwardRef(({className:s,...t},a)=>e.jsx(jn,{ref:a,className:v("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",s),...t}));ia.displayName=jn.displayName;const st=c.forwardRef(({className:s,...t},a)=>e.jsx(gn,{ref:a,className:v("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),...t}));st.displayName=gn.displayName;const Dd=c.forwardRef(({className:s,...t},a)=>e.jsx(fn,{ref:a,className:v("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",s),...t}));Dd.displayName=fn.displayName;const G=xi,xs=bi,Y=mi,U=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(pn,{ref:n,className:v("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...a,children:[t,e.jsx(hi,{asChild:!0,children:e.jsx(ta,{className:"h-4 w-4 opacity-50"})})]}));U.displayName=pn.displayName;const pr=c.forwardRef(({className:s,...t},a)=>e.jsx(vn,{ref:a,className:v("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ji,{className:"h-4 w-4"})}));pr.displayName=vn.displayName;const vr=c.forwardRef(({className:s,...t},a)=>e.jsx(bn,{ref:a,className:v("flex cursor-default items-center justify-center py-1",s),...t,children:e.jsx(ta,{className:"h-4 w-4"})}));vr.displayName=bn.displayName;const B=c.forwardRef(({className:s,children:t,position:a="popper",...n},l)=>e.jsx(gi,{children:e.jsxs(yn,{ref:l,className:v("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:a,...n,children:[e.jsx(pr,{}),e.jsx(fi,{className:v("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),e.jsx(vr,{})]})}));B.displayName=yn.displayName;const Pd=c.forwardRef(({className:s,...t},a)=>e.jsx(Nn,{ref:a,className:v("px-2 py-1.5 text-sm font-semibold",s),...t}));Pd.displayName=Nn.displayName;const O=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(wn,{ref:n,className:v("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...a,children:[e.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(pi,{children:e.jsx(ks,{className:"h-4 w-4"})})}),e.jsx(vi,{children:t})]}));O.displayName=wn.displayName;const Vd=c.forwardRef(({className:s,...t},a)=>e.jsx(_n,{ref:a,className:v("-mx-1 my-1 h-px bg-muted",s),...t}));Vd.displayName=_n.displayName;function Rs({className:s,classNames:t,showOutsideDays:a=!0,...n}){return e.jsx(yi,{showOutsideDays:a,className:v("p-3",s),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:v($s({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:v("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md",n.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:v($s({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({className:l,...o})=>e.jsx(Cn,{className:v("h-4 w-4",l),...o}),IconRight:({className:l,...o})=>e.jsx(sa,{className:v("h-4 w-4",l),...o})},...n})}Rs.displayName="Calendar";const Ze=wi,Xe=_i,qe=c.forwardRef(({className:s,align:t="center",sideOffset:a=4,...n},l)=>e.jsx(Ni,{children:e.jsx(Sn,{ref:l,align:t,sideOffset:a,className:v("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...n})}));qe.displayName=Sn.displayName;const ms={income:{main:"hsl(var(--primary))",gradient:{start:"hsl(var(--primary))",end:"transparent"}},commission:{main:"hsl(var(--secondary))",gradient:{start:"hsl(var(--secondary))",end:"transparent"}}},Ws=s=>(s/100).toFixed(2),Id=({active:s,payload:t,label:a})=>s&&t&&t.length?e.jsxs("div",{className:"rounded-lg border bg-background p-3 shadow-sm",children:[e.jsx("div",{className:"mb-2 text-sm font-medium",children:a}),t.map((n,l)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[e.jsx("div",{className:"h-2 w-2 rounded-full",style:{backgroundColor:n.color}}),e.jsxs("span",{className:"text-muted-foreground",children:[n.name,":"]}),e.jsx("span",{className:"font-medium",children:n.name.includes("金额")?`¥${Ws(n.value)}`:`${n.value}笔`})]},l))]}):null,Rd=[{value:"7d",label:"最近7天"},{value:"30d",label:"最近30天"},{value:"90d",label:"最近90天"},{value:"180d",label:"最近180天"},{value:"365d",label:"最近一年"},{value:"custom",label:"自定义范围"}],Ed=(s,t)=>{const a=new Date;if(s==="custom"&&t)return{startDate:t.from,endDate:t.to};let n;switch(s){case"7d":n=Le(a,7);break;case"30d":n=Le(a,30);break;case"90d":n=Le(a,90);break;case"180d":n=Le(a,180);break;case"365d":n=Le(a,365);break;default:n=Le(a,30)}return{startDate:n,endDate:a}};function Fd(){const[s,t]=c.useState("amount"),[a,n]=c.useState("30d"),[l,o]=c.useState({from:Le(new Date,7),to:new Date}),{startDate:d,endDate:x}=Ed(a,l),{data:r}=Q({queryKey:["orderStat",{start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(x,"yyyy-MM-dd")}],queryFn:async()=>{const{data:i}=await Cc({start_date:Pe(d,"yyyy-MM-dd"),end_date:Pe(x,"yyyy-MM-dd")});return i},refetchInterval:3e4});return e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(gs,{children:"收入趋势"}),e.jsx(Xs,{children:`${r?.summary.start_date||""} 至 ${r?.summary.end_date||""}`})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsxs(G,{value:a,onValueChange:i=>n(i),children:[e.jsx(U,{className:"w-[120px]",children:e.jsx(Y,{placeholder:"选择时间范围"})}),e.jsx(B,{children:Rd.map(i=>e.jsx(O,{value:i.value,children:i.label},i.value))})]}),a==="custom"&&e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(W,{variant:"outline",className:v("min-w-0 justify-start text-left font-normal",!l&&"text-muted-foreground"),children:[e.jsx(lt,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:l?.from?l.to?e.jsxs(e.Fragment,{children:[Pe(l.from,"yyyy-MM-dd")," -"," ",Pe(l.to,"yyyy-MM-dd")]}):Pe(l.from,"yyyy-MM-dd"):e.jsx("span",{children:"选择日期范围"})})]})}),e.jsx(qe,{className:"w-auto p-0",align:"end",children:e.jsx(Rs,{mode:"range",defaultMonth:l?.from,selected:{from:l?.from,to:l?.to},onSelect:i=>{i?.from&&i?.to&&o({from:i.from,to:i.to})},numberOfMonths:2})})]})]}),e.jsx(fr,{value:s,onValueChange:i=>t(i),children:e.jsxs(ia,{children:[e.jsx(st,{value:"amount",children:"金额"}),e.jsx(st,{value:"count",children:"笔数"})]})})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总收入"}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ws(r?.summary?.paid_total||0)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["共 ",r?.summary?.paid_count||0," 笔"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["平均订单金额 ¥",Ws(r?.summary?.avg_paid_amount||0)]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:"总佣金"}),e.jsxs("div",{className:"text-2xl font-bold",children:["¥",Ws(r?.summary?.commission_total||0)]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["共 ",r?.summary?.commission_count||0," 笔"]}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["佣金比率 ",r?.summary?.commission_rate.toFixed(2)||0,"%"]})]})]})]}),e.jsx(Qe,{children:e.jsx("div",{className:"h-[400px] w-full",children:e.jsx(Ci,{width:"100%",height:"100%",children:e.jsxs(Si,{data:r?.list||[],margin:{top:20,right:20,left:0,bottom:0},children:[e.jsxs("defs",{children:[e.jsxs("linearGradient",{id:"incomeGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ms.income.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:ms.income.gradient.end,stopOpacity:.1})]}),e.jsxs("linearGradient",{id:"commissionGradient",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:ms.commission.gradient.start,stopOpacity:.2}),e.jsx("stop",{offset:"100%",stopColor:ms.commission.gradient.end,stopOpacity:.1})]})]}),e.jsx(ki,{dataKey:"date",axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:i=>Pe(new Date(i),"MM-dd",{locale:Vi})}),e.jsx(Ti,{axisLine:!1,tickLine:!1,tick:{fill:"hsl(var(--muted-foreground))",fontSize:12},tickFormatter:i=>s==="amount"?`¥${Ws(i)}`:`${i}笔`}),e.jsx(Di,{strokeDasharray:"3 3",vertical:!1,stroke:"hsl(var(--border))",opacity:.3}),e.jsx(Pi,{content:e.jsx(Id,{})}),s==="amount"?e.jsxs(e.Fragment,{children:[e.jsx(_a,{type:"monotone",dataKey:"paid_total",name:"收款金额",stroke:ms.income.main,fill:"url(#incomeGradient)",strokeWidth:2}),e.jsx(_a,{type:"monotone",dataKey:"commission_total",name:"佣金金额",stroke:ms.commission.main,fill:"url(#commissionGradient)",strokeWidth:2})]}):e.jsxs(e.Fragment,{children:[e.jsx(Ca,{dataKey:"paid_count",name:"收款笔数",fill:ms.income.main,radius:[4,4,0,0],maxBarSize:40}),e.jsx(Ca,{dataKey:"commission_count",name:"佣金笔数",fill:ms.commission.main,radius:[4,4,0,0],maxBarSize:40})]})]})})})})]})}function Ee({className:s,...t}){return e.jsx("div",{className:v("animate-pulse rounded-md bg-primary/10",s),...t})}function Md(){return e.jsxs($e,{children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(Ee,{className:"h-4 w-[100px]"}),e.jsx(Ee,{className:"h-4 w-4"})]}),e.jsxs(Qe,{children:[e.jsx(Ee,{className:"h-8 w-[120px]"}),e.jsx("div",{className:"flex items-center pt-1",children:e.jsx(Ee,{className:"h-4 w-[100px]"})})]})]})}function zd(){return e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((s,t)=>e.jsx(Md,{},t))})}var ge=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.CANCELLED=2]="CANCELLED",s[s.COMPLETED=3]="COMPLETED",s[s.DISCOUNTED=4]="DISCOUNTED",s))(ge||{});const Ms={0:"待支付",1:"开通中",2:"已取消",3:"已完成",4:"已折抵"},Gs={0:"yellow-500",1:"blue-500",2:"red-500",3:"green-500",4:"green-500"};var as=(s=>(s[s.NEW=1]="NEW",s[s.RENEWAL=2]="RENEWAL",s[s.UPGRADE=3]="UPGRADE",s[s.RESET_FLOW=4]="RESET_FLOW",s))(as||{});const br={1:"新购",2:"续费",3:"升级",4:"流量重置"};var pe=(s=>(s[s.PENDING=0]="PENDING",s[s.PROCESSING=1]="PROCESSING",s[s.VALID=2]="VALID",s[s.INVALID=3]="INVALID",s))(pe||{});const dt={0:"待确认",1:"发放中",2:"有效",3:"无效"},ut={0:"yellow-500",1:"blue-500",2:"green-500",3:"red-500"};var ne=(s=>(s.MONTH_PRICE="month_price",s.QUARTER_PRICE="quarter_price",s.HALF_YEAR_PRICE="half_year_price",s.YEAR_PRICE="year_price",s.TWO_YEAR_PRICE="two_year_price",s.THREE_YEAR_PRICE="three_year_price",s.ONETIME_PRICE="onetime_price",s.RESET_PRICE="reset_price",s))(ne||{});const tt={month_price:"月付",quarter_price:"季付",half_year_price:"半年付",year_price:"年付",two_year_price:"两年付",three_year_price:"三年付",onetime_price:"一次性",reset_price:"流量重置包"};var fe=(s=>(s.Shadowsocks="shadowsocks",s.Vmess="vmess",s.Trojan="trojan",s.Hysteria="hysteria",s.Vless="vless",s))(fe||{});const ws=[{type:"shadowsocks",label:"Shadowsocks"},{type:"vmess",label:"VMess"},{type:"trojan",label:"Trojan"},{type:"hysteria",label:"Hysteria"},{type:"vless",label:"VLess"}],ts={shadowsocks:"#489851",vmess:"#CB3180",trojan:"#EBB749",hysteria:"#5684e6",vless:"#1a1a1a"};var Rt=(s=>(s[s.AMOUNT=1]="AMOUNT",s[s.PERCENTAGE=2]="PERCENTAGE",s))(Rt||{});const oa={1:"按金额优惠",2:"按比例优惠"},Od={0:"正常",1:"锁定"};var Os=(s=>(s[s.OPENING=0]="OPENING",s[s.CLOSED=1]="CLOSED",s))(Os||{});const Ld={0:"开启",1:"已关闭"};var ss=(s=>(s[s.LOW=0]="LOW",s[s.MIDDLE=1]="MIDDLE",s[s.HIGH=2]="HIGH",s))(ss||{});const Qs={0:"低",1:"中",2:"高"};function hs({title:s,value:t,icon:a,trend:n,description:l,onClick:o,highlight:d,className:x}){return e.jsxs($e,{className:v("transition-colors",o&&"cursor-pointer hover:bg-muted/50",d&&"border-primary/50",x),onClick:o,children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(gs,{className:"text-sm font-medium",children:s}),a]}),e.jsxs(Qe,{children:[e.jsx("div",{className:"text-2xl font-bold",children:t}),n?e.jsxs("div",{className:"flex items-center pt-1",children:[e.jsx(zi,{className:v("h-4 w-4",n.isPositive?"text-emerald-500":"text-red-500")}),e.jsxs("span",{className:v("ml-1 text-xs",n.isPositive?"text-emerald-500":"text-red-500"),children:[n.isPositive?"+":"-",Math.abs(n.value),"%"]}),e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:n.label})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:l})]})]})}function $d({className:s}){const t=ns(),{data:a,isLoading:n}=Q({queryKey:["dashboardStats"],queryFn:async()=>(await Sc()).data,refetchInterval:1e3*60*5});if(n||!a)return e.jsx(zd,{});const l=()=>{const o=new URLSearchParams;o.set("commission_status",pe.PENDING.toString()),o.set("status",ge.COMPLETED.toString()),o.set("commission_balance","gt:0"),t(`/finance/order?${o.toString()}`)};return e.jsxs("div",{className:v("grid gap-4 md:grid-cols-2 lg:grid-cols-4",s),children:[e.jsx(hs,{title:"今日收入",value:Ns(a.todayIncome),icon:e.jsx(Ii,{className:"h-4 w-4 text-emerald-500"}),trend:{value:a.dayIncomeGrowth,label:"vs 昨日",isPositive:a.dayIncomeGrowth>0}}),e.jsx(hs,{title:"本月收入",value:Ns(a.currentMonthIncome),icon:e.jsx(Ri,{className:"h-4 w-4 text-blue-500"}),trend:{value:a.monthIncomeGrowth,label:"vs 上月",isPositive:a.monthIncomeGrowth>0}}),e.jsx(hs,{title:"待处理工单",value:a.ticketPendingTotal,icon:e.jsx(Ei,{className:v("h-4 w-4",a.ticketPendingTotal>0?"text-orange-500":"text-muted-foreground")}),description:a.ticketPendingTotal>0?"有待处理的工单需要关注":"暂无待处理工单",onClick:()=>t("/user/ticket"),highlight:a.ticketPendingTotal>0}),e.jsx(hs,{title:"待处理佣金",value:a.commissionPendingTotal,icon:e.jsx(Fi,{className:v("h-4 w-4",a.commissionPendingTotal>0?"text-blue-500":"text-muted-foreground")}),description:a.commissionPendingTotal>0?"有待处理的佣金需要确认":"暂无待处理佣金",onClick:l,highlight:a.commissionPendingTotal>0}),e.jsx(hs,{title:"本月新增用户",value:a.currentMonthNewUsers,icon:e.jsx(At,{className:"h-4 w-4 text-blue-500"}),trend:{value:a.userGrowth,label:"vs 上月",isPositive:a.userGrowth>0}}),e.jsx(hs,{title:"总用户数",value:a.totalUsers,icon:e.jsx(At,{className:"h-4 w-4 text-muted-foreground"}),description:`有效用户: ${a.activeUsers}`}),e.jsx(hs,{title:"本月上行流量",value:Ye(a.monthTraffic.upload),icon:e.jsx(Ht,{className:"h-4 w-4 text-emerald-500"}),description:`今日: ${Ye(a.todayTraffic.upload)}`}),e.jsx(hs,{title:"本月下行流量",value:Ye(a.monthTraffic.download),icon:e.jsx(Mi,{className:"h-4 w-4 text-blue-500"}),description:`今日: ${Ye(a.todayTraffic.download)}`})]})}const at=c.forwardRef(({className:s,children:t,...a},n)=>e.jsxs(kn,{ref:n,className:v("relative overflow-hidden",s),...a,children:[e.jsx(Oi,{className:"h-full w-full rounded-[inherit]",children:t}),e.jsx(wt,{}),e.jsx(Li,{})]}));at.displayName=kn.displayName;const wt=c.forwardRef(({className:s,orientation:t="vertical",...a},n)=>e.jsx(Tn,{ref:n,orientation:t,className:v("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...a,children:e.jsx($i,{className:"relative flex-1 rounded-full bg-border"})}));wt.displayName=Tn.displayName;const Jt={today:{label:"今天",getValue:()=>{const s=Hi();return{start:s,end:Ki(s,1)}}},last7days:{label:"最近7天",getValue:()=>{const s=new Date;return{start:Le(s,7),end:s}}},last30days:{label:"最近30天",getValue:()=>{const s=new Date;return{start:Le(s,30),end:s}}},custom:{label:"自定义范围",getValue:()=>null}};function Oa({selectedRange:s,customDateRange:t,onRangeChange:a,onCustomRangeChange:n}){return e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:[e.jsxs(G,{value:s,onValueChange:a,children:[e.jsx(U,{className:"w-[120px]",children:e.jsx(Y,{placeholder:"选择时间范围"})}),e.jsx(B,{position:"popper",className:"z-50",children:Object.entries(Jt).map(([l,{label:o}])=>e.jsx(O,{value:l,children:o},l))})]}),s==="custom"&&e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(W,{variant:"outline",className:v("min-w-0 justify-start text-left font-normal",!t&&"text-muted-foreground"),children:[e.jsx(lt,{className:"mr-2 h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:t?.from?t.to?e.jsxs(e.Fragment,{children:[Pe(t.from,"yyyy-MM-dd")," -"," ",Pe(t.to,"yyyy-MM-dd")]}):Pe(t.from,"yyyy-MM-dd"):e.jsx("span",{children:"选择日期范围"})})]})}),e.jsx(qe,{className:"w-auto p-0",align:"end",children:e.jsx(Rs,{mode:"range",defaultMonth:t?.from,selected:{from:t?.from,to:t?.to},onSelect:l=>{l?.from&&l?.to&&n({from:l.from,to:l.to})},numberOfMonths:2})})]})]})}const Fs=s=>`${(s/1024/1024/1024).toFixed(2)} GB`;function Ad({className:s}){const[t,a]=c.useState("today"),[n,l]=c.useState({from:Le(new Date,7),to:new Date}),[o,d]=c.useState("today"),[x,r]=c.useState({from:Le(new Date,7),to:new Date}),i=c.useMemo(()=>t==="custom"?{start:n.from,end:n.to}:Jt[t].getValue(),[t,n]),h=c.useMemo(()=>o==="custom"?{start:x.from,end:x.to}:Jt[o].getValue(),[o,x]),{data:D}=Q({queryKey:["nodeTrafficRank",i.start,i.end],queryFn:()=>Ma({type:"node",start_time:de.round(i.start.getTime()/1e3),end_time:de.round(i.end.getTime()/1e3)}),refetchInterval:3e4}),{data:C}=Q({queryKey:["userTrafficRank",h.start,h.end],queryFn:()=>Ma({type:"user",start_time:de.round(h.start.getTime()/1e3),end_time:de.round(h.end.getTime()/1e3)}),refetchInterval:3e4});return e.jsxs("div",{className:v("grid gap-4 md:grid-cols-2",s),children:[e.jsxs($e,{children:[e.jsx(Je,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(gs,{className:"flex items-center text-base font-medium",children:[e.jsx(Ai,{className:"mr-2 h-4 w-4"}),"节点流量排行"]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(Oa,{selectedRange:t,customDateRange:n,onRangeChange:a,onCustomRangeChange:l}),e.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Qe,{className:"flex-1",children:D?.data?e.jsxs(at,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:D.data.map(m=>e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:m.name}),e.jsxs("span",{className:v("ml-2 flex items-center text-xs font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?e.jsx(Kt,{className:"mr-1 h-3 w-3"}):e.jsx(qt,{className:"mr-1 h-3 w-3"}),Math.abs(m.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${m.value/D.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:Fs(m.value)})]})]})})}),e.jsx(ee,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"当前流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.value)}),e.jsx("span",{className:"text-muted-foreground",children:"上期流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.previousValue)}),e.jsx("span",{className:"text-muted-foreground",children:"变化率:"}),e.jsxs("span",{className:v("font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?"+":"",m.change,"%"]}),e.jsx("span",{className:"text-muted-foreground",children:"记录时间:"}),e.jsx("span",{className:"font-medium",children:Pe(new Date(m.timestamp),"yyyy-MM-dd HH:mm")})]})})]})},m.id))}),e.jsx(wt,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:"Loading..."})})})]}),e.jsxs($e,{children:[e.jsx(Je,{className:"flex-none pb-2",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs(gs,{className:"flex items-center text-base font-medium",children:[e.jsx(At,{className:"mr-2 h-4 w-4"}),"用户流量排行"]}),e.jsxs("div",{className:"flex min-w-0 items-center gap-1",children:[e.jsx(Oa,{selectedRange:o,customDateRange:x,onRangeChange:d,onCustomRangeChange:r}),e.jsx(Sa,{className:"h-4 w-4 flex-shrink-0 text-muted-foreground"})]})]})}),e.jsx(Qe,{className:"flex-1",children:C?.data?e.jsxs(at,{className:"h-[400px] pr-4",children:[e.jsx("div",{className:"space-y-3",children:C.data.map(m=>e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx("div",{className:"flex cursor-pointer items-center justify-between space-x-2 rounded-lg bg-muted/50 p-2 transition-colors hover:bg-muted/70",children:e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:m.name}),e.jsxs("span",{className:v("ml-2 flex items-center text-xs font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?e.jsx(Kt,{className:"mr-1 h-3 w-3"}):e.jsx(qt,{className:"mr-1 h-3 w-3"}),Math.abs(m.change),"%"]})]}),e.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.jsx("div",{className:"h-2 flex-1 overflow-hidden rounded-full bg-muted",children:e.jsx("div",{className:"h-full bg-primary transition-all",style:{width:`${m.value/C.data[0].value*100}%`}})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:Fs(m.value)})]})]})})}),e.jsx(ee,{side:"right",className:"space-y-2 p-4",children:e.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"当前流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.value)}),e.jsx("span",{className:"text-muted-foreground",children:"上期流量:"}),e.jsx("span",{className:"font-medium",children:Fs(m.previousValue)}),e.jsx("span",{className:"text-muted-foreground",children:"变化率:"}),e.jsxs("span",{className:v("font-medium",m.change>=0?"text-green-600":"text-red-600"),children:[m.change>=0?"+":"",m.change,"%"]}),e.jsx("span",{className:"text-muted-foreground",children:"记录时间:"}),e.jsx("span",{className:"font-medium",children:Pe(new Date(m.timestamp),"yyyy-MM-dd HH:mm")})]})})]})},m.id))}),e.jsx(wt,{orientation:"vertical"})]}):e.jsx("div",{className:"flex h-[400px] items-center justify-center",children:e.jsx("div",{className:"animate-pulse",children:"Loading..."})})})]})]})}const Hd=Ss("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/10",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function L({className:s,variant:t,...a}){return e.jsx("div",{className:v(Hd({variant:t}),s),...a})}const pt=c.forwardRef(({className:s,value:t,...a},n)=>e.jsx(Dn,{ref:n,className:v("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",s),...a,children:e.jsx(qi,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));pt.displayName=Dn.displayName;function Kd(){const[s,t]=c.useState(null),[a,n]=c.useState(null),[l,o]=c.useState(!0),[d,x]=c.useState(!1),r=async()=>{try{x(!0);const[D,C]=await Promise.all([Fa.getSystemStatus(),Fa.getQueueStats()]);t(D.data),n(C.data)}catch(D){console.error("Error fetching system data:",D)}finally{o(!1),x(!1)}};c.useEffect(()=>{r();const D=setInterval(r,3e4);return()=>clearInterval(D)},[]);const i=()=>{r()};if(l)return e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(aa,{className:"h-6 w-6 animate-spin"})});const h=D=>D?e.jsx(Pn,{className:"h-5 w-5 text-green-500"}):e.jsx(Vn,{className:"h-5 w-5 text-red-500"});return e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs($e,{children:[e.jsxs(Je,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs(gs,{className:"flex items-center gap-2",children:[e.jsx(Ui,{className:"h-5 w-5"}),"队列状态"]}),e.jsx(Xs,{children:"当前队列运行状态"})]}),e.jsx(W,{variant:"outline",size:"icon",onClick:i,disabled:d,children:e.jsx(Bi,{className:v("h-4 w-4",d&&"animate-spin")})})]}),e.jsx(Qe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[h(a?.status||!1),e.jsx("span",{className:"font-medium",children:"运行状态"})]}),e.jsx(L,{variant:a?.status?"secondary":"destructive",children:a?.status?"正常":"异常"})]}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["当前等待时间:",a?.wait?.default||0," 秒"]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"近期任务数"}),e.jsx("p",{className:"text-2xl font-bold",children:a?.recentJobs||0}),e.jsx(pt,{value:(a?.recentJobs||0)/(a?.periods?.recentJobs||1)*100,className:"h-1"})]})}),e.jsx(ee,{children:e.jsxs("p",{children:["统计时间范围: ",a?.periods?.recentJobs||0," 小时"]})})]})}),e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"每分钟处理量"}),e.jsx("p",{className:"text-2xl font-bold",children:a?.jobsPerMinute||0}),e.jsx(pt,{value:(a?.jobsPerMinute||0)/(a?.queueWithMaxThroughput?.throughput||1)*100,className:"h-1"})]})}),e.jsx(ee,{children:e.jsxs("p",{children:["最高吞吐量:"," ",a?.queueWithMaxThroughput?.throughput||0]})})]})})]})]})})]}),e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsxs(gs,{className:"flex items-center gap-2",children:[e.jsx(Gi,{className:"h-5 w-5"}),"作业详情"]}),e.jsx(Xs,{children:"队列处理详细信息"})]}),e.jsx(Qe,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"7日报错数量"}),e.jsx("p",{className:"text-2xl font-bold text-destructive",children:a?.failedJobs||0}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:["保留 ",a?.periods?.failedJobs||0," 小时"]})]}),e.jsxs("div",{className:"space-y-2 rounded-lg bg-muted/50 p-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"最长运行队列"}),e.jsxs("p",{className:"text-2xl font-bold",children:[a?.queueWithMaxRuntime?.runtime||0,"s"]}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:a?.queueWithMaxRuntime?.name||"N/A"})]})]}),e.jsxs("div",{className:"rounded-lg bg-muted/50 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"活跃进程"}),e.jsxs("span",{className:"font-medium",children:[a?.processes||0," /"," ",(a?.processes||0)+(a?.pausedMasters||0)]})]}),e.jsx(pt,{value:(a?.processes||0)/((a?.processes||0)+(a?.pausedMasters||0))*100,className:"mt-2 h-1"})]})]})})]})]})}function qd(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx("div",{className:"flex items-center",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:"仪表盘"})}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(ke,{}),e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsx(_e,{children:e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"grid gap-6",children:[e.jsx($d,{}),e.jsx(Fd,{}),e.jsx(Ad,{}),e.jsx(Kd,{})]})})})]})}const Ud=Object.freeze(Object.defineProperty({__proto__:null,default:qd},Symbol.toStringTag,{value:"Module"})),je=c.forwardRef(({className:s,orientation:t="horizontal",decorative:a=!0,...n},l)=>e.jsx(In,{ref:l,decorative:a,orientation:t,className:v("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",s),...n}));je.displayName=In.displayName;function Bd({className:s,items:t,...a}){const{pathname:n}=Zt(),l=ns(),[o,d]=c.useState(n??"/settings"),x=r=>{d(r),l(r)};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-1 md:hidden",children:e.jsxs(G,{value:o,onValueChange:x,children:[e.jsx(U,{className:"h-12 sm:w-48",children:e.jsx(Y,{placeholder:"Theme"})}),e.jsx(B,{children:t.map(r=>e.jsx(O,{value:r.href,children:e.jsxs("div",{className:"flex gap-x-4 px-2 py-1",children:[e.jsx("span",{className:"scale-125",children:r.icon}),e.jsx("span",{className:"text-md",children:r.title})]})},r.href))})]})}),e.jsx("div",{className:"hidden w-full overflow-x-auto bg-background px-1 py-2 md:block",children:e.jsx("nav",{className:v("flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1",s),...a,children:t.map(r=>e.jsxs(Ts,{to:r.href,className:v(As({variant:"ghost"}),n===r.href?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),children:[e.jsx("span",{className:"mr-2",children:r.icon}),r.title]},r.href))})})]})}const yr=[{title:"站点设置",key:"site",icon:e.jsx(Yi,{size:18}),href:"/config/system",description:"配置站点基本信息,包括站点名称、描述、货币单位等核心设置。"},{title:"安全设置",key:"safe",icon:e.jsx(dn,{size:18}),href:"/config/system/safe",description:"配置系统安全相关选项,包括登录验证、密码策略、API访问等安全设置。"},{title:"订阅设置",key:"subscribe",icon:e.jsx(un,{size:18}),href:"/config/system/subscribe",description:"管理用户订阅相关配置,包括订阅链接格式、更新频率、流量统计等设置。"},{title:"邀请&佣金",key:"invite",icon:e.jsx(Wi,{size:18}),href:"/config/system/invite",description:"管理用户邀请和佣金系统,配置邀请奖励、分销规则等。"},{title:"节点配置",key:"server",icon:e.jsx(cn,{size:18}),href:"/config/system/server",description:"配置节点通信和同步设置,包括通信密钥、轮询间隔、负载均衡等高级选项。"},{title:"邮件设置",key:"email",icon:e.jsx(Ji,{size:18}),href:"/config/system/email",description:"配置系统邮件服务,用于发送验证码、密码重置、通知等邮件,支持多种SMTP服务商。"},{title:"Telegram设置",key:"telegram",icon:e.jsx(Qi,{size:18}),href:"/config/system/telegram",description:"配置Telegram机器人功能,实现用户通知、账户绑定、指令交互等自动化服务。"},{title:"APP设置",key:"app",icon:e.jsx(on,{size:18}),href:"/config/system/app",description:"管理移动应用程序相关配置,包括API接口、版本控制、推送通知等功能设置。"}];function Gd(){return e.jsxs(ye,{fadedBelow:!0,fixedHeight:!0,children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight md:text-3xl",children:"系统设置"}),e.jsx("div",{className:"text-muted-foreground",children:"管理系统核心配置,包括站点、安全、订阅、邀请佣金、节点、邮件和通知等设置"})]}),e.jsx(je,{className:"my-6"}),e.jsxs("div",{className:"flex flex-1 flex-col space-y-8 overflow-auto lg:flex-row lg:space-x-12 lg:space-y-0",children:[e.jsx("aside",{className:"sticky top-0 lg:w-1/5",children:e.jsx(Bd,{items:yr})}),e.jsx("div",{className:"w-full p-1 pr-4 lg:max-w-xl",children:e.jsx("div",{className:"pb-16",children:e.jsx(Xt,{})})})]})]})]})}const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Gd},Symbol.toStringTag,{value:"Module"}));function Wd({title:s,description:t,children:a}){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:s}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),e.jsx(je,{}),a]})}const H=c.forwardRef(({className:s,...t},a)=>e.jsx(Rn,{className:v("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-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...t,ref:a,children:e.jsx(Zi,{className:v("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));H.displayName=Rn.displayName;const bs=c.forwardRef(({className:s,...t},a)=>e.jsx("textarea",{className:v("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",s),ref:a,...t}));bs.displayName="Textarea";const Jd=u.object({logo:u.string().nullable().default(""),force_https:u.number().nullable().default(0),stop_register:u.number().nullable().default(0),app_name:u.string().nullable().default(""),app_description:u.string().nullable().default(""),app_url:u.string().nullable().default(""),subscribe_url:u.string().nullable().default(""),try_out_plan_id:u.number().nullable().default(0),try_out_hour:u.coerce.number().nullable().default(0),tos_url:u.string().nullable().default(""),currency:u.string().nullable().default(""),currency_symbol:u.string().nullable().default("")});function Qd(){const[s,t]=c.useState(!1),a=c.useRef(null),{data:n}=Q({queryKey:["settings","site"],queryFn:()=>os("site")}),{data:l}=Q({queryKey:["plans"],queryFn:()=>Is()}),o=ae({resolver:ie(Jd),defaultValues:{},mode:"onBlur"}),{mutateAsync:d}=We({mutationFn:cs,onSuccess:i=>{i.data&&A.success("已自动保存")}});c.useEffect(()=>{if(n?.data?.site){const i=n?.data?.site;Object.entries(i).forEach(([h,D])=>{o.setValue(h,D)}),a.current=i}},[n]);const x=c.useCallback(de.debounce(async i=>{if(!de.isEqual(i,a.current)){t(!0);try{const h=Object.entries(i).reduce((D,[C,m])=>(D[C]=m===null?"":m,D),{});await d(h),a.current=i}finally{t(!1)}}},1e3),[d]),r=c.useCallback(i=>{x(i)},[x]);return c.useEffect(()=>{const i=o.watch(h=>{r(h)});return()=>i.unsubscribe()},[o.watch,r]),e.jsx(oe,{...o,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:o.control,name:"app_name",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点名称",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要站点名称的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"app_description",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点描述"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点描述",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要站点描述的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"app_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"站点网址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"当前网站最新网址,将会在邮件等需要用于网址处体现。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"force_https",render:({field:i})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"强制HTTPS"}),e.jsx(F,{children:"当站点没有使用HTTPS,CDN或反代开启强制HTTPS时需要开启。"})]}),e.jsx(y,{children:e.jsx(H,{checked:!!i.value,onCheckedChange:h=>{i.onChange(Number(h)),r(o.getValues())}})})]})}),e.jsx(g,{control:o.control,name:"logo",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"LOGO"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入LOGO URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于显示需要LOGO的地方。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"subscribe_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"订阅URL"}),e.jsx(y,{children:e.jsx(bs,{placeholder:"用于订阅所使用,多个订阅地址用','隔开.留空则为站点URL。",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于订阅所使用,留空则为站点URL。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"tos_url",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"用户条款(TOS)URL"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入用户条款URL,末尾不要/",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"用于跳转到用户条款(TOS)"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"stop_register",render:({field:i})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"停止新用户注册"}),e.jsx(F,{children:"开启后任何人都将无法进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:!!i.value,onCheckedChange:h=>{i.onChange(Number(h)),r(o.getValues())}})})]})}),e.jsx(g,{control:o.control,name:"try_out_plan_id",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"注册试用"}),e.jsx(y,{children:e.jsxs(G,{value:i.value?.toString(),onValueChange:h=>{i.onChange(Number(h)),r(o.getValues())},children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"关闭"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"关闭"}),l?.data?.map(h=>e.jsx(O,{value:h.id.toString(),children:h.name},h.id.toString()))]})]})}),e.jsx(F,{children:"选择需要试用的订阅,如果没有选项请先前往订阅管理添加。"}),e.jsx(k,{})]})}),!!o.watch("try_out_plan_id")&&e.jsx(g,{control:o.control,name:"try_out_hour",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"",children:"注册试用时长"}),e.jsx(y,{children:e.jsx(S,{placeholder:"0",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"注册试用时长,单位为小时。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"currency",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"货币单位"}),e.jsx(y,{children:e.jsx(S,{placeholder:"CNY",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"仅用于展示使用,更改后系统中所有的货币单位都将发生变更。"}),e.jsx(k,{})]})}),e.jsx(g,{control:o.control,name:"currency_symbol",render:({field:i})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"货币符号"}),e.jsx(y,{children:e.jsx(S,{placeholder:"¥",...i,value:i.value||"",onChange:h=>{i.onChange(h),r(o.getValues())}})}),e.jsx(F,{children:"仅用于展示使用,更改后系统中所有的货币单位都将发生变更。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Zd(){const s=yr.find(t=>t.key==="site");return e.jsx(Wd,{title:s.title,description:s.description,children:e.jsx(Qd,{})})}const Xd=Object.freeze(Object.defineProperty({__proto__:null,default:Zd},Symbol.toStringTag,{value:"Module"})),eu=u.object({email_verify:u.boolean().nullable(),safe_mode_enable:u.boolean().nullable(),secure_path:u.string().nullable(),email_whitelist_enable:u.boolean().nullable(),email_whitelist_suffix:u.array(u.string().nullable()).nullable(),email_gmail_limit_enable:u.boolean().nullable(),recaptcha_enable:u.boolean().nullable(),recaptcha_key:u.string().nullable(),recaptcha_site_key:u.string().nullable(),register_limit_by_ip_enable:u.boolean().nullable(),register_limit_count:u.coerce.string().transform(s=>s===""?null:s).nullable(),register_limit_expire:u.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_enable:u.boolean().nullable(),password_limit_count:u.coerce.string().transform(s=>s===""?null:s).nullable(),password_limit_expire:u.coerce.string().transform(s=>s===""?null:s).nullable()}),su={email_verify:!1,safe_mode_enable:!1,secure_path:"",email_whitelist_enable:!1,email_whitelist_suffix:[],email_gmail_limit_enable:!1,recaptcha_enable:!1,recaptcha_key:"",recaptcha_site_key:"",register_limit_by_ip_enable:!1,register_limit_count:"",register_limit_expire:"",password_limit_enable:!1,password_limit_count:"",password_limit_expire:""};function tu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(eu),defaultValues:su,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","safe"],queryFn:()=>os("safe")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.safe){const r=l.data.safe;Object.entries(r).forEach(([i,h])=>{typeof h=="number"?n.setValue(i,String(h)):n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"email_verify",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮箱验证"}),e.jsx(F,{children:"开启后将会强制要求用户进行邮箱验证。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"email_gmail_limit_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"禁止使用Gmail多别名"}),e.jsx(F,{children:"开启后Gmail多别名将无法注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"safe_mode_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"安全模式"}),e.jsx(F,{children:"开启后除了站点URL以外的绑定本站点的域名访问都将会被403。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"secure_path",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"后台路径"}),e.jsx(y,{children:e.jsx(S,{placeholder:"admin",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(F,{children:"后台管理路径,修改后将会改变原有的admin路径"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"email_whitelist_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮箱后缀白名单"}),e.jsx(F,{children:"开启后在名单中的邮箱后缀才允许进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("email_whitelist_enable")&&e.jsx(g,{control:n.control,name:"email_whitelist_suffix",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"白名单后缀"}),e.jsx(y,{children:e.jsx(bs,{placeholder:"请输入后缀域名,逗号分割 如:qq.com,gmail.com",value:r.value?.length?r.value.join(","):"",onChange:i=>{const h=i.target.value?i.target.value.split(","):[];r.onChange(h),x(n.getValues())}})}),e.jsx(F,{children:"请使用逗号进行分割,如:qq.com,gmail.com。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"recaptcha_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"防机器人"}),e.jsx(F,{children:"开启后将会使用Google reCAPTCHA防止机器人。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("recaptcha_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"recaptcha_key",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入密钥",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"recaptcha_site_key",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"站点密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入站点密钥",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:n.control,name:"register_limit_by_ip_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"IP注册限制"}),e.jsx(F,{children:"开启后同一IP将会被限制注册次数。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("register_limit_by_ip_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"register_limit_count",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制次数"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制次数",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"register_limit_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制时长(分钟)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制时长",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:n.control,name:"password_limit_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"密码错误限制"}),e.jsx(F,{children:"开启后密码错误将会被限制登录。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("password_limit_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"password_limit_count",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制次数"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制次数",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"password_limit_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"限制时长(分钟)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入限制时长",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsx(k,{})]})})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function au(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"安全设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置系统安全相关选项,包括登录验证、密码策略、API访问等安全设置。"})]}),e.jsx(je,{}),e.jsx(tu,{})]})}const nu=Object.freeze(Object.defineProperty({__proto__:null,default:au},Symbol.toStringTag,{value:"Module"})),ru=u.object({plan_change_enable:u.boolean().nullable().default(!1),reset_traffic_method:u.coerce.number().nullable().default(0),surplus_enable:u.boolean().nullable().default(!1),new_order_event_id:u.coerce.number().nullable().default(0),renew_order_event_id:u.coerce.number().nullable().default(0),change_order_event_id:u.coerce.number().nullable().default(0),show_info_to_server_enable:u.boolean().nullable().default(!1),show_protocol_to_server_enable:u.boolean().nullable().default(!1),default_remind_expire:u.boolean().nullable().default(!1),default_remind_traffic:u.boolean().nullable().default(!1),remind_mail_enable:u.boolean().nullable().default(!1),subscribe_path:u.string().nullable().default("s")}),lu={plan_change_enable:!1,reset_traffic_method:0,surplus_enable:!1,new_order_event_id:0,renew_order_event_id:0,change_order_event_id:0,show_info_to_server_enable:!1,show_protocol_to_server_enable:!1,default_remind_expire:!1,default_remind_traffic:!1,remind_mail_enable:!1,subscribe_path:"s"};function iu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(ru),defaultValues:lu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","subscribe"],queryFn:()=>os("subscribe")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data?.subscribe){const r=l?.data?.subscribe;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"plan_change_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"允许用户更改订阅"}),e.jsx(F,{children:"开启后用户将会可以对订阅计划进行变更。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"reset_traffic_method",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"月流量重置方式"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"每月1号"}),e.jsx(O,{value:"1",children:"按月重置"}),e.jsx(O,{value:"2",children:"不重置"}),e.jsx(O,{value:"3",children:"每年1月1号"}),e.jsx(O,{value:"4",children:"按年重置"})]})]})})}),e.jsx(F,{children:"全局流量重置方式,默认每月1号。可以在订阅管理为订阅单独设置。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"surplus_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"开启折抵方案"}),e.jsx(F,{children:"开启后用户更换订阅将会由系统对原有订阅进行折抵,方案参考文档。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"new_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅新购时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"新购订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"renew_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅续费时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"续费订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"change_order_event_id",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"当订阅变更时触发事件"}),e.jsx("div",{className:"relative w-max",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString(),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不执行任何动作"}),e.jsx(O,{value:"1",children:"重置用户流量"})]})]})})}),e.jsx(F,{children:"变更订阅完成时将触发该任务。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"subscribe_path",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"订阅路径"}),e.jsx(y,{children:e.jsx(S,{placeholder:"subscribe",...r,value:r.value||"",onChange:i=>{r.onChange(i),x(n.getValues())}})}),e.jsxs("div",{className:"text-sm text-muted-foreground",children:["订阅路径,修改后将会改变原有的subscribe路径",e.jsx("br",{}),"当前订阅路径格式:",r.value?`${r.value}/xxxxxxxxxx`:"s/xxxxxxxxxx"]}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"show_info_to_server_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"在订阅中展示订阅信息"}),e.jsx(F,{children:"开启后将会在用户订阅节点时输出订阅信息。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"show_protocol_to_server_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"在订阅中线路名称中显示协议名称"}),e.jsx(F,{children:"开启后订阅线路会附带协议名称(例如: [Hy2]香港)"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"remind_mail_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邮件提醒"}),e.jsx(F,{children:"开启后用户订阅即将到期时和流量告急时时将发送邮件通知。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value||!1,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function ou(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"订阅设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"管理用户订阅相关配置,包括订阅链接格式、更新频率、流量统计等设置。"})]}),e.jsx(je,{}),e.jsx(iu,{})]})}const cu=Object.freeze(Object.defineProperty({__proto__:null,default:ou},Symbol.toStringTag,{value:"Module"})),du=u.object({invite_force:u.boolean().default(!1),invite_commission:u.coerce.string().default("0"),invite_gen_limit:u.coerce.string().default("0"),invite_never_expire:u.boolean().default(!1),commission_first_time_enable:u.boolean().default(!1),commission_auto_check_enable:u.boolean().default(!1),commission_withdraw_limit:u.coerce.string().default("0"),commission_withdraw_method:u.array(u.string()).default(["支付宝","USDT","Paypal"]),withdraw_close_enable:u.boolean().default(!1),commission_distribution_enable:u.boolean().default(!1),commission_distribution_l1:u.coerce.number().default(0),commission_distribution_l2:u.coerce.number().default(0),commission_distribution_l3:u.coerce.number().default(0)}),uu={invite_force:!1,invite_commission:"0",invite_gen_limit:"0",invite_never_expire:!1,commission_first_time_enable:!1,commission_auto_check_enable:!1,commission_withdraw_limit:"0",commission_withdraw_method:["支付宝","USDT","Paypal"],withdraw_close_enable:!1,commission_distribution_enable:!1,commission_distribution_l1:0,commission_distribution_l2:0,commission_distribution_l3:0};function xu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(du),defaultValues:uu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","invite"],queryFn:()=>os("invite")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data?.invite){const r=l?.data?.invite;Object.entries(r).forEach(([i,h])=>{typeof h=="number"?n.setValue(i,String(h)):n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"invite_force",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"开启强制邀请"}),e.jsx(F,{children:"开启后只有被邀请的用户才可以进行注册。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"invite_commission",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:" 邀请佣金百分比"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"默认全局的佣金分配比例,你可以在用户管理单独配置单个比例。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"invite_gen_limit",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"用户可创建邀请码上限"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"用户可创建邀请码上限"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"invite_never_expire",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"邀请码永不失效"}),e.jsx(F,{children:"开启后邀请码被使用后将不会失效,否则使用过后即失效。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_first_time_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"佣金仅首次发放"}),e.jsx(F,{children:"开启后被邀请人首次支付时才会产生佣金,可以在用户管理对用户进行单独配置。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_auto_check_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"佣金自动确认"}),e.jsx(F,{children:"开启后佣金将会在订单完成3日后自动进行确认。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_withdraw_limit",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"提现单申请门槛(元)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"小于门槛金额的提现单将不会被提交。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_withdraw_method",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"提现方式"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:Array.isArray(r.value)?r.value.join(","):"",onChange:i=>{const h=i.target.value.split(",").filter(Boolean);r.onChange(h),x(n.getValues())}})}),e.jsx(F,{children:"可以支持的提现方式,多个用逗号分隔。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"withdraw_close_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"关闭提现"}),e.jsx(F,{children:"关闭后将禁止用户申请提现,且邀请佣金将会直接进入用户余额。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_enable",render:({field:r})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"三级分销"}),e.jsx(F,{children:"开启后将佣金将按照设置的3成比例进行分成,三成比例合计请不要大于100%。"})]}),e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:i=>{r.onChange(i),x(n.getValues())}})})]})}),n.watch("commission_distribution_enable")&&e.jsxs(e.Fragment,{children:[e.jsx(g,{control:n.control,name:"commission_distribution_l1",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"一级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_l2",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"二级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"commission_distribution_l3",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"三级邀请人比例"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入比例如:50",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):0;r.onChange(h),x(n.getValues())}})}),e.jsx(k,{})]})})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function mu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"邀请&佣金设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"邀请注册、佣金相关设置。"})]}),e.jsx(je,{}),e.jsx(xu,{})]})}const hu=Object.freeze(Object.defineProperty({__proto__:null,default:mu},Symbol.toStringTag,{value:"Module"})),ju=u.object({frontend_theme:u.string().nullable(),frontend_theme_sidebar:u.string().nullable(),frontend_theme_header:u.string().nullable(),frontend_theme_color:u.string().nullable(),frontend_background_url:u.string().url().nullable()}),gu={frontend_theme:"",frontend_theme_sidebar:"",frontend_theme_header:"",frontend_theme_color:"",frontend_background_url:""};function fu(){const{data:s}=Q({queryKey:["settings","frontend"],queryFn:()=>os("frontend")}),t=ae({resolver:ie(ju),defaultValues:gu,mode:"onChange"});c.useEffect(()=>{if(s?.data?.frontend){const n=s?.data?.frontend;Object.entries(n).forEach(([l,o])=>{t.setValue(l,o)})}},[s]);function a(n){cs(n).then(({data:l})=>{l&&A.success("更新成功")})}return e.jsx(oe,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(a),className:"space-y-8",children:[e.jsx(g,{control:t.control,name:"frontend_theme_sidebar",render:({field:n})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"边栏风格"}),e.jsx(F,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(H,{checked:n.value,onCheckedChange:n.onChange})})]})}),e.jsx(g,{control:t.control,name:"frontend_theme_header",render:({field:n})=>e.jsxs(j,{children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(p,{className:"text-base",children:"头部风格"}),e.jsx(F,{children:"边栏风格"})]}),e.jsx(y,{children:e.jsx(H,{checked:n.value,onCheckedChange:n.onChange})})]})}),e.jsx(g,{control:t.control,name:"frontend_theme_color",render:({field:n})=>e.jsxs(j,{children:[e.jsx(p,{children:"主题色"}),e.jsxs("div",{className:"relative w-max",children:[e.jsx(y,{children:e.jsxs("select",{className:v(As({variant:"outline"}),"w-[200px] appearance-none font-normal"),...n,children:[e.jsx("option",{value:"default",children:"默认"}),e.jsx("option",{value:"black",children:"黑色"}),e.jsx("option",{value:"blackblue",children:"暗蓝色"}),e.jsx("option",{value:"green",children:"奶绿色"})]})}),e.jsx(ta,{className:"absolute right-3 top-2.5 h-4 w-4 opacity-50"})]}),e.jsx(F,{children:"主题色"}),e.jsx(k,{})]})}),e.jsx(g,{control:t.control,name:"frontend_background_url",render:({field:n})=>e.jsxs(j,{children:[e.jsx(p,{children:"背景"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入图片地址",...n})}),e.jsx(F,{children:"将会在后台登录页面进行展示。"}),e.jsx(k,{})]})}),e.jsx(T,{type:"submit",children:"保存设置"})]})})}function pu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"个性化设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"自定义系统界面外观,包括主题风格、布局、颜色方案、背景图等个性化选项。"})]}),e.jsx(je,{}),e.jsx(fu,{})]})}const vu=Object.freeze(Object.defineProperty({__proto__:null,default:pu},Symbol.toStringTag,{value:"Module"})),bu=u.object({server_pull_interval:u.coerce.number().nullable(),server_push_interval:u.coerce.number().nullable(),server_token:u.string().nullable(),device_limit_mode:u.coerce.number().nullable()}),yu={server_pull_interval:0,server_push_interval:0,server_token:"",device_limit_mode:0};function Nu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(bu),defaultValues:yu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","server"],queryFn:()=>os("server")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.server){const r=l.data.server;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"server_token",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"通讯密钥"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",...r,value:r.value||""})}),e.jsx(F,{children:"Xboard与节点通讯的密钥,以便数据不会被他人获取。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"server_pull_interval",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"节点拉取动作轮询间隔"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):null;r.onChange(h)}})}),e.jsx(F,{children:"节点从面板获取数据的间隔频率。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"server_push_interval",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"节点推送动作轮询间隔"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入",...r,value:r.value||"",onChange:i=>{const h=i.target.value?Number(i.target.value):null;r.onChange(h)}})}),e.jsx(F,{children:"节点推送数据到面板的间隔频率。"}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"device_limit_mode",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"设备限制模式"}),e.jsxs(G,{onValueChange:r.onChange,value:r.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择设备限制模式"})})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"严格模式"}),e.jsx(O,{value:"1",children:"宽松模式"})]})]}),e.jsx(F,{children:"宽松模式下,同一IP地址使用多个节点只统计为一个设备。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function wu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"节点配置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置节点通信和同步设置,包括通信密钥、轮询间隔、负载均衡等高级选项。"})]}),e.jsx(je,{}),e.jsx(Nu,{})]})}const _u=Object.freeze(Object.defineProperty({__proto__:null,default:wu},Symbol.toStringTag,{value:"Module"}));function Cu({open:s,onOpenChange:t,result:a}){const n=!a.error;return e.jsx(ue,{open:s,onOpenChange:t,children:e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[n?e.jsx(Pn,{className:"h-5 w-5 text-green-500"}):e.jsx(Vn,{className:"h-5 w-5 text-destructive"}),e.jsx(xe,{children:n?"邮件发送成功":"邮件发送失败"})]}),e.jsx(Se,{children:n?"测试邮件已成功发送,请检查收件箱":"发送测试邮件时遇到错误"})]}),e.jsxs("div",{className:"grid gap-4 py-4",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"发送详情"}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2 text-sm",children:[e.jsx("div",{className:"text-muted-foreground",children:"收件地址"}),e.jsx("div",{children:a.email}),e.jsx("div",{className:"text-muted-foreground",children:"邮件主题"}),e.jsx("div",{children:a.subject}),e.jsx("div",{className:"text-muted-foreground",children:"模板名称"}),e.jsx("div",{children:a.template_name})]})]}),a.error&&e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium text-destructive",children:"错误信息"}),e.jsx("div",{className:"rounded-md bg-destructive/10 p-3 text-sm text-destructive break-all",children:a.error})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"font-medium",children:"配置信息"}),e.jsx(at,{className:"h-[200px] rounded-md border p-4",children:e.jsx("div",{className:"grid gap-2 text-sm",children:e.jsxs("div",{className:"grid grid-cols-[100px_1fr] items-center gap-2",children:[e.jsx("div",{className:"text-muted-foreground",children:"驱动"}),e.jsx("div",{children:a.config.driver}),e.jsx("div",{className:"text-muted-foreground",children:"服务器"}),e.jsx("div",{children:a.config.host}),e.jsx("div",{className:"text-muted-foreground",children:"端口"}),e.jsx("div",{children:a.config.port}),e.jsx("div",{className:"text-muted-foreground",children:"加密方式"}),e.jsx("div",{children:a.config.encryption||"无"}),e.jsx("div",{className:"text-muted-foreground",children:"发件人"}),e.jsx("div",{children:a.config.from.address?`${a.config.from.address}${a.config.from.name?` (${a.config.from.name})`:""}`:"未设置"}),e.jsx("div",{className:"text-muted-foreground",children:"用户名"}),e.jsx("div",{children:a.config.username||"未设置"})]})})})]})]})]})})}const Su=u.object({email_template:u.string().nullable().default("classic"),email_host:u.string().nullable().default(""),email_port:u.string().regex(/^\d+$/).nullable().default("465"),email_username:u.string().nullable().default(""),email_password:u.string().nullable().default(""),email_encryption:u.string().nullable().default(""),email_from_address:u.string().email().nullable().default("")});function ku(){const[s,t]=c.useState(null),[a,n]=c.useState(!1),l=c.useRef(null),[o,d]=c.useState(!1),x=ae({resolver:ie(Su),defaultValues:{},mode:"onBlur"}),{data:r}=Q({queryKey:["settings","email"],queryFn:()=>os("email")}),{data:i}=Q({queryKey:["emailTemplate"],queryFn:()=>Cd()}),{mutateAsync:h}=We({mutationFn:cs,onSuccess:_=>{_.data&&A.success("已自动保存")}}),{mutate:D,isPending:C}=We({mutationFn:Sd,onMutate:()=>{t(null),n(!1)},onSuccess:_=>{t(_.data),n(!0),_.data.error||A.success("发送成功")}});c.useEffect(()=>{if(r?.data.email){const _=r.data.email;Object.entries(_).forEach(([b,N])=>{x.setValue(b,N)}),l.current=_}},[r]);const m=c.useCallback(de.debounce(async _=>{if(!de.isEqual(_,l.current)){d(!0);try{await h(_),l.current=_}finally{d(!1)}}},1e3),[h]),w=c.useCallback(_=>{m(_)},[m]);return c.useEffect(()=>{const _=x.watch(b=>{w(b)});return()=>_.unsubscribe()},[x.watch,w]),e.jsxs(e.Fragment,{children:[e.jsx(oe,{...x,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:x.control,name:"email_host",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP服务器地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的服务地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_port",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP服务端口"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"常见的端口有25, 465, 587"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_encryption",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP加密方式"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"465端口加密方式一般为SSL,587端口加密方式一般为TLS"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_username",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP账号"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的账号"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_password",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"SMTP密码"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||"",type:"password"})}),e.jsx(F,{children:"由邮件服务商提供的密码"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_from_address",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"发件地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入",..._,value:_.value||""})}),e.jsx(F,{children:"由邮件服务商提供的发件地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"email_template",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"邮件模板"}),e.jsxs(G,{onValueChange:b=>{_.onChange(b),w(x.getValues())},value:_.value||void 0,children:[e.jsx(y,{children:e.jsx(U,{className:"w-[200px]",children:e.jsx(Y,{placeholder:"选择邮件模板"})})}),e.jsx(B,{children:i?.data?.map(b=>e.jsx(O,{value:b,children:b},b))})]}),e.jsx(F,{children:"你可以在文档查看如何自定义邮件模板"}),e.jsx(k,{})]})}),e.jsx("div",{className:"flex items-center justify-between",children:e.jsx(T,{onClick:()=>D(),loading:C,disabled:C,children:C?"发送中...":"发送测试邮件"})})]})}),o&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."}),s&&e.jsx(Cu,{open:a,onOpenChange:n,result:s})]})}function Tu(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"邮件设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置系统邮件服务,用于发送验证码、密码重置、通知等邮件,支持多种SMTP服务商。"})]}),e.jsx(je,{}),e.jsx(ku,{})]})}const Du=Object.freeze(Object.defineProperty({__proto__:null,default:Tu},Symbol.toStringTag,{value:"Module"})),Pu=u.object({telegram_bot_enable:u.boolean().nullable(),telegram_bot_token:u.string().nullable(),telegram_discuss_link:u.string().nullable()}),Vu={telegram_bot_enable:!1,telegram_bot_token:"",telegram_discuss_link:""};function Iu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(Pu),defaultValues:Vu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","telegram"],queryFn:()=>os("telegram")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:h=>{h.data&&A.success("已自动保存")}}),{mutate:d,isPending:x}=We({mutationFn:kd,onSuccess:h=>{h.data&&A.success("Webhook设置成功")}});c.useEffect(()=>{if(l?.data.telegram){const h=l.data.telegram;Object.entries(h).forEach(([D,C])=>{n.setValue(D,C)}),a.current=h}},[l]);const r=c.useCallback(de.debounce(async h=>{if(!de.isEqual(h,a.current)){t(!0);try{await o(h),a.current=h}finally{t(!1)}}},1e3),[o]),i=c.useCallback(h=>{r(h)},[r]);return c.useEffect(()=>{const h=n.watch(D=>{i(D)});return()=>h.unsubscribe()},[n.watch,i]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:n.control,name:"telegram_bot_token",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"机器人Token"}),e.jsx(y,{children:e.jsx(S,{placeholder:"0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",...h,value:h.value||""})}),e.jsx(F,{children:"请输入由Botfather提供的token。"}),e.jsx(k,{})]})}),n.watch("telegram_bot_token")&&e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"设置Webhook"}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(T,{loading:x,disabled:x,onClick:()=>d(),children:x?"Webhook设置中...":"一键设置"}),s&&e.jsx("span",{className:"text-sm text-muted-foreground",children:"保存中..."})]}),e.jsx(F,{children:"对机器人进行Webhook设置,不设置将无法收到Telegram通知。"}),e.jsx(k,{})]}),e.jsx(g,{control:n.control,name:"telegram_bot_enable",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"开启机器人通知"}),e.jsx(F,{children:"开启后bot将会对绑定了telegram的管理员和用户进行基础通知。"}),e.jsx(y,{children:e.jsx(H,{checked:h.value||!1,onCheckedChange:D=>{h.onChange(D),i(n.getValues())}})}),e.jsx(k,{})]})}),e.jsx(g,{control:n.control,name:"telegram_discuss_link",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{className:"text-base",children:"群组地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://t.me/xxxxxx",...h,value:h.value||""})}),e.jsx(F,{children:"填写后将会在用户端展示,或者被用于需要的地方。"}),e.jsx(k,{})]})}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Ru(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"Telegram设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"配置Telegram机器人功能,实现用户通知、账户绑定、指令交互等自动化服务。"})]}),e.jsx(je,{}),e.jsx(Iu,{})]})}const Eu=Object.freeze(Object.defineProperty({__proto__:null,default:Ru},Symbol.toStringTag,{value:"Module"})),Fu=u.object({windows_version:u.string().nullable(),windows_download_url:u.string().nullable(),macos_version:u.string().nullable(),macos_download_url:u.string().nullable(),android_version:u.string().nullable(),android_download_url:u.string().nullable()}),Mu={windows_version:"",windows_download_url:"",macos_version:"",macos_download_url:"",android_version:"",android_download_url:""};function zu(){const[s,t]=c.useState(!1),a=c.useRef(null),n=ae({resolver:ie(Fu),defaultValues:Mu,mode:"onBlur"}),{data:l}=Q({queryKey:["settings","app"],queryFn:()=>os("app")}),{mutateAsync:o}=We({mutationFn:cs,onSuccess:r=>{r.data&&A.success("已自动保存")}});c.useEffect(()=>{if(l?.data.app){const r=l.data.app;Object.entries(r).forEach(([i,h])=>{n.setValue(i,h)}),a.current=r}},[l]);const d=c.useCallback(de.debounce(async r=>{if(!de.isEqual(r,a.current)){t(!0);try{await o(r),a.current=r}finally{t(!1)}}},1e3),[o]),x=c.useCallback(r=>{d(r)},[d]);return c.useEffect(()=>{const r=n.watch(i=>{x(i)});return()=>r.unsubscribe()},[n.watch,x]),e.jsx(oe,{...n,children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Windows"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"Windows端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"windows_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"windows_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.exe",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"macOS"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"macOS端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"macos_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"macos_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.dmg",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Android"}),e.jsx("div",{className:"text-[0.8rem] text-muted-foreground",children:"Android端版本号及下载地址"}),e.jsxs("div",{children:[e.jsx("div",{className:"mb-1",children:e.jsx(g,{control:n.control,name:"android_version",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"1.0.0",...r,value:r.value||""})}),e.jsx(k,{})]})})}),e.jsx("div",{children:e.jsx(g,{control:n.control,name:"android_download_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(y,{children:e.jsx(S,{placeholder:"https://xxx.com/xxx.apk",...r,value:r.value||""})}),e.jsx(k,{})]})})})]})]}),s&&e.jsx("div",{className:"text-sm text-muted-foreground",children:"保存中..."})]})})}function Ou(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-medium",children:"APP设置"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"管理移动应用程序相关配置,包括API接口、版本控制、推送通知等功能设置。"})]}),e.jsx(je,{}),e.jsx(zu,{})]})}const Lu=Object.freeze(Object.defineProperty({__proto__:null,default:Ou},Symbol.toStringTag,{value:"Module"})),ca=c.forwardRef(({className:s,...t},a)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:a,className:v("w-full caption-bottom text-sm",s),...t})}));ca.displayName="Table";const da=c.forwardRef(({className:s,...t},a)=>e.jsx("thead",{ref:a,className:v("[&_tr]:border-b",s),...t}));da.displayName="TableHeader";const ua=c.forwardRef(({className:s,...t},a)=>e.jsx("tbody",{ref:a,className:v("[&_tr:last-child]:border-0",s),...t}));ua.displayName="TableBody";const $u=c.forwardRef(({className:s,...t},a)=>e.jsx("tfoot",{ref:a,className:v("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",s),...t}));$u.displayName="TableFooter";const js=c.forwardRef(({className:s,...t},a)=>e.jsx("tr",{ref:a,className:v("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",s),...t}));js.displayName="TableRow";const xa=c.forwardRef(({className:s,...t},a)=>e.jsx("th",{ref:a,className:v("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t}));xa.displayName="TableHead";const Ls=c.forwardRef(({className:s,...t},a)=>e.jsx("td",{ref:a,className:v("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",s),...t}));Ls.displayName="TableCell";const Au=c.forwardRef(({className:s,...t},a)=>e.jsx("caption",{ref:a,className:v("mt-4 text-sm text-muted-foreground",s),...t}));Au.displayName="TableCaption";function Hu({table:s}){const[t,a]=c.useState("");c.useEffect(()=>{a((s.getState().pagination.pageIndex+1).toString())},[s.getState().pagination.pageIndex]);const n=l=>{const o=parseInt(l);!isNaN(o)&&o>=1&&o<=s.getPageCount()?s.setPageIndex(o-1):a((s.getState().pagination.pageIndex+1).toString())};return e.jsxs("div",{className:"flex flex-col-reverse gap-4 px-2 py-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:["已选择 ",s.getFilteredSelectedRowModel().rows.length," 项, 共"," ",s.getFilteredRowModel().rows.length," 项"]}),e.jsxs("div",{className:"flex flex-col-reverse items-center gap-4 sm:flex-row sm:gap-6 lg:gap-8",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("p",{className:"text-sm font-medium",children:"每页显示"}),e.jsxs(G,{value:`${s.getState().pagination.pageSize}`,onValueChange:l=>{s.setPageSize(Number(l))},children:[e.jsx(U,{className:"h-8 w-[70px]",children:e.jsx(Y,{placeholder:s.getState().pagination.pageSize})}),e.jsx(B,{side:"top",children:[10,20,30,40,50,100,500].map(l=>e.jsx(O,{value:`${l}`,children:l},l))})]})]}),e.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[e.jsx("span",{children:"第"}),e.jsx(S,{type:"text",value:t,onChange:l=>a(l.target.value),onBlur:l=>n(l.target.value),onKeyDown:l=>{l.key==="Enter"&&n(l.currentTarget.value)},className:"h-8 w-[50px] text-center"}),e.jsxs("span",{children:["页,共 ",s.getPageCount()," 页"]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(T,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(0),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"跳转到第一页"}),e.jsx(Xi,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.previousPage(),disabled:!s.getCanPreviousPage(),children:[e.jsx("span",{className:"sr-only",children:"上一页"}),e.jsx(Cn,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>s.nextPage(),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"下一页"}),e.jsx(sa,{className:"h-4 w-4"})]}),e.jsxs(T,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>s.setPageIndex(s.getPageCount()-1),disabled:!s.getCanNextPage(),children:[e.jsx("span",{className:"sr-only",children:"跳转到最后一页"}),e.jsx(eo,{className:"h-4 w-4"})]})]})]})]})}function Ue({table:s,toolbar:t,draggable:a=!1,onDragStart:n,onDragEnd:l,onDragOver:o,onDragLeave:d,onDrop:x,showPagination:r=!0,isLoading:i=!1}){const h=c.useRef(null),D=s.getAllColumns().filter(_=>_.getIsPinned()==="left"),C=s.getAllColumns().filter(_=>_.getIsPinned()==="right"),m=_=>D.slice(0,_).reduce((b,N)=>b+(N.getSize()??0),0),w=_=>C.slice(_+1).reduce((b,N)=>b+(N.getSize()??0),0);return e.jsxs("div",{className:"space-y-4",children:[typeof t=="function"?t(s):t,e.jsx("div",{ref:h,className:"relative overflow-auto rounded-md border bg-card",children:e.jsx("div",{className:"overflow-auto",children:e.jsxs(ca,{children:[e.jsx(da,{children:s.getHeaderGroups().map(_=>e.jsx(js,{className:"hover:bg-transparent",children:_.headers.map((b,N)=>{const P=b.column.getIsPinned()==="left",f=b.column.getIsPinned()==="right",R=P?m(D.indexOf(b.column)):void 0,z=f?w(C.indexOf(b.column)):void 0;return e.jsx(xa,{colSpan:b.colSpan,style:{width:b.getSize(),...P&&{left:R},...f&&{right:z}},className:v("h-11 bg-card px-4 text-muted-foreground",(P||f)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",P&&"before:right-0",f&&"before:left-0"]),children:b.isPlaceholder?null:vt(b.column.columnDef.header,b.getContext())},b.id)})},_.id))}),e.jsx(ua,{children:s.getRowModel().rows?.length?s.getRowModel().rows.map((_,b)=>e.jsx(js,{"data-state":_.getIsSelected()&&"selected",className:"hover:bg-muted/50",draggable:a,onDragStart:N=>n?.(N,b),onDragEnd:l,onDragOver:o,onDragLeave:d,onDrop:N=>x?.(N,b),children:_.getVisibleCells().map((N,P)=>{const f=N.column.getIsPinned()==="left",R=N.column.getIsPinned()==="right",z=f?m(D.indexOf(N.column)):void 0,$=R?w(C.indexOf(N.column)):void 0;return e.jsx(Ls,{style:{width:N.column.getSize(),...f&&{left:z},...R&&{right:$}},className:v("bg-card",(f||R)&&["sticky z-20","before:absolute before:bottom-0 before:top-0 before:w-[1px] before:bg-border",f&&"before:right-0",R&&"before:left-0"]),children:vt(N.column.columnDef.cell,N.getContext())},N.id)})},_.id)):e.jsx(js,{children:e.jsx(Ls,{colSpan:s.getAllColumns().length,className:"h-24 text-center",children:"暂无数据"})})})]})})}),r&&e.jsx(Hu,{table:s})]})}const Nr=(s,t)=>{let a=null;switch(s.field_type){case"input":a=e.jsx(S,{placeholder:s.placeholder,...t});break;case"textarea":a=e.jsx(bs,{placeholder:s.placeholder,...t});break;case"select":a=e.jsx("select",{className:v($s({variant:"outline"}),"w-full appearance-none font-normal"),...t,children:s.select_options&&Object.keys(s.select_options).map(n=>e.jsx("option",{value:n,children:s.select_options?.[n]},n))});break;default:a=null;break}return a},Ku=u.object({id:u.number().nullable(),name:u.string().min(2,"名称至少需要2个字符").max(30,"名称不能超过30个字符"),icon:u.string().optional().nullable(),notify_domain:u.string().refine(s=>!s||/^https?:\/\/\S+/.test(s),"请输入有效的URL").optional().nullable(),handling_fee_fixed:u.coerce.number().min(0).optional().nullable(),handling_fee_percent:u.coerce.number().min(0).max(100).optional().nullable(),payment:u.string().min(1,"请选择支付接口"),config:u.record(u.string(),u.string())}),La={id:null,name:"",icon:"",notify_domain:"",handling_fee_fixed:0,handling_fee_percent:0,payment:"",config:{}};function wr({refetch:s,dialogTrigger:t,type:a="add",defaultFormValues:n=La}){const[l,o]=c.useState(!1),[d,x]=c.useState(!1),[r,i]=c.useState([]),[h,D]=c.useState([]),C=ae({resolver:ie(Ku),defaultValues:n,mode:"onChange"}),m=C.watch("payment");c.useEffect(()=>{l&&(async()=>{const{data:b}=await Kc();i(b)})()},[l]),c.useEffect(()=>{if(!m||!l)return;(async()=>{const b={payment:m,...a==="edit"&&{id:Number(C.getValues("id"))}};qc(b).then(({data:N})=>{D(N);const P=N.reduce((f,R)=>(R.field_name&&(f[R.field_name]=R.value??""),f),{});C.setValue("config",P)})})()},[m,l,C,a]);const w=async _=>{x(!0),(await Uc(_)).data&&(A.success("保存成功"),C.reset(La),s(),o(!1)),x(!1)};return e.jsxs(ue,{open:l,onOpenChange:o,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加支付方式"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsx(he,{children:e.jsx(xe,{children:a==="add"?"添加支付方式":"编辑支付方式"})}),e.jsx(oe,{...C,children:e.jsxs("form",{onSubmit:C.handleSubmit(w),className:"space-y-4",children:[e.jsx(g,{control:C.control,name:"name",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入支付名称",..._})}),e.jsx(F,{children:"用于前端显示"}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"icon",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"图标URL"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://example.com/icon.svg",..._})}),e.jsx(F,{children:"用于前端显示的图标地址"}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"notify_domain",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"通知域名"}),e.jsx(y,{children:e.jsx(S,{placeholder:"https://example.com",..._})}),e.jsx(F,{children:"网关通知将发送到该域名"}),e.jsx(k,{})]})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsx(g,{control:C.control,name:"handling_fee_percent",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"百分比手续费(%)"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0-100",..._})}),e.jsx(k,{})]})}),e.jsx(g,{control:C.control,name:"handling_fee_fixed",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"固定手续费"}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0",..._})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:C.control,name:"payment",render:({field:_})=>e.jsxs(j,{children:[e.jsx(p,{children:"支付接口"}),e.jsxs(G,{value:_.value,onValueChange:_.onChange,children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择支付接口"})})}),e.jsx(B,{children:r.map(b=>e.jsx(O,{value:b,children:b},b))})]}),e.jsx(k,{})]})}),h.map(_=>e.jsx(g,{control:C.control,name:`config.${_.field_name}`,render:({field:b})=>e.jsxs(j,{children:[e.jsx(p,{children:_.label}),e.jsx(y,{children:Nr(_,b)}),e.jsx(k,{})]})},_.field_name)),e.jsxs(Re,{className:"gap-2",children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",disabled:d,className:v(d&&"cursor-not-allowed opacity-50"),children:d?"保存中...":"提交"})]})]})})]})]})}function V({column:s,title:t,tooltip:a,className:n}){return s.getCanSort()?e.jsx("div",{className:"flex items-center gap-1",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs(T,{variant:"ghost",size:"default",className:v("-ml-3 flex h-8 items-center gap-2 text-nowrap font-medium hover:bg-muted/60",n),onClick:()=>s.toggleSorting(s.getIsSorted()==="asc"),children:[e.jsx("span",{children:t}),a&&e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ka,{className:"h-4 w-4 cursor-pointer text-muted-foreground"})}),e.jsx(ee,{children:a})]})}),s.getIsSorted()==="asc"?e.jsx(Kt,{className:"h-4 w-4 text-foreground/70"}):s.getIsSorted()==="desc"?e.jsx(qt,{className:"h-4 w-4 text-foreground/70"}):e.jsx(so,{className:"h-4 w-4 text-muted-foreground/70 transition-colors hover:text-foreground/70"})]})})}):e.jsxs("div",{className:v("flex items-center space-x-1 text-nowrap py-2 font-medium text-muted-foreground",n),children:[e.jsx("span",{children:t}),a&&e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{children:e.jsx(ka,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(ee,{children:a})]})})]})}const qu=to,Uu=ao,Bu=no,_r=c.forwardRef(({className:s,...t},a)=>e.jsx(En,{className:v("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...t,ref:a}));_r.displayName=En.displayName;const Cr=c.forwardRef(({className:s,...t},a)=>e.jsxs(Bu,{children:[e.jsx(_r,{}),e.jsx(Fn,{ref:a,className:v("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",s),...t})]}));Cr.displayName=Fn.displayName;const Sr=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col space-y-2 text-center sm:text-left",s),...t});Sr.displayName="AlertDialogHeader";const kr=({className:s,...t})=>e.jsx("div",{className:v("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...t});kr.displayName="AlertDialogFooter";const Tr=c.forwardRef(({className:s,...t},a)=>e.jsx(Mn,{ref:a,className:v("text-lg font-semibold",s),...t}));Tr.displayName=Mn.displayName;const Dr=c.forwardRef(({className:s,...t},a)=>e.jsx(zn,{ref:a,className:v("text-sm text-muted-foreground",s),...t}));Dr.displayName=zn.displayName;const Pr=c.forwardRef(({className:s,...t},a)=>e.jsx(On,{ref:a,className:v($s(),s),...t}));Pr.displayName=On.displayName;const Vr=c.forwardRef(({className:s,...t},a)=>e.jsx(Ln,{ref:a,className:v($s({variant:"outline"}),"mt-2 sm:mt-0",s),...t}));Vr.displayName=Ln.displayName;function Be({onConfirm:s,children:t,title:a="确认操作",description:n="确定要执行此操作吗?",cancelText:l="取消",confirmText:o="确认",variant:d="default",className:x}){return e.jsxs(qu,{children:[e.jsx(Uu,{asChild:!0,children:t}),e.jsxs(Cr,{className:v("sm:max-w-[425px]",x),children:[e.jsxs(Sr,{children:[e.jsx(Tr,{children:a}),e.jsx(Dr,{children:n})]}),e.jsxs(kr,{children:[e.jsx(Vr,{asChild:!0,children:e.jsx(T,{variant:"outline",children:l})}),e.jsx(Pr,{asChild:!0,children:e.jsx(T,{variant:d,onClick:s,children:o})})]})]})]})}const Ir=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M11.29 15.29a2 2 0 0 0-.12.15a.8.8 0 0 0-.09.18a.6.6 0 0 0-.06.18a1.4 1.4 0 0 0 0 .2a.84.84 0 0 0 .08.38a.9.9 0 0 0 .54.54a.94.94 0 0 0 .76 0a.9.9 0 0 0 .54-.54A1 1 0 0 0 13 16a1 1 0 0 0-.29-.71a1 1 0 0 0-1.42 0M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2m0 18a8 8 0 1 1 8-8a8 8 0 0 1-8 8m0-13a3 3 0 0 0-2.6 1.5a1 1 0 1 0 1.73 1A1 1 0 0 1 12 9a1 1 0 0 1 0 2a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-.18A3 3 0 0 0 12 7"})}),Gu=({refetch:s,isSortMode:t=!1})=>[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:t?"cursor-move":"opacity-0",children:e.jsx(Tt,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:a})=>e.jsx(V,{column:a,title:"ID"}),cell:({row:a})=>e.jsx(L,{variant:"outline",children:a.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"enable",header:({column:a})=>e.jsx(V,{column:a,title:"启用"}),cell:({row:a})=>e.jsx(H,{defaultChecked:a.getValue("enable"),onCheckedChange:async()=>{const{data:n}=await Gc({id:a.original.id});n||s()}}),enableSorting:!1,size:100},{accessorKey:"name",header:({column:a})=>e.jsx(V,{column:a,title:"显示名称"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:a.getValue("name")})}),enableSorting:!1,size:200},{accessorKey:"payment",header:({column:a})=>e.jsx(V,{column:a,title:"支付接口"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[200px] truncate font-medium",children:a.getValue("payment")})}),enableSorting:!1,size:200},{accessorKey:"notify_url",header:({column:a})=>e.jsxs("div",{className:"flex items-center",children:[e.jsx(V,{column:a,title:"通知地址"}),e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{className:"ml-1",children:e.jsx(Ir,{className:"h-4 w-4"})}),e.jsx(ee,{children:"支付网关将会把数据通知到本地址,请通过防火墙放行本地址。"})]})})]}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx("span",{className:"max-w-[300px] truncate font-medium",children:a.getValue("notify_url")})}),enableSorting:!1,size:3e3},{id:"actions",header:({column:a})=>e.jsx(V,{className:"justify-end",column:a,title:"操作"}),cell:({row:a})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(wr,{refetch:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:a.original}),e.jsx(Be,{title:"删除确认",description:"确定要删除该支付方式吗?此操作无法撤销。",onConfirm:async()=>{const{data:n}=await Bc({id:a.original.id});n&&s()},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-destructive/10",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-destructive"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function Yu({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽支付方式进行排序,完成后点击保存"}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(wr,{refetch:t}),e.jsx(S,{placeholder:"搜索支付方式...",value:s.getColumn("name")?.getFilterValue()??"",onChange:o=>s.getColumn("name")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,size:"sm",children:n?"保存排序":"编辑排序"})})]})}function Wu(){const[s,t]=c.useState([]),[a,n]=c.useState([]),[l,o]=c.useState(!1),[d,x]=c.useState([]),[r,i]=c.useState({"drag-handle":!1}),[h,D]=c.useState({pageSize:20,pageIndex:0}),{refetch:C}=Q({queryKey:["paymentList"],queryFn:async()=>{const{data:N}=await Hc();return x(N?.map(P=>({...P,enable:!!P.enable}))||[]),N}});c.useEffect(()=>{i({"drag-handle":l}),D({pageSize:l?99999:10,pageIndex:0})},[l]);const m=(N,P)=>{l&&(N.dataTransfer.setData("text/plain",P.toString()),N.currentTarget.classList.add("opacity-50"))},w=(N,P)=>{if(!l)return;N.preventDefault(),N.currentTarget.classList.remove("bg-muted");const f=parseInt(N.dataTransfer.getData("text/plain"));if(f===P)return;const R=[...d],[z]=R.splice(f,1);R.splice(P,0,z),x(R)},_=async()=>{l?Yc({ids:d.map(N=>N.id)}).then(()=>{C(),o(!1),A.success("排序保存成功")}):o(!0)},b=Me({data:d,columns:Gu({refetch:C,isSortMode:l}),state:{sorting:a,columnFilters:s,columnVisibility:r,pagination:h},onSortingChange:n,onColumnFiltersChange:t,onColumnVisibilityChange:i,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),initialState:{columnPinning:{right:["actions"]}},pageCount:l?1:void 0});return e.jsx(Ue,{table:b,toolbar:N=>e.jsx(Yu,{table:N,refetch:C,saveOrder:_,isSortMode:l}),draggable:l,onDragStart:m,onDragEnd:N=>N.currentTarget.classList.remove("opacity-50"),onDragOver:N=>{N.preventDefault(),N.currentTarget.classList.add("bg-muted")},onDragLeave:N=>N.currentTarget.classList.remove("bg-muted"),onDrop:w,showPagination:!l})}function Ju(){return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{children:[e.jsx("header",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"支付配置"})}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置支付方式,包括支付宝、微信等。"})]})}),e.jsx("section",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Wu,{})})]})]})}const Qu=Object.freeze(Object.defineProperty({__proto__:null,default:Ju},Symbol.toStringTag,{value:"Module"}));function Zu({themeKey:s,themeInfo:t}){const[a,n]=c.useState(!1),[l,o]=c.useState(!1),[d,x]=c.useState(!1),r=ae({defaultValues:t.configs.reduce((D,C)=>(D[C.field_name]="",D),{})}),i=async()=>{o(!0),Tc(s).then(({data:D})=>{Object.entries(D).forEach(([C,m])=>{r.setValue(C,m)})}).finally(()=>{o(!1)})},h=async D=>{x(!0),Dc(s,D).then(()=>{A.success("保存成功"),n(!1)}).finally(()=>{x(!1)})};return e.jsxs(ue,{open:a,onOpenChange:D=>{n(D),D?i():r.reset()},children:[e.jsx(Ie,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"主题设置"})}),e.jsxs(ce,{className:"max-h-[90vh] overflow-auto sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsxs(xe,{children:["配置",t.name,"主题"]}),e.jsx(Se,{children:"修改主题的样式、布局和其他显示选项。"})]}),l?e.jsx("div",{className:"flex h-40 items-center justify-center",children:e.jsx(aa,{className:"h-6 w-6 animate-spin"})}):e.jsx(oe,{...r,children:e.jsxs("form",{onSubmit:r.handleSubmit(h),className:"space-y-4",children:[t.configs.map(D=>e.jsx(g,{control:r.control,name:D.field_name,render:({field:C})=>e.jsxs(j,{children:[e.jsx(p,{children:D.label}),e.jsx(y,{children:Nr(D,C)}),e.jsx(k,{})]})},D.field_name)),e.jsxs(Re,{className:"mt-6 gap-2",children:[e.jsx(T,{type:"button",variant:"secondary",onClick:()=>n(!1),children:"取消"}),e.jsx(T,{type:"submit",loading:d,children:"保存"})]})]})})]})]})}function Xu(){const[s,t]=c.useState(null),[a,n]=c.useState(!1),[l,o]=c.useState(!1),[d,x]=c.useState(!1),[r,i]=c.useState(null),h=c.useRef(null),[D,C]=c.useState(0),{data:m,isLoading:w,refetch:_}=Q({queryKey:["themeList"],queryFn:async()=>{const{data:E}=await kc();return E}}),b=async E=>{t(E),Ic({frontend_theme:E}).then(()=>{A.success("主题切换成功"),_()}).finally(()=>{t(null)})},N=async E=>{if(!E.name.endsWith(".zip")){A.error("只支持上传 ZIP 格式的主题文件");return}n(!0),Pc(E).then(()=>{A.success("主题上传成功"),o(!1),_()}).finally(()=>{n(!1),h.current&&(h.current.value="")})},P=E=>{E.preventDefault(),E.stopPropagation(),E.type==="dragenter"||E.type==="dragover"?x(!0):E.type==="dragleave"&&x(!1)},f=E=>{E.preventDefault(),E.stopPropagation(),x(!1),E.dataTransfer.files&&E.dataTransfer.files[0]&&N(E.dataTransfer.files[0])},R=()=>{r&&C(E=>E===0?r.images.length-1:E-1)},z=()=>{r&&C(E=>E===r.images.length-1?0:E+1)},$=(E,K)=>{C(0),i({name:E,images:K})};return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("div",{className:"mb-2",children:e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"主题配置"})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-muted-foreground",children:"主题配置,包括主题色、字体大小等。如果你采用前后分离的方式部署V2board,那么主题配置将不会生效。"}),e.jsxs(T,{onClick:()=>o(!0),variant:"outline",className:"ml-4 shrink-0",size:"sm",children:[e.jsx(Ht,{className:"mr-2 h-4 w-4"}),"上传主题"]})]})]}),e.jsx("section",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3",children:w?e.jsxs(e.Fragment,{children:[e.jsx($a,{}),e.jsx($a,{})]}):m?.themes&&Object.entries(m.themes).map(([E,K])=>e.jsx($e,{className:"group relative overflow-hidden transition-all hover:shadow-md",style:{backgroundImage:K.background_url?`url(${K.background_url})`:"none",backgroundSize:"cover",backgroundPosition:"center"},children:e.jsxs("div",{className:v("relative z-10 h-full transition-colors",K.background_url?"group-hover:from-background/98 bg-gradient-to-t from-background/95 via-background/80 to-background/60 backdrop-blur-[1px] group-hover:via-background/90 group-hover:to-background/70":"bg-background"),children:[!!K.can_delete&&e.jsx("div",{className:"absolute right-2 top-2",children:e.jsx(Be,{title:"删除主题",description:"确定要删除该主题吗?删除后无法恢复。",confirmText:"删除",variant:"destructive",onConfirm:async()=>{if(E===m?.active){A.error("不能删除当前使用的主题");return}t(E),Vc(E).then(()=>{A.success("主题删除成功"),_()}).finally(()=>{t(null)})},children:e.jsx(T,{disabled:s===E,loading:s===E,variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:e.jsx(rs,{className:"h-4 w-4"})})})}),e.jsxs(Je,{children:[e.jsx(gs,{children:K.name}),e.jsx(Xs,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{children:K.description}),K.version&&e.jsxs("div",{className:"text-sm text-muted-foreground",children:["版本: ",K.version]})]})})]}),e.jsxs(Qe,{className:"flex items-center justify-end space-x-3",children:[K.images&&Array.isArray(K.images)&&K.images.length>0&&e.jsx(T,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>$(K.name,K.images),children:e.jsx(ro,{className:"h-4 w-4"})}),e.jsx(Zu,{themeKey:E,themeInfo:K}),e.jsx(T,{onClick:()=>b(E),disabled:s===E||E===m.active,loading:s===E,variant:E===m.active?"secondary":"default",children:E===m.active?"当前主题":"激活主题"})]})]})},E))}),e.jsx(ue,{open:l,onOpenChange:o,children:e.jsxs(ce,{className:"sm:max-w-md",children:[e.jsxs(he,{children:[e.jsx(xe,{children:"上传主题"}),e.jsx(Se,{children:"请上传一个有效的主题压缩包(.zip 格式)。主题包应包含完整的主题文件结构。"})]}),e.jsxs("div",{className:v("relative mt-4 flex h-64 flex-col items-center justify-center rounded-lg border-2 border-dashed border-muted-foreground/25 px-5 py-10 text-center transition-colors",d&&"border-primary/50 bg-muted/50"),onDragEnter:P,onDragLeave:P,onDragOver:P,onDrop:f,children:[e.jsx("input",{type:"file",ref:h,className:"hidden",accept:".zip",onChange:E=>{const K=E.target.files?.[0];K&&N(K)}}),a?e.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[e.jsx("div",{className:"h-10 w-10 animate-spin rounded-full border-b-2 border-primary"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"正在上传..."})]}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[e.jsx("div",{className:"rounded-full border-2 border-muted-foreground/25 p-3",children:e.jsx(Ht,{className:"h-6 w-6 text-muted-foreground/50"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-sm font-medium",children:["将主题文件拖放到此处,或者",e.jsx("button",{type:"button",onClick:()=>h.current?.click(),className:"mx-1 text-primary hover:underline",children:"点击选择"})]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"支持 .zip 格式的主题包"})]})]})})]})]})}),e.jsx(ue,{open:!!r,onOpenChange:E=>{E||(i(null),C(0))},children:e.jsxs(ce,{className:"max-w-4xl",children:[e.jsxs(he,{children:[e.jsxs(xe,{children:[r?.name," 主题预览"]}),e.jsx(Se,{className:"text-center",children:r&&`${D+1} / ${r.images.length}`})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"aspect-[16/9] overflow-hidden rounded-lg border bg-muted",children:r?.images[D]&&e.jsx("img",{src:r.images[D],alt:`${r.name} 预览图 ${D+1}`,className:"h-full w-full object-contain"})}),r&&r.images.length>1&&e.jsxs(e.Fragment,{children:[e.jsx(T,{variant:"outline",size:"icon",className:"absolute left-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:R,children:e.jsx(lo,{className:"h-4 w-4"})}),e.jsx(T,{variant:"outline",size:"icon",className:"absolute right-4 top-1/2 h-8 w-8 -translate-y-1/2 rounded-full bg-background/80 hover:bg-background",onClick:z,children:e.jsx(io,{className:"h-4 w-4"})})]})]}),r&&r.images.length>1&&e.jsx("div",{className:"mt-4 flex gap-2 overflow-x-auto pb-2",children:r.images.map((E,K)=>e.jsx("button",{onClick:()=>C(K),className:v("relative h-16 w-16 flex-shrink-0 overflow-hidden rounded-md border-2",D===K?"border-primary":"border-transparent"),children:e.jsx("img",{src:E,alt:`缩略图 ${K+1}`,className:"h-full w-full object-cover"})},K))})]})})]})]})}function $a(){return e.jsxs($e,{children:[e.jsxs(Je,{children:[e.jsx(Ee,{className:"h-6 w-[200px]"}),e.jsx(Ee,{className:"h-4 w-[300px]"})]}),e.jsxs(Qe,{className:"flex items-center justify-end space-x-3",children:[e.jsx(Ee,{className:"h-10 w-[100px]"}),e.jsx(Ee,{className:"h-10 w-[100px]"})]})]})}const ex=Object.freeze(Object.defineProperty({__proto__:null,default:Xu},Symbol.toStringTag,{value:"Module"})),ma=c.forwardRef(({className:s,value:t,onChange:a,...n},l)=>{const[o,d]=c.useState("");c.useEffect(()=>{if(o.includes(",")){const r=new Set([...t,...o.split(",").map(i=>i.trim())]);a(Array.from(r)),d("")}},[o,a,t]);const x=()=>{if(o){const r=new Set([...t,o]);a(Array.from(r)),d("")}};return e.jsxs("div",{className:v(" has-[:focus-visible]:outline-none has-[:focus-visible]:ring-1 has-[:focus-visible]:ring-neutral-950 dark:has-[:focus-visible]:ring-neutral-300 flex w-full flex-wrap gap-2 rounded-md border border-input shadow-sm px-3 py-2 text-sm ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",s),children:[t.map(r=>e.jsxs(L,{variant:"secondary",children:[r,e.jsx(W,{variant:"ghost",size:"icon",className:"ml-2 h-3 w-3",onClick:()=>{a(t.filter(i=>i!==r))},children:e.jsx(Ut,{className:"w-3"})})]},r)),e.jsx("input",{className:"flex-1 outline-none placeholder:text-muted-foreground bg-transparent",value:o,onChange:r=>d(r.target.value),onKeyDown:r=>{r.key==="Enter"||r.key===","?(r.preventDefault(),x()):r.key==="Backspace"&&o.length===0&&t.length>0&&(r.preventDefault(),a(t.slice(0,-1)))},...n,ref:l})]})});ma.displayName="InputTags";const sx=u.object({id:u.number().nullable(),title:u.string().min(1).max(250),content:u.string().min(1),show:u.boolean(),tags:u.array(u.string()),img_url:u.string().nullable()}),tx={id:null,show:!1,tags:[],img_url:"",title:"",content:""};function Rr({refetch:s,dialogTrigger:t,type:a="add",defaultFormValues:n=tx}){const[l,o]=c.useState(!1),d=ae({resolver:ie(sx),defaultValues:n,mode:"onChange",shouldFocusError:!0}),x=new na({html:!0});return e.jsx(oe,{...d,children:e.jsxs(ue,{onOpenChange:o,open:l,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加公告"})]})}),e.jsxs(ce,{className:"sm:max-w-[1025px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a==="add"?"添加公告":"编辑公告"}),e.jsx(Se,{})]}),e.jsx(g,{control:d.control,name:"title",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"标题"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入公告标题",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"content",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"公告内容"}),e.jsx(y,{children:e.jsx(ra,{style:{height:"500px"},value:r.value,renderHTML:i=>x.render(i),onChange:({text:i})=>{r.onChange(i)}})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"img_url",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"公告背景"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"请输入公告背景图片URL",...r,value:r.value||""})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"show",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示"}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:r.onChange})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"tags",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点标签"}),e.jsx(y,{children:e.jsx(ma,{value:r.value,onChange:r.onChange,placeholder:"输入后回车添加标签",className:"w-full"})}),e.jsx(k,{})]})}),e.jsxs(Re,{children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",onClick:r=>{r.preventDefault(),d.handleSubmit(async i=>{Jc(i).then(({data:h})=>{h&&(A.success("提交成功"),s(),o(!1))})})()},children:"提交"})]})]})]})})}function ax({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between space-x-2 ",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[!n&&e.jsx(Rr,{refetch:t}),!n&&e.jsx(S,{placeholder:"搜索公告标题...",value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),l&&!n&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-9 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,className:"h-8",size:"sm",children:n?"保存排序":"编辑排序"})})]})}const nx=s=>[{id:"drag-handle",header:"",cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(oo,{className:"h-4 w-4 text-muted-foreground cursor-move"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"ID"}),cell:({row:t})=>e.jsx(L,{variant:"outline",className:"font-mono",children:t.getValue("id")}),enableSorting:!0,size:60},{accessorKey:"show",header:({column:t})=>e.jsx(V,{column:t,title:"显示状态"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(H,{defaultChecked:t.getValue("show"),onCheckedChange:async()=>{const{data:a}=await Zc({id:t.original.id});a||s()}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:t})=>e.jsx(V,{column:t,title:"标题"}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[500px] items-center",children:e.jsx("span",{className:"truncate font-medium",children:t.getValue("title")})}),enableSorting:!1,size:6e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[e.jsx(Rr,{refetch:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:t.original}),e.jsx(Be,{title:"删除确认",description:"确定要删除该条公告吗?此操作无法撤销。",onConfirm:async()=>{Qc({id:t.original.id}).then(()=>{A.success("删除成功"),s()})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function rx(){const[s,t]=c.useState({}),[a,n]=c.useState({}),[l,o]=c.useState([]),[d,x]=c.useState([]),[r,i]=c.useState(!1),[h,D]=c.useState({}),[C,m]=c.useState({pageSize:50,pageIndex:0}),[w,_]=c.useState([]),{refetch:b}=Q({queryKey:["notices"],queryFn:async()=>{const{data:z}=await Wc();return _(z),z}});c.useEffect(()=>{n({"drag-handle":r,content:!r,created_at:!r,actions:!r}),m({pageSize:r?99999:50,pageIndex:0})},[r]);const N=(z,$)=>{r&&(z.dataTransfer.setData("text/plain",$.toString()),z.currentTarget.classList.add("opacity-50"))},P=(z,$)=>{if(!r)return;z.preventDefault(),z.currentTarget.classList.remove("bg-muted");const E=parseInt(z.dataTransfer.getData("text/plain"));if(E===$)return;const K=[...w],[ds]=K.splice(E,1);K.splice($,0,ds),_(K)},f=async()=>{if(!r){i(!0);return}Td(w.map(z=>z.id)).then(()=>{A.success("排序保存成功"),i(!1),b()}).finally(()=>{i(!1)})},R=Me({data:w??[],columns:nx(b),state:{sorting:d,columnVisibility:a,rowSelection:s,columnFilters:l,columnSizing:h,pagination:C},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:x,onColumnFiltersChange:o,onColumnVisibilityChange:n,onColumnSizingChange:D,onPaginationChange:m,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx("div",{className:"space-y-4",children:e.jsx(Ue,{table:R,toolbar:z=>e.jsx(ax,{table:z,refetch:b,saveOrder:f,isSortMode:r}),draggable:r,onDragStart:N,onDragEnd:z=>z.currentTarget.classList.remove("opacity-50"),onDragOver:z=>{z.preventDefault(),z.currentTarget.classList.add("bg-muted")},onDragLeave:z=>z.currentTarget.classList.remove("bg-muted"),onDrop:P,showPagination:!r})})}function lx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{className:"flex items-center justify-between",children:[e.jsx(ke,{}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("div",{className:"mb-2",children:e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"公告管理"})}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置公告,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(rx,{})})]})]})}const ix=Object.freeze(Object.defineProperty({__proto__:null,default:lx},Symbol.toStringTag,{value:"Module"})),ox=u.object({id:u.number().nullable(),language:u.string().max(250),category:u.string().max(250),title:u.string().min(1).max(250),body:u.string().min(1),show:u.boolean()}),cx={id:null,language:"zh-CN",category:"",title:"",body:"",show:!1};function Er({refreshData:s,dialogTrigger:t,type:a="add",defaultFormValues:n=cx}){const[l,o]=c.useState(!1),d=ae({resolver:ie(ox),defaultValues:n,mode:"onChange",shouldFocusError:!0}),x=new na({html:!0});return c.useEffect(()=>{l&&n.id&&ed(n.id).then(({data:r})=>{d.reset(r)})},[n.id,d,l]),e.jsxs(ue,{onOpenChange:o,open:l,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加知识"})]})}),e.jsxs(ce,{className:"sm:max-w-[1025px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a==="add"?"添加知识":"编辑知识"}),e.jsx(Se,{})]}),e.jsxs(oe,{...d,children:[e.jsx(g,{control:d.control,name:"title",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"标题"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入知识标题",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"category",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"分类"}),e.jsx("div",{className:"relative ",children:e.jsx(y,{children:e.jsx(S,{placeholder:"请输入分类,分类将会自动归类",...r})})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"language",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"语言"}),e.jsx(y,{children:e.jsxs(G,{value:r.value,onValueChange:r.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择语言"})}),e.jsx(B,{children:[{field:"English",value:"en-US"},{field:"日本語",value:"ja-JP"},{field:"한국어",value:"ko-KR"},{field:"Tiếng Việt",value:"vi-VN"},{field:"简体中文",value:"zh-CN"},{field:"繁體中文",value:"zh-TW"}].map(i=>e.jsx(O,{value:i.value,className:"cursor-pointer",children:i.field},i.value))})]})})]})}),e.jsx(g,{control:d.control,name:"body",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"内容"}),e.jsx(y,{children:e.jsx(ra,{style:{height:"500px"},value:r.value,renderHTML:i=>x.render(i),onChange:({text:i})=>{r.onChange(i)}})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"show",render:({field:r})=>e.jsxs(j,{children:[e.jsx(p,{children:"显示"}),e.jsx("div",{className:"relative py-2",children:e.jsx(y,{children:e.jsx(H,{checked:r.value,onCheckedChange:r.onChange})})}),e.jsx(k,{})]})}),e.jsxs(Re,{children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",onClick:()=>{d.handleSubmit(r=>{sd(r).then(({data:i})=>{i&&(d.reset(),A.success("操作成功"),o(!1),s())})})()},children:"提交"})]})]})]})]})}function dx({column:s,title:t,options:a}){const n=s?.getFacetedUniqueValues(),l=new Set(s?.getFilterValue());return e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(it,{className:"mr-2 h-4 w-4"}),t,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(je,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):a.filter(o=>l.has(o.value)).map(o=>e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(qe,{className:"w-[200px] p-0",align:"start",children:e.jsxs(ps,{children:[e.jsx(Ps,{placeholder:t}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"No results found."}),e.jsx(Ve,{children:a.map(o=>{const d=l.has(o.value);return e.jsxs(be,{onSelect:()=>{d?l.delete(o.value):l.add(o.value);const x=Array.from(l);s?.setFilterValue(x.length?x:void 0)},children:[e.jsx("div",{className:v("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ks,{className:v("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),e.jsx("span",{children:o.label}),n?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:n.get(o.value)})]},o.value)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Hs,{}),e.jsx(Ve,{children:e.jsx(be,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})]})})]})}function ux({table:s,refetch:t,saveOrder:a,isSortMode:n}){const l=s.getState().columnFilters.length>0;return e.jsxs("div",{className:"flex items-center justify-between",children:[n?e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽知识条目进行排序,完成后点击保存"}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Er,{refreshData:t}),e.jsx(S,{placeholder:"搜索知识...",value:s.getColumn("title")?.getFilterValue()??"",onChange:o=>s.getColumn("title")?.setFilterValue(o.target.value),className:"h-8 w-[250px]"}),s.getColumn("category")&&e.jsx(dx,{column:s.getColumn("category"),title:"分类",options:Array.from(new Set(s.getCoreRowModel().rows.map(o=>o.getValue("category")))).map(o=>({label:o,value:o}))}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:n?"default":"outline",onClick:a,size:"sm",children:n?"保存排序":"编辑排序"})})]})}const xx=({refetch:s,isSortMode:t=!1})=>[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:t?"cursor-move":"opacity-0",children:e.jsx(Tt,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:a})=>e.jsx(V,{column:a,title:"ID"}),cell:({row:a})=>e.jsx(L,{variant:"outline",className:"justify-center",children:a.getValue("id")}),enableSorting:!0,size:70},{accessorKey:"show",header:({column:a})=>e.jsx(V,{column:a,title:"状态"}),cell:({row:a})=>e.jsx("div",{className:"flex items-center",children:e.jsx(H,{defaultChecked:a.getValue("show"),onCheckedChange:async()=>{ad({id:a.original.id}).then(({data:n})=>{n||s()})}})}),enableSorting:!1,size:100},{accessorKey:"title",header:({column:a})=>e.jsx(V,{column:a,title:"标题"}),cell:({row:a})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"line-clamp-2 font-medium",children:a.getValue("title")})}),enableSorting:!0,size:600},{accessorKey:"category",header:({column:a})=>e.jsx(V,{column:a,title:"分类"}),cell:({row:a})=>e.jsx(L,{variant:"secondary",className:"max-w-[180px] truncate",children:a.getValue("category")}),enableSorting:!0,size:1800},{id:"actions",header:({column:a})=>e.jsx(V,{className:"justify-end",column:a,title:"操作"}),cell:({row:a})=>e.jsxs("div",{className:"flex items-center justify-end space-x-1",children:[e.jsx(Er,{refreshData:s,dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),type:"edit",defaultFormValues:a.original}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该知识库记录,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{td({id:a.original.id}).then(({data:n})=>{n&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]}),size:100}];function mx(){const[s,t]=c.useState([]),[a,n]=c.useState([]),[l,o]=c.useState(!1),[d,x]=c.useState([]),[r,i]=c.useState({"drag-handle":!1}),[h,D]=c.useState({pageSize:20,pageIndex:0}),{refetch:C,isLoading:m,data:w}=Q({queryKey:["knowledge"],queryFn:async()=>{const{data:f}=await Xc();return x(f||[]),f}});c.useEffect(()=>{i({"drag-handle":l}),D({pageSize:l?99999:10,pageIndex:0})},[l]);const _=(f,R)=>{l&&(f.dataTransfer.setData("text/plain",R.toString()),f.currentTarget.classList.add("opacity-50"))},b=(f,R)=>{if(!l)return;f.preventDefault(),f.currentTarget.classList.remove("bg-muted");const z=parseInt(f.dataTransfer.getData("text/plain"));if(z===R)return;const $=[...d],[E]=$.splice(z,1);$.splice(R,0,E),x($)},N=async()=>{l?nd({ids:d.map(f=>f.id)}).then(()=>{C(),o(!1),A.success("排序保存成功")}):o(!0)},P=Me({data:d,columns:xx({refetch:C,isSortMode:l}),state:{sorting:a,columnFilters:s,columnVisibility:r,pagination:h},onSortingChange:n,onColumnFiltersChange:t,onColumnVisibilityChange:i,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Ue,{table:P,toolbar:f=>e.jsx(ux,{table:f,refetch:C,saveOrder:N,isSortMode:l}),draggable:l,onDragStart:_,onDragEnd:f=>f.currentTarget.classList.remove("opacity-50"),onDragOver:f=>{f.preventDefault(),f.currentTarget.classList.add("bg-muted")},onDragLeave:f=>f.currentTarget.classList.remove("bg-muted"),onDrop:b,showPagination:!l})}function hx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight mb-2",children:"知识库管理"}),e.jsx("p",{className:"text-muted-foreground",children:"在这里可以配置知识库,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(mx,{})})]})]})}const jx=Object.freeze(Object.defineProperty({__proto__:null,default:hx},Symbol.toStringTag,{value:"Module"}));function gx(s,t){const[a,n]=c.useState(s);return c.useEffect(()=>{const l=setTimeout(()=>n(s),t);return()=>{clearTimeout(l)}},[s,t]),a}function Ot(s,t){if(s.length===0)return{};if(!t)return{"":s};const a={};return s.forEach(n=>{const l=n[t]||"";a[l]||(a[l]=[]),a[l].push(n)}),a}function fx(s,t){const a=JSON.parse(JSON.stringify(s));for(const[n,l]of Object.entries(a))a[n]=l.filter(o=>!t.find(d=>d.value===o.value));return a}function px(s,t){for(const[,a]of Object.entries(s))if(a.some(n=>t.find(l=>l.value===n.value)))return!0;return!1}const Fr=c.forwardRef(({className:s,...t},a)=>co(l=>l.filtered.count===0)?e.jsx("div",{ref:a,className:v("py-6 text-center text-sm",s),"cmdk-empty":"",role:"presentation",...t}):null);Fr.displayName="CommandEmpty";const nt=c.forwardRef(({value:s,onChange:t,placeholder:a,defaultOptions:n=[],options:l,delay:o,onSearch:d,loadingIndicator:x,emptyIndicator:r,maxSelected:i=Number.MAX_SAFE_INTEGER,onMaxSelected:h,hidePlaceholderWhenSelected:D,disabled:C,groupBy:m,className:w,badgeClassName:_,selectFirstItem:b=!0,creatable:N=!1,triggerSearchOnFocus:P=!1,commandProps:f,inputProps:R,hideClearAllButton:z=!1},$)=>{const E=c.useRef(null),[K,ds]=c.useState(!1),Ks=c.useRef(!1),[va,ba]=c.useState(!1),[J,qs]=c.useState(s||[]),[ys,ya]=c.useState(Ot(n,m)),[us,Ft]=c.useState(""),Us=gx(us,o||500);c.useImperativeHandle($,()=>({selectedValue:[...J],input:E.current,focus:()=>E.current?.focus()}),[J]);const ct=c.useCallback(q=>{const Z=J.filter(Ce=>Ce.value!==q.value);qs(Z),t?.(Z)},[t,J]),ll=c.useCallback(q=>{const Z=E.current;Z&&((q.key==="Delete"||q.key==="Backspace")&&Z.value===""&&J.length>0&&(J[J.length-1].fixed||ct(J[J.length-1])),q.key==="Escape"&&Z.blur())},[ct,J]);c.useEffect(()=>{s&&qs(s)},[s]),c.useEffect(()=>{if(!l||d)return;const q=Ot(l||[],m);JSON.stringify(q)!==JSON.stringify(ys)&&ya(q)},[n,l,m,d,ys]),c.useEffect(()=>{const q=async()=>{ba(!0);const Ce=await d?.(Us);ya(Ot(Ce||[],m)),ba(!1)};(async()=>{!d||!K||(P&&await q(),Us&&await q())})()},[Us,m,K,P]);const il=()=>{if(!N||px(ys,[{value:us,label:us}])||J.find(Z=>Z.value===us))return;const q=e.jsx(be,{value:us,className:"cursor-pointer",onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation()},onSelect:Z=>{if(J.length>=i){h?.(J.length);return}Ft("");const Ce=[...J,{value:Z,label:Z}];qs(Ce),t?.(Ce)},children:`Create "${us}"`});if(!d&&us.length>0||d&&Us.length>0&&!va)return q},ol=c.useCallback(()=>{if(r)return d&&!N&&Object.keys(ys).length===0?e.jsx(be,{value:"-",disabled:!0,children:r}):e.jsx(Fr,{children:r})},[N,r,d,ys]),cl=c.useMemo(()=>fx(ys,J),[ys,J]),dl=c.useCallback(()=>{if(f?.filter)return f.filter;if(N)return(q,Z)=>q.toLowerCase().includes(Z.toLowerCase())?1:-1},[N,f?.filter]),ul=c.useCallback(()=>{const q=J.filter(Z=>Z.fixed);qs(q),t?.(q)},[t,J]);return e.jsxs(ps,{...f,onKeyDown:q=>{ll(q),f?.onKeyDown?.(q)},className:v("h-auto overflow-visible bg-transparent",f?.className),shouldFilter:f?.shouldFilter!==void 0?f.shouldFilter:!d,filter:dl(),children:[e.jsx("div",{className:v("rounded-md border border-input text-sm ring-offset-background focus-within:ring-1 focus-within:ring-ring ",{"px-3 py-2":J.length!==0,"cursor-text":!C&&J.length!==0},w),onClick:()=>{C||E.current?.focus()},children:e.jsxs("div",{className:"flex flex-wrap gap-1",children:[J.map(q=>e.jsxs(L,{className:v("data-[disabled]:bg-muted-foreground data-[disabled]:text-muted data-[disabled]:hover:bg-muted-foreground","data-[fixed]:bg-muted-foreground data-[fixed]:text-muted data-[fixed]:hover:bg-muted-foreground",_),"data-fixed":q.fixed,"data-disabled":C||void 0,children:[q.label,e.jsx("button",{className:v("ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",(C||q.fixed)&&"hidden"),onKeyDown:Z=>{Z.key==="Enter"&&ct(q)},onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation()},onClick:()=>ct(q),children:e.jsx(Ut,{className:"h-3 w-3 text-muted-foreground hover:text-foreground"})})]},q.value)),e.jsx(we.Input,{...R,ref:E,value:us,disabled:C,onValueChange:q=>{Ft(q),R?.onValueChange?.(q)},onBlur:q=>{Ks.current===!1&&ds(!1),R?.onBlur?.(q)},onFocus:q=>{ds(!0),P&&d?.(Us),R?.onFocus?.(q)},placeholder:D&&J.length!==0?"":a,className:v("flex-1 bg-transparent outline-none placeholder:text-muted-foreground",{"w-full":D,"px-3 py-2":J.length===0,"ml-1":J.length!==0},R?.className)}),e.jsx("button",{type:"button",onClick:ul,className:v((z||C||J.length<1||J.filter(q=>q.fixed).length===J.length)&&"hidden"),children:e.jsx(Ut,{})})]})}),e.jsx("div",{className:"relative",children:K&&e.jsx(vs,{className:"absolute top-1 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in",onMouseLeave:()=>{Ks.current=!1},onMouseEnter:()=>{Ks.current=!0},onMouseUp:()=>{E.current?.focus()},children:va?e.jsx(e.Fragment,{children:x}):e.jsxs(e.Fragment,{children:[ol(),il(),!b&&e.jsx(be,{value:"-",className:"hidden"}),Object.entries(cl).map(([q,Z])=>e.jsx(Ve,{heading:q,className:"h-full overflow-auto",children:e.jsx(e.Fragment,{children:Z.map(Ce=>e.jsx(be,{value:Ce.value,disabled:Ce.disable,onMouseDown:Bs=>{Bs.preventDefault(),Bs.stopPropagation()},onSelect:()=>{if(J.length>=i){h?.(J.length);return}Ft("");const Bs=[...J,Ce];qs(Bs),t?.(Bs)},className:v("cursor-pointer",Ce.disable&&"cursor-default text-muted-foreground"),children:Ce.label},Ce.value))})},q))]})})})]})});nt.displayName="MultipleSelector";const vx=u.object({id:u.number().optional(),name:u.string().min(2,"组名至少需要2个字符").max(50,"组名不能超过50个字符").regex(/^[a-zA-Z0-9\u4e00-\u9fa5_-]+$/,"组名只能包含字母、数字、中文、下划线和连字符")});function Et({refetch:s,dialogTrigger:t,defaultValues:a={name:""},type:n="add"}){const l=ae({resolver:ie(vx),defaultValues:a,mode:"onChange"}),[o,d]=c.useState(!1),[x,r]=c.useState(!1),i=async h=>{r(!0),Oc(h).then(()=>{A.success(n==="edit"?"更新成功":"创建成功"),s&&s(),l.reset(),d(!1)}).finally(()=>{r(!1)})};return e.jsxs(ue,{open:o,onOpenChange:d,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"}),e.jsx("span",{children:"添加权限组"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:n==="edit"?"编辑权限组":"创建权限组"}),e.jsx(Se,{children:n==="edit"?"修改权限组信息,更新后会立即生效。":"创建新的权限组,可以为不同的用户分配不同的权限。"})]}),e.jsx(oe,{...l,children:e.jsxs("form",{onSubmit:l.handleSubmit(i),className:"space-y-4",children:[e.jsx(g,{control:l.control,name:"name",render:({field:h})=>e.jsxs(j,{children:[e.jsx(p,{children:"组名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入权限组名称",...h,className:"w-full"})}),e.jsx(F,{children:"权限组名称用于标识不同的用户组,建议使用有意义的名称。"}),e.jsx(k,{})]})}),e.jsxs(Re,{className:"gap-2",children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{type:"button",variant:"outline",children:"取消"})}),e.jsxs(T,{type:"submit",disabled:x||!l.formState.isValid,children:[x&&e.jsx(aa,{className:"mr-2 h-4 w-4 animate-spin"}),n==="edit"?"更新":"创建"]})]})]})})]})]})}const Mr=c.createContext(void 0);function bx({children:s,refetch:t}){const[a,n]=c.useState(!1),[l,o]=c.useState(null),[d,x]=c.useState(fe.Shadowsocks);return e.jsx(Mr.Provider,{value:{isOpen:a,setIsOpen:n,editingServer:l,setEditingServer:o,serverType:d,setServerType:x,refetch:t},children:s})}function zr(){const s=c.useContext(Mr);if(s===void 0)throw new Error("useServerEdit must be used within a ServerEditProvider");return s}function Lt({dialogTrigger:s,value:t,setValue:a,templateType:n}){c.useEffect(()=>{console.log(t)},[t]);const[l,o]=c.useState(!1),[d,x]=c.useState(()=>{if(!t||Object.keys(t).length===0)return"";try{return JSON.stringify(t,null,2)}catch{return""}}),[r,i]=c.useState(null),h=b=>{if(!b)return null;try{const N=JSON.parse(b);return typeof N!="object"||N===null?"配置必须是一个JSON对象":null}catch{return"无效的JSON格式"}},D={tcp:{label:"TCP",content:{acceptProxyProtocol:!1,header:{type:"none"}}},"tcp-http":{label:"TCP + HTTP",content:{acceptProxyProtocol:!1,header:{type:"http",request:{version:"1.1",method:"GET",path:["/"],headers:{Host:["www.example.com"]}},response:{version:"1.1",status:"200",reason:"OK"}}}},grpc:{label:"gRPC",content:{serviceName:"GunService"}},ws:{label:"WebSocket",content:{path:"/",headers:{Host:"v2ray.com"}}}},C=()=>{switch(n){case"tcp":return["tcp","tcp-http"];case"grpc":return["grpc"];case"ws":return["ws"];default:return[]}},m=()=>{const b=h(d||"");if(b){A.error(b);return}try{if(!d){a(null),o(!1);return}a(JSON.parse(d)),o(!1)}catch{A.error("保存时发生错误")}},w=b=>{x(b),i(h(b))},_=b=>{const N=D[b];if(N){const P=JSON.stringify(N.content,null,2);x(P),i(null)}};return c.useEffect(()=>{l&&console.log(t)},[l,t]),c.useEffect(()=>{l&&t&&Object.keys(t).length>0&&x(JSON.stringify(t,null,2))},[l,t]),e.jsxs(ue,{open:l,onOpenChange:b=>{!b&&l&&m(),o(b)},children:[e.jsx(Ie,{asChild:!0,children:s??e.jsx(W,{variant:"link",children:"编辑协议"})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsx(he,{children:e.jsx(xe,{children:"编辑协议配置"})}),e.jsxs("div",{className:"space-y-4",children:[C().length>0&&e.jsx("div",{className:"flex flex-wrap gap-2 pt-2",children:C().map(b=>e.jsxs(W,{variant:"outline",size:"sm",onClick:()=>_(b),children:["使用",D[b].label,"模板"]},b))}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(bs,{className:`min-h-[200px] font-mono text-sm ${r?"border-red-500 focus-visible:ring-red-500":""}`,value:d,placeholder:`请输入JSON配置${C().length>0?"或选择上方模板":""}`,onChange:b=>w(b.target.value)}),r&&e.jsx("p",{className:"text-sm text-red-500",children:r})]})]}),e.jsxs(Re,{className:"gap-2",children:[e.jsx(W,{variant:"outline",onClick:()=>o(!1),children:"取消"}),e.jsx(W,{onClick:m,disabled:!!r,children:"确定"})]})]})]})}function vh(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}const yx={},Nx=Object.freeze(Object.defineProperty({__proto__:null,default:yx},Symbol.toStringTag,{value:"Module"})),bh=No(Nx),Aa=s=>s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""),wx=()=>{try{const s=uo.box.keyPair(),t=Aa(Ta.encodeBase64(s.secretKey)),a=Aa(Ta.encodeBase64(s.publicKey));return{privateKey:t,publicKey:a}}catch(s){throw console.error("Error generating x25519 key pair:",s),s}},_x=()=>{try{return wx()}catch(s){throw console.error("Error generating key pair:",s),s}},Cx=s=>{const t=new Uint8Array(Math.ceil(s/2));return window.crypto.getRandomValues(t),Array.from(t).map(a=>a.toString(16).padStart(2,"0")).join("").substring(0,s)},Sx=()=>{const s=Math.floor(Math.random()*8)*2+2;return Cx(s)},kx=u.object({cipher:u.string().default("aes-128-gcm"),obfs:u.string().default("0"),obfs_settings:u.object({path:u.string().default(""),host:u.string().default("")}).default({})}),Tx=u.object({tls:u.coerce.number().default(0),tls_settings:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({})}),Dx=u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({})}),Px=u.object({version:u.coerce.number().default(2),alpn:u.string().default("h2"),obfs:u.object({open:u.coerce.boolean().default(!1),type:u.string().default("salamander"),password:u.string().default("")}).default({}),tls:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),bandwidth:u.object({up:u.string().default(""),down:u.string().default("")}).default({})}),Vx=u.object({tls:u.coerce.number().default(0),tls_settings:u.object({server_name:u.string().default(""),allow_insecure:u.boolean().default(!1)}).default({}),reality_settings:u.object({server_port:u.coerce.number().default(443),server_name:u.string().default(""),allow_insecure:u.boolean().default(!1),public_key:u.string().default(""),private_key:u.string().default(""),short_id:u.string().default("")}).default({}),network:u.string().default("tcp"),network_settings:u.record(u.any()).default({}),flow:u.string().default("")}),es={shadowsocks:{schema:kx,ciphers:["aes-128-gcm","aes-192-gcm","aes-256-gcm","chacha20-ietf-poly1305","2022-blake3-aes-128-gcm","2022-blake3-aes-256-gcm"]},vmess:{schema:Tx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},trojan:{schema:Dx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"}]},hysteria:{schema:Px,versions:["1","2"],alpnOptions:["hysteria","http/1.1","h2","h3"]},vless:{schema:Vx,networkOptions:[{value:"tcp",label:"TCP"},{value:"ws",label:"Websocket"},{value:"grpc",label:"gRPC"},{value:"kcp",label:"mKCP"},{value:"httpupgrade",label:"HttpUpgrade"},{value:"xhttp",label:"XHTTP"}],flowOptions:["none","xtls-rprx-direct","xtls-rprx-splice","xtls-rprx-vision"]}},Ix=({serverType:s,value:t,onChange:a})=>{const n=s?es[s]:null,l=n?.schema||u.record(u.any()),o=s?l.parse({}):{},d=ae({resolver:ie(l),defaultValues:o,mode:"onChange"});return c.useEffect(()=>{if(!t||Object.keys(t).length===0){if(s){const m=l.parse({});d.reset(m)}}else d.reset(t)},[s,t,a,d,l]),c.useEffect(()=>{const m=d.watch(w=>{a(w)});return()=>m.unsubscribe()},[d,a]),!s||!n?null:{shadowsocks:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"cipher",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"加密算法"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择加密算法"})}),e.jsx(B,{children:e.jsx(xs,{children:es.shadowsocks.ciphers.map(w=>e.jsx(O,{value:w,children:w},w))})})]})})]})}),e.jsx(g,{control:d.control,name:"obfs",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"混淆"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择混淆方式"})}),e.jsx(B,{children:e.jsxs(xs,{children:[e.jsx(O,{value:"0",children:"无"}),e.jsx(O,{value:"http",children:"HTTP"})]})})]})})]})}),d.watch("obfs")==="http"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"obfs_settings.path",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"路径",...m})}),e.jsx(k,{})]})}),e.jsx(g,{control:d.control,name:"obfs_settings.host",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"Host",...m})}),e.jsx(k,{})]})})]})]}),vmess:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"tls",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"TLS"}),e.jsx(y,{children:e.jsxs(G,{value:m.value?.toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择安全性"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"不支持"}),e.jsx(O,{value:"1",children:"支持"})]})]})})]})}),d.watch("tls")==1&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"不使用请留空",...m})})]})}),e.jsx(g,{control:d.control,name:"tls_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.vmess.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),trojan:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"当节点地址于证书不一致时用于证书验证",...m,value:m.value||""})})]})}),e.jsx(g,{control:d.control,name:"allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings")||{},setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")||"tcp"})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value||"tcp",children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.trojan.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})})]}),hysteria:()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"version",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"协议版本"}),e.jsx(y,{children:e.jsxs(G,{value:(m.value||2).toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"协议版本"})}),e.jsx(B,{children:e.jsx(xs,{children:es.hysteria.versions.map(w=>e.jsxs(O,{value:w,className:"cursor-pointer",children:["V",w]},w))})})]})})]})}),d.watch("version")==1&&e.jsx(g,{control:d.control,name:"alpn",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"ALPN"}),e.jsx(y,{children:e.jsxs(G,{value:m.value||"h2",onValueChange:m.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"ALPN"})}),e.jsx(B,{children:e.jsx(xs,{children:es.hysteria.alpnOptions.map(w=>e.jsx(O,{value:w,children:w},w))})})]})})]})})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"obfs.open",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"混淆"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})}),!!d.watch("obfs.open")&&e.jsxs(e.Fragment,{children:[d.watch("version")=="2"&&e.jsx(g,{control:d.control,name:"obfs.type",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"混淆实现"}),e.jsx(y,{children:e.jsxs(G,{value:m.value||"salamander",onValueChange:m.onChange,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择混淆实现"})}),e.jsx(B,{children:e.jsx(xs,{children:e.jsx(O,{value:"salamander",children:"Salamander"})})})]})})]})}),e.jsx(g,{control:d.control,name:"obfs.password",render:({field:m})=>e.jsxs(j,{className:d.watch("version")==2?"w-full":"flex-[2]",children:[e.jsx(p,{children:"混淆密码"}),e.jsxs("div",{className:"relative",children:[e.jsx(y,{children:e.jsx(S,{placeholder:"请输入混淆密码",...m,value:m.value||"",className:"pr-9"})}),e.jsx(W,{type:"button",variant:"ghost",size:"icon",onClick:()=>{const w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",_=Array.from(crypto.getRandomValues(new Uint8Array(16))).map(b=>w[b%w.length]).join("");d.setValue("obfs.password",_),A.success("混淆密码生成成功")},className:"absolute right-0 top-0 h-full px-2 active:scale-90 transition-transform duration-150",children:e.jsx(ve,{icon:"ion:refresh-outline",className:"h-4 w-4 transition-transform hover:rotate-180 duration-300"})})]})]})})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"当节点地址于证书不一致时用于证书验证",...m,value:m.value||""})})]})}),e.jsx(g,{control:d.control,name:"tls.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value||!1,onCheckedChange:m.onChange})})})]})})]}),e.jsx(g,{control:d.control,name:"bandwidth.up",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"上行宽带"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入上行宽带"+(d.watch("version")==2?",留空则使用BBR":""),className:"rounded-br-none rounded-tr-none",...m,value:m.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:"Mbps"})})]})]})}),e.jsx(g,{control:d.control,name:"bandwidth.down",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"下行宽带"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"请输入下行宽带"+(d.watch("version")==2?",留空则使用BBR":""),className:"rounded-br-none rounded-tr-none",...m,value:m.value||""})}),e.jsx("div",{className:"pointer-events-none z-[-1] flex items-center rounded-md rounded-bl-none rounded-tl-none border border-l-0 border-input px-3 shadow-sm",children:e.jsx("span",{className:"text-gray-500",children:"Mbps"})})]})]})})]}),vless:()=>e.jsxs(e.Fragment,{children:[e.jsx(g,{control:d.control,name:"tls",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"安全性"}),e.jsx(y,{children:e.jsxs(G,{value:m.value?.toString(),onValueChange:w=>m.onChange(Number(w)),children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择安全性"})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"无"}),e.jsx(O,{value:"1",children:"TLS"}),e.jsx(O,{value:"2",children:"Reality"})]})]})})]})}),d.watch("tls")=="1"&&e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"tls_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"服务器名称指示(SNI)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"不使用请留空",...m})})]})}),e.jsx(g,{control:d.control,name:"tls_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),d.watch("tls")==2&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:d.control,name:"reality_settings.server_name",render:({field:m})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"伪装站点(dest)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"例如:example.com",...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.server_port",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"端口(port)"}),e.jsx(y,{children:e.jsx(S,{placeholder:"例如:443",...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.allow_insecure",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"允许不安全?"}),e.jsx("div",{className:"py-2 text-center",children:e.jsx(y,{children:e.jsx(H,{checked:m.value,onCheckedChange:m.onChange})})})]})})]}),e.jsxs("div",{className:"flex items-end gap-2",children:[e.jsx(g,{control:d.control,name:"reality_settings.private_key",render:({field:m})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"私钥(Private key)"}),e.jsx(y,{children:e.jsx(S,{...m})})]})}),e.jsxs(W,{variant:"outline",className:"",onClick:()=>{try{const m=_x();d.setValue("reality_settings.private_key",m.privateKey),d.setValue("reality_settings.public_key",m.publicKey),A.success("密钥对生成成功")}catch{A.error("生成密钥对失败")}},children:[e.jsx(ve,{icon:"ion:key-outline",className:"mr-2 h-4 w-4"}),"生成密钥对"]})]}),e.jsx(g,{control:d.control,name:"reality_settings.public_key",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"公钥(Public key)"}),e.jsx(y,{children:e.jsx(S,{...m})})]})}),e.jsx(g,{control:d.control,name:"reality_settings.short_id",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"Short ID"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(y,{children:e.jsx(S,{...m,placeholder:"可留空,长度为2的倍数,最长16位"})}),e.jsxs(W,{variant:"outline",onClick:()=>{const w=Sx();d.setValue("reality_settings.short_id",w),A.success("Short ID 生成成功")},children:[e.jsx(ve,{icon:"ion:refresh-outline",className:"mr-2 h-4 w-4"}),"生成"]})]}),e.jsx(F,{className:"text-xs text-muted-foreground",children:"客户端可用的 shortId 列表,可用于区分不同的客户端,使用0-f的十六进制字符"})]})})]}),e.jsx(g,{control:d.control,name:"network",render:({field:m})=>e.jsxs(j,{children:[e.jsxs(p,{children:["传输协议",e.jsx(Lt,{value:d.watch("network_settings"),setValue:w=>d.setValue("network_settings",w),templateType:d.watch("network")})]}),e.jsx(y,{children:e.jsxs(G,{onValueChange:m.onChange,value:m.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择传输协议"})}),e.jsx(B,{children:e.jsx(xs,{children:es.vless.networkOptions.map(w=>e.jsx(O,{value:w.value,className:"cursor-pointer",children:w.label},w.value))})})]})})]})}),e.jsx(g,{control:d.control,name:"flow",render:({field:m})=>e.jsxs(j,{children:[e.jsx(p,{children:"流控"}),e.jsx(y,{children:e.jsxs(G,{onValueChange:w=>m.onChange(w==="none"?null:w),value:m.value||"none",children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"选择流控"})}),e.jsx(B,{children:es.vless.flowOptions.map(w=>e.jsx(O,{value:w,children:w},w))})]})})]})})]})}[s]?.()},Rx=u.object({id:u.number().optional().nullable(),code:u.string().optional(),name:u.string().min(1,"Please enter a valid name."),rate:u.string().min(1,"Please enter a valid rate."),tags:u.array(u.string()).default([]),excludes:u.array(u.string()).default([]),ips:u.array(u.string()).default([]),group_ids:u.array(u.string()).default([]),host:u.string().min(1,"Please enter a valid host."),port:u.string().min(1,"Please enter a valid port."),server_port:u.string().min(1,"Please enter a valid server port."),parent_id:u.string().default("0").nullable(),route_ids:u.array(u.string()).default([]),protocol_settings:u.record(u.any()).default({}).nullable()}),xt={id:null,code:"",name:"",rate:"1",tags:[],excludes:[],ips:[],group_ids:[],host:"",port:"",server_port:"",parent_id:"0",route_ids:[],protocol_settings:null};function Ex(){const{isOpen:s,setIsOpen:t,editingServer:a,setEditingServer:n,serverType:l,setServerType:o,refetch:d}=zr(),[x,r]=c.useState([]),[i,h]=c.useState([]),[D,C]=c.useState([]),m=ae({resolver:ie(Rx),defaultValues:xt,mode:"onChange"});c.useEffect(()=>{w()},[s]),c.useEffect(()=>{a?.type&&a.type!==l&&o(a.type)},[a,l,o]),c.useEffect(()=>{a?a.type===l&&m.reset({...xt,...a}):m.reset({...xt,protocol_settings:es[l].schema.parse({})})},[a,m,l]);const w=async()=>{if(!s)return;const[f,R,z]=await Promise.all([It(),jr(),hr()]);r(f.data?.map($=>({label:$.name,value:$.id.toString()}))||[]),h(R.data?.map($=>({label:$.remarks,value:$.id.toString()}))||[]),C(z.data||[])},_=c.useMemo(()=>D?.filter(f=>(f.parent_id===0||f.parent_id===null)&&f.type===l&&f.id!==m.watch("id")),[l,D,m]),b=()=>e.jsxs(_s,{children:[e.jsx(Cs,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"}),e.jsx("div",{children:"添加节点"})]})}),e.jsx(fs,{align:"start",children:e.jsx(rc,{children:ws.map(({type:f,label:R})=>e.jsx(me,{onClick:()=>{o(f),t(!0)},className:"cursor-pointer",children:e.jsx(L,{variant:"outline",className:"text-white",style:{background:ts[f]},children:R})},f))})})]}),N=()=>{t(!1),n(null),m.reset(xt)},P=async()=>{const f=m.getValues();(await Rc({...f,type:l})).data&&(N(),A.success("提交成功"),d())};return e.jsxs(ue,{open:s,onOpenChange:N,children:[b(),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:a?"编辑节点":"新建节点"}),e.jsx(Se,{})]}),e.jsxs(oe,{...m,children:[e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{control:m.control,name:"name",render:({field:f})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"节点名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入节点名称",...f})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"rate",render:({field:f})=>e.jsxs(j,{className:"flex-[1]",children:[e.jsx(p,{children:"倍率"}),e.jsx("div",{className:"relative flex",children:e.jsx(y,{children:e.jsx(S,{type:"number",min:"0",step:"0.1",...f})})}),e.jsx(k,{})]})})]}),e.jsx(g,{control:m.control,name:"code",render:({field:f})=>e.jsxs(j,{children:[e.jsxs(p,{children:["自定义节点ID",e.jsx("span",{className:"ml-1 text-xs text-muted-foreground",children:"(选填)"})]}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入自定义节点ID",...f,value:f.value||""})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"tags",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点标签"}),e.jsx(y,{children:e.jsx(ma,{value:f.value,onChange:f.onChange,placeholder:"输入后回车添加标签",className:"w-full"})}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"group_ids",render:({field:f})=>e.jsxs(j,{children:[e.jsxs(p,{className:"flex items-center justify-between",children:["权限组",e.jsx(Et,{dialogTrigger:e.jsx(T,{variant:"link",children:"添加权限组"}),refetch:w})]}),e.jsx(y,{children:e.jsx(nt,{options:x,onChange:R=>f.onChange(R.map(z=>z.value)),value:x?.filter(R=>f.value.includes(R.value)),placeholder:"请选择权限组",emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:"no results found."})})}),e.jsx(k,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:m.control,name:"host",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"节点地址"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入节点域名或者IP",...f})}),e.jsx(k,{})]})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx(g,{control:m.control,name:"port",render:({field:f})=>e.jsxs(j,{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-1.5",children:["连接端口",e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ve,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Da,{children:e.jsx(ee,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:"用户实际连接使用的端口,这是客户端配置中需要填写的端口号。如果使用了中转或隧道,这个端口可能与服务器实际监听的端口不同。"})})})]})})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(y,{children:e.jsx(S,{placeholder:"用户连接端口",...f})}),e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0 text-muted-foreground/50 hover:text-muted-foreground",onClick:()=>{const R=f.value;R&&m.setValue("server_port",R)},children:e.jsx(ve,{icon:"tabler:arrows-right",className:"size-3"})})}),e.jsx(ee,{side:"right",children:e.jsx("p",{children:"同步到服务端口"})})]})})]}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"server_port",render:({field:f})=>e.jsxs(j,{className:"flex-1",children:[e.jsxs(p,{className:"flex items-center gap-1.5",children:["服务端口",e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(ve,{icon:"ph:info-light",className:"size-3.5 cursor-help text-muted-foreground"})}),e.jsx(Da,{children:e.jsx(ee,{side:"top",sideOffset:8,className:"max-w-80 p-3",children:e.jsx("p",{children:"服务器实际监听的端口,这是在服务器上开放的真实端口。如果使用了中转或隧道,这个端口可能与用户连接端口不同。"})})})]})})]}),e.jsx(y,{children:e.jsx(S,{placeholder:"服务端开放端口",...f})}),e.jsx(k,{})]})})]})]}),s&&e.jsx(Ix,{serverType:l,value:m.watch("protocol_settings"),onChange:f=>m.setValue("protocol_settings",f,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),e.jsx(g,{control:m.control,name:"parent_id",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"父节点"}),e.jsxs(G,{onValueChange:f.onChange,value:f.value?.toString()||"0",children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"选择父节点"})})}),e.jsxs(B,{children:[e.jsx(O,{value:"0",children:"无"}),_?.map(R=>e.jsx(O,{value:R.id.toString(),className:"cursor-pointer",children:R.name},R.id))]})]}),e.jsx(k,{})]})}),e.jsx(g,{control:m.control,name:"route_ids",render:({field:f})=>e.jsxs(j,{children:[e.jsx(p,{children:"路由组"}),e.jsx(y,{children:e.jsx(nt,{options:i,onChange:R=>f.onChange(R.map(z=>z.value)),value:i?.filter(R=>f.value.includes(R.value)),placeholder:"选择路由组",emptyIndicator:e.jsx("p",{className:"text-center text-lg leading-10 text-gray-600 dark:text-gray-400",children:"no results found."})})}),e.jsx(k,{})]})})]}),e.jsxs(Re,{className:"mt-6",children:[e.jsx(T,{type:"button",variant:"outline",onClick:N,children:"取消"}),e.jsx(T,{type:"submit",onClick:P,children:"提交"})]})]})]})]})}function Ha({column:s,title:t,options:a}){const n=s?.getFacetedUniqueValues(),l=new Set(s?.getFilterValue());return e.jsxs(Ze,{children:[e.jsx(Xe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-8 border-dashed",children:[e.jsx(it,{className:"mr-2 h-4 w-4"}),t,l?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(je,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:l.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:l.size>2?e.jsxs(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[l.size," selected"]}):a.filter(o=>l.has(o.value)).map(o=>e.jsx(L,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:o.label},o.value))})]})]})}),e.jsx(qe,{className:"w-[200px] p-0",align:"start",children:e.jsxs(ps,{children:[e.jsx(Ps,{placeholder:t}),e.jsxs(vs,{children:[e.jsx(Vs,{children:"No results found."}),e.jsx(Ve,{children:a.map(o=>{const d=l.has(o.value);return e.jsxs(be,{onSelect:()=>{d?l.delete(o.value):l.add(o.value);const x=Array.from(l);s?.setFilterValue(x.length?x:void 0)},className:"cursor-pointer",children:[e.jsx("div",{className:v("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",d?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:e.jsx(ks,{className:v("h-4 w-4")})}),o.icon&&e.jsx(o.icon,{className:`mr-2 h-4 w-4 text-muted-foreground text-${o.color}`}),e.jsx("span",{children:o.label}),n?.get(o.value)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:n.get(o.value)})]},o.value)})}),l.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Hs,{}),e.jsx(Ve,{children:e.jsx(be,{onSelect:()=>s?.setFilterValue(void 0),className:"justify-center text-center cursor-pointer",children:"Clear filters"})})]})]})]})})]})}const Fx=[{value:fe.Shadowsocks,label:ws.find(s=>s.type===fe.Shadowsocks)?.label,color:ts[fe.Shadowsocks]},{value:fe.Vmess,label:ws.find(s=>s.type===fe.Vmess)?.label,color:ts[fe.Vmess]},{value:fe.Trojan,label:ws.find(s=>s.type===fe.Trojan)?.label,color:ts[fe.Trojan]},{value:fe.Hysteria,label:ws.find(s=>s.type===fe.Hysteria)?.label,color:ts[fe.Hysteria]},{value:fe.Vless,label:ws.find(s=>s.type===fe.Vless)?.label,color:ts[fe.Vless]}];function Mx({table:s,saveOrder:t,isSortMode:a,groups:n}){const l=s.getState().columnFilters.length>0,o=n.map(d=>({label:d,value:d}));return e.jsxs("div",{className:"flex items-center justify-between ",children:[e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[!a&&e.jsxs(e.Fragment,{children:[e.jsx(Ex,{}),e.jsx(S,{placeholder:"搜索节点...",value:s.getColumn("name")?.getFilterValue()??"",onChange:d=>s.getColumn("name")?.setFilterValue(d.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),e.jsxs("div",{className:"flex gap-x-2",children:[s.getColumn("type")&&e.jsx(Ha,{column:s.getColumn("type"),title:"类型",options:Fx}),s.getColumn("groups")&&e.jsx(Ha,{column:s.getColumn("groups"),title:"权限组",options:o})]}),l&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]}),a&&e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"拖拽节点进行排序,完成后点击保存"})})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:a?"default":"outline",onClick:t,size:"sm",children:a?"保存排序":"编辑排序"})})]})}const rt=s=>e.jsx("svg",{className:"inline-block",viewBox:"0 0 24 24",width:"1.2em",height:"1.2em",...s,children:e.jsx("path",{fill:"currentColor",d:"M15.71 12.71a6 6 0 1 0-7.42 0a10 10 0 0 0-6.22 8.18a1 1 0 0 0 2 .22a8 8 0 0 1 15.9 0a1 1 0 0 0 1 .89h.11a1 1 0 0 0 .88-1.1a10 10 0 0 0-6.25-8.19M12 12a4 4 0 1 1 4-4a4 4 0 0 1-4 4"})}),mt={0:"bg-destructive/80 shadow-sm shadow-destructive/50",1:"bg-yellow-500/80 shadow-sm shadow-yellow-500/50",2:"bg-emerald-500/80 shadow-sm shadow-emerald-500/50"},ht={0:"未运行",1:"无人使用或异常",2:"运行正常"},zx=s=>[{id:"drag-handle",header:({column:t})=>e.jsx(V,{column:t,title:"排序"}),cell:()=>e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(Tt,{className:"size-4 cursor-move text-muted-foreground transition-colors hover:text-primary","aria-hidden":"true"})}),size:50},{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"节点ID"}),cell:({row:t})=>{const a=t.getValue("id"),n=t.original.code;return e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsxs("div",{className:"group/id flex items-center space-x-2",children:[e.jsxs(L,{variant:"outline",className:v("border-2 font-medium transition-all duration-200 hover:opacity-80","flex items-center gap-1.5"),style:{borderColor:ts[t.original.type]},children:[e.jsx($n,{className:"size-3"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"flex items-center gap-0.5",children:n??a}),t.original.parent?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-muted-foreground/30",children:"→"}),e.jsx("span",{children:t.original.parent?.code||t.original.parent?.id})]}):""]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"size-5 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:text-muted-foreground group-hover/id:opacity-100",onClick:l=>{l.stopPropagation(),Nt(n||a.toString())},children:e.jsx(Pa,{className:"size-3"})})]})}),e.jsxs(ee,{side:"top",className:"flex flex-col gap-1 p-3",children:[e.jsxs("p",{className:"font-medium",children:[ws.find(l=>l.type===t.original.type)?.label,t.original.parent_id?" (子节点)":""]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n?"点击括号内容或复制按钮可复制节点代码":"点击复制按钮可复制节点ID"})]})]})})},size:200,enableSorting:!0},{accessorKey:"show",header:({column:t})=>e.jsx(V,{column:t,title:"显隐"}),cell:({row:t})=>{const[a,n]=c.useState(!!t.getValue("show"));return e.jsx(H,{checked:a,onCheckedChange:async l=>{n(l),Mc({id:t.original.id,type:t.original.type,show:l?1:0}).catch(()=>{n(!l),s()})},style:{backgroundColor:a?ts[t.original.type]:void 0}})},size:50,enableSorting:!1},{accessorKey:"name",header:({column:t})=>e.jsx("div",{className:"flex items-center",children:e.jsx(V,{column:t,title:"节点",tooltip:e.jsxs("div",{className:"grid grid-cols-1 gap-3 p-2",children:[e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[0])}),e.jsx("span",{className:"text-sm font-medium",children:ht[0]})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[1])}),e.jsx("span",{className:"text-sm font-medium",children:ht[1]})]}),e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("h-2.5 w-2.5 rounded-full",mt[2])}),e.jsx("span",{className:"text-sm font-medium",children:ht[2]})]})]})})}),cell:({row:t})=>e.jsx(le,{delayDuration:100,children:e.jsxs(se,{children:[e.jsx(te,{children:e.jsxs("div",{className:"flex items-center space-x-2.5",children:[e.jsx("span",{className:v("size-2.5 flex-shrink-0 rounded-full transition-all duration-200",mt[t.original.available_status])}),e.jsx("span",{className:"text-left font-medium transition-colors hover:text-primary",children:t.getValue("name")})]})}),e.jsx(ee,{children:e.jsx("p",{className:"font-medium",children:ht[t.original.available_status]})})]})}),enableSorting:!1,size:200},{accessorKey:"host",header:({column:t})=>e.jsx(V,{column:t,title:"地址"}),cell:({row:t})=>{const a=`${t.original.host}:${t.original.port}`,n=t.original.port!==t.original.server_port;return e.jsxs("div",{className:"group relative flex min-w-0 items-start",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-baseline gap-x-1 gap-y-0.5 pr-7",children:[e.jsx("div",{className:"flex items-center ",children:e.jsxs("span",{className:"font-mono text-sm font-medium text-foreground/90",children:[t.original.host,":",t.original.port]})}),n&&e.jsxs("span",{className:"whitespace-nowrap text-[0.7rem] tracking-tight text-muted-foreground/40",children:["(内部端口 ",t.original.server_port,")"]})]}),e.jsx("div",{className:"absolute right-0 top-0",children:e.jsx(le,{delayDuration:0,children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"size-6 text-muted-foreground/40 opacity-0 transition-all duration-200 hover:bg-muted/50 hover:text-muted-foreground group-hover:opacity-100",onClick:l=>{l.stopPropagation(),Nt(a)},children:e.jsx(Pa,{className:"size-3"})})}),e.jsx(ee,{side:"top",sideOffset:10,children:"复制连接地址"})]})})})]})},enableSorting:!1,enableHiding:!0},{accessorKey:"online",header:({column:t})=>e.jsx(V,{column:t,title:"在线人数",tooltip:"在线人数根据服务端上报频率而定"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(rt,{className:"size-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("online")})]}),size:80,enableSorting:!0,enableHiding:!0},{accessorKey:"rate",header:({column:t})=>e.jsx(V,{column:t,title:"倍率",tooltip:"流量扣费倍率"}),cell:({row:t})=>e.jsxs(L,{variant:"secondary",className:"font-medium",children:[t.getValue("rate")," x"]}),size:80,enableSorting:!1,enableHiding:!0},{accessorKey:"groups",header:({column:t})=>e.jsx(V,{column:t,title:"权限组",tooltip:"可订阅到该节点的权限组"}),cell:({row:t})=>{const a=t.getValue("groups")||[];return e.jsx("div",{className:"flex min-w-[300px] max-w-[600px] flex-wrap items-center gap-1.5",children:a.length>0?a.map((n,l)=>e.jsx(L,{variant:"secondary",className:v("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:n.name},l)):e.jsx("span",{className:"text-sm text-muted-foreground",children:"--"})})},enableSorting:!1,size:600,filterFn:(t,a,n)=>{const l=t.getValue(a);return l?n.some(o=>l.includes(o)):!1}},{accessorKey:"type",header:({column:t})=>e.jsx(V,{column:t,title:"类型"}),cell:({row:t})=>{const a=t.getValue("type");return e.jsx(L,{variant:"outline",className:"border-2 font-medium transition-colors",style:{borderColor:ts[a]},children:a})},enableSorting:!1,enableHiding:!0,enableColumnFilter:!1,size:8e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>{const{setIsOpen:a,setEditingServer:n,setServerType:l}=zr();return e.jsx("div",{className:"flex justify-center",children:e.jsxs(_s,{modal:!1,children:[e.jsx(Cs,{asChild:!0,children:e.jsx(T,{variant:"ghost",className:"h-8 w-8 p-0 hover:bg-muted","aria-label":"打开操作菜单",children:e.jsx(bt,{className:"size-4"})})}),e.jsxs(fs,{align:"end",className:"w-40",children:[e.jsx(me,{className:"cursor-pointer",onClick:()=>{l(t.original.type),n(t.original),a(!0)},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(xo,{className:"mr-2 size-4"}),"编辑"]})}),e.jsxs(me,{className:"cursor-pointer",onClick:async()=>{Fc({id:t.original.id}).then(({data:o})=>{o&&(A.success("复制成功"),s())})},children:[e.jsx(mo,{className:"mr-2 size-4"}),"复制"]}),e.jsx(et,{}),e.jsx(me,{className:"cursor-pointer text-destructive focus:text-destructive",onSelect:o=>o.preventDefault(),children:e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该节点,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{Ec({id:t.original.id}).then(({data:o})=>{o&&(A.success("删除成功"),s())})},children:e.jsxs("div",{className:"flex w-full items-center",children:[e.jsx(rs,{className:"mr-2 size-4"}),"删除"]})})})]})]})})},size:50}];function Ox(){const[s,t]=c.useState({}),[a,n]=c.useState({"drag-handle":!1}),[l,o]=c.useState([]),[d,x]=c.useState({pageSize:500,pageIndex:0}),[r,i]=c.useState([]),[h,D]=c.useState(!1),[C,m]=c.useState({}),[w,_]=c.useState([]),{refetch:b}=Q({queryKey:["nodeList"],queryFn:async()=>{const{data:$}=await hr();return _($),$}}),N=c.useMemo(()=>{const $=new Set;return w.forEach(E=>{E.groups&&E.groups.forEach(K=>$.add(K.name))}),Array.from($).sort()},[w]);c.useEffect(()=>{n({"drag-handle":h,show:!h,host:!h,online:!h,rate:!h,groups:!h,type:!1,actions:!h}),m({name:h?2e3:200}),x({pageSize:h?99999:500,pageIndex:0})},[h]);const P=($,E)=>{h&&($.dataTransfer.setData("text/plain",E.toString()),$.currentTarget.classList.add("opacity-50"))},f=($,E)=>{if(!h)return;$.preventDefault(),$.currentTarget.classList.remove("bg-muted");const K=parseInt($.dataTransfer.getData("text/plain"));if(K===E)return;const ds=[...w],[Ks]=ds.splice(K,1);ds.splice(E,0,Ks),_(ds)},R=async()=>{if(!h){D(!0);return}const $=w?.map((E,K)=>({id:E.id,order:K+1}));zc($).then(()=>{A.success("排序保存成功"),D(!1),b()}).finally(()=>{D(!1)})},z=Me({data:w||[],columns:zx(b),state:{sorting:r,columnVisibility:a,rowSelection:s,columnFilters:l,columnSizing:C,pagination:d},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:i,onColumnFiltersChange:o,onColumnVisibilityChange:n,onColumnSizingChange:m,onPaginationChange:x,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(bx,{refetch:b,children:e.jsx("div",{className:"space-y-4",children:e.jsx(Ue,{table:z,toolbar:$=>e.jsx(Mx,{table:$,refetch:b,saveOrder:R,isSortMode:h,groups:N}),draggable:h,onDragStart:P,onDragEnd:$=>$.currentTarget.classList.remove("opacity-50"),onDragOver:$=>{$.preventDefault(),$.currentTarget.classList.add("bg-muted")},onDragLeave:$=>$.currentTarget.classList.remove("bg-muted"),onDrop:f,showPagination:!h})})})}function Lx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"节点管理"}),e.jsx("p",{className:"text-muted-foreground mt-2",children:"管理所有节点,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Ox,{})})]})]})}const $x=Object.freeze(Object.defineProperty({__proto__:null,default:Lx},Symbol.toStringTag,{value:"Module"}));function Ax({table:s,refetch:t}){const a=s.getState().columnFilters.length>0;return e.jsx("div",{className:"flex items-center justify-between space-x-4",children:e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsx(Et,{refetch:t}),e.jsx(S,{placeholder:"搜索权限组...",value:s.getColumn("name")?.getFilterValue()??"",onChange:n=>s.getColumn("name")?.setFilterValue(n.target.value),className:v("h-8 w-[150px] lg:w-[250px]",a&&"border-primary/50 ring-primary/20")}),a&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:["重置",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]})})}const Hx=s=>[{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"组ID"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0},{accessorKey:"name",header:({column:t})=>e.jsx(V,{column:t,title:"组名称"}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium",children:t.getValue("name")})})},{accessorKey:"users_count",header:({column:t})=>e.jsx(V,{column:t,title:"用户数量"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx(rt,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"server_count",header:({column:t})=>e.jsx(V,{column:t,title:"节点数量"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-4",children:[e.jsx($n,{className:"h-4 w-4"}),e.jsx("span",{className:"font-medium",children:t.getValue("server_count")})]}),enableSorting:!0,size:8e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Et,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]})}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该权限组,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{Lc({id:t.original.id}).then(({data:a})=>{a&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]})}];function Kx(){const[s,t]=c.useState({}),[a,n]=c.useState({}),[l,o]=c.useState([]),[d,x]=c.useState([]),{data:r,refetch:i,isLoading:h}=Q({queryKey:["serverGroupList"],queryFn:async()=>{const{data:C}=await It();return C}}),D=Me({data:r||[],columns:Hx(i),state:{sorting:d,columnVisibility:a,rowSelection:s,columnFilters:l},enableRowSelection:!0,onRowSelectionChange:t,onSortingChange:x,onColumnFiltersChange:o,onColumnVisibilityChange:n,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Ue,{table:D,toolbar:C=>e.jsx(Ax,{table:C,refetch:i}),isLoading:h})}function qx(){return e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"权限组管理"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"管理所有权限组,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Kx,{})})]})]})}const Ux=Object.freeze(Object.defineProperty({__proto__:null,default:qx},Symbol.toStringTag,{value:"Module"})),Bx=u.object({remarks:u.string().min(1,"Please enter a valid remarks."),match:u.array(u.string()),action:u.enum(["block","dns"]),action_value:u.string().optional()});function Or({refetch:s,dialogTrigger:t,defaultValues:a={remarks:"",match:[],action:"block",action_value:""},type:n="add"}){const l=ae({resolver:ie(Bx),defaultValues:a,mode:"onChange"}),[o,d]=c.useState(!1);return e.jsxs(ue,{open:o,onOpenChange:d,children:[e.jsx(Ie,{asChild:!0,children:t||e.jsxs(T,{variant:"outline",size:"sm",className:"space-x-2",children:[e.jsx(ve,{icon:"ion:add"})," ",e.jsx("div",{children:"添加路由"})]})}),e.jsxs(ce,{className:"sm:max-w-[425px]",children:[e.jsxs(he,{children:[e.jsx(xe,{children:n==="edit"?"编辑路由":"创建路由"}),e.jsx(Se,{})]}),e.jsxs(oe,{...l,children:[e.jsx(g,{control:l.control,name:"remarks",render:({field:x})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"备注"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"请输入备注",...x})})}),e.jsx(k,{})]})}),e.jsx(g,{control:l.control,name:"match",render:({field:x})=>e.jsxs(j,{className:"flex-[2]",children:[e.jsx(p,{children:"备注"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(bs,{className:"min-h-[120px]",placeholder:`example.com *.example.com`,value:x.value.join(` `),onChange:r=>{x.onChange(r.target.value.split(` `))}})})}),e.jsx(k,{})]})}),e.jsx(g,{control:l.control,name:"action",render:({field:x})=>e.jsxs(j,{children:[e.jsx(p,{children:"动作"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsxs(G,{onValueChange:x.onChange,defaultValue:x.value,children:[e.jsx(U,{children:e.jsx(Y,{placeholder:"请选择动作"})}),e.jsxs(B,{children:[e.jsx(O,{value:"block",children:"禁止访问"}),e.jsx(O,{value:"dns",children:"指定DNS服务器进行解析"})]})]})})}),e.jsx(k,{})]})}),l.watch("action")==="dns"&&e.jsx(g,{control:l.control,name:"action_value",render:({field:x})=>e.jsxs(j,{children:[e.jsx(p,{children:"DNS服务器"}),e.jsx("div",{className:"relative",children:e.jsx(y,{children:e.jsx(S,{type:"text",placeholder:"请输入DNS服务器",...x})})})]})}),e.jsxs(Re,{children:[e.jsx(ot,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"取消"})}),e.jsx(T,{type:"submit",onClick:()=>{$c(l.getValues()).then(({data:x})=>{x&&(d(!1),s&&s(),l.reset())})},children:"提交"})]})]})]})]})}function Gx({table:s,refetch:t}){const a=s.getState().columnFilters.length>0;return e.jsx("div",{className:"flex items-center justify-between ",children:e.jsxs("div",{className:"flex flex-1 flex-col-reverse items-start gap-y-2 sm:flex-row sm:items-center sm:space-x-2",children:[e.jsx(Or,{refetch:t}),e.jsx(S,{placeholder:"搜索路由...",value:s.getColumn("remarks")?.getFilterValue()??"",onChange:n=>s.getColumn("remarks")?.setFilterValue(n.target.value),className:"h-8 w-[150px] lg:w-[250px]"}),a&&e.jsxs(T,{variant:"ghost",onClick:()=>s.resetColumnFilters(),className:"h-8 px-2 lg:px-3",children:["Reset",e.jsx(Fe,{className:"ml-2 h-4 w-4"})]})]})})}function Yx({columns:s,data:t,refetch:a}){const[n,l]=c.useState({}),[o,d]=c.useState({}),[x,r]=c.useState([]),[i,h]=c.useState([]),D=Me({data:t,columns:s,state:{sorting:i,columnVisibility:o,rowSelection:n,columnFilters:x},enableRowSelection:!0,onRowSelectionChange:l,onSortingChange:h,onColumnFiltersChange:r,onColumnVisibilityChange:d,getCoreRowModel:ze(),getFilteredRowModel:Ae(),getPaginationRowModel:He(),getSortedRowModel:Ke(),getFacetedRowModel:ls(),getFacetedUniqueValues:is(),initialState:{columnPinning:{right:["actions"]}}});return e.jsx(Ue,{table:D,toolbar:C=>e.jsx(Gx,{table:C,refetch:a})})}const Wx=s=>[{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"组ID"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"remarks",header:({column:t})=>e.jsx(V,{column:t,title:"备注"}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsxs("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:["匹配 ",t.original.match?.length," 条规则"]})}),enableHiding:!1,enableSorting:!1},{accessorKey:"action",header:({column:t})=>e.jsx(V,{column:t,title:"动作"}),cell:({row:t})=>{const a={dns:"指定DNS服务器进行解析",block:"禁止访问"};return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:a[t.getValue("action")]})})},enableSorting:!1,size:9e3},{id:"actions",header:()=>e.jsx("div",{className:"text-right",children:"操作"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsx(Or,{defaultValues:t.original,refetch:s,type:"edit",dialogTrigger:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]})}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该权限组,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{Ac({id:t.original.id}).then(({data:a})=>{a&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]})}];function Jx(){const[s,t]=c.useState([]);function a(){jr().then(({data:n})=>{t(n)})}return c.useEffect(()=>{a()},[]),e.jsxs(ye,{children:[e.jsxs(Ne,{children:[e.jsx(ke,{}),e.jsxs("div",{className:"ml-auto flex items-center space-x-4",children:[e.jsx(Te,{}),e.jsx(De,{})]})]}),e.jsxs(_e,{className:"flex flex-col",fixedHeight:!0,children:[e.jsx("div",{className:"mb-2 flex items-center justify-between space-y-2",children:e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"路由管理"}),e.jsx("p",{className:"mt-2 text-muted-foreground",children:"管理所有路由组,包括添加、删除、编辑等操作。"})]})}),e.jsx("div",{className:"-mx-4 flex-1 overflow-auto px-4 py-1 lg:flex-row lg:space-x-12 lg:space-y-0",children:e.jsx(Yx,{data:s,columns:Wx(a),refetch:a})})]})]})}const Qx=Object.freeze(Object.defineProperty({__proto__:null,default:Jx},Symbol.toStringTag,{value:"Module"})),Lr=c.createContext(void 0);function Zx({children:s,refreshData:t}){const[a,n]=c.useState(!1),[l,o]=c.useState(null);return e.jsx(Lr.Provider,{value:{isOpen:a,setIsOpen:n,editingPlan:l,setEditingPlan:o,refreshData:t},children:s})}function ha(){const s=c.useContext(Lr);if(s===void 0)throw new Error("usePlanEdit must be used within a PlanEditProvider");return s}function Xx({table:s,saveOrder:t,isSortMode:a}){const{setIsOpen:n}=ha();return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center space-x-2",children:[e.jsxs(T,{variant:"outline",className:"space-x-2",size:"sm",onClick:()=>n(!0),children:[e.jsx(ve,{icon:"ion:add"}),e.jsx("div",{children:"添加套餐"})]}),e.jsx(S,{placeholder:"搜索套餐...",value:s.getColumn("name")?.getFilterValue()??"",onChange:l=>s.getColumn("name")?.setFilterValue(l.target.value),className:"h-8 w-[150px] lg:w-[250px]"})]}),s.getRowCount()>0&&e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(T,{variant:a?"default":"outline",onClick:t,size:"sm",children:a?"保存排序":"编辑排序"})})]})}const Ka={monthly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},quarterly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},half_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},two_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},three_yearly:{color:"text-slate-700",bgColor:"bg-slate-100/80"},onetime:{color:"text-slate-700",bgColor:"bg-slate-100/80"},reset_traffic:{color:"text-slate-700",bgColor:"bg-slate-100/80"}},em=s=>[{id:"drag-handle",header:()=>null,cell:()=>e.jsx("div",{className:"cursor-move",children:e.jsx(Tt,{className:"size-4"})}),size:40,enableSorting:!1},{accessorKey:"id",header:({column:t})=>e.jsx(V,{column:t,title:"ID"}),cell:({row:t})=>e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(L,{variant:"outline",children:t.getValue("id")})}),enableSorting:!0,enableHiding:!1},{accessorKey:"show",header:({column:t})=>e.jsx(V,{column:t,title:"显示"}),cell:({row:t})=>e.jsx(H,{defaultChecked:t.getValue("show"),onCheckedChange:a=>{zt({id:t.original.id,show:a}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"sell",header:({column:t})=>e.jsx(V,{column:t,title:"新购"}),cell:({row:t})=>e.jsx(H,{defaultChecked:t.getValue("sell"),onCheckedChange:a=>{zt({id:t.original.id,sell:a}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"renew",header:({column:t})=>e.jsx(V,{column:t,title:"续费",tooltip:"在订阅停止销售时,已购用户是否可以续费"}),cell:({row:t})=>e.jsx(H,{defaultChecked:t.getValue("renew"),onCheckedChange:a=>{zt({id:t.original.id,renew:a}).then(({data:n})=>{!n&&s()})}}),enableSorting:!1,enableHiding:!1},{accessorKey:"name",header:({column:t})=>e.jsx(V,{column:t,title:"名称"}),cell:({row:t})=>e.jsx("div",{className:"flex space-x-2",children:e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("name")})}),enableSorting:!1,enableHiding:!1,size:900},{accessorKey:"users_count",header:({column:t})=>e.jsx(V,{column:t,title:"统计"}),cell:({row:t})=>e.jsxs("div",{className:"flex items-center space-x-2 px-2",children:[e.jsx(rt,{}),e.jsx("span",{className:"max-w-32 truncate font-medium sm:max-w-72 md:max-w-[31rem]",children:t.getValue("users_count")})]}),enableSorting:!0},{accessorKey:"group",header:({column:t})=>e.jsx(V,{column:t,title:"权限组"}),cell:({row:t})=>e.jsx("div",{className:"flex max-w-[600px] flex-wrap items-center gap-1.5 text-nowrap",children:e.jsx(L,{variant:"secondary",className:v("px-2 py-0.5 font-medium","bg-secondary/50 hover:bg-secondary/70","border border-border/50","transition-all duration-200","cursor-default select-none","flex items-center gap-1.5"),children:t.getValue("group")?.name})}),enableSorting:!1,enableHiding:!1},{accessorKey:"prices",header:({column:t})=>e.jsx(V,{column:t,title:"价格"}),cell:({row:t})=>{const a=t.getValue("prices"),n=[{period:"月付",key:"monthly",unit:"元/月"},{period:"季付",key:"quarterly",unit:"元/季"},{period:"半年付",key:"half_yearly",unit:"元/半年"},{period:"年付",key:"yearly",unit:"元/年"},{period:"两年付",key:"two_yearly",unit:"元/两年"},{period:"三年付",key:"three_yearly",unit:"元/三年"},{period:"流量包",key:"onetime",unit:"元"},{period:"重置包",key:"reset_traffic",unit:"元/次"}];return e.jsx("div",{className:"flex flex-wrap items-center gap-2",children:n.map(({period:l,key:o,unit:d})=>a[o]!=null&&e.jsxs(L,{variant:"secondary",className:v("px-2 py-0.5 font-medium transition-colors text-nowrap",Ka[o].color,Ka[o].bgColor,"border border-border/50","hover:bg-slate-200/80"),children:[l," ¥",a[o],d]},o))})},enableSorting:!1,size:9e3},{id:"actions",header:({column:t})=>e.jsx(V,{className:"justify-end",column:t,title:"操作"}),cell:({row:t})=>{const{setIsOpen:a,setEditingPlan:n}=ha();return e.jsxs("div",{className:"flex items-center justify-center",children:[e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-muted",onClick:()=>{n(t.original),a(!0)},children:[e.jsx(Ds,{className:"h-4 w-4 text-muted-foreground hover:text-foreground"}),e.jsx("span",{className:"sr-only",children:"编辑"})]}),e.jsx(Be,{title:"确认删除",description:"此操作将永久删除该订阅,删除后无法恢复。确定要继续吗?",confirmText:"删除",variant:"destructive",onConfirm:async()=>{ld({id:t.original.id}).then(({data:l})=>{l&&(A.success("删除成功"),s())})},children:e.jsxs(T,{variant:"ghost",size:"icon",className:"h-8 w-8 hover:bg-red-100 dark:hover:bg-red-900",children:[e.jsx(rs,{className:"h-4 w-4 text-muted-foreground hover:text-red-600 dark:hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"删除"})]})})]})}}],sm=u.object({id:u.number().nullable(),group_id:u.union([u.number(),u.string()]).nullable().optional(),name:u.string().min(1).max(250),content:u.string().nullable().optional(),transfer_enable:u.union([u.number().min(0),u.string().min(1)]),prices:u.object({monthly:u.union([u.number(),u.string()]).nullable().optional(),quarterly:u.union([u.number(),u.string()]).nullable().optional(),half_yearly:u.union([u.number(),u.string()]).nullable().optional(),yearly:u.union([u.number(),u.string()]).nullable().optional(),two_yearly:u.union([u.number(),u.string()]).nullable().optional(),three_yearly:u.union([u.number(),u.string()]).nullable().optional(),onetime:u.union([u.number(),u.string()]).nullable().optional(),reset_traffic:u.union([u.number(),u.string()]).nullable().optional()}).default({}),speed_limit:u.union([u.number(),u.string()]).nullable().optional(),capacity_limit:u.union([u.number(),u.string()]).nullable().optional(),device_limit:u.union([u.number(),u.string()]).nullable().optional(),force_update:u.boolean().optional(),reset_traffic_method:u.number().nullable(),users_count:u.number().optional()}),$r=c.forwardRef(({className:s,...t},a)=>e.jsx(An,{ref:a,className:v("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",s),...t,children:e.jsx(ho,{className:v("flex items-center justify-center text-current"),children:e.jsx(ks,{className:"h-4 w-4"})})}));$r.displayName=An.displayName;const jt={id:null,group_id:null,name:"",content:"",transfer_enable:"",prices:{monthly:"",quarterly:"",half_yearly:"",yearly:"",two_yearly:"",three_yearly:"",onetime:"",reset_traffic:""},speed_limit:"",capacity_limit:"",device_limit:"",force_update:!1,reset_traffic_method:null},gt={monthly:{label:"月付",months:1,discount:1},quarterly:{label:"季付",months:3,discount:.95},half_yearly:{label:"半年付",months:6,discount:.9},yearly:{label:"年付",months:12,discount:.85},two_yearly:{label:"两年付",months:24,discount:.8},three_yearly:{label:"三年付",months:36,discount:.75},onetime:{label:"流量包",months:1,discount:1},reset_traffic:{label:"重置包",months:1,discount:1}},tm=[{value:null,label:"跟随系统设置"},{value:0,label:"每月1号"},{value:1,label:"按月重置"},{value:2,label:"不重置"},{value:3,label:"每年1月1日"},{value:4,label:"按年重置"}];function am(){const{isOpen:s,setIsOpen:t,editingPlan:a,setEditingPlan:n,refreshData:l}=ha(),[o,d]=c.useState(!1),x=ae({resolver:ie(sm),defaultValues:{...jt,...a||{}},mode:"onChange"});c.useEffect(()=>{a?x.reset({...jt,...a}):x.reset(jt)},[a,x]);const r=new na({html:!0}),[i,h]=c.useState();async function D(){It().then(({data:w})=>{h(w)})}c.useEffect(()=>{s&&D()},[s]);const C=w=>{if(isNaN(w))return;const _=Object.entries(gt).reduce((b,[N,P])=>{const f=w*P.months*P.discount;return{...b,[N]:f.toFixed(2)}},{});x.setValue("prices",_,{shouldDirty:!0})},m=()=>{t(!1),n(null),x.reset(jt)};return e.jsx(ue,{open:s,onOpenChange:m,children:e.jsxs(ce,{children:[e.jsxs(he,{children:[e.jsx(xe,{children:a?"编辑套餐":"添加套餐"}),e.jsx(Se,{})]}),e.jsxs(oe,{...x,children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{control:x.control,name:"name",render:({field:w})=>e.jsxs(j,{children:[e.jsx(p,{children:"套餐名称"}),e.jsx(y,{children:e.jsx(S,{placeholder:"请输入套餐名称",...w})}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"group_id",render:({field:w})=>e.jsxs(j,{children:[e.jsxs(p,{className:"flex items-center justify-between",children:["权限组",e.jsx(Et,{dialogTrigger:e.jsx(T,{variant:"link",children:"添加权限组"}),refetch:D})]}),e.jsxs(G,{value:w.value||"",onValueChange:w.onChange,children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"选择权限组"})})}),e.jsx(B,{children:i?.map(_=>e.jsx(O,{value:_.id,children:_.name},_.id))})]}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"transfer_enable",render:({field:w})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"流量"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",min:0,placeholder:"请输入流量大小",className:"rounded-r-none",...w})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:"GB"})]}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"speed_limit",render:({field:w})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"限速"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",min:0,placeholder:"请输入限速",className:"rounded-r-none",...w})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:"Mbps"})]}),e.jsx(k,{})]})}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex flex-1 items-center",children:[e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"}),e.jsx("h3",{className:"mx-4 text-sm font-medium text-gray-500 dark:text-gray-400",children:"售价设置"}),e.jsx("div",{className:"flex-grow border-t border-gray-200 dark:border-gray-700"})]}),e.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(S,{type:"number",placeholder:"基础月付价格",className:"h-7 w-32 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500",onChange:w=>{const _=parseFloat(w.target.value);C(_)}})]}),e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{const w=Object.keys(gt).reduce((_,b)=>({..._,[b]:""}),{});x.setValue("prices",w,{shouldDirty:!0})},children:"清空价格"})}),e.jsx(ee,{side:"top",align:"end",children:e.jsx("p",{className:"text-xs",children:"清空所有周期的价格设置"})})]})})]})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3 lg:grid-cols-3",children:Object.entries(gt).filter(([w])=>!["onetime","reset_traffic"].includes(w)).map(([w,_])=>e.jsx("div",{className:"group relative rounded-md bg-card p-2 ring-1 ring-gray-200 transition-all hover:ring-primary dark:ring-gray-800",children:e.jsx(g,{control:x.control,name:`prices.${w}`,render:({field:b})=>e.jsxs(j,{children:[e.jsxs(p,{className:"text-xs font-medium text-muted-foreground",children:[_.label,e.jsxs("span",{className:"ml-1 text-[10px] text-gray-400",children:["(",_.months===1?"每月":`每${_.months}个月`,"结算)"]})]}),e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0.00",min:0,...b,value:b.value??"",onChange:N=>b.onChange(N.target.value),className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})},w))}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:Object.entries(gt).filter(([w])=>["onetime","reset_traffic"].includes(w)).map(([w,_])=>e.jsx("div",{className:"rounded-md border border-dashed border-gray-200 bg-muted/30 p-3 dark:border-gray-700",children:e.jsx(g,{control:x.control,name:`prices.${w}`,render:({field:b})=>e.jsx(j,{children:e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-0",children:[e.jsx(p,{className:"text-xs font-medium",children:_.label}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:w==="onetime"?"一次性流量包,购买后立即生效":"用户可随时购买流量重置包,立即重置流量"})]}),e.jsxs("div",{className:"relative w-full md:w-32",children:[e.jsx("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2",children:e.jsx("span",{className:"text-sm font-medium text-gray-400",children:"¥"})}),e.jsx(y,{children:e.jsx(S,{type:"number",placeholder:"0.00",min:0,...b,className:"h-7 border-0 bg-gray-50 pl-6 pr-2 text-sm shadow-none ring-1 ring-gray-200 transition-shadow focus-visible:ring-2 focus-visible:ring-primary dark:bg-gray-800/50 dark:ring-gray-700 dark:placeholder:text-gray-500"})})]})]})})})},w))})]}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx(g,{control:x.control,name:"device_limit",render:({field:w})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"设备限制"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",min:0,placeholder:"留空则不限制",className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:"台"})]}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"capacity_limit",render:({field:w})=>e.jsxs(j,{className:"flex-1",children:[e.jsx(p,{children:"容量限制"}),e.jsxs("div",{className:"relative flex",children:[e.jsx(y,{children:e.jsx(S,{type:"number",min:0,placeholder:"留空则不限制",className:"rounded-r-none",...w,value:w.value??""})}),e.jsx("div",{className:"flex items-center rounded-r-md border border-l-0 border-input bg-muted px-3 text-sm text-muted-foreground",children:"人"})]}),e.jsx(k,{})]})})]}),e.jsx(g,{control:x.control,name:"reset_traffic_method",render:({field:w})=>e.jsxs(j,{children:[e.jsx(p,{children:"流量重置方式"}),e.jsxs(G,{value:w.value?.toString()??"null",onValueChange:_=>w.onChange(_=="null"?null:Number(_)),children:[e.jsx(y,{children:e.jsx(U,{children:e.jsx(Y,{placeholder:"选择流量重置方式"})})}),e.jsx(B,{children:tm.map(_=>e.jsx(O,{value:_.value?.toString()??"null",children:_.label},_.value))})]}),e.jsx(F,{className:"text-xs",children:"设置订阅流量的重置方式,不同的重置方式会影响用户的流量计算方式"}),e.jsx(k,{})]})}),e.jsx(g,{control:x.control,name:"content",render:({field:w})=>{const[_,b]=c.useState(!1);return e.jsxs(j,{className:"space-y-2",children:[e.jsxs(p,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:["套餐描述",e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>b(!_),children:_?e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{d:"M10 12.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5z"}),e.jsx("path",{fillRule:"evenodd",d:"M.664 10.59a1.651 1.651 0 010-1.186A10.004 10.004 0 0110 3c4.257 0 7.893 2.66 9.336 6.41.147.381.146.804 0 1.186A10.004 10.004 0 0110 17c-4.257 0-7.893-2.66-9.336-6.41zM14 10a4 4 0 11-8 0 4 4 0 018 0z",clipRule:"evenodd"})]}):e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:"h-4 w-4",children:[e.jsx("path",{fillRule:"evenodd",d:"M3.28 2.22a.75.75 0 00-1.06 1.06l14.5 14.5a.75.75 0 101.06-1.06l-1.745-1.745a10.029 10.029 0 003.3-4.38 1.651 1.651 0 000-1.185A10.004 10.004 0 009.999 3a9.956 9.956 0 00-4.744 1.194L3.28 2.22zM7.752 6.69l1.092 1.092a2.5 2.5 0 013.374 3.373l1.091 1.092a4 4 0 00-5.557-5.557z",clipRule:"evenodd"}),e.jsx("path",{d:"M10.748 13.93l2.523 2.523a9.987 9.987 0 01-3.27.547c-4.258 0-7.894-2.66-9.337-6.41a1.651 1.651 0 010-1.186A10.007 10.007 0 012.839 6.02L6.07 9.252a4 4 0 004.678 4.678z"})]})})}),e.jsx(ee,{side:"top",children:e.jsx("p",{className:"text-xs",children:_?"隐藏预览":"显示预览"})})]})})]}),e.jsx(le,{children:e.jsxs(se,{children:[e.jsx(te,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"sm",onClick:()=>{w.onChange(`## 套餐特点 diff --git a/resources/views/admin.blade.php b/resources/views/admin.blade.php index cca205d..bec895e 100644 --- a/resources/views/admin.blade.php +++ b/resources/views/admin.blade.php @@ -14,9 +14,9 @@ secure_path: "{{ $secure_path }}", }; - - - + + +