From 6669ef35827fa073c9fc9bd698a969004c5519c0 Mon Sep 17 00:00:00 2001 From: qseudo <57642143+yg-lim@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:35:51 -0400 Subject: [PATCH 1/6] chore: restructures response object from chatbots routes --- pipeline/config_util.py | 25 +++++++++++++++++++++++ routers/chatbots.py | 4 ++-- ui/src/services/knowledge-base-service.ts | 2 +- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/pipeline/config_util.py b/pipeline/config_util.py index cc0f054..b6f27fe 100644 --- a/pipeline/config_util.py +++ b/pipeline/config_util.py @@ -37,3 +37,28 @@ def ui_to_pipeline(ui_json): log.debug('config_util.py ui_to_pipeline: pipeline_obj', pipeline_obj) return pipeline_obj + + +def pipeline_to_ui(pipeline_obj): + ui_obj = { + "id": pipeline_obj['id'], + "name": pipeline_obj['name'], + "knowledge_bases": pipeline_obj['knowledgebases'], + "generative_model": pipeline_obj['generative_model'], + "similarity": { + "on": pipeline_obj['postprocessing']['similarity']['on'], + "cutoff": pipeline_obj['postprocessing']['similarity'].get('similarity_cutoff', 0.7) + }, + "colbert_rerank": { + "on": pipeline_obj['postprocessing']['colbertRerank']['on'], + "top_n": pipeline_obj['postprocessing']['colbertRerank'].get('top_n', DEFAULT_TOP_N) + }, + "long_context_reorder": { + "on": pipeline_obj['postprocessing']['longContextReorder']['on'] + }, + "prompt": pipeline_obj['prompt']['template_str'] + } + + log.debug('config_util.py pipeline_to_ui: ui_obj', ui_obj) + return ui_obj + \ No newline at end of file diff --git a/routers/chatbots.py b/routers/chatbots.py index 262d771..953160d 100644 --- a/routers/chatbots.py +++ b/routers/chatbots.py @@ -29,7 +29,7 @@ async def get_chatbots(): log.info('/api/chatbots loaded') results = mutil.get_all(CONFIG_DB, CONFIG_PIPELINE_COL, {}, { '_id': 0 }) log.info('/api/chatbots results:', results) - return results + return [cutil.pipeline_to_ui(result) for result in results] @router.get('/{id}') async def get_chatbots_id(id: str): @@ -38,7 +38,7 @@ async def get_chatbots_id(id: str): if not results: return {"message": "no chatbot configuration found"} - return results + return [cutil.pipeline_to_ui(result) for result in results] @router.post('/') async def post_chatbots(request: Request): diff --git a/ui/src/services/knowledge-base-service.ts b/ui/src/services/knowledge-base-service.ts index be08990..7c252b6 100644 --- a/ui/src/services/knowledge-base-service.ts +++ b/ui/src/services/knowledge-base-service.ts @@ -125,7 +125,7 @@ async function fetchKnowledgeBases() { } async function fetchKnowledgeBaseById(id: string) { - const response = await axios.get(`${baseUrl}/api/knowledge-base/${id}`); + const response = await axios.get(`${baseUrl}/api/knowledge-bases/${id}`); console.log(response.data); return response.data; } From 7a584a499c9ec37168789e328c70f6b8c43eb576 Mon Sep 17 00:00:00 2001 From: qseudo <57642143+yg-lim@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:49:40 -0400 Subject: [PATCH 2/6] feat: update UI configuration and server integration --- routers/chatbots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/chatbots.py b/routers/chatbots.py index 953160d..97602e8 100644 --- a/routers/chatbots.py +++ b/routers/chatbots.py @@ -38,7 +38,7 @@ async def get_chatbots_id(id: str): if not results: return {"message": "no chatbot configuration found"} - return [cutil.pipeline_to_ui(result) for result in results] + return cutil.pipeline_to_ui(results) @router.post('/') async def post_chatbots(request: Request): From 7413b66257c7d8d07eac6be09a2f6aa9b746c510 Mon Sep 17 00:00:00 2001 From: yg-lim Date: Wed, 7 Aug 2024 21:06:01 +0000 Subject: [PATCH 3/6] fix: deployment fixes from ec2 - working version --- .gitignore | 2 +- ui/.gitignore | 2 +- ui/dist/assets/index-BzAze5ww.css | 1 + ui/dist/assets/index-DF12BThB.js | 169 ++++++++++++++++++++++++++++++ ui/dist/index.html | 14 +++ ui/dist/vite.svg | 1 + 6 files changed, 187 insertions(+), 2 deletions(-) create mode 100644 ui/dist/assets/index-BzAze5ww.css create mode 100644 ui/dist/assets/index-DF12BThB.js create mode 100644 ui/dist/index.html create mode 100644 ui/dist/vite.svg diff --git a/.gitignore b/.gitignore index d6aa1b4..5940589 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ __pycache__/ .Python build/ develop-eggs/ -dist/ +# dist/ downloads/ eggs/ .eggs/ diff --git a/ui/.gitignore b/ui/.gitignore index a547bf3..cf7ff2f 100644 --- a/ui/.gitignore +++ b/ui/.gitignore @@ -8,7 +8,7 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist +# dist dist-ssr *.local diff --git a/ui/dist/assets/index-BzAze5ww.css b/ui/dist/assets/index-BzAze5ww.css new file mode 100644 index 0000000..1f938a6 --- /dev/null +++ b/ui/dist/assets/index-BzAze5ww.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap";@tailwind base;@tailwind components;@tailwind utilities;*,: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]{display:none}:root{font-family:Rubik,system-ui,Avenir,Helvetica,Arial,sans-serif;--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;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,: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: }.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}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-72{margin-left:18rem}.ml-auto{margin-left:auto}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.\!table{display:table!important}.table{display:table}.grid{display:grid}.size-12{width:3rem;height:3rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[75vh\]{height:75vh}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-96{max-height:24rem}.min-h-\[80px\]{min-height:80px}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-72{width:18rem}.w-8{width:2rem}.w-full{width:100%}.w-screen{width:100vw}.min-w-0\.5{min-width:.125rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-\[75\%\]{max-width:75%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.-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-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))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.scroll-m-20{scroll-margin:5rem}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.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-4{gap:1rem}.gap-8{gap:2rem}.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-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-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\.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-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))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.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-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-l-2{border-left-width:2px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-background{background-color:hsl(var(--background))}.bg-black\/\[0\.3\]{background-color:#0000004d}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-12{padding:3rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-12{padding-left:3rem;padding-right:3rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pl-6{padding-left:1.5rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.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-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-extrabold{font-weight:800}.font-medium{font-weight:500}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.capitalize{text-transform:capitalize}.italic{font-style:italic}.leading-7{line-height:1.75rem}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.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-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.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-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)}.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-offset-background{--tw-ring-offset-color: hsl(var(--background))}.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)}.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-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}@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))}}.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))}.first\:mt-0:first-child{margin-top:0}.first\:mt-6:first-child{margin-top:1.5rem}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.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)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.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-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-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))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.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-5[data-state=checked]{--tw-translate-x: 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))}.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))}.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\=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-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:hsl(var(--primary-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{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-\[state\=closed\]\:animate-out[data-state=closed]{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-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.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}@media (min-width: 768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:text-5xl{font-size:3rem;line-height:1}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\:not\(\:first-child\)\]\:mt-6:not(:first-child){margin-top:1.5rem}.\[\&\>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}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/ui/dist/assets/index-DF12BThB.js b/ui/dist/assets/index-DF12BThB.js new file mode 100644 index 0000000..0e5422f --- /dev/null +++ b/ui/dist/assets/index-DF12BThB.js @@ -0,0 +1,169 @@ +var qm=e=>{throw TypeError(e)};var Yc=(e,t,n)=>t.has(e)||qm("Cannot "+n);var R=(e,t,n)=>(Yc(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?qm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Z=(e,t,n,r)=>(Yc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ge=(e,t,n)=>(Yc(e,t,"access private method"),n);var pa=(e,t,n,r)=>({set _(o){Z(e,t,o,n)},get _(){return R(e,t,r)}});function Ab(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();function jy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ay={exports:{}},sc={},My={exports:{}},we={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Jl=Symbol.for("react.element"),Mb=Symbol.for("react.portal"),Ob=Symbol.for("react.fragment"),Ib=Symbol.for("react.strict_mode"),Fb=Symbol.for("react.profiler"),Db=Symbol.for("react.provider"),Lb=Symbol.for("react.context"),Vb=Symbol.for("react.forward_ref"),$b=Symbol.for("react.suspense"),zb=Symbol.for("react.memo"),Bb=Symbol.for("react.lazy"),Qm=Symbol.iterator;function Ub(e){return e===null||typeof e!="object"?null:(e=Qm&&e[Qm]||e["@@iterator"],typeof e=="function"?e:null)}var Oy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Iy=Object.assign,Fy={};function yi(e,t,n){this.props=e,this.context=t,this.refs=Fy,this.updater=n||Oy}yi.prototype.isReactComponent={};yi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Dy(){}Dy.prototype=yi.prototype;function Dp(e,t,n){this.props=e,this.context=t,this.refs=Fy,this.updater=n||Oy}var Lp=Dp.prototype=new Dy;Lp.constructor=Dp;Iy(Lp,yi.prototype);Lp.isPureReactComponent=!0;var Xm=Array.isArray,Ly=Object.prototype.hasOwnProperty,Vp={current:null},Vy={key:!0,ref:!0,__self:!0,__source:!0};function $y(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Ly.call(t,r)&&!Vy.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,he=M[se];if(0>>1;seo(Rt,K))Feo(ee,Rt)?(M[se]=ee,M[Fe]=K,se=Fe):(M[se]=Rt,M[ze]=K,se=ze);else if(Feo(ee,K))M[se]=ee,M[Fe]=K,se=Fe;else break e}}return j}function o(M,j){var K=M.sortIndex-j.sortIndex;return K!==0?K:M.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],u=[],c=1,d=null,p=3,h=!1,m=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(M){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=M)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function C(M){if(w=!1,x(M),!m)if(n(a)!==null)m=!0,re(_);else{var j=n(u);j!==null&&Q(C,j.startTime-M)}}function _(M,j){m=!1,w&&(w=!1,y(E),E=-1),h=!0;var K=p;try{for(x(j),d=n(a);d!==null&&(!(d.expirationTime>j)||M&&!Y());){var se=d.callback;if(typeof se=="function"){d.callback=null,p=d.priorityLevel;var he=se(d.expirationTime<=j);j=e.unstable_now(),typeof he=="function"?d.callback=he:d===n(a)&&r(a),x(j)}else r(a);d=n(a)}if(d!==null)var mt=!0;else{var ze=n(u);ze!==null&&Q(C,ze.startTime-j),mt=!1}return mt}finally{d=null,p=K,h=!1}}var P=!1,k=null,E=-1,I=5,O=-1;function Y(){return!(e.unstable_now()-OM||125se?(M.sortIndex=K,t(u,M),n(a)===null&&M===n(u)&&(w?(y(E),E=-1):w=!0,Q(C,K-se))):(M.sortIndex=he,t(a,M),m||h||(m=!0,re(_))),M},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(M){var j=p;return function(){var K=p;p=j;try{return M.apply(this,arguments)}finally{p=K}}}})(Gy);Wy.exports=Gy;var eR=Wy.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var tR=g,nn=eR;function D(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yd=Object.prototype.hasOwnProperty,nR=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Jm={},eg={};function rR(e){return Yd.call(eg,e)?!0:Yd.call(Jm,e)?!1:nR.test(e)?eg[e]=!0:(Jm[e]=!0,!1)}function oR(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sR(e,t,n,r){if(t===null||typeof t>"u"||oR(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mt(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ht[e]=new Mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ht[t]=new Mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ht[e]=new Mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ht[e]=new Mt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ht[e]=new Mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ht[e]=new Mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ht[e]=new Mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ht[e]=new Mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ht[e]=new Mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var zp=/[\-:]([a-z])/g;function Bp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zp,Bp);ht[t]=new Mt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zp,Bp);ht[t]=new Mt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zp,Bp);ht[t]=new Mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ht[e]=new Mt(e,1,!1,e.toLowerCase(),null,!1,!1)});ht.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ht[e]=new Mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Up(e,t,n,r){var o=ht.hasOwnProperty(t)?ht[t]:null;(o!==null?o.type!==0:r||!(2l||o[i]!==s[l]){var a=` +`+o[i].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Bi(e):""}function iR(e){switch(e.tag){case 5:return Bi(e.type);case 16:return Bi("Lazy");case 13:return Bi("Suspense");case 19:return Bi("SuspenseList");case 0:case 2:case 15:return e=nd(e.type,!1),e;case 11:return e=nd(e.type.render,!1),e;case 1:return e=nd(e.type,!0),e;default:return""}}function nf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case hs:return"Fragment";case ps:return"Portal";case Jd:return"Profiler";case Hp:return"StrictMode";case ef:return"Suspense";case tf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qy:return(e.displayName||"Context")+".Consumer";case Zy:return(e._context.displayName||"Context")+".Provider";case Wp:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Gp:return t=e.displayName||null,t!==null?t:nf(e.type)||"Memo";case Ar:t=e._payload,e=e._init;try{return nf(e(t))}catch{}}return null}function lR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nf(t);case 8:return t===Hp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ro(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Xy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aR(e){var t=Xy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ga(e){e._valueTracker||(e._valueTracker=aR(e))}function Yy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Xy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function uu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rf(e,t){var n=t.checked;return We({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ng(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ro(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jy(e,t){t=t.checked,t!=null&&Up(e,"checked",t,!1)}function of(e,t){Jy(e,t);var n=ro(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?sf(e,t.type,n):t.hasOwnProperty("defaultValue")&&sf(e,t.type,ro(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function rg(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function sf(e,t,n){(t!=="number"||uu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ui=Array.isArray;function Ns(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=va.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var el={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},uR=["Webkit","ms","Moz","O"];Object.keys(el).forEach(function(e){uR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),el[t]=el[e]})});function rw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||el.hasOwnProperty(e)&&el[e]?(""+t).trim():t+"px"}function ow(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=rw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var cR=We({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function uf(e,t){if(t){if(cR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(D(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(D(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(D(61))}if(t.style!=null&&typeof t.style!="object")throw Error(D(62))}}function cf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var df=null;function Kp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ff=null,js=null,As=null;function ig(e){if(e=na(e)){if(typeof ff!="function")throw Error(D(280));var t=e.stateNode;t&&(t=cc(t),ff(e.stateNode,e.type,t))}}function sw(e){js?As?As.push(e):As=[e]:js=e}function iw(){if(js){var e=js,t=As;if(As=js=null,ig(e),t)for(e=0;e>>=0,e===0?32:31-(SR(e)/CR|0)|0}var ya=64,wa=4194304;function Hi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=Hi(l):(s&=i,s!==0&&(r=Hi(s)))}else i=n&~o,i!==0?r=Hi(i):s!==0&&(r=Hi(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ea(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-kn(t),e[t]=n}function ER(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=nl),mg=" ",gg=!1;function Ew(e,t){switch(e){case"keyup":return e1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ms=!1;function n1(e,t){switch(e){case"compositionend":return kw(t);case"keypress":return t.which!==32?null:(gg=!0,mg);case"textInput":return e=t.data,e===mg&&gg?null:e;default:return null}}function r1(e,t){if(ms)return e==="compositionend"||!th&&Ew(e,t)?(e=bw(),Ka=Yp=Wr=null,ms=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=xg(n)}}function jw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?jw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Aw(){for(var e=window,t=uu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=uu(e.document)}return t}function nh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function f1(e){var t=Aw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&jw(n.ownerDocument.documentElement,n)){if(r!==null&&nh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Sg(n,s);var i=Sg(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,gs=null,yf=null,ol=null,wf=!1;function Cg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wf||gs==null||gs!==uu(r)||(r=gs,"selectionStart"in r&&nh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ol&&wl(ol,r)||(ol=r,r=gu(yf,"onSelect"),0ws||(e.current=Rf[ws],Rf[ws]=null,ws--)}function Ie(e,t){ws++,Rf[ws]=e.current,e.current=t}var oo={},Ct=go(oo),$t=go(!1),$o=oo;function ti(e,t){var n=e.type.contextTypes;if(!n)return oo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function zt(e){return e=e.childContextTypes,e!=null}function yu(){Ve($t),Ve(Ct)}function Tg(e,t,n){if(Ct.current!==oo)throw Error(D(168));Ie(Ct,t),Ie($t,n)}function zw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(D(108,lR(e)||"Unknown",o));return We({},n,r)}function wu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||oo,$o=Ct.current,Ie(Ct,e),Ie($t,$t.current),!0}function Ng(e,t,n){var r=e.stateNode;if(!r)throw Error(D(169));n?(e=zw(e,t,$o),r.__reactInternalMemoizedMergedChildContext=e,Ve($t),Ve(Ct),Ie(Ct,e)):Ve($t),Ie($t,n)}var ur=null,dc=!1,gd=!1;function Bw(e){ur===null?ur=[e]:ur.push(e)}function b1(e){dc=!0,Bw(e)}function vo(){if(!gd&&ur!==null){gd=!0;var e=0,t=Me;try{var n=ur;for(Me=1;e>=i,o-=i,dr=1<<32-kn(t)+o|n<E?(I=k,k=null):I=k.sibling;var O=p(y,k,x[E],C);if(O===null){k===null&&(k=I);break}e&&k&&O.alternate===null&&t(y,k),v=s(O,v,E),P===null?_=O:P.sibling=O,P=O,k=I}if(E===x.length)return n(y,k),$e&&xo(y,E),_;if(k===null){for(;EE?(I=k,k=null):I=k.sibling;var Y=p(y,k,O.value,C);if(Y===null){k===null&&(k=I);break}e&&k&&Y.alternate===null&&t(y,k),v=s(Y,v,E),P===null?_=Y:P.sibling=Y,P=Y,k=I}if(O.done)return n(y,k),$e&&xo(y,E),_;if(k===null){for(;!O.done;E++,O=x.next())O=d(y,O.value,C),O!==null&&(v=s(O,v,E),P===null?_=O:P.sibling=O,P=O);return $e&&xo(y,E),_}for(k=r(y,k);!O.done;E++,O=x.next())O=h(k,y,E,O.value,C),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?E:O.key),v=s(O,v,E),P===null?_=O:P.sibling=O,P=O);return e&&k.forEach(function(F){return t(y,F)}),$e&&xo(y,E),_}function S(y,v,x,C){if(typeof x=="object"&&x!==null&&x.type===hs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case ma:e:{for(var _=x.key,P=v;P!==null;){if(P.key===_){if(_=x.type,_===hs){if(P.tag===7){n(y,P.sibling),v=o(P,x.props.children),v.return=y,y=v;break e}}else if(P.elementType===_||typeof _=="object"&&_!==null&&_.$$typeof===Ar&&Mg(_)===P.type){n(y,P.sibling),v=o(P,x.props),v.ref=Mi(y,P,x),v.return=y,y=v;break e}n(y,P);break}else t(y,P);P=P.sibling}x.type===hs?(v=Fo(x.props.children,y.mode,C,x.key),v.return=y,y=v):(C=tu(x.type,x.key,x.props,null,y.mode,C),C.ref=Mi(y,v,x),C.return=y,y=C)}return i(y);case ps:e:{for(P=x.key;v!==null;){if(v.key===P)if(v.tag===4&&v.stateNode.containerInfo===x.containerInfo&&v.stateNode.implementation===x.implementation){n(y,v.sibling),v=o(v,x.children||[]),v.return=y,y=v;break e}else{n(y,v);break}else t(y,v);v=v.sibling}v=bd(x,y.mode,C),v.return=y,y=v}return i(y);case Ar:return P=x._init,S(y,v,P(x._payload),C)}if(Ui(x))return m(y,v,x,C);if(Pi(x))return w(y,v,x,C);Ea(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,v!==null&&v.tag===6?(n(y,v.sibling),v=o(v,x),v.return=y,y=v):(n(y,v),v=_d(x,y.mode,C),v.return=y,y=v),i(y)):n(y,v)}return S}var ri=Gw(!0),Kw=Gw(!1),Cu=go(null),_u=null,Cs=null,ih=null;function lh(){ih=Cs=_u=null}function ah(e){var t=Cu.current;Ve(Cu),e._currentValue=t}function Pf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Os(e,t){_u=e,ih=Cs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vt=!0),e.firstContext=null)}function gn(e){var t=e._currentValue;if(ih!==e)if(e={context:e,memoizedValue:t,next:null},Cs===null){if(_u===null)throw Error(D(308));Cs=e,_u.dependencies={lanes:0,firstContext:e}}else Cs=Cs.next=e;return t}var _o=null;function uh(e){_o===null?_o=[e]:_o.push(e)}function Zw(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,uh(t)):(n.next=o.next,o.next=n),t.interleaved=n,vr(e,r)}function vr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Mr=!1;function ch(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function pr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,_e&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,vr(e,n)}return o=r.interleaved,o===null?(t.next=t,uh(r)):(t.next=o.next,o.next=t),r.interleaved=t,vr(e,n)}function qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qp(e,n)}}function Og(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function bu(e,t,n,r){var o=e.updateQueue;Mr=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,i===null?s=u:i.next=u,i=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==i&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(s!==null){var d=o.baseState;i=0,c=u=a=null,l=s;do{var p=l.lane,h=l.eventTime;if((r&p)===p){c!==null&&(c=c.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var m=e,w=l;switch(p=t,h=n,w.tag){case 1:if(m=w.payload,typeof m=="function"){d=m.call(h,d,p);break e}d=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=w.payload,p=typeof m=="function"?m.call(h,d,p):m,p==null)break e;d=We({},d,p);break e;case 2:Mr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[l]:p.push(l))}else h={eventTime:h,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=h,a=d):c=c.next=h,i|=p;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;p=l,l=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);Uo|=i,e.lanes=i,e.memoizedState=d}}function Ig(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=yd.transition;yd.transition={};try{e(!1),t()}finally{Me=n,yd.transition=r}}function fx(){return vn().memoizedState}function P1(e,t,n){var r=to(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},px(e))hx(t,n);else if(n=Zw(e,t,n,r),n!==null){var o=Nt();Pn(n,e,r,o),mx(n,t,r)}}function T1(e,t,n){var r=to(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(px(e))hx(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,An(l,i)){var a=t.interleaved;a===null?(o.next=o,uh(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Zw(e,t,o,r),n!==null&&(o=Nt(),Pn(n,e,r,o),mx(n,t,r))}}function px(e){var t=e.alternate;return e===He||t!==null&&t===He}function hx(e,t){sl=Eu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mx(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qp(e,n)}}var ku={readContext:gn,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useInsertionEffect:vt,useLayoutEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useMutableSource:vt,useSyncExternalStore:vt,useId:vt,unstable_isNewReconciler:!1},N1={readContext:gn,useCallback:function(e,t){return Ln().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:Dg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Xa(4194308,4,lx.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xa(4,2,e,t)},useMemo:function(e,t){var n=Ln();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ln();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=P1.bind(null,He,e),[r.memoizedState,e]},useRef:function(e){var t=Ln();return e={current:e},t.memoizedState=e},useState:Fg,useDebugValue:yh,useDeferredValue:function(e){return Ln().memoizedState=e},useTransition:function(){var e=Fg(!1),t=e[0];return e=k1.bind(null,e[1]),Ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=He,o=Ln();if($e){if(n===void 0)throw Error(D(407));n=n()}else{if(n=t(),ct===null)throw Error(D(349));Bo&30||Jw(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,Dg(tx.bind(null,r,s,e),[e]),r.flags|=2048,kl(9,ex.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Ln(),t=ct.identifierPrefix;if($e){var n=fr,r=dr;n=(r&~(1<<32-kn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Un]=t,e[Cl]=r,Rx(e,t,!1,!1),t.stateNode=e;e:{switch(i=cf(n,r),n){case"dialog":Le("cancel",e),Le("close",e),o=r;break;case"iframe":case"object":case"embed":Le("load",e),o=r;break;case"video":case"audio":for(o=0;oii&&(t.flags|=128,r=!0,Oi(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ru(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Oi(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!$e)return yt(t),null}else 2*Ye()-s.renderingStartTime>ii&&n!==1073741824&&(t.flags|=128,r=!0,Oi(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ye(),t.sibling=null,n=Ue.current,Ie(Ue,r?n&1|2:n&1),t):(yt(t),null);case 22:case 23:return bh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Zt&1073741824&&(yt(t),t.subtreeFlags&6&&(t.flags|=8192)):yt(t),null;case 24:return null;case 25:return null}throw Error(D(156,t.tag))}function L1(e,t){switch(oh(t),t.tag){case 1:return zt(t.type)&&yu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oi(),Ve($t),Ve(Ct),ph(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fh(t),null;case 13:if(Ve(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(D(340));ni()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ve(Ue),null;case 4:return oi(),null;case 10:return ah(t.type._context),null;case 22:case 23:return bh(),null;case 24:return null;default:return null}}var Pa=!1,St=!1,V1=typeof WeakSet=="function"?WeakSet:Set,q=null;function _s(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qe(e,t,r)}else n.current=null}function Df(e,t,n){try{n()}catch(r){qe(e,t,r)}}var Zg=!1;function $1(e,t){if(xf=hu,e=Aw(),nh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,u=0,c=0,d=e,p=null;t:for(;;){for(var h;d!==n||o!==0&&d.nodeType!==3||(l=i+o),d!==s||r!==0&&d.nodeType!==3||(a=i+r),d.nodeType===3&&(i+=d.nodeValue.length),(h=d.firstChild)!==null;)p=d,d=h;for(;;){if(d===e)break t;if(p===n&&++u===o&&(l=i),p===s&&++c===r&&(a=i),(h=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=h}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sf={focusedElem:e,selectionRange:n},hu=!1,q=t;q!==null;)if(t=q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,q=e;else for(;q!==null;){t=q;try{var m=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var w=m.memoizedProps,S=m.memoizedState,y=t.stateNode,v=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:xn(t.type,w),S);y.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(D(163))}}catch(C){qe(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,q=e;break}q=t.return}return m=Zg,Zg=!1,m}function il(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&Df(t,n,s)}o=o.next}while(o!==r)}}function hc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Px(e){var t=e.alternate;t!==null&&(e.alternate=null,Px(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Un],delete t[Cl],delete t[bf],delete t[C1],delete t[_1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tx(e){return e.tag===5||e.tag===3||e.tag===4}function qg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Vf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=vu));else if(r!==4&&(e=e.child,e!==null))for(Vf(e,t,n),e=e.sibling;e!==null;)Vf(e,t,n),e=e.sibling}function $f(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for($f(e,t,n),e=e.sibling;e!==null;)$f(e,t,n),e=e.sibling}var ft=null,Cn=!1;function Er(e,t,n){for(n=n.child;n!==null;)Nx(e,t,n),n=n.sibling}function Nx(e,t,n){if(Zn&&typeof Zn.onCommitFiberUnmount=="function")try{Zn.onCommitFiberUnmount(ic,n)}catch{}switch(n.tag){case 5:St||_s(n,t);case 6:var r=ft,o=Cn;ft=null,Er(e,t,n),ft=r,Cn=o,ft!==null&&(Cn?(e=ft,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ft.removeChild(n.stateNode));break;case 18:ft!==null&&(Cn?(e=ft,n=n.stateNode,e.nodeType===8?md(e.parentNode,n):e.nodeType===1&&md(e,n),vl(e)):md(ft,n.stateNode));break;case 4:r=ft,o=Cn,ft=n.stateNode.containerInfo,Cn=!0,Er(e,t,n),ft=r,Cn=o;break;case 0:case 11:case 14:case 15:if(!St&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Df(n,t,i),o=o.next}while(o!==r)}Er(e,t,n);break;case 1:if(!St&&(_s(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){qe(n,t,l)}Er(e,t,n);break;case 21:Er(e,t,n);break;case 22:n.mode&1?(St=(r=St)||n.memoizedState!==null,Er(e,t,n),St=r):Er(e,t,n);break;default:Er(e,t,n)}}function Qg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new V1),t.forEach(function(r){var o=q1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function wn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=i),r&=~s}if(r=o,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*B1(r/1960))-r,10e?16:e,Gr===null)var r=!1;else{if(e=Gr,Gr=null,Nu=0,_e&6)throw Error(D(331));var o=_e;for(_e|=4,q=e.current;q!==null;){var s=q,i=s.child;if(q.flags&16){var l=s.deletions;if(l!==null){for(var a=0;aYe()-Ch?Io(e,0):Sh|=n),Bt(e,t)}function Lx(e,t){t===0&&(e.mode&1?(t=wa,wa<<=1,!(wa&130023424)&&(wa=4194304)):t=1);var n=Nt();e=vr(e,t),e!==null&&(ea(e,t,n),Bt(e,n))}function Z1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lx(e,n)}function q1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(D(314))}r!==null&&r.delete(t),Lx(e,n)}var Vx;Vx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$t.current)Vt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vt=!1,F1(e,t,n);Vt=!!(e.flags&131072)}else Vt=!1,$e&&t.flags&1048576&&Uw(t,Su,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ya(e,t),e=t.pendingProps;var o=ti(t,Ct.current);Os(t,n),o=mh(null,t,r,e,o,n);var s=gh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zt(r)?(s=!0,wu(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ch(t),o.updater=pc,t.stateNode=o,o._reactInternals=t,Nf(t,r,e,n),t=Mf(null,t,r,!0,s,n)):(t.tag=0,$e&&s&&rh(t),Pt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ya(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=X1(r),e=xn(r,e),o){case 0:t=Af(null,t,r,e,n);break e;case 1:t=Wg(null,t,r,e,n);break e;case 11:t=Ug(null,t,r,e,n);break e;case 14:t=Hg(null,t,r,xn(r.type,e),n);break e}throw Error(D(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xn(r,o),Af(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xn(r,o),Wg(e,t,r,o,n);case 3:e:{if(Cx(t),e===null)throw Error(D(387));r=t.pendingProps,s=t.memoizedState,o=s.element,qw(e,t),bu(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=si(Error(D(423)),t),t=Gg(e,t,r,n,o);break e}else if(r!==o){o=si(Error(D(424)),t),t=Gg(e,t,r,n,o);break e}else for(Yt=Yr(t.stateNode.containerInfo.firstChild),Jt=t,$e=!0,_n=null,n=Kw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ni(),r===o){t=yr(e,t,n);break e}Pt(e,t,r,n)}t=t.child}return t;case 5:return Qw(t),e===null&&kf(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Cf(r,o)?i=null:s!==null&&Cf(r,s)&&(t.flags|=32),Sx(e,t),Pt(e,t,i,n),t.child;case 6:return e===null&&kf(t),null;case 13:return _x(e,t,n);case 4:return dh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ri(t,null,r,n):Pt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xn(r,o),Ug(e,t,r,o,n);case 7:return Pt(e,t,t.pendingProps,n),t.child;case 8:return Pt(e,t,t.pendingProps.children,n),t.child;case 12:return Pt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,Ie(Cu,r._currentValue),r._currentValue=i,s!==null)if(An(s.value,i)){if(s.children===o.children&&!$t.current){t=yr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=pr(-1,n&-n),a.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Pf(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(D(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Pf(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}Pt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Os(t,n),o=gn(o),r=r(o),t.flags|=1,Pt(e,t,r,n),t.child;case 14:return r=t.type,o=xn(r,t.pendingProps),o=xn(r.type,o),Hg(e,t,r,o,n);case 15:return wx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:xn(r,o),Ya(e,t),t.tag=1,zt(r)?(e=!0,wu(t)):e=!1,Os(t,n),gx(t,r,o),Nf(t,r,o,n),Mf(null,t,r,!0,e,n);case 19:return bx(e,t,n);case 22:return xx(e,t,n)}throw Error(D(156,t.tag))};function $x(e,t){return pw(e,t)}function Q1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,r){return new Q1(e,t,n,r)}function Eh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function X1(e){if(typeof e=="function")return Eh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Wp)return 11;if(e===Gp)return 14}return 2}function no(e,t){var n=e.alternate;return n===null?(n=fn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function tu(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")Eh(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case hs:return Fo(n.children,o,s,t);case Hp:i=8,o|=8;break;case Jd:return e=fn(12,n,t,o|2),e.elementType=Jd,e.lanes=s,e;case ef:return e=fn(13,n,t,o),e.elementType=ef,e.lanes=s,e;case tf:return e=fn(19,n,t,o),e.elementType=tf,e.lanes=s,e;case Qy:return gc(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zy:i=10;break e;case qy:i=9;break e;case Wp:i=11;break e;case Gp:i=14;break e;case Ar:i=16,r=null;break e}throw Error(D(130,e==null?e:typeof e,""))}return t=fn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Fo(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function gc(e,t,n,r){return e=fn(22,e,r,t),e.elementType=Qy,e.lanes=n,e.stateNode={isHidden:!1},e}function _d(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function bd(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Y1(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=od(0),this.expirationTimes=od(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=od(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function kh(e,t,n,r,o,s,i,l,a){return e=new Y1(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=fn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ch(s),e}function J1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hx)}catch(e){console.error(e)}}Hx(),Hy.exports=on;var Jo=Hy.exports;const oE=jy(Jo);var ov=Jo;Xd.createRoot=ov.createRoot,Xd.hydrateRoot=ov.hydrateRoot;function sE(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,o,s,i=[],l="",a=e.split("/");for(a[0]||a.shift();o=a.shift();)n=o[0],n==="*"?(i.push(n),l+=o[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=o.indexOf("?",1),s=o.indexOf(".",1),i.push(o.substring(1,~r?r:~s?s:o.length)),l+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(l+=(~r?"?":"")+"\\"+o.substring(s))):l+="/"+o;return{keys:i,pattern:new RegExp("^"+l+(t?"(?=$|/)":"/?$"),"i")}}var Wx={exports:{}},Gx={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var li=g;function iE(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var lE=typeof Object.is=="function"?Object.is:iE,aE=li.useState,uE=li.useEffect,cE=li.useLayoutEffect,dE=li.useDebugValue;function fE(e,t){var n=t(),r=aE({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return cE(function(){o.value=n,o.getSnapshot=t,Rd(o)&&s({inst:o})},[e,n,t]),uE(function(){return Rd(o)&&s({inst:o}),e(function(){Rd(o)&&s({inst:o})})},[e]),dE(n),n}function Rd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!lE(e,n)}catch{return!0}}function pE(e,t){return t()}var hE=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?pE:fE;Gx.useSyncExternalStore=li.useSyncExternalStore!==void 0?li.useSyncExternalStore:hE;Wx.exports=Gx;var mE=Wx.exports;const gE=By.useInsertionEffect,vE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yE=vE?g.useLayoutEffect:g.useEffect,wE=gE||yE,Kx=e=>{const t=g.useRef([e,(...n)=>t[0](...n)]).current;return wE(()=>{t[0]=e}),t[1]},xE="popstate",jh="pushState",Ah="replaceState",SE="hashchange",sv=[xE,jh,Ah,SE],CE=e=>{for(const t of sv)addEventListener(t,e);return()=>{for(const t of sv)removeEventListener(t,e)}},Zx=(e,t)=>mE.useSyncExternalStore(CE,e,t),_E=()=>location.search,bE=({ssrSearch:e=""}={})=>Zx(_E,()=>e),iv=()=>location.pathname,RE=({ssrPath:e}={})=>Zx(iv,e?()=>e:iv),EE=(e,{replace:t=!1,state:n=null}={})=>history[t?Ah:jh](n,"",e),kE=(e={})=>[RE(e),EE],lv=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[lv]>"u"){for(const e of[jh,Ah]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,lv,{value:!0})}const PE=(e="",t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",TE=(e,t="")=>e[0]==="~"?e.slice(1):t+e,NE=e=>{try{return decodeURI(e)}catch{return e}},qx={hook:kE,searchHook:bE,parser:sE,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},Qx=g.createContext(qx),Sc=()=>g.useContext(Qx),Xx={},Yx=g.createContext(Xx),jE=()=>g.useContext(Yx),Mh=e=>{const[t,n]=e.hook(e);return[NE(PE(e.base,t)),Kx((r,o)=>n(TE(r,e.base),o))]},AE=()=>Mh(Sc()),ME=(e,t,n,r)=>{const{pattern:o,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),i=o.exec(n)||[],[l,...a]=i;return l!==void 0?[!0,(()=>{const u=s!==!1?Object.fromEntries(s.map((d,p)=>[d,a[p]])):i.groups;let c={...a};return u&&Object.assign(c,u),c})(),...r?[l]:[]]:[!1,null]},Jx=({children:e,...t})=>{var c,d;const n=Sc(),r=t.hook?qx:n;let o=r;const[s,i]=((c=t.ssrPath)==null?void 0:c.split("?"))??[];i&&(t.ssrSearch=i,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let l=g.useRef({}),a=l.current,u=a;for(let p in r){const h=p==="base"?r[p]+(t[p]||""):t[p]||r[p];a===u&&h!==u[p]&&(l.current=u={...u}),u[p]=h,h!==r[p]&&(o=u)}return g.createElement(Qx.Provider,{value:o,children:e})},av=({children:e,component:t},n)=>t?g.createElement(t,{params:n}):typeof e=="function"?e(n):e,OE=e=>{let t=g.useRef(Xx),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return t.current=n},Fi=({path:e,nest:t,match:n,...r})=>{const o=Sc(),[s]=Mh(o),[i,l,a]=n??ME(o.parser,e,s,t),u=OE({...jE(),...l});if(!i)return null;const c=a?g.createElement(Jx,{base:a},av(r,u)):av(r,u);return g.createElement(Yx.Provider,{value:u,children:c})},Mu=g.forwardRef((e,t)=>{const n=Sc(),[r,o]=Mh(n),{to:s,href:i=s,onClick:l,asChild:a,children:u,className:c,replace:d,state:p,...h}=e,m=Kx(S=>{S.ctrlKey||S.metaKey||S.altKey||S.shiftKey||S.button!==0||(l==null||l(S),S.defaultPrevented||(S.preventDefault(),o(i,e)))}),w=n.hrefs(i[0]==="~"?i.slice(1):n.base+i,n);return a&&g.isValidElement(u)?g.cloneElement(u,{onClick:m,href:w}):g.createElement("a",{...h,onClick:m,href:w,className:c!=null&&c.call?c(r===i):c,children:u,ref:t})});var Si=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ai=typeof window>"u"||"Deno"in globalThis;function an(){}function IE(e,t){return typeof e=="function"?e(t):e}function Wf(e){return typeof e=="number"&&e>=0&&e!==1/0}function e0(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fs(e,t){return typeof e=="function"?e(t):e}function bn(e,t){return typeof e=="function"?e(t):e}function uv(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:l}=e;if(i){if(r){if(t.queryHash!==Oh(i,t.options))return!1}else if(!Tl(t.queryKey,i))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||s&&!s(t))}function cv(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wo(t.options.mutationKey)!==Wo(s))return!1}else if(!Tl(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Oh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wo)(e)}function Wo(e){return JSON.stringify(e,(t,n)=>Gf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Tl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Tl(e[n],t[n])):!1}function t0(e,t){if(e===t)return e;const n=dv(e)&&dv(t);if(n||Gf(e)&&Gf(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,l=n?[]:{};let a=0;for(let u=0;u{setTimeout(t,e)})}function Kf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?t0(e,t):t}function DE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function LE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var n0=Symbol();function r0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===n0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Po,Dr,zs,Sy,VE=(Sy=class extends Si{constructor(){super();ie(this,Po);ie(this,Dr);ie(this,zs);Z(this,zs,t=>{if(!ai&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){R(this,Dr)||this.setEventListener(R(this,zs))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,Dr))==null||t.call(this),Z(this,Dr,void 0))}setEventListener(t){var n;Z(this,zs,t),(n=R(this,Dr))==null||n.call(this),Z(this,Dr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){R(this,Po)!==t&&(Z(this,Po,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof R(this,Po)=="boolean"?R(this,Po):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Po=new WeakMap,Dr=new WeakMap,zs=new WeakMap,Sy),Ih=new VE,Bs,Lr,Us,Cy,$E=(Cy=class extends Si{constructor(){super();ie(this,Bs,!0);ie(this,Lr);ie(this,Us);Z(this,Us,t=>{if(!ai&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){R(this,Lr)||this.setEventListener(R(this,Us))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,Lr))==null||t.call(this),Z(this,Lr,void 0))}setEventListener(t){var n;Z(this,Us,t),(n=R(this,Lr))==null||n.call(this),Z(this,Lr,t(this.setOnline.bind(this)))}setOnline(t){R(this,Bs)!==t&&(Z(this,Bs,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return R(this,Bs)}},Bs=new WeakMap,Lr=new WeakMap,Us=new WeakMap,Cy),Iu=new $E;function zE(e){return Math.min(1e3*2**e,3e4)}function o0(e){return(e??"online")==="online"?Iu.isOnline():!0}var s0=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ed(e){return e instanceof s0}function i0(e){let t=!1,n=0,r=!1,o,s,i;const l=new Promise((y,v)=>{s=y,i=v}),a=y=>{var v;r||(m(new s0(y)),(v=e.abort)==null||v.call(e))},u=()=>{t=!0},c=()=>{t=!1},d=()=>Ih.isFocused()&&(e.networkMode==="always"||Iu.isOnline())&&e.canRun(),p=()=>o0(e.networkMode)&&e.canRun(),h=y=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,y),o==null||o(),s(y))},m=y=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,y),o==null||o(),i(y))},w=()=>new Promise(y=>{var v;o=x=>{(r||d())&&y(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),S=()=>{if(r)return;let y;const v=n===0?e.initialPromise:void 0;try{y=v??e.fn()}catch(x){y=Promise.reject(x)}Promise.resolve(y).then(h).catch(x=>{var E;if(r)return;const C=e.retry??(ai?0:3),_=e.retryDelay??zE,P=typeof _=="function"?_(n,x):_,k=C===!0||typeof C=="number"&&nd()?void 0:w()).then(()=>{t?m(x):S()})})};return{promise:l,cancel:a,continue:()=>(o==null||o(),l),cancelRetry:u,continueRetry:c,canStart:p,start:()=>(p()?S():w().then(S),l)}}function BE(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const s=p=>{o=p},i=p=>{let h;t++;try{h=p()}finally{t--,t||u()}return h},l=p=>{t?e.push(p):o(()=>{n(p)})},a=p=>(...h)=>{l(()=>{p(...h)})},u=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:a,schedule:l,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:s}}var st=BE(),To,_y,l0=(_y=class{constructor(){ie(this,To)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Wf(this.gcTime)&&Z(this,To,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ai?1/0:5*60*1e3))}clearGcTimeout(){R(this,To)&&(clearTimeout(R(this,To)),Z(this,To,void 0))}},To=new WeakMap,_y),Hs,Ws,ln,xt,ql,No,Sn,or,by,UE=(by=class extends l0{constructor(t){super();ie(this,Sn);ie(this,Hs);ie(this,Ws);ie(this,ln);ie(this,xt);ie(this,ql);ie(this,No);Z(this,No,!1),Z(this,ql,t.defaultOptions),this.setOptions(t.options),this.observers=[],Z(this,ln,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Z(this,Hs,t.state||HE(this.options)),this.state=R(this,Hs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=R(this,xt))==null?void 0:t.promise}setOptions(t){this.options={...R(this,ql),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,ln).remove(this)}setData(t,n){const r=Kf(this.state.data,t,this.options);return ge(this,Sn,or).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ge(this,Sn,or).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=R(this,xt))==null?void 0:r.promise;return(o=R(this,xt))==null||o.cancel(t),n?n.then(an).catch(an):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(R(this,Hs))}isActive(){return this.observers.some(t=>bn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!e0(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=R(this,xt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=R(this,xt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),R(this,ln).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(R(this,xt)&&(R(this,No)?R(this,xt).cancel({revert:!0}):R(this,xt).cancelRetry()),this.scheduleGc()),R(this,ln).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ge(this,Sn,or).call(this,{type:"invalidate"})}fetch(t,n){var a,u,c;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(R(this,xt))return R(this,xt).continueRetry(),R(this,xt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,o=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(Z(this,No,!0),r.signal)})},s=()=>{const d=r0(this.options,n),p={queryKey:this.queryKey,meta:this.meta};return o(p),Z(this,No,!1),this.options.persister?this.options.persister(d,p,this):d(p)},i={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(i),(a=this.options.behavior)==null||a.onFetch(i,this),Z(this,Ws,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=i.fetchOptions)==null?void 0:u.meta))&&ge(this,Sn,or).call(this,{type:"fetch",meta:(c=i.fetchOptions)==null?void 0:c.meta});const l=d=>{var p,h,m,w;Ed(d)&&d.silent||ge(this,Sn,or).call(this,{type:"error",error:d}),Ed(d)||((h=(p=R(this,ln).config).onError)==null||h.call(p,d,this),(w=(m=R(this,ln).config).onSettled)==null||w.call(m,this.state.data,d,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Z(this,xt,i0({initialPromise:n==null?void 0:n.initialPromise,fn:i.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,w;if(d===void 0){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(d),(h=(p=R(this,ln).config).onSuccess)==null||h.call(p,d,this),(w=(m=R(this,ln).config).onSettled)==null||w.call(m,d,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(d,p)=>{ge(this,Sn,or).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{ge(this,Sn,or).call(this,{type:"pause"})},onContinue:()=>{ge(this,Sn,or).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),R(this,xt).start()}},Hs=new WeakMap,Ws=new WeakMap,ln=new WeakMap,xt=new WeakMap,ql=new WeakMap,No=new WeakMap,Sn=new WeakSet,or=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...a0(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ed(o)&&o.revert&&R(this,Ws)?{...R(this,Ws),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),st.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),R(this,ln).notify({query:this,type:"updated",action:t})})},by);function a0(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function HE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Vn,Ry,WE=(Ry=class extends Si{constructor(t={}){super();ie(this,Vn);this.config=t,Z(this,Vn,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Oh(o,n);let i=this.get(s);return i||(i=new UE({cache:this,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){R(this,Vn).has(t.queryHash)||(R(this,Vn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=R(this,Vn).get(t.queryHash);n&&(t.destroy(),n===t&&R(this,Vn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){st.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return R(this,Vn).get(t)}getAll(){return[...R(this,Vn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>uv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>uv(t,r)):n}notify(t){st.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){st.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){st.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vn=new WeakMap,Ry),$n,Et,jo,zn,Nr,Ey,GE=(Ey=class extends l0{constructor(t){super();ie(this,zn);ie(this,$n);ie(this,Et);ie(this,jo);this.mutationId=t.mutationId,Z(this,Et,t.mutationCache),Z(this,$n,[]),this.state=t.state||u0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){R(this,$n).includes(t)||(R(this,$n).push(t),this.clearGcTimeout(),R(this,Et).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Z(this,$n,R(this,$n).filter(n=>n!==t)),this.scheduleGc(),R(this,Et).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){R(this,$n).length||(this.state.status==="pending"?this.scheduleGc():R(this,Et).remove(this))}continue(){var t;return((t=R(this,jo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,i,l,a,u,c,d,p,h,m,w,S,y,v,x,C,_,P,k;Z(this,jo,i0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,I)=>{ge(this,zn,Nr).call(this,{type:"failed",failureCount:E,error:I})},onPause:()=>{ge(this,zn,Nr).call(this,{type:"pause"})},onContinue:()=>{ge(this,zn,Nr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,Et).canRun(this)}));const n=this.state.status==="pending",r=!R(this,jo).canStart();try{if(!n){ge(this,zn,Nr).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(o=R(this,Et).config).onMutate)==null?void 0:s.call(o,t,this));const I=await((l=(i=this.options).onMutate)==null?void 0:l.call(i,t));I!==this.state.context&&ge(this,zn,Nr).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const E=await R(this,jo).start();return await((u=(a=R(this,Et).config).onSuccess)==null?void 0:u.call(a,E,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,E,t,this.state.context)),await((h=(p=R(this,Et).config).onSettled)==null?void 0:h.call(p,E,null,this.state.variables,this.state.context,this)),await((w=(m=this.options).onSettled)==null?void 0:w.call(m,E,null,t,this.state.context)),ge(this,zn,Nr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((y=(S=R(this,Et).config).onError)==null?void 0:y.call(S,E,t,this.state.context,this)),await((x=(v=this.options).onError)==null?void 0:x.call(v,E,t,this.state.context)),await((_=(C=R(this,Et).config).onSettled)==null?void 0:_.call(C,void 0,E,this.state.variables,this.state.context,this)),await((k=(P=this.options).onSettled)==null?void 0:k.call(P,void 0,E,t,this.state.context)),E}finally{ge(this,zn,Nr).call(this,{type:"error",error:E})}}finally{R(this,Et).runNext(this)}}},$n=new WeakMap,Et=new WeakMap,jo=new WeakMap,zn=new WeakSet,Nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),st.batch(()=>{R(this,$n).forEach(r=>{r.onMutationUpdate(t)}),R(this,Et).notify({mutation:this,type:"updated",action:t})})},Ey);function u0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Gt,Ql,ky,KE=(ky=class extends Si{constructor(t={}){super();ie(this,Gt);ie(this,Ql);this.config=t,Z(this,Gt,new Map),Z(this,Ql,Date.now())}build(t,n,r){const o=new GE({mutationCache:this,mutationId:++pa(this,Ql)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=ja(t),r=R(this,Gt).get(n)??[];r.push(t),R(this,Gt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ja(t);if(R(this,Gt).has(n)){const o=(r=R(this,Gt).get(n))==null?void 0:r.filter(s=>s!==t);o&&(o.length===0?R(this,Gt).delete(n):R(this,Gt).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=R(this,Gt).get(ja(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=R(this,Gt).get(ja(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){st.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...R(this,Gt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cv(n,r))}findAll(t={}){return this.getAll().filter(n=>cv(t,n))}notify(t){st.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return st.batch(()=>Promise.all(t.map(n=>n.continue().catch(an))))}},Gt=new WeakMap,Ql=new WeakMap,ky);function ja(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function ZE(e){return{onFetch:(t,n)=>{const r=async()=>{var m,w,S,y,v;const o=t.options,s=(S=(w=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:w.fetchMore)==null?void 0:S.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],l=((v=t.state.data)==null?void 0:v.pageParams)||[],a={pages:[],pageParams:[]};let u=!1;const c=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=r0(t.options,t.fetchOptions),p=async(x,C,_)=>{if(u)return Promise.reject();if(C==null&&x.pages.length)return Promise.resolve(x);const P={queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};c(P);const k=await d(P),{maxPages:E}=t.options,I=_?LE:DE;return{pages:I(x.pages,k,E),pageParams:I(x.pageParams,C,E)}};let h;if(s&&i.length){const x=s==="backward",C=x?qE:pv,_={pages:i,pageParams:l},P=C(o,_);h=await p(_,P,x)}else{h=await p(a,l[0]??o.initialPageParam);const x=e??i.length;for(let C=1;C{var o,s;return(s=(o=t.options).persister)==null?void 0:s.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function pv(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qE(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ge,Vr,$r,Gs,Ks,zr,Zs,qs,Py,QE=(Py=class{constructor(e={}){ie(this,Ge);ie(this,Vr);ie(this,$r);ie(this,Gs);ie(this,Ks);ie(this,zr);ie(this,Zs);ie(this,qs);Z(this,Ge,e.queryCache||new WE),Z(this,Vr,e.mutationCache||new KE),Z(this,$r,e.defaultOptions||{}),Z(this,Gs,new Map),Z(this,Ks,new Map),Z(this,zr,0)}mount(){pa(this,zr)._++,R(this,zr)===1&&(Z(this,Zs,Ih.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,Ge).onFocus())})),Z(this,qs,Iu.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,Ge).onOnline())})))}unmount(){var e,t;pa(this,zr)._--,R(this,zr)===0&&((e=R(this,Zs))==null||e.call(this),Z(this,Zs,void 0),(t=R(this,qs))==null||t.call(this),Z(this,qs,void 0))}isFetching(e){return R(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return R(this,Vr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=R(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=R(this,Ge).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Fs(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return R(this,Ge).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=R(this,Ge).get(r.queryHash),s=o==null?void 0:o.state.data,i=IE(t,s);if(i!==void 0)return R(this,Ge).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return st.batch(()=>R(this,Ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=R(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=R(this,Ge);st.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=R(this,Ge),r={type:"active",...e};return st.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=st.batch(()=>R(this,Ge).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(an).catch(an)}invalidateQueries(e={},t={}){return st.batch(()=>{if(R(this,Ge).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=st.batch(()=>R(this,Ge).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(an)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(an)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=R(this,Ge).build(this,t);return n.isStaleByTime(Fs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(an).catch(an)}fetchInfiniteQuery(e){return e.behavior=ZE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(an).catch(an)}resumePausedMutations(){return Iu.isOnline()?R(this,Vr).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,Ge)}getMutationCache(){return R(this,Vr)}getDefaultOptions(){return R(this,$r)}setDefaultOptions(e){Z(this,$r,e)}setQueryDefaults(e,t){R(this,Gs).set(Wo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...R(this,Gs).values()];let n={};return t.forEach(r=>{Tl(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){R(this,Ks).set(Wo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...R(this,Ks).values()];let n={};return t.forEach(r=>{Tl(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...R(this,$r).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Oh(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===n0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...R(this,$r).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){R(this,Ge).clear(),R(this,Vr).clear()}},Ge=new WeakMap,Vr=new WeakMap,$r=new WeakMap,Gs=new WeakMap,Ks=new WeakMap,zr=new WeakMap,Zs=new WeakMap,qs=new WeakMap,Py),Ft,Se,Xl,kt,Ao,Qs,Bn,Yl,Xs,Ys,Mo,Oo,Br,Js,je,Gi,Zf,qf,Qf,Xf,Yf,Jf,ep,c0,Ty,XE=(Ty=class extends Si{constructor(t,n){super();ie(this,je);ie(this,Ft);ie(this,Se);ie(this,Xl);ie(this,kt);ie(this,Ao);ie(this,Qs);ie(this,Bn);ie(this,Yl);ie(this,Xs);ie(this,Ys);ie(this,Mo);ie(this,Oo);ie(this,Br);ie(this,Js,new Set);this.options=n,Z(this,Ft,t),Z(this,Bn,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Se).addObserver(this),hv(R(this,Se),this.options)?ge(this,je,Gi).call(this):this.updateResult(),ge(this,je,Xf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return tp(R(this,Se),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return tp(R(this,Se),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ge(this,je,Yf).call(this),ge(this,je,Jf).call(this),R(this,Se).removeObserver(this)}setOptions(t,n){const r=this.options,o=R(this,Se);if(this.options=R(this,Ft).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bn(this.options.enabled,R(this,Se))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ge(this,je,ep).call(this),R(this,Se).setOptions(this.options),r._defaulted&&!Ou(this.options,r)&&R(this,Ft).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Se),observer:this});const s=this.hasListeners();s&&mv(R(this,Se),o,this.options,r)&&ge(this,je,Gi).call(this),this.updateResult(n),s&&(R(this,Se)!==o||bn(this.options.enabled,R(this,Se))!==bn(r.enabled,R(this,Se))||Fs(this.options.staleTime,R(this,Se))!==Fs(r.staleTime,R(this,Se)))&&ge(this,je,Zf).call(this);const i=ge(this,je,qf).call(this);s&&(R(this,Se)!==o||bn(this.options.enabled,R(this,Se))!==bn(r.enabled,R(this,Se))||i!==R(this,Br))&&ge(this,je,Qf).call(this,i)}getOptimisticResult(t){const n=R(this,Ft).getQueryCache().build(R(this,Ft),t),r=this.createResult(n,t);return JE(this,r)&&(Z(this,kt,r),Z(this,Qs,this.options),Z(this,Ao,R(this,Se).state)),r}getCurrentResult(){return R(this,kt)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){R(this,Js).add(t)}getCurrentQuery(){return R(this,Se)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=R(this,Ft).defaultQueryOptions(t),r=R(this,Ft).getQueryCache().build(R(this,Ft),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ge(this,je,Gi).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,kt)))}createResult(t,n){var k;const r=R(this,Se),o=this.options,s=R(this,kt),i=R(this,Ao),l=R(this,Qs),u=t!==r?t.state:R(this,Xl),{state:c}=t;let d={...c},p=!1,h;if(n._optimisticResults){const E=this.hasListeners(),I=!E&&hv(t,n),O=E&&mv(t,r,n,o);(I||O)&&(d={...d,...a0(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:w,status:S}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(i==null?void 0:i.data)&&n.select===R(this,Yl))h=R(this,Xs);else try{Z(this,Yl,n.select),h=n.select(d.data),h=Kf(s==null?void 0:s.data,h,n),Z(this,Xs,h),Z(this,Bn,null)}catch(E){Z(this,Bn,E)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&S==="pending"){let E;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))E=s.data;else if(E=typeof n.placeholderData=="function"?n.placeholderData((k=R(this,Ys))==null?void 0:k.state.data,R(this,Ys)):n.placeholderData,n.select&&E!==void 0)try{E=n.select(E),Z(this,Bn,null)}catch(I){Z(this,Bn,I)}E!==void 0&&(S="success",h=Kf(s==null?void 0:s.data,E,n),p=!0)}R(this,Bn)&&(m=R(this,Bn),h=R(this,Xs),w=Date.now(),S="error");const y=d.fetchStatus==="fetching",v=S==="pending",x=S==="error",C=v&&y,_=h!==void 0;return{status:S,fetchStatus:d.fetchStatus,isPending:v,isSuccess:S==="success",isError:x,isInitialLoading:C,isLoading:C,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:w,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:y,isRefetching:y&&!v,isLoadingError:x&&!_,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:x&&_,isStale:Fh(t,n),refetch:this.refetch}}updateResult(t){const n=R(this,kt),r=this.createResult(R(this,Se),this.options);if(Z(this,Ao,R(this,Se).state),Z(this,Qs,this.options),R(this,Ao).data!==void 0&&Z(this,Ys,R(this,Se)),Ou(r,n))return;Z(this,kt,r);const o={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:i}=this.options,l=typeof i=="function"?i():i;if(l==="all"||!l&&!R(this,Js).size)return!0;const a=new Set(l??R(this,Js));return this.options.throwOnError&&a.add("error"),Object.keys(R(this,kt)).some(u=>{const c=u;return R(this,kt)[c]!==n[c]&&a.has(c)})};(t==null?void 0:t.listeners)!==!1&&s()&&(o.listeners=!0),ge(this,je,c0).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ge(this,je,Xf).call(this)}},Ft=new WeakMap,Se=new WeakMap,Xl=new WeakMap,kt=new WeakMap,Ao=new WeakMap,Qs=new WeakMap,Bn=new WeakMap,Yl=new WeakMap,Xs=new WeakMap,Ys=new WeakMap,Mo=new WeakMap,Oo=new WeakMap,Br=new WeakMap,Js=new WeakMap,je=new WeakSet,Gi=function(t){ge(this,je,ep).call(this);let n=R(this,Se).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(an)),n},Zf=function(){ge(this,je,Yf).call(this);const t=Fs(this.options.staleTime,R(this,Se));if(ai||R(this,kt).isStale||!Wf(t))return;const r=e0(R(this,kt).dataUpdatedAt,t)+1;Z(this,Mo,setTimeout(()=>{R(this,kt).isStale||this.updateResult()},r))},qf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Se)):this.options.refetchInterval)??!1},Qf=function(t){ge(this,je,Jf).call(this),Z(this,Br,t),!(ai||bn(this.options.enabled,R(this,Se))===!1||!Wf(R(this,Br))||R(this,Br)===0)&&Z(this,Oo,setInterval(()=>{(this.options.refetchIntervalInBackground||Ih.isFocused())&&ge(this,je,Gi).call(this)},R(this,Br)))},Xf=function(){ge(this,je,Zf).call(this),ge(this,je,Qf).call(this,ge(this,je,qf).call(this))},Yf=function(){R(this,Mo)&&(clearTimeout(R(this,Mo)),Z(this,Mo,void 0))},Jf=function(){R(this,Oo)&&(clearInterval(R(this,Oo)),Z(this,Oo,void 0))},ep=function(){const t=R(this,Ft).getQueryCache().build(R(this,Ft),this.options);if(t===R(this,Se))return;const n=R(this,Se);Z(this,Se,t),Z(this,Xl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},c0=function(t){st.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(R(this,kt))}),R(this,Ft).getQueryCache().notify({query:R(this,Se),type:"observerResultsUpdated"})})},Ty);function YE(e,t){return bn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function hv(e,t){return YE(e,t)||e.state.data!==void 0&&tp(e,t,t.refetchOnMount)}function tp(e,t,n){if(bn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Fh(e,t)}return!1}function mv(e,t,n,r){return(e!==t||bn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Fh(e,n)}function Fh(e,t){return bn(t.enabled,e)!==!1&&e.isStaleByTime(Fs(t.staleTime,e))}function JE(e,t){return!Ou(e.getCurrentResult(),t)}var Ur,Hr,Dt,cr,hr,nu,np,Ny,ek=(Ny=class extends Si{constructor(n,r){super();ie(this,hr);ie(this,Ur);ie(this,Hr);ie(this,Dt);ie(this,cr);Z(this,Ur,n),this.setOptions(r),this.bindMethods(),ge(this,hr,nu).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=R(this,Ur).defaultMutationOptions(n),Ou(this.options,r)||R(this,Ur).getMutationCache().notify({type:"observerOptionsUpdated",mutation:R(this,Dt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Wo(r.mutationKey)!==Wo(this.options.mutationKey)?this.reset():((o=R(this,Dt))==null?void 0:o.state.status)==="pending"&&R(this,Dt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=R(this,Dt))==null||n.removeObserver(this)}onMutationUpdate(n){ge(this,hr,nu).call(this),ge(this,hr,np).call(this,n)}getCurrentResult(){return R(this,Hr)}reset(){var n;(n=R(this,Dt))==null||n.removeObserver(this),Z(this,Dt,void 0),ge(this,hr,nu).call(this),ge(this,hr,np).call(this)}mutate(n,r){var o;return Z(this,cr,r),(o=R(this,Dt))==null||o.removeObserver(this),Z(this,Dt,R(this,Ur).getMutationCache().build(R(this,Ur),this.options)),R(this,Dt).addObserver(this),R(this,Dt).execute(n)}},Ur=new WeakMap,Hr=new WeakMap,Dt=new WeakMap,cr=new WeakMap,hr=new WeakSet,nu=function(){var r;const n=((r=R(this,Dt))==null?void 0:r.state)??u0();Z(this,Hr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},np=function(n){st.batch(()=>{var r,o,s,i,l,a,u,c;if(R(this,cr)&&this.hasListeners()){const d=R(this,Hr).variables,p=R(this,Hr).context;(n==null?void 0:n.type)==="success"?((o=(r=R(this,cr)).onSuccess)==null||o.call(r,n.data,d,p),(i=(s=R(this,cr)).onSettled)==null||i.call(s,n.data,null,d,p)):(n==null?void 0:n.type)==="error"&&((a=(l=R(this,cr)).onError)==null||a.call(l,n.error,d,p),(c=(u=R(this,cr)).onSettled)==null||c.call(u,void 0,n.error,d,p))}this.listeners.forEach(d=>{d(R(this,Hr))})})},Ny),d0=g.createContext(void 0),f0=e=>{const t=g.useContext(d0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tk=({client:e,children:t})=>(g.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),f.jsx(d0.Provider,{value:e,children:t})),p0=g.createContext(!1),nk=()=>g.useContext(p0);p0.Provider;function rk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ok=g.createContext(rk()),sk=()=>g.useContext(ok);function h0(e,t){return typeof e=="function"?e(...t):!!e}function ik(){}var lk=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},ak=e=>{g.useEffect(()=>{e.clearReset()},[e])},uk=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&h0(n,[e.error,r]),ck=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},dk=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,fk=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function pk(e,t,n){var u,c,d,p;const r=f0(),o=nk(),s=sk(),i=r.defaultQueryOptions(e);(c=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||c.call(u,i),i._optimisticResults=o?"isRestoring":"optimistic",ck(i),lk(i,s),ak(s);const[l]=g.useState(()=>new t(r,i)),a=l.getOptimisticResult(i);if(g.useSyncExternalStore(g.useCallback(h=>{const m=o?()=>{}:l.subscribe(st.batchCalls(h));return l.updateResult(),m},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),g.useEffect(()=>{l.setOptions(i,{listeners:!1})},[i,l]),dk(i,a))throw fk(i,l,s);if(uk({result:a,errorResetBoundary:s,throwOnError:i.throwOnError,query:r.getQueryCache().get(i.queryHash)}))throw a.error;return(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_afterQuery)==null||p.call(d,i,a),i.notifyOnChangeProps?a:l.trackResult(a)}function ui(e,t){return pk(e,XE)}function Cc(e,t){const n=f0(),[r]=g.useState(()=>new ek(n,e));g.useEffect(()=>{r.setOptions(e)},[r,e]);const o=g.useSyncExternalStore(g.useCallback(i=>r.subscribe(st.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=g.useCallback((i,l)=>{r.mutate(i,l).catch(ik)},[r]);if(o.error&&h0(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}const hk="data:image/svg+xml,%3csvg%20width='150'%20height='150'%20viewBox='0%200%20150%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='150'%20height='150'%20rx='28'%20fill='url(%23paint0_linear_3507_4162)'/%3e%3cpath%20d='M56.5387%2053.1882L38.0151%2064.1489L75.0623%2085.8511L93.586%2075L56.5387%2053.1882Z'%20fill='%2362D4F9'/%3e%3cpath%20d='M56.5387%2031.4859L38.0151%2042.337L93.586%2075L112%2064.1489L56.5387%2031.4859Z'%20fill='%23E16BFC'/%3e%3cpath%20d='M93.586%2075L75.0624%2085.8511V107.553L93.586%2096.7022V75Z'%20fill='%2335A6E7'/%3e%3cpath%20d='M112%2064.1489L93.5859%2075V96.7022L112%2085.8511V64.1489Z'%20fill='%239119F6'/%3e%3cpath%20d='M75.0623%2085.8511L56.5387%2096.8119L38.0151%2085.8511V107.663L56.5387%20118.514L75.0623%20107.553V85.8511Z'%20fill='%232163DF'/%3e%3cpath%20d='M38.0151%2085.8511L56.5387%2075L75.0623%2085.8511L56.5387%2096.8118L38.0151%2085.8511Z'%20fill='%23248AE3'/%3e%3cpath%20d='M38.0151%2064.1489V85.8511L56.5387%2075L38.0151%2064.1489Z'%20fill='%2335A6E7'/%3e%3cpath%20d='M38.0151%2042.337V64.1489L56.5387%2053.1882L38.0151%2042.337Z'%20fill='%239119F6'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_3507_4162'%20x1='75'%20y1='-32.5'%20x2='75'%20y2='196'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23351CC1'/%3e%3cstop%20offset='1'%20stop-color='%23190D5B'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";function gv({children:e}){return f.jsx("div",{className:"my-4",children:f.jsx("p",{className:"px-4 py-2 border rounded-lg",children:e})})}const mk=[{href:"/dashboard",text:"Dashboard"},{href:"/knowledge-bases",text:"Knowledge Bases"},{href:"/chatbots",text:"Chatbots"},{href:"/evaluations",text:"Evaluations"}],gk=[{href:"/api-keys",text:"API Keys"},{href:"/settings",text:"Settings"}];function vk(){return f.jsxs("div",{className:"flex flex-col justify-between fixed h-full w-72 bg-white z-10 px-12 py-8 border-r-2",children:[f.jsxs("nav",{children:[f.jsx("img",{src:hk,alt:"Paisley Logo",className:"size-12"}),mk.map(e=>f.jsx(Mu,{href:e.href,children:f.jsx(gv,{children:e.text})},e.href))]}),f.jsx("nav",{children:gk.map(e=>f.jsx(Mu,{href:e.href,children:f.jsx(gv,{children:e.text})},e.href))})]})}function m0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;tl(s)))==null?void 0:i.classGroupId}const vv=/^\[(.+)\]$/;function xk(e){if(vv.test(e)){const t=vv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function Sk(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return _k(Object.entries(e.classGroups),n).forEach(([s,i])=>{rp(i,r,s,t)}),r}function rp(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:yv(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Ck(o)){rp(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{rp(i,yv(t,s),n,r)})})}function yv(e,t){let n=e;return t.split(Dh).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function Ck(e){return e.isThemeGetter}function _k(e,t){return t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,l])=>[t+i,l])):s);return[n,o]}):e}function bk(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(s,i){n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)}return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}}const v0="!";function Rk(e){const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length;function i(l){const a=[];let u=0,c=0,d;for(let S=0;Sc?d-c:void 0;return{modifiers:a,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:w}}return n?function(a){return n({className:a,parseClassName:i})}:i}function Ek(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function kk(e){return{cache:bk(e.cacheSize),parseClassName:Rk(e),...wk(e)}}const Pk=/\s+/;function Tk(e,t){const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=new Set;return e.trim().split(Pk).map(i=>{const{modifiers:l,hasImportantModifier:a,baseClassName:u,maybePostfixModifierPosition:c}=n(i);let d=!!c,p=r(d?u.substring(0,c):u);if(!p){if(!d)return{isTailwindClass:!1,originalClassName:i};if(p=r(u),!p)return{isTailwindClass:!1,originalClassName:i};d=!1}const h=Ek(l).join(":");return{isTailwindClass:!0,modifierId:a?h+v0:h,classGroupId:p,originalClassName:i,hasPostfixModifier:d}}).reverse().filter(i=>{if(!i.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:u}=i,c=l+a;return s.has(c)?!1:(s.add(c),o(a,u).forEach(d=>s.add(l+d)),!0)}).reverse().map(i=>i.originalClassName).join(" ")}function Nk(){let e=0,t,n,r="";for(;ed(c),e());return n=kk(u),r=n.cache.get,o=n.cache.set,s=l,l(a)}function l(a){const u=r(a);if(u)return u;const c=Tk(a,n);return o(a,c),c}return function(){return s(Nk.apply(null,arguments))}}function De(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const w0=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ak=/^\d+\/\d+$/,Mk=new Set(["px","full","screen"]),Ok=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ik=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Fk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Dk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Lk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function nr(e){return Ro(e)||Mk.has(e)||Ak.test(e)}function kr(e){return Ci(e,"length",Gk)}function Ro(e){return!!e&&!Number.isNaN(Number(e))}function Aa(e){return Ci(e,"number",Ro)}function Di(e){return!!e&&Number.isInteger(Number(e))}function Vk(e){return e.endsWith("%")&&Ro(e.slice(0,-1))}function me(e){return w0.test(e)}function Pr(e){return Ok.test(e)}const $k=new Set(["length","size","percentage"]);function zk(e){return Ci(e,$k,x0)}function Bk(e){return Ci(e,"position",x0)}const Uk=new Set(["image","url"]);function Hk(e){return Ci(e,Uk,Zk)}function Wk(e){return Ci(e,"",Kk)}function Li(){return!0}function Ci(e,t,n){const r=w0.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function Gk(e){return Ik.test(e)&&!Fk.test(e)}function x0(){return!1}function Kk(e){return Dk.test(e)}function Zk(e){return Lk.test(e)}function qk(){const e=De("colors"),t=De("spacing"),n=De("blur"),r=De("brightness"),o=De("borderColor"),s=De("borderRadius"),i=De("borderSpacing"),l=De("borderWidth"),a=De("contrast"),u=De("grayscale"),c=De("hueRotate"),d=De("invert"),p=De("gap"),h=De("gradientColorStops"),m=De("gradientColorStopPositions"),w=De("inset"),S=De("margin"),y=De("opacity"),v=De("padding"),x=De("saturate"),C=De("scale"),_=De("sepia"),P=De("skew"),k=De("space"),E=De("translate"),I=()=>["auto","contain","none"],O=()=>["auto","hidden","clip","visible","scroll"],Y=()=>["auto",me,t],F=()=>[me,t],G=()=>["",nr,kr],X=()=>["auto",Ro,me],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",me],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],se=()=>[Ro,Aa],he=()=>[Ro,me];return{cacheSize:500,separator:":",theme:{colors:[Li],spacing:[nr,kr],blur:["none","",Pr,me],brightness:se(),borderColor:[e],borderRadius:["none","","full",Pr,me],borderSpacing:F(),borderWidth:G(),contrast:se(),grayscale:j(),hueRotate:he(),invert:j(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[Vk,kr],inset:Y(),margin:Y(),opacity:se(),padding:F(),saturate:se(),scale:se(),sepia:j(),skew:he(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[Pr]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),me]}],overflow:[{overflow:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Di,me]}],basis:[{basis:Y()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Di,me]}],"grid-cols":[{"grid-cols":[Li]}],"col-start-end":[{col:["auto",{span:["full",Di,me]},me]}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":[Li]}],"row-start-end":[{row:["auto",{span:[Di,me]},me]}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,t]}],"min-w":[{"min-w":[me,t,"min","max","fit"]}],"max-w":[{"max-w":[me,t,"none","full","min","max","fit","prose",{screen:[Pr]},Pr]}],h:[{h:[me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Pr,kr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Aa]}],"font-family":[{font:[Li]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",me]}],"line-clamp":[{"line-clamp":["none",Ro,Aa]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,kr]}],"underline-offset":[{"underline-offset":["auto",nr,me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),Bk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",zk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:re()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[nr,me]}],"outline-w":[{outline:[nr,kr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[nr,kr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Pr,Wk]}],"shadow-color":[{shadow:[Li]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",Pr,me]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:he()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:he()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Di,me]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nr,kr,Aa]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const Qk=jk(qk);function de(...e){return Qk(yk(e))}function qt({variant:e,children:t,className:n}){const r="text-foreground",o={h1:"scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-20 border-b pb-2 text-3xl font-semibold tracking-tight first:mt-0",h3:"scroll-m-20 text-2xl font-semibold tracking-tight",h4:"scroll-m-20 text-xl font-semibold tracking-tight first:mt-6",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 pl-6 italic",lead:"text-xl text-muted-foreground",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-muted-foreground"};let s;return e==="p"?s="p":e.startsWith("h")?s=e:s="div",f.jsx(s,{className:de(r,o[e],n),children:t})}function Xk(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function _c(...e){return t=>e.forEach(n=>Xk(n,t))}function Re(...e){return g.useCallback(_c(...e),e)}var so=g.forwardRef((e,t)=>{const{children:n,...r}=e,o=g.Children.toArray(n),s=o.find(Jk);if(s){const i=s.props.children,l=o.map(a=>a===s?g.Children.count(i)>1?g.Children.only(null):g.isValidElement(i)?i.props.children:null:a);return f.jsx(op,{...r,ref:t,children:g.isValidElement(i)?g.cloneElement(i,void 0,l):null})}return f.jsx(op,{...r,ref:t,children:n})});so.displayName="Slot";var op=g.forwardRef((e,t)=>{const{children:n,...r}=e;if(g.isValidElement(n)){const o=tP(n);return g.cloneElement(n,{...eP(r,n.props),ref:t?_c(t,o):o})}return g.Children.count(n)>1?g.Children.only(null):null});op.displayName="SlotClone";var Yk=({children:e})=>f.jsx(f.Fragment,{children:e});function Jk(e){return g.isValidElement(e)&&e.type===Yk}function eP(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...l)=>{s(...l),o(...l)}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function tP(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function S0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,xv=nP,C0=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(u=>{const c=n==null?void 0:n[u],d=s==null?void 0:s[u];if(c===null)return null;const p=wv(c)||wv(d);return o[u][p]}),l=n&&Object.entries(n).reduce((u,c)=>{let[d,p]=c;return p===void 0||(u[d]=p),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,c)=>{let{class:d,className:p,...h}=c;return Object.entries(h).every(m=>{let[w,S]=m;return Array.isArray(S)?S.includes({...s,...l}[w]):{...s,...l}[w]===S})?[...u,d,p]:u},[]);return xv(e,i,a,n==null?void 0:n.class,n==null?void 0:n.className)},rP=C0("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),dt=g.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},s)=>{const i=r?so:"button";return f.jsx(i,{className:de(rP({variant:t,size:n,className:e})),ref:s,...o})});dt.displayName="Button";const ci=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));ci.displayName="Card";const Lh=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("flex flex-col space-y-1.5 p-6",e),...t}));Lh.displayName="CardHeader";const Vh=g.forwardRef(({className:e,...t},n)=>f.jsx("h3",{ref:n,className:de("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vh.displayName="CardTitle";const $h=g.forwardRef(({className:e,...t},n)=>f.jsx("p",{ref:n,className:de("text-sm text-muted-foreground",e),...t}));$h.displayName="CardDescription";const zh=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("p-6 pt-0",e),...t}));zh.displayName="CardContent";const oP=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{ref:n,className:de("flex items-center p-6 pt-0",e),...t}));oP.displayName="CardFooter";const dn=g.forwardRef(({className:e,type:t,...n},r)=>f.jsx("input",{type:t,className:de("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));dn.displayName="Input";function sp(e,[t,n]){return Math.min(n,Math.max(t,e))}function te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function br(e,t=[]){let n=[];function r(s,i){const l=g.createContext(i),a=n.length;n=[...n,i];function u(d){const{scope:p,children:h,...m}=d,w=(p==null?void 0:p[e][a])||l,S=g.useMemo(()=>m,Object.values(m));return f.jsx(w.Provider,{value:S,children:h})}function c(d,p){const h=(p==null?void 0:p[e][a])||l,m=g.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return u.displayName=s+"Provider",[u,c]}const o=()=>{const s=n.map(i=>g.createContext(i));return function(l){const a=(l==null?void 0:l[e])||s;return g.useMemo(()=>({[`__scope${e}`]:{...l,[e]:a}}),[l,a])}};return o.scopeName=e,[r,sP(o,...t)]}function sP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((l,{useScope:a,scopeName:u})=>{const d=a(s)[`__scope${u}`];return{...l,...d}},{});return g.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function Bh(e){const t=e+"CollectionProvider",[n,r]=br(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=h=>{const{scope:m,children:w}=h,S=xe.useRef(null),y=xe.useRef(new Map).current;return f.jsx(o,{scope:m,itemMap:y,collectionRef:S,children:w})};i.displayName=t;const l=e+"CollectionSlot",a=xe.forwardRef((h,m)=>{const{scope:w,children:S}=h,y=s(l,w),v=Re(m,y.collectionRef);return f.jsx(so,{ref:v,children:S})});a.displayName=l;const u=e+"CollectionItemSlot",c="data-radix-collection-item",d=xe.forwardRef((h,m)=>{const{scope:w,children:S,...y}=h,v=xe.useRef(null),x=Re(m,v),C=s(u,w);return xe.useEffect(()=>(C.itemMap.set(v,{ref:v,...y}),()=>void C.itemMap.delete(v))),f.jsx(so,{[c]:"",ref:x,children:S})});d.displayName=u;function p(h){const m=s(e+"CollectionConsumer",h);return xe.useCallback(()=>{const S=m.collectionRef.current;if(!S)return[];const y=Array.from(S.querySelectorAll(`[${c}]`));return Array.from(m.itemMap.values()).sort((C,_)=>y.indexOf(C.ref.current)-y.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:a,ItemSlot:d},p,r]}var iP=g.createContext(void 0);function bc(e){const t=g.useContext(iP);return e||t||"ltr"}var lP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ye=lP.reduce((e,t)=>{const n=g.forwardRef((r,o)=>{const{asChild:s,...i}=r,l=s?so:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),f.jsx(l,{...i,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _0(e,t){e&&Jo.flushSync(()=>e.dispatchEvent(t))}function it(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function aP(e,t=globalThis==null?void 0:globalThis.document){const n=it(e);g.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var uP="DismissableLayer",ip="dismissableLayer.update",cP="dismissableLayer.pointerDownOutside",dP="dismissableLayer.focusOutside",Sv,b0=g.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Uh=g.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:l,...a}=e,u=g.useContext(b0),[c,d]=g.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=g.useState({}),m=Re(t,k=>d(k)),w=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=w.indexOf(S),v=c?w.indexOf(c):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=v>=y,_=hP(k=>{const E=k.target,I=[...u.branches].some(O=>O.contains(E));!C||I||(o==null||o(k),i==null||i(k),k.defaultPrevented||l==null||l())},p),P=mP(k=>{const E=k.target;[...u.branches].some(O=>O.contains(E))||(s==null||s(k),i==null||i(k),k.defaultPrevented||l==null||l())},p);return aP(k=>{v===u.layers.size-1&&(r==null||r(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},p),g.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Sv=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Cv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Sv)}},[c,p,n,u]),g.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Cv())},[c,u]),g.useEffect(()=>{const k=()=>h({});return document.addEventListener(ip,k),()=>document.removeEventListener(ip,k)},[]),f.jsx(ye.div,{...a,ref:m,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:te(e.onFocusCapture,P.onFocusCapture),onBlurCapture:te(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:te(e.onPointerDownCapture,_.onPointerDownCapture)})});Uh.displayName=uP;var fP="DismissableLayerBranch",pP=g.forwardRef((e,t)=>{const n=g.useContext(b0),r=g.useRef(null),o=Re(t,r);return g.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),f.jsx(ye.div,{...e,ref:o})});pP.displayName=fP;function hP(e,t=globalThis==null?void 0:globalThis.document){const n=it(e),r=g.useRef(!1),o=g.useRef(()=>{});return g.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let a=function(){R0(cP,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=a,t.addEventListener("click",o.current,{once:!0})):a()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function mP(e,t=globalThis==null?void 0:globalThis.document){const n=it(e),r=g.useRef(!1);return g.useEffect(()=>{const o=s=>{s.target&&!r.current&&R0(dP,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Cv(){const e=new CustomEvent(ip);document.dispatchEvent(e)}function R0(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?_0(o,s):o.dispatchEvent(s)}var kd=0;function E0(){g.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??_v()),document.body.insertAdjacentElement("beforeend",e[1]??_v()),kd++,()=>{kd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kd--}},[])}function _v(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Pd="focusScope.autoFocusOnMount",Td="focusScope.autoFocusOnUnmount",bv={bubbles:!1,cancelable:!0},gP="FocusScope",Hh=g.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[l,a]=g.useState(null),u=it(o),c=it(s),d=g.useRef(null),p=Re(t,w=>a(w)),h=g.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;g.useEffect(()=>{if(r){let w=function(x){if(h.paused||!l)return;const C=x.target;l.contains(C)?d.current=C:jr(d.current,{select:!0})},S=function(x){if(h.paused||!l)return;const C=x.relatedTarget;C!==null&&(l.contains(C)||jr(d.current,{select:!0}))},y=function(x){if(document.activeElement===document.body)for(const _ of x)_.removedNodes.length>0&&jr(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",S);const v=new MutationObserver(y);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",S),v.disconnect()}}},[r,l,h.paused]),g.useEffect(()=>{if(l){Ev.add(h);const w=document.activeElement;if(!l.contains(w)){const y=new CustomEvent(Pd,bv);l.addEventListener(Pd,u),l.dispatchEvent(y),y.defaultPrevented||(vP(CP(k0(l)),{select:!0}),document.activeElement===w&&jr(l))}return()=>{l.removeEventListener(Pd,u),setTimeout(()=>{const y=new CustomEvent(Td,bv);l.addEventListener(Td,c),l.dispatchEvent(y),y.defaultPrevented||jr(w??document.body,{select:!0}),l.removeEventListener(Td,c),Ev.remove(h)},0)}}},[l,u,c,h]);const m=g.useCallback(w=>{if(!n&&!r||h.paused)return;const S=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,y=document.activeElement;if(S&&y){const v=w.currentTarget,[x,C]=yP(v);x&&C?!w.shiftKey&&y===C?(w.preventDefault(),n&&jr(x,{select:!0})):w.shiftKey&&y===x&&(w.preventDefault(),n&&jr(C,{select:!0})):y===v&&w.preventDefault()}},[n,r,h.paused]);return f.jsx(ye.div,{tabIndex:-1,...i,ref:p,onKeyDown:m})});Hh.displayName=gP;function vP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(jr(r,{select:t}),document.activeElement!==n)return}function yP(e){const t=k0(e),n=Rv(t,e),r=Rv(t.reverse(),e);return[n,r]}function k0(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Rv(e,t){for(const n of e)if(!wP(n,{upTo:t}))return n}function wP(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xP(e){return e instanceof HTMLInputElement&&"select"in e}function jr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xP(e)&&t&&e.select()}}var Ev=SP();function SP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=kv(e,t),e.unshift(t)},remove(t){var n;e=kv(e,t),(n=e[0])==null||n.resume()}}}function kv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function CP(e){return e.filter(t=>t.tagName!=="A")}var _t=globalThis!=null&&globalThis.document?g.useLayoutEffect:()=>{},_P=By.useId||(()=>{}),bP=0;function di(e){const[t,n]=g.useState(_P());return _t(()=>{n(r=>r??String(bP++))},[e]),t?`radix-${t}`:""}const RP=["top","right","bottom","left"],Gn=Math.min,Qt=Math.max,Fu=Math.round,Ma=Math.floor,io=e=>({x:e,y:e}),EP={left:"right",right:"left",bottom:"top",top:"bottom"},kP={start:"end",end:"start"};function lp(e,t,n){return Qt(e,Gn(t,n))}function wr(e,t){return typeof e=="function"?e(t):e}function xr(e){return e.split("-")[0]}function _i(e){return e.split("-")[1]}function Wh(e){return e==="x"?"y":"x"}function Gh(e){return e==="y"?"height":"width"}function lo(e){return["top","bottom"].includes(xr(e))?"y":"x"}function Kh(e){return Wh(lo(e))}function PP(e,t,n){n===void 0&&(n=!1);const r=_i(e),o=Kh(e),s=Gh(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Du(i)),[i,Du(i)]}function TP(e){const t=Du(e);return[ap(e),t,ap(t)]}function ap(e){return e.replace(/start|end/g,t=>kP[t])}function NP(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function jP(e,t,n,r){const o=_i(e);let s=NP(xr(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ap)))),s}function Du(e){return e.replace(/left|right|bottom|top/g,t=>EP[t])}function AP(e){return{top:0,right:0,bottom:0,left:0,...e}}function P0(e){return typeof e!="number"?AP(e):{top:e,right:e,bottom:e,left:e}}function Lu(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Pv(e,t,n){let{reference:r,floating:o}=e;const s=lo(t),i=Kh(t),l=Gh(i),a=xr(t),u=s==="y",c=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let h;switch(a){case"top":h={x:c,y:r.y-o.height};break;case"bottom":h={x:c,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(_i(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}const MP=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=Pv(u,r,a),p=r,h={},m=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:a}=t,{element:u,padding:c=0}=wr(e,t)||{};if(u==null)return{};const d=P0(c),p={x:n,y:r},h=Kh(o),m=Gh(h),w=await i.getDimensions(u),S=h==="y",y=S?"top":"left",v=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=s.reference[m]+s.reference[h]-p[h]-s.floating[m],_=p[h]-s.reference[h],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let k=P?P[x]:0;(!k||!await(i.isElement==null?void 0:i.isElement(P)))&&(k=l.floating[x]||s.floating[m]);const E=C/2-_/2,I=k/2-w[m]/2-1,O=Gn(d[y],I),Y=Gn(d[v],I),F=O,G=k-w[m]-Y,X=k/2-w[m]/2+E,J=lp(F,X,G),re=!a.arrow&&_i(o)!=null&&X!==J&&s.reference[m]/2-(XX<=0)){var Y,F;const X=(((Y=s.flip)==null?void 0:Y.index)||0)+1,J=k[X];if(J)return{data:{index:X,overflows:O},reset:{placement:J}};let re=(F=O.filter(Q=>Q.overflows[0]<=0).sort((Q,M)=>Q.overflows[1]-M.overflows[1])[0])==null?void 0:F.placement;if(!re)switch(h){case"bestFit":{var G;const Q=(G=O.filter(M=>{if(P){const j=lo(M.placement);return j===v||j==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(j=>j>0).reduce((j,K)=>j+K,0)]).sort((M,j)=>M[1]-j[1])[0])==null?void 0:G[0];Q&&(re=Q);break}case"initialPlacement":re=l;break}if(o!==re)return{reset:{placement:re}}}return{}}}};function Tv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Nv(e){return RP.some(t=>e[t]>=0)}const FP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=wr(e,t);switch(r){case"referenceHidden":{const s=await Nl(t,{...o,elementContext:"reference"}),i=Tv(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Nv(i)}}}case"escaped":{const s=await Nl(t,{...o,altBoundary:!0}),i=Tv(s,n.floating);return{data:{escapedOffsets:i,escaped:Nv(i)}}}default:return{}}}}};async function DP(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xr(n),l=_i(n),a=lo(n)==="y",u=["left","top"].includes(i)?-1:1,c=s&&a?-1:1,d=wr(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return l&&typeof m=="number"&&(h=l==="end"?m*-1:m),a?{x:h*c,y:p*u}:{x:p*u,y:h*c}}const LP=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await DP(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},VP=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:S=>{let{x:y,y:v}=S;return{x:y,y:v}}},...a}=wr(e,t),u={x:n,y:r},c=await Nl(t,a),d=lo(xr(o)),p=Wh(d);let h=u[p],m=u[d];if(s){const S=p==="y"?"top":"left",y=p==="y"?"bottom":"right",v=h+c[S],x=h-c[y];h=lp(v,h,x)}if(i){const S=d==="y"?"top":"left",y=d==="y"?"bottom":"right",v=m+c[S],x=m-c[y];m=lp(v,m,x)}const w=l.fn({...t,[p]:h,[d]:m});return{...w,data:{x:w.x-n,y:w.y-r}}}}},$P=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:l=0,mainAxis:a=!0,crossAxis:u=!0}=wr(e,t),c={x:n,y:r},d=lo(o),p=Wh(d);let h=c[p],m=c[d];const w=wr(l,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(a){const x=p==="y"?"height":"width",C=s.reference[p]-s.floating[x]+S.mainAxis,_=s.reference[p]+s.reference[x]-S.mainAxis;h_&&(h=_)}if(u){var y,v;const x=p==="y"?"width":"height",C=["top","left"].includes(xr(o)),_=s.reference[d]-s.floating[x]+(C&&((y=i.offset)==null?void 0:y[d])||0)+(C?0:S.crossAxis),P=s.reference[d]+s.reference[x]+(C?0:((v=i.offset)==null?void 0:v[d])||0)-(C?S.crossAxis:0);m<_?m=_:m>P&&(m=P)}return{[p]:h,[d]:m}}}},zP=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...l}=wr(e,t),a=await Nl(t,l),u=xr(n),c=_i(n),d=lo(n)==="y",{width:p,height:h}=r.floating;let m,w;u==="top"||u==="bottom"?(m=u,w=c===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(w=u,m=c==="end"?"top":"bottom");const S=h-a.top-a.bottom,y=p-a.left-a.right,v=Gn(h-a[m],S),x=Gn(p-a[w],y),C=!t.middlewareData.shift;let _=v,P=x;if(d?P=c||C?Gn(x,y):y:_=c||C?Gn(v,S):S,C&&!c){const E=Qt(a.left,0),I=Qt(a.right,0),O=Qt(a.top,0),Y=Qt(a.bottom,0);d?P=p-2*(E!==0||I!==0?E+I:Qt(a.left,a.right)):_=h-2*(O!==0||Y!==0?O+Y:Qt(a.top,a.bottom))}await i({...t,availableWidth:P,availableHeight:_});const k=await o.getDimensions(s.floating);return p!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function bi(e){return T0(e)?(e.nodeName||"").toLowerCase():"#document"}function en(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rr(e){var t;return(t=(T0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T0(e){return e instanceof Node||e instanceof en(e).Node}function Mn(e){return e instanceof Element||e instanceof en(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof en(e).HTMLElement}function jv(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof en(e).ShadowRoot}function oa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=On(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function BP(e){return["table","td","th"].includes(bi(e))}function Rc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Zh(e){const t=qh(),n=Mn(e)?On(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function UP(e){let t=ao(e);for(;Xn(t)&&!fi(t);){if(Zh(t))return t;if(Rc(t))return null;t=ao(t)}return null}function qh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function fi(e){return["html","body","#document"].includes(bi(e))}function On(e){return en(e).getComputedStyle(e)}function Ec(e){return Mn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ao(e){if(bi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jv(e)&&e.host||Rr(e);return jv(t)?t.host:t}function N0(e){const t=ao(e);return fi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xn(t)&&oa(t)?t:N0(t)}function jl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=N0(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=en(o);return s?t.concat(i,i.visualViewport||[],oa(o)?o:[],i.frameElement&&n?jl(i.frameElement):[]):t.concat(o,jl(o,[],n))}function j0(e){const t=On(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Xn(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Fu(n)!==s||Fu(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Qh(e){return Mn(e)?e:e.contextElement}function Ds(e){const t=Qh(e);if(!Xn(t))return io(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=j0(t);let i=(s?Fu(n.width):n.width)/r,l=(s?Fu(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const HP=io(0);function A0(e){const t=en(e);return!qh()||!t.visualViewport?HP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WP(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==en(e)?!1:t}function Go(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Qh(e);let i=io(1);t&&(r?Mn(r)&&(i=Ds(r)):i=Ds(e));const l=WP(s,n,r)?A0(s):io(0);let a=(o.left+l.x)/i.x,u=(o.top+l.y)/i.y,c=o.width/i.x,d=o.height/i.y;if(s){const p=en(s),h=r&&Mn(r)?en(r):r;let m=p,w=m.frameElement;for(;w&&r&&h!==m;){const S=Ds(w),y=w.getBoundingClientRect(),v=On(w),x=y.left+(w.clientLeft+parseFloat(v.paddingLeft))*S.x,C=y.top+(w.clientTop+parseFloat(v.paddingTop))*S.y;a*=S.x,u*=S.y,c*=S.x,d*=S.y,a+=x,u+=C,m=en(w),w=m.frameElement}}return Lu({width:c,height:d,x:a,y:u})}function GP(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Rr(r),l=t?Rc(t.floating):!1;if(r===i||l&&s)return n;let a={scrollLeft:0,scrollTop:0},u=io(1);const c=io(0),d=Xn(r);if((d||!d&&!s)&&((bi(r)!=="body"||oa(i))&&(a=Ec(r)),Xn(r))){const p=Go(r);u=Ds(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-a.scrollLeft*u.x+c.x,y:n.y*u.y-a.scrollTop*u.y+c.y}}function KP(e){return Array.from(e.getClientRects())}function M0(e){return Go(Rr(e)).left+Ec(e).scrollLeft}function ZP(e){const t=Rr(e),n=Ec(e),r=e.ownerDocument.body,o=Qt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Qt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+M0(e);const l=-n.scrollTop;return On(r).direction==="rtl"&&(i+=Qt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}function qP(e,t){const n=en(e),r=Rr(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,a=0;if(o){s=o.width,i=o.height;const u=qh();(!u||u&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:i,x:l,y:a}}function QP(e,t){const n=Go(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Xn(e)?Ds(e):io(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,u=r*s.y;return{width:i,height:l,x:a,y:u}}function Av(e,t,n){let r;if(t==="viewport")r=qP(e,n);else if(t==="document")r=ZP(Rr(e));else if(Mn(t))r=QP(t,n);else{const o=A0(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Lu(r)}function O0(e,t){const n=ao(e);return n===t||!Mn(n)||fi(n)?!1:On(n).position==="fixed"||O0(n,t)}function XP(e,t){const n=t.get(e);if(n)return n;let r=jl(e,[],!1).filter(l=>Mn(l)&&bi(l)!=="body"),o=null;const s=On(e).position==="fixed";let i=s?ao(e):e;for(;Mn(i)&&!fi(i);){const l=On(i),a=Zh(i);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||oa(i)&&!a&&O0(e,i))?r=r.filter(c=>c!==i):o=l,i=ao(i)}return t.set(e,r),r}function YP(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Rc(t)?[]:XP(t,this._c):[].concat(n),r],l=i[0],a=i.reduce((u,c)=>{const d=Av(t,c,o);return u.top=Qt(d.top,u.top),u.right=Gn(d.right,u.right),u.bottom=Gn(d.bottom,u.bottom),u.left=Qt(d.left,u.left),u},Av(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function JP(e){const{width:t,height:n}=j0(e);return{width:t,height:n}}function eT(e,t,n){const r=Xn(t),o=Rr(t),s=n==="fixed",i=Go(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=io(0);if(r||!r&&!s)if((bi(t)!=="body"||oa(o))&&(l=Ec(t)),r){const d=Go(t,!0,s,t);a.x=d.x+t.clientLeft,a.y=d.y+t.clientTop}else o&&(a.x=M0(o));const u=i.left+l.scrollLeft-a.x,c=i.top+l.scrollTop-a.y;return{x:u,y:c,width:i.width,height:i.height}}function Nd(e){return On(e).position==="static"}function Mv(e,t){return!Xn(e)||On(e).position==="fixed"?null:t?t(e):e.offsetParent}function I0(e,t){const n=en(e);if(Rc(e))return n;if(!Xn(e)){let o=ao(e);for(;o&&!fi(o);){if(Mn(o)&&!Nd(o))return o;o=ao(o)}return n}let r=Mv(e,t);for(;r&&BP(r)&&Nd(r);)r=Mv(r,t);return r&&fi(r)&&Nd(r)&&!Zh(r)?n:r||UP(e)||n}const tT=async function(e){const t=this.getOffsetParent||I0,n=this.getDimensions,r=await n(e.floating);return{reference:eT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nT(e){return On(e).direction==="rtl"}const rT={convertOffsetParentRelativeRectToViewportRelativeRect:GP,getDocumentElement:Rr,getClippingRect:YP,getOffsetParent:I0,getElementRects:tT,getClientRects:KP,getDimensions:JP,getScale:Ds,isElement:Mn,isRTL:nT};function oT(e,t){let n=null,r;const o=Rr(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(l||t(),!d||!p)return;const h=Ma(c),m=Ma(o.clientWidth-(u+d)),w=Ma(o.clientHeight-(c+p)),S=Ma(u),v={rootMargin:-h+"px "+-m+"px "+-w+"px "+-S+"px",threshold:Qt(0,Gn(1,a))||1};let x=!0;function C(_){const P=_[0].intersectionRatio;if(P!==a){if(!x)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,{...v,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,v)}n.observe(e)}return i(!0),s}function sT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,u=Qh(e),c=o||s?[...u?jl(u):[],...jl(t)]:[];c.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=u&&l?oT(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(y=>{let[v]=y;v&&v.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var x;(x=h)==null||x.observe(t)})),n()}),u&&!a&&h.observe(u),h.observe(t));let m,w=a?Go(e):null;a&&S();function S(){const y=Go(e);w&&(y.x!==w.x||y.y!==w.y||y.width!==w.width||y.height!==w.height)&&n(),w=y,m=requestAnimationFrame(S)}return n(),()=>{var y;c.forEach(v=>{o&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,a&&cancelAnimationFrame(m)}}const iT=LP,lT=VP,aT=IP,uT=zP,cT=FP,Ov=OP,dT=$P,fT=(e,t,n)=>{const r=new Map,o={platform:rT,...n},s={...o.platform,_c:r};return MP(e,t,{...o,platform:s})};var ru=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Vu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vu(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Vu(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function F0(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Iv(e,t){const n=F0(e);return Math.round(t*n)/n}function Fv(e){const t=g.useRef(e);return ru(()=>{t.current=e}),t}function pT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:a,open:u}=e,[c,d]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=g.useState(r);Vu(p,r)||h(r);const[m,w]=g.useState(null),[S,y]=g.useState(null),v=g.useCallback(Q=>{Q!==P.current&&(P.current=Q,w(Q))},[]),x=g.useCallback(Q=>{Q!==k.current&&(k.current=Q,y(Q))},[]),C=s||m,_=i||S,P=g.useRef(null),k=g.useRef(null),E=g.useRef(c),I=a!=null,O=Fv(a),Y=Fv(o),F=g.useCallback(()=>{if(!P.current||!k.current)return;const Q={placement:t,strategy:n,middleware:p};Y.current&&(Q.platform=Y.current),fT(P.current,k.current,Q).then(M=>{const j={...M,isPositioned:!0};G.current&&!Vu(E.current,j)&&(E.current=j,Jo.flushSync(()=>{d(j)}))})},[p,t,n,Y]);ru(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(Q=>({...Q,isPositioned:!1})))},[u]);const G=g.useRef(!1);ru(()=>(G.current=!0,()=>{G.current=!1}),[]),ru(()=>{if(C&&(P.current=C),_&&(k.current=_),C&&_){if(O.current)return O.current(C,_,F);F()}},[C,_,F,O,I]);const X=g.useMemo(()=>({reference:P,floating:k,setReference:v,setFloating:x}),[v,x]),J=g.useMemo(()=>({reference:C,floating:_}),[C,_]),re=g.useMemo(()=>{const Q={position:n,left:0,top:0};if(!J.floating)return Q;const M=Iv(J.floating,c.x),j=Iv(J.floating,c.y);return l?{...Q,transform:"translate("+M+"px, "+j+"px)",...F0(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:j}},[n,l,J.floating,c.x,c.y]);return g.useMemo(()=>({...c,update:F,refs:X,elements:J,floatingStyles:re}),[c,F,X,J,re])}const hT=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ov({element:r.current,padding:o}).fn(n):{}:r?Ov({element:r,padding:o}).fn(n):{}}}},mT=(e,t)=>({...iT(e),options:[e,t]}),gT=(e,t)=>({...lT(e),options:[e,t]}),vT=(e,t)=>({...dT(e),options:[e,t]}),yT=(e,t)=>({...aT(e),options:[e,t]}),wT=(e,t)=>({...uT(e),options:[e,t]}),xT=(e,t)=>({...cT(e),options:[e,t]}),ST=(e,t)=>({...hT(e),options:[e,t]});var CT="Arrow",D0=g.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...s}=e;return f.jsx(ye.svg,{...s,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:f.jsx("polygon",{points:"0,0 30,0 15,10"})})});D0.displayName=CT;var _T=D0;function Xh(e){const[t,n]=g.useState(void 0);return _t(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let i,l;if("borderBoxSize"in s){const a=s.borderBoxSize,u=Array.isArray(a)?a[0]:a;i=u.inlineSize,l=u.blockSize}else i=e.offsetWidth,l=e.offsetHeight;n({width:i,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Yh="Popper",[L0,kc]=br(Yh),[bT,V0]=L0(Yh),$0=e=>{const{__scopePopper:t,children:n}=e,[r,o]=g.useState(null);return f.jsx(bT,{scope:t,anchor:r,onAnchorChange:o,children:n})};$0.displayName=Yh;var z0="PopperAnchor",B0=g.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,s=V0(z0,n),i=g.useRef(null),l=Re(t,i);return g.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:f.jsx(ye.div,{...o,ref:l})});B0.displayName=z0;var Jh="PopperContent",[RT,ET]=L0(Jh),U0=g.forwardRef((e,t)=>{var ee,be,Ae,Ee,ke,Pe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,arrowPadding:l=0,avoidCollisions:a=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...w}=e,S=V0(Jh,n),[y,v]=g.useState(null),x=Re(t,gt=>v(gt)),[C,_]=g.useState(null),P=Xh(C),k=(P==null?void 0:P.width)??0,E=(P==null?void 0:P.height)??0,I=r+(s!=="center"?"-"+s:""),O=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},Y=Array.isArray(u)?u:[u],F=Y.length>0,G={padding:O,boundary:Y.filter(PT),altBoundary:F},{refs:X,floatingStyles:J,placement:re,isPositioned:Q,middlewareData:M}=pT({strategy:"fixed",placement:I,whileElementsMounted:(...gt)=>sT(...gt,{animationFrame:h==="always"}),elements:{reference:S.anchor},middleware:[mT({mainAxis:o+E,alignmentAxis:i}),a&&gT({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?vT():void 0,...G}),a&&yT({...G}),wT({...G,apply:({elements:gt,rects:Ht,availableWidth:rs,availableHeight:os})=>{const{width:ss,height:b}=Ht.reference,T=gt.floating.style;T.setProperty("--radix-popper-available-width",`${rs}px`),T.setProperty("--radix-popper-available-height",`${os}px`),T.setProperty("--radix-popper-anchor-width",`${ss}px`),T.setProperty("--radix-popper-anchor-height",`${b}px`)}}),C&&ST({element:C,padding:l}),TT({arrowWidth:k,arrowHeight:E}),p&&xT({strategy:"referenceHidden",...G})]}),[j,K]=G0(re),se=it(m);_t(()=>{Q&&(se==null||se())},[Q,se]);const he=(ee=M.arrow)==null?void 0:ee.x,mt=(be=M.arrow)==null?void 0:be.y,ze=((Ae=M.arrow)==null?void 0:Ae.centerOffset)!==0,[Rt,Fe]=g.useState();return _t(()=>{y&&Fe(window.getComputedStyle(y).zIndex)},[y]),f.jsx("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:Q?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Rt,"--radix-popper-transform-origin":[(Ee=M.transformOrigin)==null?void 0:Ee.x,(ke=M.transformOrigin)==null?void 0:ke.y].join(" "),...((Pe=M.hide)==null?void 0:Pe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:f.jsx(RT,{scope:n,placedSide:j,onArrowChange:_,arrowX:he,arrowY:mt,shouldHideArrow:ze,children:f.jsx(ye.div,{"data-side":j,"data-align":K,...w,ref:x,style:{...w.style,animation:Q?void 0:"none"}})})})});U0.displayName=Jh;var H0="PopperArrow",kT={top:"bottom",right:"left",bottom:"top",left:"right"},W0=g.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,s=ET(H0,r),i=kT[s.placedSide];return f.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:f.jsx(_T,{...o,ref:n,style:{...o.style,display:"block"}})})});W0.displayName=H0;function PT(e){return e!==null}var TT=e=>({name:"transformOrigin",options:e,fn(t){var S,y,v;const{placement:n,rects:r,middlewareData:o}=t,i=((S=o.arrow)==null?void 0:S.centerOffset)!==0,l=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[u,c]=G0(n),d={start:"0%",center:"50%",end:"100%"}[c],p=(((y=o.arrow)==null?void 0:y.x)??0)+l/2,h=(((v=o.arrow)==null?void 0:v.y)??0)+a/2;let m="",w="";return u==="bottom"?(m=i?d:`${p}px`,w=`${-a}px`):u==="top"?(m=i?d:`${p}px`,w=`${r.floating.height+a}px`):u==="right"?(m=`${-a}px`,w=i?d:`${h}px`):u==="left"&&(m=`${r.floating.width+a}px`,w=i?d:`${h}px`),{data:{x:m,y:w}}}});function G0(e){const[t,n="center"]=e.split("-");return[t,n]}var K0=$0,Z0=B0,q0=U0,Q0=W0,NT="Portal",em=g.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,s]=g.useState(!1);_t(()=>s(!0),[]);const i=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return i?oE.createPortal(f.jsx(ye.div,{...r,ref:t}),i):null});em.displayName=NT;function pi({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=jT({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,l=it(n),a=g.useCallback(u=>{if(s){const d=typeof u=="function"?u(e):u;d!==e&&l(d)}else o(u)},[s,e,o,l]);return[i,a]}function jT({defaultProp:e,onChange:t}){const n=g.useState(e),[r]=n,o=g.useRef(r),s=it(t);return g.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function tm(e){const t=g.useRef({value:e,previous:e});return g.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var AT="VisuallyHidden",X0=g.forwardRef((e,t)=>f.jsx(ye.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));X0.displayName=AT;var MT=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},as=new WeakMap,Oa=new WeakMap,Ia={},jd=0,Y0=function(e){return e&&(e.host||Y0(e.parentNode))},OT=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Y0(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},IT=function(e,t,n,r){var o=OT(t,Array.isArray(e)?e:[e]);Ia[n]||(Ia[n]=new WeakMap);var s=Ia[n],i=[],l=new Set,a=new Set(o),u=function(d){!d||l.has(d)||(l.add(d),u(d.parentNode))};o.forEach(u);var c=function(d){!d||a.has(d)||Array.prototype.forEach.call(d.children,function(p){if(l.has(p))c(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",w=(as.get(p)||0)+1,S=(s.get(p)||0)+1;as.set(p,w),s.set(p,S),i.push(p),w===1&&m&&Oa.set(p,!0),S===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return c(t),l.clear(),jd++,function(){i.forEach(function(d){var p=as.get(d)-1,h=s.get(d)-1;as.set(d,p),s.set(d,h),p||(Oa.has(d)||d.removeAttribute(r),Oa.delete(d)),h||d.removeAttribute(n)}),jd--,jd||(as=new WeakMap,as=new WeakMap,Oa=new WeakMap,Ia={})}},J0=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=MT(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),IT(r,o,n,"aria-hidden")):function(){return null}},Hn=function(){return Hn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return YT;var t=JT(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tN=rS(),Ls="data-scroll-locked",nN=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,l=e.gap;return n===void 0&&(n="margin"),` + .`.concat(DT,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(l,"px ").concat(r,`; + } + body[`).concat(Ls,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(s,`px; + padding-right: `).concat(i,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(l,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(ou,` { + right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(su,` { + margin-right: `).concat(l,"px ").concat(r,`; + } + + .`).concat(ou," .").concat(ou,` { + right: 0 `).concat(r,`; + } + + .`).concat(su," .").concat(su,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Ls,`] { + `).concat(LT,": ").concat(l,`px; + } +`)},Lv=function(){var e=parseInt(document.body.getAttribute(Ls)||"0",10);return isFinite(e)?e:0},rN=function(){g.useEffect(function(){return document.body.setAttribute(Ls,(Lv()+1).toString()),function(){var e=Lv()-1;e<=0?document.body.removeAttribute(Ls):document.body.setAttribute(Ls,e.toString())}},[])},oN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;rN();var s=g.useMemo(function(){return eN(o)},[o]);return g.createElement(tN,{styles:nN(s,!t,o,n?"":"!important")})},up=!1;if(typeof window<"u")try{var Fa=Object.defineProperty({},"passive",{get:function(){return up=!0,!0}});window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{up=!1}var us=up?{passive:!1}:!1,sN=function(e){return e.tagName==="TEXTAREA"},oS=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!sN(e)&&n[t]==="visible")},iN=function(e){return oS(e,"overflowY")},lN=function(e){return oS(e,"overflowX")},Vv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=sS(e,r);if(o){var s=iS(e,r),i=s[1],l=s[2];if(i>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},aN=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},uN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sS=function(e,t){return e==="v"?iN(t):lN(t)},iS=function(e,t){return e==="v"?aN(t):uN(t)},cN=function(e,t){return e==="h"&&t==="rtl"?-1:1},dN=function(e,t,n,r,o){var s=cN(e,window.getComputedStyle(t).direction),i=s*r,l=n.target,a=t.contains(l),u=!1,c=i>0,d=0,p=0;do{var h=iS(e,l),m=h[0],w=h[1],S=h[2],y=w-S-s*m;(m||y)&&sS(e,l)&&(d+=y,p+=m),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!a&&l!==document.body||a&&(t.contains(l)||t===l));return(c&&(Math.abs(d)<1||!o)||!c&&(Math.abs(p)<1||!o))&&(u=!0),u},Da=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$v=function(e){return[e.deltaX,e.deltaY]},zv=function(e){return e&&"current"in e?e.current:e},fN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pN=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},hN=0,cs=[];function mN(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(hN++)[0],s=g.useState(rS)[0],i=g.useRef(e);g.useEffect(function(){i.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=FT([e.lockRef.current],(e.shards||[]).map(zv),!0).filter(Boolean);return w.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=g.useCallback(function(w,S){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var y=Da(w),v=n.current,x="deltaX"in w?w.deltaX:v[0]-y[0],C="deltaY"in w?w.deltaY:v[1]-y[1],_,P=w.target,k=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in w&&k==="h"&&P.type==="range")return!1;var E=Vv(k,P);if(!E)return!0;if(E?_=k:(_=k==="v"?"h":"v",E=Vv(k,P)),!E)return!1;if(!r.current&&"changedTouches"in w&&(x||C)&&(r.current=_),!_)return!0;var I=r.current||_;return dN(I,S,w,I==="h"?x:C,!0)},[]),a=g.useCallback(function(w){var S=w;if(!(!cs.length||cs[cs.length-1]!==s)){var y="deltaY"in S?$v(S):Da(S),v=t.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&fN(_.delta,y)})[0];if(v&&v.should){S.cancelable&&S.preventDefault();return}if(!v){var x=(i.current.shards||[]).map(zv).filter(Boolean).filter(function(_){return _.contains(S.target)}),C=x.length>0?l(S,x[0]):!i.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=g.useCallback(function(w,S,y,v){var x={name:w,delta:S,target:y,should:v,shadowParent:gN(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),c=g.useCallback(function(w){n.current=Da(w),r.current=void 0},[]),d=g.useCallback(function(w){u(w.type,$v(w),w.target,l(w,e.lockRef.current))},[]),p=g.useCallback(function(w){u(w.type,Da(w),w.target,l(w,e.lockRef.current))},[]);g.useEffect(function(){return cs.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",a,us),document.addEventListener("touchmove",a,us),document.addEventListener("touchstart",c,us),function(){cs=cs.filter(function(w){return w!==s}),document.removeEventListener("wheel",a,us),document.removeEventListener("touchmove",a,us),document.removeEventListener("touchstart",c,us)}},[]);var h=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(s,{styles:pN(o)}):null,h?g.createElement(oN,{gapMode:e.gapMode}):null)}function gN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vN=WT(nS,mN);var nm=g.forwardRef(function(e,t){return g.createElement(Pc,Hn({},e,{ref:t,sideCar:vN}))});nm.classNames=Pc.classNames;var yN=[" ","Enter","ArrowUp","ArrowDown"],wN=[" ","Enter"],sa="Select",[Tc,Nc,xN]=Bh(sa),[Ri,TD]=br(sa,[xN,kc]),jc=kc(),[SN,yo]=Ri(sa),[CN,_N]=Ri(sa),lS=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:s,value:i,defaultValue:l,onValueChange:a,dir:u,name:c,autoComplete:d,disabled:p,required:h}=e,m=jc(t),[w,S]=g.useState(null),[y,v]=g.useState(null),[x,C]=g.useState(!1),_=bc(u),[P=!1,k]=pi({prop:r,defaultProp:o,onChange:s}),[E,I]=pi({prop:i,defaultProp:l,onChange:a}),O=g.useRef(null),Y=w?!!w.closest("form"):!0,[F,G]=g.useState(new Set),X=Array.from(F).map(J=>J.props.value).join(";");return f.jsx(K0,{...m,children:f.jsxs(SN,{required:h,scope:t,trigger:w,onTriggerChange:S,valueNode:y,onValueNodeChange:v,valueNodeHasChildren:x,onValueNodeHasChildrenChange:C,contentId:di(),value:E,onValueChange:I,open:P,onOpenChange:k,dir:_,triggerPointerDownPosRef:O,disabled:p,children:[f.jsx(Tc.Provider,{scope:t,children:f.jsx(CN,{scope:e.__scopeSelect,onNativeOptionAdd:g.useCallback(J=>{G(re=>new Set(re).add(J))},[]),onNativeOptionRemove:g.useCallback(J=>{G(re=>{const Q=new Set(re);return Q.delete(J),Q})},[]),children:n})}),Y?f.jsxs(MS,{"aria-hidden":!0,required:h,tabIndex:-1,name:c,autoComplete:d,value:E,onChange:J=>I(J.target.value),disabled:p,children:[E===void 0?f.jsx("option",{value:""}):null,Array.from(F)]},X):null]})})};lS.displayName=sa;var aS="SelectTrigger",uS=g.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,s=jc(n),i=yo(aS,n),l=i.disabled||r,a=Re(t,i.onTriggerChange),u=Nc(n),[c,d,p]=OS(m=>{const w=u().filter(v=>!v.disabled),S=w.find(v=>v.value===i.value),y=IS(w,m,S);y!==void 0&&i.onValueChange(y.value)}),h=()=>{l||(i.onOpenChange(!0),p())};return f.jsx(Z0,{asChild:!0,...s,children:f.jsx(ye.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":AS(i.value)?"":void 0,...o,ref:a,onClick:te(o.onClick,m=>{m.currentTarget.focus()}),onPointerDown:te(o.onPointerDown,m=>{const w=m.target;w.hasPointerCapture(m.pointerId)&&w.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&(h(),i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)},m.preventDefault())}),onKeyDown:te(o.onKeyDown,m=>{const w=c.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&d(m.key),!(w&&m.key===" ")&&yN.includes(m.key)&&(h(),m.preventDefault())})})})});uS.displayName=aS;var cS="SelectValue",dS=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:s,placeholder:i="",...l}=e,a=yo(cS,n),{onValueNodeHasChildrenChange:u}=a,c=s!==void 0,d=Re(t,a.onValueNodeChange);return _t(()=>{u(c)},[u,c]),f.jsx(ye.span,{...l,ref:d,style:{pointerEvents:"none"},children:AS(a.value)?f.jsx(f.Fragment,{children:i}):s})});dS.displayName=cS;var bN="SelectIcon",fS=g.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return f.jsx(ye.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});fS.displayName=bN;var RN="SelectPortal",pS=e=>f.jsx(em,{asChild:!0,...e});pS.displayName=RN;var Ko="SelectContent",hS=g.forwardRef((e,t)=>{const n=yo(Ko,e.__scopeSelect),[r,o]=g.useState();if(_t(()=>{o(new DocumentFragment)},[]),!n.open){const s=r;return s?Jo.createPortal(f.jsx(mS,{scope:e.__scopeSelect,children:f.jsx(Tc.Slot,{scope:e.__scopeSelect,children:f.jsx("div",{children:e.children})})}),s):null}return f.jsx(gS,{...e,ref:t})});hS.displayName=Ko;var lr=10,[mS,wo]=Ri(Ko),EN="SelectContentImpl",gS=g.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:s,onPointerDownOutside:i,side:l,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:w,avoidCollisions:S,...y}=e,v=yo(Ko,n),[x,C]=g.useState(null),[_,P]=g.useState(null),k=Re(t,ee=>C(ee)),[E,I]=g.useState(null),[O,Y]=g.useState(null),F=Nc(n),[G,X]=g.useState(!1),J=g.useRef(!1);g.useEffect(()=>{if(x)return J0(x)},[x]),E0();const re=g.useCallback(ee=>{const[be,...Ae]=F().map(Pe=>Pe.ref.current),[Ee]=Ae.slice(-1),ke=document.activeElement;for(const Pe of ee)if(Pe===ke||(Pe==null||Pe.scrollIntoView({block:"nearest"}),Pe===be&&_&&(_.scrollTop=0),Pe===Ee&&_&&(_.scrollTop=_.scrollHeight),Pe==null||Pe.focus(),document.activeElement!==ke))return},[F,_]),Q=g.useCallback(()=>re([E,x]),[re,E,x]);g.useEffect(()=>{G&&Q()},[G,Q]);const{onOpenChange:M,triggerPointerDownPosRef:j}=v;g.useEffect(()=>{if(x){let ee={x:0,y:0};const be=Ee=>{var ke,Pe;ee={x:Math.abs(Math.round(Ee.pageX)-(((ke=j.current)==null?void 0:ke.x)??0)),y:Math.abs(Math.round(Ee.pageY)-(((Pe=j.current)==null?void 0:Pe.y)??0))}},Ae=Ee=>{ee.x<=10&&ee.y<=10?Ee.preventDefault():x.contains(Ee.target)||M(!1),document.removeEventListener("pointermove",be),j.current=null};return j.current!==null&&(document.addEventListener("pointermove",be),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",be),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[x,M,j]),g.useEffect(()=>{const ee=()=>M(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[M]);const[K,se]=OS(ee=>{const be=F().filter(ke=>!ke.disabled),Ae=be.find(ke=>ke.ref.current===document.activeElement),Ee=IS(be,ee,Ae);Ee&&setTimeout(()=>Ee.ref.current.focus())}),he=g.useCallback((ee,be,Ae)=>{const Ee=!J.current&&!Ae;(v.value!==void 0&&v.value===be||Ee)&&(I(ee),Ee&&(J.current=!0))},[v.value]),mt=g.useCallback(()=>x==null?void 0:x.focus(),[x]),ze=g.useCallback((ee,be,Ae)=>{const Ee=!J.current&&!Ae;(v.value!==void 0&&v.value===be||Ee)&&Y(ee)},[v.value]),Rt=r==="popper"?cp:vS,Fe=Rt===cp?{side:l,sideOffset:a,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:w,avoidCollisions:S}:{};return f.jsx(mS,{scope:n,content:x,viewport:_,onViewportChange:P,itemRefCallback:he,selectedItem:E,onItemLeave:mt,itemTextRefCallback:ze,focusSelectedItem:Q,selectedItemText:O,position:r,isPositioned:G,searchRef:K,children:f.jsx(nm,{as:so,allowPinchZoom:!0,children:f.jsx(Hh,{asChild:!0,trapped:v.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:te(o,ee=>{var be;(be=v.trigger)==null||be.focus({preventScroll:!0}),ee.preventDefault()}),children:f.jsx(Uh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:f.jsx(Rt,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:ee=>ee.preventDefault(),...y,...Fe,onPlaced:()=>X(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:te(y.onKeyDown,ee=>{const be=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!be&&ee.key.length===1&&se(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Ee=F().filter(ke=>!ke.disabled).map(ke=>ke.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Ee=Ee.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const ke=ee.target,Pe=Ee.indexOf(ke);Ee=Ee.slice(Pe+1)}setTimeout(()=>re(Ee)),ee.preventDefault()}})})})})})})});gS.displayName=EN;var kN="SelectItemAlignedPosition",vS=g.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,s=yo(Ko,n),i=wo(Ko,n),[l,a]=g.useState(null),[u,c]=g.useState(null),d=Re(t,k=>c(k)),p=Nc(n),h=g.useRef(!1),m=g.useRef(!0),{viewport:w,selectedItem:S,selectedItemText:y,focusSelectedItem:v}=i,x=g.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&u&&w&&S&&y){const k=s.trigger.getBoundingClientRect(),E=u.getBoundingClientRect(),I=s.valueNode.getBoundingClientRect(),O=y.getBoundingClientRect();if(s.dir!=="rtl"){const ke=O.left-E.left,Pe=I.left-ke,gt=k.left-Pe,Ht=k.width+gt,rs=Math.max(Ht,E.width),os=window.innerWidth-lr,ss=sp(Pe,[lr,os-rs]);l.style.minWidth=Ht+"px",l.style.left=ss+"px"}else{const ke=E.right-O.right,Pe=window.innerWidth-I.right-ke,gt=window.innerWidth-k.right-Pe,Ht=k.width+gt,rs=Math.max(Ht,E.width),os=window.innerWidth-lr,ss=sp(Pe,[lr,os-rs]);l.style.minWidth=Ht+"px",l.style.right=ss+"px"}const Y=p(),F=window.innerHeight-lr*2,G=w.scrollHeight,X=window.getComputedStyle(u),J=parseInt(X.borderTopWidth,10),re=parseInt(X.paddingTop,10),Q=parseInt(X.borderBottomWidth,10),M=parseInt(X.paddingBottom,10),j=J+re+G+M+Q,K=Math.min(S.offsetHeight*5,j),se=window.getComputedStyle(w),he=parseInt(se.paddingTop,10),mt=parseInt(se.paddingBottom,10),ze=k.top+k.height/2-lr,Rt=F-ze,Fe=S.offsetHeight/2,ee=S.offsetTop+Fe,be=J+re+ee,Ae=j-be;if(be<=ze){const ke=S===Y[Y.length-1].ref.current;l.style.bottom="0px";const Pe=u.clientHeight-w.offsetTop-w.offsetHeight,gt=Math.max(Rt,Fe+(ke?mt:0)+Pe+Q),Ht=be+gt;l.style.height=Ht+"px"}else{const ke=S===Y[0].ref.current;l.style.top="0px";const gt=Math.max(ze,J+w.offsetTop+(ke?he:0)+Fe)+Ae;l.style.height=gt+"px",w.scrollTop=be-ze+w.offsetTop}l.style.margin=`${lr}px 0`,l.style.minHeight=K+"px",l.style.maxHeight=F+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,s.trigger,s.valueNode,l,u,w,S,y,s.dir,r]);_t(()=>x(),[x]);const[C,_]=g.useState();_t(()=>{u&&_(window.getComputedStyle(u).zIndex)},[u]);const P=g.useCallback(k=>{k&&m.current===!0&&(x(),v==null||v(),m.current=!1)},[x,v]);return f.jsx(TN,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:P,children:f.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:f.jsx(ye.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});vS.displayName=kN;var PN="SelectPopperPosition",cp=g.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=lr,...s}=e,i=jc(n);return f.jsx(q0,{...i,...s,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...s.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});cp.displayName=PN;var[TN,rm]=Ri(Ko,{}),dp="SelectViewport",yS=g.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,s=wo(dp,n),i=rm(dp,n),l=Re(t,s.onViewportChange),a=g.useRef(0);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),f.jsx(Tc.Slot,{scope:n,children:f.jsx(ye.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:te(o.onScroll,u=>{const c=u.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&d){const h=Math.abs(a.current-c.scrollTop);if(h>0){const m=window.innerHeight-lr*2,w=parseFloat(d.style.minHeight),S=parseFloat(d.style.height),y=Math.max(w,S);if(y0?C:0,d.style.justifyContent="flex-end")}}}a.current=c.scrollTop})})})]})});yS.displayName=dp;var wS="SelectGroup",[NN,jN]=Ri(wS),xS=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=di();return f.jsx(NN,{scope:n,id:o,children:f.jsx(ye.div,{role:"group","aria-labelledby":o,...r,ref:t})})});xS.displayName=wS;var SS="SelectLabel",CS=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jN(SS,n);return f.jsx(ye.div,{id:o.id,...r,ref:t})});CS.displayName=SS;var $u="SelectItem",[AN,_S]=Ri($u),bS=g.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...i}=e,l=yo($u,n),a=wo($u,n),u=l.value===r,[c,d]=g.useState(s??""),[p,h]=g.useState(!1),m=Re(t,y=>{var v;return(v=a.itemRefCallback)==null?void 0:v.call(a,y,r,o)}),w=di(),S=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return f.jsx(AN,{scope:n,value:r,disabled:o,textId:w,isSelected:u,onItemTextChange:g.useCallback(y=>{d(v=>v||((y==null?void 0:y.textContent)??"").trim())},[]),children:f.jsx(Tc.ItemSlot,{scope:n,value:r,disabled:o,textValue:c,children:f.jsx(ye.div,{role:"option","aria-labelledby":w,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:m,onFocus:te(i.onFocus,()=>h(!0)),onBlur:te(i.onBlur,()=>h(!1)),onPointerUp:te(i.onPointerUp,S),onPointerMove:te(i.onPointerMove,y=>{var v;o?(v=a.onItemLeave)==null||v.call(a):y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:te(i.onPointerLeave,y=>{var v;y.currentTarget===document.activeElement&&((v=a.onItemLeave)==null||v.call(a))}),onKeyDown:te(i.onKeyDown,y=>{var x;((x=a.searchRef)==null?void 0:x.current)!==""&&y.key===" "||(wN.includes(y.key)&&S(),y.key===" "&&y.preventDefault())})})})})});bS.displayName=$u;var Ki="SelectItemText",RS=g.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...s}=e,i=yo(Ki,n),l=wo(Ki,n),a=_S(Ki,n),u=_N(Ki,n),[c,d]=g.useState(null),p=Re(t,y=>d(y),a.onItemTextChange,y=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,y,a.value,a.disabled)}),h=c==null?void 0:c.textContent,m=g.useMemo(()=>f.jsx("option",{value:a.value,disabled:a.disabled,children:h},a.value),[a.disabled,a.value,h]),{onNativeOptionAdd:w,onNativeOptionRemove:S}=u;return _t(()=>(w(m),()=>S(m)),[w,S,m]),f.jsxs(f.Fragment,{children:[f.jsx(ye.span,{id:a.textId,...s,ref:p}),a.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Jo.createPortal(s.children,i.valueNode):null]})});RS.displayName=Ki;var ES="SelectItemIndicator",kS=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return _S(ES,n).isSelected?f.jsx(ye.span,{"aria-hidden":!0,...r,ref:t}):null});kS.displayName=ES;var fp="SelectScrollUpButton",PS=g.forwardRef((e,t)=>{const n=wo(fp,e.__scopeSelect),r=rm(fp,e.__scopeSelect),[o,s]=g.useState(!1),i=Re(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollTop>0;s(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?f.jsx(NS,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=n;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});PS.displayName=fp;var pp="SelectScrollDownButton",TS=g.forwardRef((e,t)=>{const n=wo(pp,e.__scopeSelect),r=rm(pp,e.__scopeSelect),[o,s]=g.useState(!1),i=Re(t,r.onScrollButtonChange);return _t(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,c=Math.ceil(a.scrollTop)a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?f.jsx(NS,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=n;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});TS.displayName=pp;var NS=g.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,s=wo("SelectScrollButton",n),i=g.useRef(null),l=Nc(n),a=g.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return g.useEffect(()=>()=>a(),[a]),_t(()=>{var c;const u=l().find(d=>d.ref.current===document.activeElement);(c=u==null?void 0:u.ref.current)==null||c.scrollIntoView({block:"nearest"})},[l]),f.jsx(ye.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:te(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:te(o.onPointerMove,()=>{var u;(u=s.onItemLeave)==null||u.call(s),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:te(o.onPointerLeave,()=>{a()})})}),MN="SelectSeparator",jS=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return f.jsx(ye.div,{"aria-hidden":!0,...r,ref:t})});jS.displayName=MN;var hp="SelectArrow",ON=g.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=jc(n),s=yo(hp,n),i=wo(hp,n);return s.open&&i.position==="popper"?f.jsx(Q0,{...o,...r,ref:t}):null});ON.displayName=hp;function AS(e){return e===""||e===void 0}var MS=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=g.useRef(null),s=Re(t,o),i=tm(n);return g.useEffect(()=>{const l=o.current,a=window.HTMLSelectElement.prototype,c=Object.getOwnPropertyDescriptor(a,"value").set;if(i!==n&&c){const d=new Event("change",{bubbles:!0});c.call(l,n),l.dispatchEvent(d)}},[i,n]),f.jsx(X0,{asChild:!0,children:f.jsx("select",{...r,ref:s,defaultValue:n})})});MS.displayName="BubbleSelect";function OS(e){const t=it(e),n=g.useRef(""),r=g.useRef(0),o=g.useCallback(i=>{const l=n.current+i;t(l),function a(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>a(""),1e3))}(l)},[t]),s=g.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,s]}function IS(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=IN(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const a=i.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function IN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FN=lS,FS=uS,DN=dS,LN=fS,VN=pS,DS=hS,$N=yS,zN=xS,LS=CS,VS=bS,BN=RS,UN=kS,$S=PS,zS=TS,BS=jS;/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const HN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),US=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var WN={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GN=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},a)=>g.createElement("svg",{ref:a,...WN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:US("lucide",o),...l},[...i.map(([u,c])=>g.createElement(u,c)),...Array.isArray(s)?s:[s]]));/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const es=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(GN,{ref:s,iconNode:t,className:US(`lucide-${HN(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bv=es("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const om=es("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sm=es("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const KN=es("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZN=es("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qN=es("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + * @license lucide-react v0.416.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const QN=es("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),Zi=FN,La=zN,qi=DN,Rs=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(FS,{ref:r,className:de("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,f.jsx(LN,{asChild:!0,children:f.jsx(sm,{className:"h-4 w-4 opacity-50"})})]}));Rs.displayName=FS.displayName;const HS=g.forwardRef(({className:e,...t},n)=>f.jsx($S,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(ZN,{className:"h-4 w-4"})}));HS.displayName=$S.displayName;const WS=g.forwardRef(({className:e,...t},n)=>f.jsx(zS,{ref:n,className:de("flex cursor-default items-center justify-center py-1",e),...t,children:f.jsx(sm,{className:"h-4 w-4"})}));WS.displayName=zS.displayName;const Es=g.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>f.jsx(VN,{children:f.jsxs(DS,{ref:o,className:de("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",n==="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",e),position:n,...r,children:[f.jsx(HS,{}),f.jsx($N,{className:de("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),f.jsx(WS,{})]})}));Es.displayName=DS.displayName;const Qi=g.forwardRef(({className:e,...t},n)=>f.jsx(LS,{ref:n,className:de("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Qi.displayName=LS.displayName;const Ke=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(VS,{ref:r,className:de("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(UN,{children:f.jsx(om,{className:"h-4 w-4"})})}),f.jsx(BN,{children:t})]}));Ke.displayName=VS.displayName;const mp=g.forwardRef(({className:e,...t},n)=>f.jsx(BS,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));mp.displayName=BS.displayName;var ia=e=>e.type==="checkbox",ks=e=>e instanceof Date,Tt=e=>e==null;const GS=e=>typeof e=="object";var at=e=>!Tt(e)&&!Array.isArray(e)&&GS(e)&&!ks(e),KS=e=>at(e)&&e.target?ia(e.target)?e.target.checked:e.target.value:e,XN=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,ZS=(e,t)=>e.has(XN(t)),YN=e=>{const t=e.constructor&&e.constructor.prototype;return at(t)&&t.hasOwnProperty("isPrototypeOf")},im=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function It(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(im&&(e instanceof Blob||e instanceof FileList))&&(n||at(e)))if(t=n?[]:{},!n&&!YN(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=It(e[r]));else return e;return t}var Ac=e=>Array.isArray(e)?e.filter(Boolean):[],Qe=e=>e===void 0,$=(e,t,n)=>{if(!t||!at(e))return n;const r=Ac(t.split(/[,[\].]+?/)).reduce((o,s)=>Tt(o)?o:o[s],e);return Qe(r)||r===e?Qe(e[t])?n:e[t]:r},Wn=e=>typeof e=="boolean",lm=e=>/^\w*$/.test(e),qS=e=>Ac(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ne=(e,t,n)=>{let r=-1;const o=lm(t)?[t]:qS(t),s=o.length,i=s-1;for(;++rxe.useContext(QS),JN=e=>{const{children:t,...n}=e;return xe.createElement(QS.Provider,{value:n},t)};var XS=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rn.all&&(t._proxyFormState[i]=!r||Rn.all),n&&(n[i]=!0),e[i]}});return o},Kt=e=>at(e)&&!Object.keys(e).length,YS=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Kt(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||Rn.all))},ul=e=>Array.isArray(e)?e:[e],JS=(e,t,n)=>!e||!t||e===t||ul(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function am(e){const t=xe.useRef(e);t.current=e,xe.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function ej(e){const t=Mc(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,l]=xe.useState(n._formState),a=xe.useRef(!0),u=xe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),c=xe.useRef(o);return c.current=o,am({disabled:r,next:d=>a.current&&JS(c.current,d.name,s)&&YS(d,u.current,n._updateFormState)&&l({...n._formState,...d}),subject:n._subjects.state}),xe.useEffect(()=>(a.current=!0,u.current.isValid&&n._updateValid(!0),()=>{a.current=!1}),[n]),XS(i,n,u.current,!1)}var Kn=e=>typeof e=="string",eC=(e,t,n,r,o)=>Kn(e)?(r&&t.watch.add(e),$(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),$(n,s))):(r&&(t.watchAll=!0),n);function tj(e){const t=Mc(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},l=xe.useRef(r);l.current=r,am({disabled:s,subject:n._subjects.values,next:c=>{JS(l.current,c.name,i)&&u(It(eC(l.current,n._names,c.values||n._formValues,!1,o)))}});const[a,u]=xe.useState(n._getWatch(r,o));return xe.useEffect(()=>n._removeUnmounted()),a}function nj(e){const t=Mc(),{name:n,disabled:r,control:o=t.control,shouldUnregister:s}=e,i=ZS(o._names.array,n),l=tj({control:o,name:n,defaultValue:$(o._formValues,n,$(o._defaultValues,n,e.defaultValue)),exact:!0}),a=ej({control:o,name:n}),u=xe.useRef(o.register(n,{...e.rules,value:l,...Wn(e.disabled)?{disabled:e.disabled}:{}}));return xe.useEffect(()=>{const c=o._options.shouldUnregister||s,d=(p,h)=>{const m=$(o._fields,p);m&&m._f&&(m._f.mount=h)};if(d(n,!0),c){const p=It($(o._options.defaultValues,n));Ne(o._defaultValues,n,p),Qe($(o._formValues,n))&&Ne(o._formValues,n,p)}return()=>{(i?c&&!o._state.action:c)?o.unregister(n):d(n,!1)}},[n,o,i,s]),xe.useEffect(()=>{$(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:$(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:l,...Wn(r)||a.disabled?{disabled:a.disabled||r}:{},onChange:xe.useCallback(c=>u.current.onChange({target:{value:KS(c),name:n},type:zu.CHANGE}),[n]),onBlur:xe.useCallback(()=>u.current.onBlur({target:{value:$(o._formValues,n),name:n},type:zu.BLUR}),[n,o]),ref:c=>{const d=$(o._fields,n);d&&c&&(d._f.ref={focus:()=>c.focus(),select:()=>c.select(),setCustomValidity:p=>c.setCustomValidity(p),reportValidity:()=>c.reportValidity()})}},formState:a,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$(a.errors,n)},isDirty:{enumerable:!0,get:()=>!!$(a.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$(a.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$(a.validatingFields,n)},error:{enumerable:!0,get:()=>$(a.errors,n)}})}}const rj=e=>e.render(nj(e));var tC=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},Uv=e=>({isOnSubmit:!e||e===Rn.onSubmit,isOnBlur:e===Rn.onBlur,isOnChange:e===Rn.onChange,isOnAll:e===Rn.all,isOnTouch:e===Rn.onTouched}),Hv=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const cl=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=$(e,o);if(s){const{_f:i,...l}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;cl(l,t)}else at(l)&&cl(l,t)}}};var oj=(e,t,n)=>{const r=ul($(e,n));return Ne(r,"root",t[n]),Ne(e,n,r),e},um=e=>e.type==="file",Kr=e=>typeof e=="function",Bu=e=>{if(!im)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},iu=e=>Kn(e),cm=e=>e.type==="radio",Uu=e=>e instanceof RegExp;const Wv={value:!1,isValid:!1},Gv={value:!0,isValid:!0};var nC=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Qe(e[0].attributes.value)?Qe(e[0].value)||e[0].value===""?Gv:{value:e[0].value,isValid:!0}:Gv:Wv}return Wv};const Kv={isValid:!1,value:null};var rC=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Kv):Kv;function Zv(e,t,n="validate"){if(iu(e)||Array.isArray(e)&&e.every(iu)||Wn(e)&&!e)return{type:n,message:iu(e)?e:"",ref:t}}var ds=e=>at(e)&&!Uu(e)?e:{value:e,message:""},qv=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:l,maxLength:a,minLength:u,min:c,max:d,pattern:p,validate:h,name:m,valueAsNumber:w,mount:S,disabled:y}=e._f,v=$(t,m);if(!S||y)return{};const x=i?i[0]:s,C=F=>{r&&x.reportValidity&&(x.setCustomValidity(Wn(F)?"":F||""),x.reportValidity())},_={},P=cm(s),k=ia(s),E=P||k,I=(w||um(s))&&Qe(s.value)&&Qe(v)||Bu(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,O=tC.bind(null,m,n,_),Y=(F,G,X,J=rr.maxLength,re=rr.minLength)=>{const Q=F?G:X;_[m]={type:F?J:re,message:Q,ref:s,...O(F?J:re,Q)}};if(o?!Array.isArray(v)||!v.length:l&&(!E&&(I||Tt(v))||Wn(v)&&!v||k&&!nC(i).isValid||P&&!rC(i).isValid)){const{value:F,message:G}=iu(l)?{value:!!l,message:l}:ds(l);if(F&&(_[m]={type:rr.required,message:G,ref:x,...O(rr.required,G)},!n))return C(G),_}if(!I&&(!Tt(c)||!Tt(d))){let F,G;const X=ds(d),J=ds(c);if(!Tt(v)&&!isNaN(v)){const re=s.valueAsNumber||v&&+v;Tt(X.value)||(F=re>X.value),Tt(J.value)||(G=renew Date(new Date().toDateString()+" "+K),M=s.type=="time",j=s.type=="week";Kn(X.value)&&v&&(F=M?Q(v)>Q(X.value):j?v>X.value:re>new Date(X.value)),Kn(J.value)&&v&&(G=M?Q(v)+F.value,J=!Tt(G.value)&&v.length<+G.value;if((X||J)&&(Y(X,F.message,G.message),!n))return C(_[m].message),_}if(p&&!I&&Kn(v)){const{value:F,message:G}=ds(p);if(Uu(F)&&!v.match(F)&&(_[m]={type:rr.pattern,message:G,ref:s,...O(rr.pattern,G)},!n))return C(G),_}if(h){if(Kr(h)){const F=await h(v,t),G=Zv(F,x);if(G&&(_[m]={...G,...O(rr.validate,G.message)},!n))return C(G.message),_}else if(at(h)){let F={};for(const G in h){if(!Kt(F)&&!n)break;const X=Zv(await h[G](v,t),x,G);X&&(F={...X,...O(G,X.message)},C(X.message),n&&(_[m]=F))}if(!Kt(F)&&(_[m]={ref:x,...F},!n))return _}}return C(!0),_};function sj(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},Hu=e=>Tt(e)||!GS(e);function Eo(e,t){if(Hu(e)||Hu(t))return e===t;if(ks(e)&&ks(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(ks(s)&&ks(i)||at(s)&&at(i)||Array.isArray(s)&&Array.isArray(i)?!Eo(s,i):s!==i)return!1}}return!0}var oC=e=>e.type==="select-multiple",lj=e=>cm(e)||ia(e),Fd=e=>Bu(e)&&e.isConnected,sC=e=>{for(const t in e)if(Kr(e[t]))return!0;return!1};function Wu(e,t={}){const n=Array.isArray(e);if(at(e)||n)for(const r in e)Array.isArray(e[r])||at(e[r])&&!sC(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Wu(e[r],t[r])):Tt(e[r])||(t[r]=!0);return t}function iC(e,t,n){const r=Array.isArray(e);if(at(e)||r)for(const o in e)Array.isArray(e[o])||at(e[o])&&!sC(e[o])?Qe(t)||Hu(n[o])?n[o]=Array.isArray(e[o])?Wu(e[o],[]):{...Wu(e[o])}:iC(e[o],Tt(t)?{}:t[o],n[o]):n[o]=!Eo(e[o],t[o]);return n}var Va=(e,t)=>iC(e,t,Wu(t)),lC=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Qe(e)?e:t?e===""?NaN:e&&+e:n&&Kn(e)?new Date(e):r?r(e):e;function Dd(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return um(t)?t.files:cm(t)?rC(e.refs).value:oC(t)?[...t.selectedOptions].map(({value:n})=>n):ia(t)?nC(e.refs).value:lC(Qe(t.value)?e.ref.value:t.value,e)}var aj=(e,t,n,r)=>{const o={};for(const s of e){const i=$(t,s);i&&Ne(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Vi=e=>Qe(e)?e:Uu(e)?e.source:at(e)?Uu(e.value)?e.value.source:e.value:e,uj=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Qv(e,t,n){const r=$(e,n);if(r||lm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=$(t,s),l=$(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(l&&l.type)return{name:s,error:l};o.pop()}return{name:n}}var cj=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,dj=(e,t)=>!Ac($(e,t)).length&&rt(e,t);const fj={mode:Rn.onSubmit,reValidateMode:Rn.onChange,shouldFocusError:!0};function pj(e={}){let t={...fj,...e},n={submitCount:0,isDirty:!1,isLoading:Kr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=at(t.defaultValues)||at(t.values)?It(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:It(o),i={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},a,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Id(),array:Id(),state:Id()},p=Uv(t.mode),h=Uv(t.reValidateMode),m=t.criteriaMode===Rn.all,w=b=>T=>{clearTimeout(u),u=setTimeout(b,T)},S=async b=>{if(c.isValid||b){const T=t.resolver?Kt((await E()).errors):await O(r,!0);T!==n.isValid&&d.state.next({isValid:T})}},y=(b,T)=>{(c.isValidating||c.validatingFields)&&((b||Array.from(l.mount)).forEach(A=>{A&&(T?Ne(n.validatingFields,A,T):rt(n.validatingFields,A))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Kt(n.validatingFields)}))},v=(b,T=[],A,H,B=!0,V=!0)=>{if(H&&A){if(i.action=!0,V&&Array.isArray($(r,b))){const oe=A($(r,b),H.argA,H.argB);B&&Ne(r,b,oe)}if(V&&Array.isArray($(n.errors,b))){const oe=A($(n.errors,b),H.argA,H.argB);B&&Ne(n.errors,b,oe),dj(n.errors,b)}if(c.touchedFields&&V&&Array.isArray($(n.touchedFields,b))){const oe=A($(n.touchedFields,b),H.argA,H.argB);B&&Ne(n.touchedFields,b,oe)}c.dirtyFields&&(n.dirtyFields=Va(o,s)),d.state.next({name:b,isDirty:F(b,T),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ne(s,b,T)},x=(b,T)=>{Ne(n.errors,b,T),d.state.next({errors:n.errors})},C=b=>{n.errors=b,d.state.next({errors:n.errors,isValid:!1})},_=(b,T,A,H)=>{const B=$(r,b);if(B){const V=$(s,b,Qe(A)?$(o,b):A);Qe(V)||H&&H.defaultChecked||T?Ne(s,b,T?V:Dd(B._f)):J(b,V),i.mount&&S()}},P=(b,T,A,H,B)=>{let V=!1,oe=!1;const Te={name:b},Je=!!($(r,b)&&$(r,b)._f&&$(r,b)._f.disabled);if(!A||H){c.isDirty&&(oe=n.isDirty,n.isDirty=Te.isDirty=F(),V=oe!==Te.isDirty);const Wt=Je||Eo($(o,b),T);oe=!!(!Je&&$(n.dirtyFields,b)),Wt||Je?rt(n.dirtyFields,b):Ne(n.dirtyFields,b,!0),Te.dirtyFields=n.dirtyFields,V=V||c.dirtyFields&&oe!==!Wt}if(A){const Wt=$(n.touchedFields,b);Wt||(Ne(n.touchedFields,b,A),Te.touchedFields=n.touchedFields,V=V||c.touchedFields&&Wt!==A)}return V&&B&&d.state.next(Te),V?Te:{}},k=(b,T,A,H)=>{const B=$(n.errors,b),V=c.isValid&&Wn(T)&&n.isValid!==T;if(e.delayError&&A?(a=w(()=>x(b,A)),a(e.delayError)):(clearTimeout(u),a=null,A?Ne(n.errors,b,A):rt(n.errors,b)),(A?!Eo(B,A):B)||!Kt(H)||V){const oe={...H,...V&&Wn(T)?{isValid:T}:{},errors:n.errors,name:b};n={...n,...oe},d.state.next(oe)}},E=async b=>{y(b,!0);const T=await t.resolver(s,t.context,aj(b||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return y(b),T},I=async b=>{const{errors:T}=await E(b);if(b)for(const A of b){const H=$(T,A);H?Ne(n.errors,A,H):rt(n.errors,A)}else n.errors=T;return T},O=async(b,T,A={valid:!0})=>{for(const H in b){const B=b[H];if(B){const{_f:V,...oe}=B;if(V){const Te=l.array.has(V.name);y([H],!0);const Je=await qv(B,s,m,t.shouldUseNativeValidation&&!T,Te);if(y([H]),Je[V.name]&&(A.valid=!1,T))break;!T&&($(Je,V.name)?Te?oj(n.errors,Je,V.name):Ne(n.errors,V.name,Je[V.name]):rt(n.errors,V.name))}oe&&await O(oe,T,A)}}return A.valid},Y=()=>{for(const b of l.unMount){const T=$(r,b);T&&(T._f.refs?T._f.refs.every(A=>!Fd(A)):!Fd(T._f.ref))&&Fe(b)}l.unMount=new Set},F=(b,T)=>(b&&T&&Ne(s,b,T),!Eo(se(),o)),G=(b,T,A)=>eC(b,l,{...i.mount?s:Qe(T)?o:Kn(b)?{[b]:T}:T},A,T),X=b=>Ac($(i.mount?s:o,b,e.shouldUnregister?$(o,b,[]):[])),J=(b,T,A={})=>{const H=$(r,b);let B=T;if(H){const V=H._f;V&&(!V.disabled&&Ne(s,b,lC(T,V)),B=Bu(V.ref)&&Tt(T)?"":T,oC(V.ref)?[...V.ref.options].forEach(oe=>oe.selected=B.includes(oe.value)):V.refs?ia(V.ref)?V.refs.length>1?V.refs.forEach(oe=>(!oe.defaultChecked||!oe.disabled)&&(oe.checked=Array.isArray(B)?!!B.find(Te=>Te===oe.value):B===oe.value)):V.refs[0]&&(V.refs[0].checked=!!B):V.refs.forEach(oe=>oe.checked=oe.value===B):um(V.ref)?V.ref.value="":(V.ref.value=B,V.ref.type||d.values.next({name:b,values:{...s}})))}(A.shouldDirty||A.shouldTouch)&&P(b,B,A.shouldTouch,A.shouldDirty,!0),A.shouldValidate&&K(b)},re=(b,T,A)=>{for(const H in T){const B=T[H],V=`${b}.${H}`,oe=$(r,V);(l.array.has(b)||!Hu(B)||oe&&!oe._f)&&!ks(B)?re(V,B,A):J(V,B,A)}},Q=(b,T,A={})=>{const H=$(r,b),B=l.array.has(b),V=It(T);Ne(s,b,V),B?(d.array.next({name:b,values:{...s}}),(c.isDirty||c.dirtyFields)&&A.shouldDirty&&d.state.next({name:b,dirtyFields:Va(o,s),isDirty:F(b,V)})):H&&!H._f&&!Tt(V)?re(b,V,A):J(b,V,A),Hv(b,l)&&d.state.next({...n}),d.values.next({name:i.mount?b:void 0,values:{...s}})},M=async b=>{i.mount=!0;const T=b.target;let A=T.name,H=!0;const B=$(r,A),V=()=>T.type?Dd(B._f):KS(b),oe=Te=>{H=Number.isNaN(Te)||Te===$(s,A,Te)};if(B){let Te,Je;const Wt=V(),is=b.type===zu.BLUR||b.type===zu.FOCUS_OUT,Tb=!uj(B._f)&&!t.resolver&&!$(n.errors,A)&&!B._f.deps||cj(is,$(n.touchedFields,A),n.isSubmitted,h,p),Qc=Hv(A,l,is);Ne(s,A,Wt),is?(B._f.onBlur&&B._f.onBlur(b),a&&a(0)):B._f.onChange&&B._f.onChange(b);const Xc=P(A,Wt,is,!1),Nb=!Kt(Xc)||Qc;if(!is&&d.values.next({name:A,type:b.type,values:{...s}}),Tb)return c.isValid&&S(),Nb&&d.state.next({name:A,...Qc?{}:Xc});if(!is&&Qc&&d.state.next({...n}),t.resolver){const{errors:Km}=await E([A]);if(oe(Wt),H){const jb=Qv(n.errors,r,A),Zm=Qv(Km,r,jb.name||A);Te=Zm.error,A=Zm.name,Je=Kt(Km)}}else y([A],!0),Te=(await qv(B,s,m,t.shouldUseNativeValidation))[A],y([A]),oe(Wt),H&&(Te?Je=!1:c.isValid&&(Je=await O(r,!0)));H&&(B._f.deps&&K(B._f.deps),k(A,Je,Te,Xc))}},j=(b,T)=>{if($(n.errors,T)&&b.focus)return b.focus(),1},K=async(b,T={})=>{let A,H;const B=ul(b);if(t.resolver){const V=await I(Qe(b)?b:B);A=Kt(V),H=b?!B.some(oe=>$(V,oe)):A}else b?(H=(await Promise.all(B.map(async V=>{const oe=$(r,V);return await O(oe&&oe._f?{[V]:oe}:oe)}))).every(Boolean),!(!H&&!n.isValid)&&S()):H=A=await O(r);return d.state.next({...!Kn(b)||c.isValid&&A!==n.isValid?{}:{name:b},...t.resolver||!b?{isValid:A}:{},errors:n.errors}),T.shouldFocus&&!H&&cl(r,j,b?B:l.mount),H},se=b=>{const T={...i.mount?s:o};return Qe(b)?T:Kn(b)?$(T,b):b.map(A=>$(T,A))},he=(b,T)=>({invalid:!!$((T||n).errors,b),isDirty:!!$((T||n).dirtyFields,b),error:$((T||n).errors,b),isValidating:!!$(n.validatingFields,b),isTouched:!!$((T||n).touchedFields,b)}),mt=b=>{b&&ul(b).forEach(T=>rt(n.errors,T)),d.state.next({errors:b?n.errors:{}})},ze=(b,T,A)=>{const H=($(r,b,{_f:{}})._f||{}).ref,B=$(n.errors,b)||{},{ref:V,message:oe,type:Te,...Je}=B;Ne(n.errors,b,{...Je,...T,ref:H}),d.state.next({name:b,errors:n.errors,isValid:!1}),A&&A.shouldFocus&&H&&H.focus&&H.focus()},Rt=(b,T)=>Kr(b)?d.values.subscribe({next:A=>b(G(void 0,T),A)}):G(b,T,!0),Fe=(b,T={})=>{for(const A of b?ul(b):l.mount)l.mount.delete(A),l.array.delete(A),T.keepValue||(rt(r,A),rt(s,A)),!T.keepError&&rt(n.errors,A),!T.keepDirty&&rt(n.dirtyFields,A),!T.keepTouched&&rt(n.touchedFields,A),!T.keepIsValidating&&rt(n.validatingFields,A),!t.shouldUnregister&&!T.keepDefaultValue&&rt(o,A);d.values.next({values:{...s}}),d.state.next({...n,...T.keepDirty?{isDirty:F()}:{}}),!T.keepIsValid&&S()},ee=({disabled:b,name:T,field:A,fields:H,value:B})=>{if(Wn(b)&&i.mount||b){const V=b?void 0:Qe(B)?Dd(A?A._f:$(H,T)._f):B;Ne(s,T,V),P(T,V,!1,!1,!0)}},be=(b,T={})=>{let A=$(r,b);const H=Wn(T.disabled);return Ne(r,b,{...A||{},_f:{...A&&A._f?A._f:{ref:{name:b}},name:b,mount:!0,...T}}),l.mount.add(b),A?ee({field:A,disabled:T.disabled,name:b,value:T.value}):_(b,!0,T.value),{...H?{disabled:T.disabled}:{},...t.progressive?{required:!!T.required,min:Vi(T.min),max:Vi(T.max),minLength:Vi(T.minLength),maxLength:Vi(T.maxLength),pattern:Vi(T.pattern)}:{},name:b,onChange:M,onBlur:M,ref:B=>{if(B){be(b,T),A=$(r,b);const V=Qe(B.value)&&B.querySelectorAll&&B.querySelectorAll("input,select,textarea")[0]||B,oe=lj(V),Te=A._f.refs||[];if(oe?Te.find(Je=>Je===V):V===A._f.ref)return;Ne(r,b,{_f:{...A._f,...oe?{refs:[...Te.filter(Fd),V,...Array.isArray($(o,b))?[{}]:[]],ref:{type:V.type,name:b}}:{ref:V}}}),_(b,!1,void 0,V)}else A=$(r,b,{}),A._f&&(A._f.mount=!1),(t.shouldUnregister||T.shouldUnregister)&&!(ZS(l.array,b)&&i.action)&&l.unMount.add(b)}}},Ae=()=>t.shouldFocusError&&cl(r,j,l.mount),Ee=b=>{Wn(b)&&(d.state.next({disabled:b}),cl(r,(T,A)=>{const H=$(r,A);H&&(T.disabled=H._f.disabled||b,Array.isArray(H._f.refs)&&H._f.refs.forEach(B=>{B.disabled=H._f.disabled||b}))},0,!1))},ke=(b,T)=>async A=>{let H;A&&(A.preventDefault&&A.preventDefault(),A.persist&&A.persist());let B=It(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:V,values:oe}=await E();n.errors=V,B=oe}else await O(r);if(rt(n.errors,"root"),Kt(n.errors)){d.state.next({errors:{}});try{await b(B,A)}catch(V){H=V}}else T&&await T({...n.errors},A),Ae(),setTimeout(Ae);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Kt(n.errors)&&!H,submitCount:n.submitCount+1,errors:n.errors}),H)throw H},Pe=(b,T={})=>{$(r,b)&&(Qe(T.defaultValue)?Q(b,It($(o,b))):(Q(b,T.defaultValue),Ne(o,b,It(T.defaultValue))),T.keepTouched||rt(n.touchedFields,b),T.keepDirty||(rt(n.dirtyFields,b),n.isDirty=T.defaultValue?F(b,It($(o,b))):F()),T.keepError||(rt(n.errors,b),c.isValid&&S()),d.state.next({...n}))},gt=(b,T={})=>{const A=b?It(b):o,H=It(A),B=Kt(b),V=B?o:H;if(T.keepDefaultValues||(o=A),!T.keepValues){if(T.keepDirtyValues)for(const oe of l.mount)$(n.dirtyFields,oe)?Ne(V,oe,$(s,oe)):Q(oe,$(V,oe));else{if(im&&Qe(b))for(const oe of l.mount){const Te=$(r,oe);if(Te&&Te._f){const Je=Array.isArray(Te._f.refs)?Te._f.refs[0]:Te._f.ref;if(Bu(Je)){const Wt=Je.closest("form");if(Wt){Wt.reset();break}}}}r={}}s=e.shouldUnregister?T.keepDefaultValues?It(o):{}:It(V),d.array.next({values:{...V}}),d.values.next({values:{...V}})}l={mount:T.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!c.isValid||!!T.keepIsValid||!!T.keepDirtyValues,i.watch=!!e.shouldUnregister,d.state.next({submitCount:T.keepSubmitCount?n.submitCount:0,isDirty:B?!1:T.keepDirty?n.isDirty:!!(T.keepDefaultValues&&!Eo(b,o)),isSubmitted:T.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:B?{}:T.keepDirtyValues?T.keepDefaultValues&&s?Va(o,s):n.dirtyFields:T.keepDefaultValues&&b?Va(o,b):T.keepDirty?n.dirtyFields:{},touchedFields:T.keepTouched?n.touchedFields:{},errors:T.keepErrors?n.errors:{},isSubmitSuccessful:T.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ht=(b,T)=>gt(Kr(b)?b(s):b,T);return{control:{register:be,unregister:Fe,getFieldState:he,handleSubmit:ke,setError:ze,_executeSchema:E,_getWatch:G,_getDirty:F,_updateValid:S,_removeUnmounted:Y,_updateFieldArray:v,_updateDisabledField:ee,_getFieldArray:X,_reset:gt,_resetDefaultValues:()=>Kr(t.defaultValues)&&t.defaultValues().then(b=>{Ht(b,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:b=>{n={...n,...b}},_disableForm:Ee,_subjects:d,_proxyFormState:c,_setErrors:C,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(b){i=b},get _defaultValues(){return o},get _names(){return l},set _names(b){l=b},get _formState(){return n},set _formState(b){n=b},get _options(){return t},set _options(b){t={...t,...b}}},trigger:K,register:be,handleSubmit:ke,watch:Rt,setValue:Q,getValues:se,reset:Ht,resetField:Pe,clearErrors:mt,unregister:Fe,setError:ze,setFocus:(b,T={})=>{const A=$(r,b),H=A&&A._f;if(H){const B=H.refs?H.refs[0]:H.ref;B.focus&&(B.focus(),T.shouldSelect&&B.select())}},getFieldState:he}}function dm(e={}){const t=xe.useRef(),n=xe.useRef(),[r,o]=xe.useState({isDirty:!1,isValidating:!1,isLoading:Kr(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Kr(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...pj(e),formState:r});const s=t.current.control;return s._options=e,am({subject:s._subjects.state,next:i=>{YS(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),xe.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),xe.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),xe.useEffect(()=>{e.values&&!Eo(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),xe.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),xe.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),xe.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=XS(r,s),t.current}var hj="Label",aC=g.forwardRef((e,t)=>f.jsx(ye.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));aC.displayName=hj;var uC=aC;const mj=C0("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),cC=g.forwardRef(({className:e,...t},n)=>f.jsx(uC,{ref:n,className:de(mj(),e),...t}));cC.displayName=uC.displayName;const fm=JN,dC=g.createContext({}),Xe=({...e})=>f.jsx(dC.Provider,{value:{name:e.name},children:f.jsx(rj,{...e})}),Oc=()=>{const e=g.useContext(dC),t=g.useContext(fC),{getFieldState:n,formState:r}=Mc(),o=n(e.name,r);if(!e)throw new Error("useFormField should be used within ");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...o}},fC=g.createContext({}),Ze=g.forwardRef(({className:e,...t},n)=>{const r=g.useId();return f.jsx(fC.Provider,{value:{id:r},children:f.jsx("div",{ref:n,className:de("space-y-2",e),...t})})});Ze.displayName="FormItem";const et=g.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:o}=Oc();return f.jsx(cC,{ref:n,className:de(r&&"text-destructive",e),htmlFor:o,...t})});et.displayName="FormLabel";const tt=g.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:o,formMessageId:s}=Oc();return f.jsx(so,{ref:t,id:r,"aria-describedby":n?`${o} ${s}`:`${o}`,"aria-invalid":!!n,...e})});tt.displayName="FormControl";const Sr=g.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=Oc();return f.jsx("p",{ref:n,id:r,className:de("text-sm text-muted-foreground",e),...t})});Sr.displayName="FormDescription";const Xt=g.forwardRef(({className:e,children:t,...n},r)=>{const{error:o,formMessageId:s}=Oc(),i=o?String(o==null?void 0:o.message):t;return i?f.jsx("p",{ref:r,id:s,className:de("text-sm font-medium text-destructive",e),...n,children:i}):null});Xt.displayName="FormMessage";function pC({setModalVisible:e}){return f.jsx("div",{className:"z-20 absolute top-0 left-0 h-screen w-screen bg-black/[0.3]",onClick:()=>e(!1)})}function hC(e,t){return function(){return e.apply(t,arguments)}}const{toString:gj}=Object.prototype,{getPrototypeOf:pm}=Object,Ic=(e=>t=>{const n=gj.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Fn=e=>(e=e.toLowerCase(),t=>Ic(t)===e),Fc=e=>t=>typeof t===e,{isArray:Ei}=Array,Al=Fc("undefined");function vj(e){return e!==null&&!Al(e)&&e.constructor!==null&&!Al(e.constructor)&&hn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const mC=Fn("ArrayBuffer");function yj(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&mC(e.buffer),t}const wj=Fc("string"),hn=Fc("function"),gC=Fc("number"),Dc=e=>e!==null&&typeof e=="object",xj=e=>e===!0||e===!1,lu=e=>{if(Ic(e)!=="object")return!1;const t=pm(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Sj=Fn("Date"),Cj=Fn("File"),_j=Fn("Blob"),bj=Fn("FileList"),Rj=e=>Dc(e)&&hn(e.pipe),Ej=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||hn(e.append)&&((t=Ic(e))==="formdata"||t==="object"&&hn(e.toString)&&e.toString()==="[object FormData]"))},kj=Fn("URLSearchParams"),[Pj,Tj,Nj,jj]=["ReadableStream","Request","Response","Headers"].map(Fn),Aj=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function la(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Ei(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const yC=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wC=e=>!Al(e)&&e!==yC;function gp(){const{caseless:e}=wC(this)&&this||{},t={},n=(r,o)=>{const s=e&&vC(t,o)||o;lu(t[s])&&lu(r)?t[s]=gp(t[s],r):lu(r)?t[s]=gp({},r):Ei(r)?t[s]=r.slice():t[s]=r};for(let r=0,o=arguments.length;r(la(t,(o,s)=>{n&&hn(o)?e[s]=hC(o,n):e[s]=o},{allOwnKeys:r}),e),Oj=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Ij=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Fj=(e,t,n,r)=>{let o,s,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&pm(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Dj=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Lj=e=>{if(!e)return null;if(Ei(e))return e;let t=e.length;if(!gC(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Vj=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&pm(Uint8Array)),$j=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const s=o.value;t.call(e,s[0],s[1])}},zj=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Bj=Fn("HTMLFormElement"),Uj=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Xv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Hj=Fn("RegExp"),xC=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};la(n,(o,s)=>{let i;(i=t(o,s,e))!==!1&&(r[s]=i||o)}),Object.defineProperties(e,r)},Wj=e=>{xC(e,(t,n)=>{if(hn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(hn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Gj=(e,t)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return Ei(e)?r(e):r(String(e).split(t)),n},Kj=()=>{},Zj=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Ld="abcdefghijklmnopqrstuvwxyz",Yv="0123456789",SC={DIGIT:Yv,ALPHA:Ld,ALPHA_DIGIT:Ld+Ld.toUpperCase()+Yv},qj=(e=16,t=SC.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Qj(e){return!!(e&&hn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Xj=e=>{const t=new Array(10),n=(r,o)=>{if(Dc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const s=Ei(r)?[]:{};return la(r,(i,l)=>{const a=n(i,o+1);!Al(a)&&(s[l]=a)}),t[o]=void 0,s}}return r};return n(e,0)},Yj=Fn("AsyncFunction"),Jj=e=>e&&(Dc(e)||hn(e))&&hn(e.then)&&hn(e.catch),N={isArray:Ei,isArrayBuffer:mC,isBuffer:vj,isFormData:Ej,isArrayBufferView:yj,isString:wj,isNumber:gC,isBoolean:xj,isObject:Dc,isPlainObject:lu,isReadableStream:Pj,isRequest:Tj,isResponse:Nj,isHeaders:jj,isUndefined:Al,isDate:Sj,isFile:Cj,isBlob:_j,isRegExp:Hj,isFunction:hn,isStream:Rj,isURLSearchParams:kj,isTypedArray:Vj,isFileList:bj,forEach:la,merge:gp,extend:Mj,trim:Aj,stripBOM:Oj,inherits:Ij,toFlatObject:Fj,kindOf:Ic,kindOfTest:Fn,endsWith:Dj,toArray:Lj,forEachEntry:$j,matchAll:zj,isHTMLForm:Bj,hasOwnProperty:Xv,hasOwnProp:Xv,reduceDescriptors:xC,freezeMethods:Wj,toObjectSet:Gj,toCamelCase:Uj,noop:Kj,toFiniteNumber:Zj,findKey:vC,global:yC,isContextDefined:wC,ALPHABET:SC,generateString:qj,isSpecCompliantForm:Qj,toJSONObject:Xj,isAsyncFn:Yj,isThenable:Jj};function fe(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}N.inherits(fe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const CC=fe.prototype,_C={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{_C[e]={value:e}});Object.defineProperties(fe,_C);Object.defineProperty(CC,"isAxiosError",{value:!0});fe.from=(e,t,n,r,o,s)=>{const i=Object.create(CC);return N.toFlatObject(e,i,function(a){return a!==Error.prototype},l=>l!=="isAxiosError"),fe.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const eA=null;function vp(e){return N.isPlainObject(e)||N.isArray(e)}function bC(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function Jv(e,t,n){return e?e.concat(t).map(function(o,s){return o=bC(o),!n&&s?"["+o+"]":o}).join(n?".":""):t}function tA(e){return N.isArray(e)&&!e.some(vp)}const nA=N.toFlatObject(N,{},null,function(t){return/^is[A-Z]/.test(t)});function Lc(e,t,n){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=N.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,S){return!N.isUndefined(S[w])});const r=n.metaTokens,o=n.visitor||c,s=n.dots,i=n.indexes,a=(n.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(o))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(N.isDate(m))return m.toISOString();if(!a&&N.isBlob(m))throw new fe("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(m)||N.isTypedArray(m)?a&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,w,S){let y=m;if(m&&!S&&typeof m=="object"){if(N.endsWith(w,"{}"))w=r?w:w.slice(0,-2),m=JSON.stringify(m);else if(N.isArray(m)&&tA(m)||(N.isFileList(m)||N.endsWith(w,"[]"))&&(y=N.toArray(m)))return w=bC(w),y.forEach(function(x,C){!(N.isUndefined(x)||x===null)&&t.append(i===!0?Jv([w],C,s):i===null?w:w+"[]",u(x))}),!1}return vp(m)?!0:(t.append(Jv(S,w,s),u(m)),!1)}const d=[],p=Object.assign(nA,{defaultVisitor:c,convertValue:u,isVisitable:vp});function h(m,w){if(!N.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+w.join("."));d.push(m),N.forEach(m,function(y,v){(!(N.isUndefined(y)||y===null)&&o.call(t,y,N.isString(v)?v.trim():v,w,p))===!0&&h(y,w?w.concat(v):[v])}),d.pop()}}if(!N.isObject(e))throw new TypeError("data must be an object");return h(e),t}function ey(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hm(e,t){this._pairs=[],e&&Lc(e,this,t)}const RC=hm.prototype;RC.append=function(t,n){this._pairs.push([t,n])};RC.toString=function(t){const n=t?function(r){return t.call(this,r,ey)}:ey;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function rA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function EC(e,t,n){if(!t)return e;const r=n&&n.encode||rA,o=n&&n.serialize;let s;if(o?s=o(t,n):s=N.isURLSearchParams(t)?t.toString():new hm(t,n).toString(r),s){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ty{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){N.forEach(this.handlers,function(r){r!==null&&t(r)})}}const kC={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oA=typeof URLSearchParams<"u"?URLSearchParams:hm,sA=typeof FormData<"u"?FormData:null,iA=typeof Blob<"u"?Blob:null,lA={isBrowser:!0,classes:{URLSearchParams:oA,FormData:sA,Blob:iA},protocols:["http","https","file","blob","url","data"]},mm=typeof window<"u"&&typeof document<"u",aA=(e=>mm&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),uA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",cA=mm&&window.location.href||"http://localhost",dA=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mm,hasStandardBrowserEnv:aA,hasStandardBrowserWebWorkerEnv:uA,origin:cA},Symbol.toStringTag,{value:"Module"})),Tn={...dA,...lA};function fA(e,t){return Lc(e,new Tn.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Tn.isNode&&N.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function pA(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function hA(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r=n.length;return i=!i&&N.isArray(o)?o.length:i,a?(N.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!l):((!o[i]||!N.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],s)&&N.isArray(o[i])&&(o[i]=hA(o[i])),!l)}if(N.isFormData(e)&&N.isFunction(e.entries)){const n={};return N.forEachEntry(e,(r,o)=>{t(pA(r),o,n,0)}),n}return null}function mA(e,t,n){if(N.isString(e))try{return(t||JSON.parse)(e),N.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const aa={transitional:kC,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=N.isObject(t);if(s&&N.isHTMLForm(t)&&(t=new FormData(t)),N.isFormData(t))return o?JSON.stringify(PC(t)):t;if(N.isArrayBuffer(t)||N.isBuffer(t)||N.isStream(t)||N.isFile(t)||N.isBlob(t)||N.isReadableStream(t))return t;if(N.isArrayBufferView(t))return t.buffer;if(N.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return fA(t,this.formSerializer).toString();if((l=N.isFileList(t))||r.indexOf("multipart/form-data")>-1){const a=this.env&&this.env.FormData;return Lc(l?{"files[]":t}:t,a&&new a,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),mA(t)):t}],transformResponse:[function(t){const n=this.transitional||aa.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(N.isResponse(t)||N.isReadableStream(t))return t;if(t&&N.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(i)throw l.name==="SyntaxError"?fe.from(l,fe.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tn.classes.FormData,Blob:Tn.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],e=>{aa.headers[e]={}});const gA=N.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),vA=e=>{const t={};let n,r,o;return e&&e.split(` +`).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&gA[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},ny=Symbol("internals");function $i(e){return e&&String(e).trim().toLowerCase()}function au(e){return e===!1||e==null?e:N.isArray(e)?e.map(au):String(e)}function yA(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const wA=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Vd(e,t,n,r,o){if(N.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!N.isString(t)){if(N.isString(r))return t.indexOf(r)!==-1;if(N.isRegExp(r))return r.test(t)}}function xA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function SA(e,t){const n=N.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Ut{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(l,a,u){const c=$i(a);if(!c)throw new Error("header name must be a non-empty string");const d=N.findKey(o,c);(!d||o[d]===void 0||u===!0||u===void 0&&o[d]!==!1)&&(o[d||a]=au(l))}const i=(l,a)=>N.forEach(l,(u,c)=>s(u,c,a));if(N.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(N.isString(t)&&(t=t.trim())&&!wA(t))i(vA(t),n);else if(N.isHeaders(t))for(const[l,a]of t.entries())s(a,l,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=$i(t),t){const r=N.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return yA(o);if(N.isFunction(n))return n.call(this,o,r);if(N.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=$i(t),t){const r=N.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Vd(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=$i(i),i){const l=N.findKey(r,i);l&&(!n||Vd(r,r[l],l,n))&&(delete r[l],o=!0)}}return N.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Vd(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return N.forEach(this,(o,s)=>{const i=N.findKey(r,s);if(i){n[i]=au(o),delete n[s];return}const l=t?xA(s):String(s).trim();l!==s&&delete n[s],n[l]=au(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return N.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&N.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[ny]=this[ny]={accessors:{}}).accessors,o=this.prototype;function s(i){const l=$i(i);r[l]||(SA(o,i),r[l]=!0)}return N.isArray(t)?t.forEach(s):s(t),this}}Ut.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);N.reduceDescriptors(Ut.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});N.freezeMethods(Ut);function $d(e,t){const n=this||aa,r=t||n,o=Ut.from(r.headers);let s=r.data;return N.forEach(e,function(l){s=l.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function TC(e){return!!(e&&e.__CANCEL__)}function ki(e,t,n){fe.call(this,e??"canceled",fe.ERR_CANCELED,t,n),this.name="CanceledError"}N.inherits(ki,fe,{__CANCEL__:!0});function NC(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new fe("Request failed with status code "+n.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function CA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function _A(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(a){const u=Date.now(),c=r[s];i||(i=u),n[o]=a,r[o]=u;let d=s,p=0;for(;d!==o;)p+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),u-ir)return o&&(clearTimeout(o),o=null),n=l,e.apply(null,arguments);o||(o=setTimeout(()=>(o=null,n=Date.now(),e.apply(null,arguments)),r-(l-n)))}}const Gu=(e,t,n=3)=>{let r=0;const o=_A(50,250);return bA(s=>{const i=s.loaded,l=s.lengthComputable?s.total:void 0,a=i-r,u=o(a),c=i<=l;r=i;const d={loaded:i,total:l,progress:l?i/l:void 0,bytes:a,rate:u||void 0,estimated:u&&l&&c?(l-i)/u:void 0,event:s,lengthComputable:l!=null};d[t?"download":"upload"]=!0,e(d)},n)},RA=Tn.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(s){let i=s;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const l=N.isString(i)?o(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),EA=Tn.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];N.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),N.isString(r)&&i.push("path="+r),N.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function PA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jC(e,t){return e&&!kA(t)?PA(e,t):t}const ry=e=>e instanceof Ut?{...e}:e;function Zo(e,t){t=t||{};const n={};function r(u,c,d){return N.isPlainObject(u)&&N.isPlainObject(c)?N.merge.call({caseless:d},u,c):N.isPlainObject(c)?N.merge({},c):N.isArray(c)?c.slice():c}function o(u,c,d){if(N.isUndefined(c)){if(!N.isUndefined(u))return r(void 0,u,d)}else return r(u,c,d)}function s(u,c){if(!N.isUndefined(c))return r(void 0,c)}function i(u,c){if(N.isUndefined(c)){if(!N.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function l(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const a={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(u,c)=>o(ry(u),ry(c),!0)};return N.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=a[c]||o,p=d(e[c],t[c],c);N.isUndefined(p)&&d!==l||(n[c]=p)}),n}const AC=e=>{const t=Zo({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:l}=t;t.headers=i=Ut.from(i),t.url=EC(jC(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let a;if(N.isFormData(n)){if(Tn.hasStandardBrowserEnv||Tn.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((a=i.getContentType())!==!1){const[u,...c]=a?a.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([u||"multipart/form-data",...c].join("; "))}}if(Tn.hasStandardBrowserEnv&&(r&&N.isFunction(r)&&(r=r(t)),r||r!==!1&&RA(t.url))){const u=o&&s&&EA.read(s);u&&i.set(o,u)}return t},TA=typeof XMLHttpRequest<"u",NA=TA&&function(e){return new Promise(function(n,r){const o=AC(e);let s=o.data;const i=Ut.from(o.headers).normalize();let{responseType:l}=o,a;function u(){o.cancelToken&&o.cancelToken.unsubscribe(a),o.signal&&o.signal.removeEventListener("abort",a)}let c=new XMLHttpRequest;c.open(o.method.toUpperCase(),o.url,!0),c.timeout=o.timeout;function d(){if(!c)return;const h=Ut.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),w={data:!l||l==="text"||l==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:h,config:e,request:c};NC(function(y){n(y),u()},function(y){r(y),u()},w),c=null}"onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(r(new fe("Request aborted",fe.ECONNABORTED,o,c)),c=null)},c.onerror=function(){r(new fe("Network Error",fe.ERR_NETWORK,o,c)),c=null},c.ontimeout=function(){let m=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const w=o.transitional||kC;o.timeoutErrorMessage&&(m=o.timeoutErrorMessage),r(new fe(m,w.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,o,c)),c=null},s===void 0&&i.setContentType(null),"setRequestHeader"in c&&N.forEach(i.toJSON(),function(m,w){c.setRequestHeader(w,m)}),N.isUndefined(o.withCredentials)||(c.withCredentials=!!o.withCredentials),l&&l!=="json"&&(c.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&c.addEventListener("progress",Gu(o.onDownloadProgress,!0)),typeof o.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Gu(o.onUploadProgress)),(o.cancelToken||o.signal)&&(a=h=>{c&&(r(!h||h.type?new ki(null,e,c):h),c.abort(),c=null)},o.cancelToken&&o.cancelToken.subscribe(a),o.signal&&(o.signal.aborted?a():o.signal.addEventListener("abort",a)));const p=CA(o.url);if(p&&Tn.protocols.indexOf(p)===-1){r(new fe("Unsupported protocol "+p+":",fe.ERR_BAD_REQUEST,e));return}c.send(s||null)})},jA=(e,t)=>{let n=new AbortController,r;const o=function(a){if(!r){r=!0,i();const u=a instanceof Error?a:this.reason;n.abort(u instanceof fe?u:new ki(u instanceof Error?u.message:u))}};let s=t&&setTimeout(()=>{o(new fe(`timeout ${t} of ms exceeded`,fe.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(a=>{a&&(a.removeEventListener?a.removeEventListener("abort",o):a.unsubscribe(o))}),e=null)};e.forEach(a=>a&&a.addEventListener&&a.addEventListener("abort",o));const{signal:l}=n;return l.unsubscribe=i,[l,()=>{s&&clearTimeout(s),s=null}]},AA=function*(e,t){let n=e.byteLength;if(!t||n{const s=MA(e,t,o);let i=0;return new ReadableStream({type:"bytes",async pull(l){const{done:a,value:u}=await s.next();if(a){l.close(),r();return}let c=u.byteLength;n&&n(i+=c),l.enqueue(new Uint8Array(u))},cancel(l){return r(l),s.return()}},{highWaterMark:2})},sy=(e,t)=>{const n=e!=null;return r=>setTimeout(()=>t({lengthComputable:n,total:e,loaded:r}))},Vc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",MC=Vc&&typeof ReadableStream=="function",yp=Vc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),OA=MC&&(()=>{let e=!1;const t=new Request(Tn.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})(),iy=64*1024,wp=MC&&!!(()=>{try{return N.isReadableStream(new Response("").body)}catch{}})(),Ku={stream:wp&&(e=>e.body)};Vc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ku[t]&&(Ku[t]=N.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new fe(`Response type '${t}' is not supported`,fe.ERR_NOT_SUPPORT,r)})})})(new Response);const IA=async e=>{if(e==null)return 0;if(N.isBlob(e))return e.size;if(N.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if(N.isArrayBufferView(e))return e.byteLength;if(N.isURLSearchParams(e)&&(e=e+""),N.isString(e))return(await yp(e)).byteLength},FA=async(e,t)=>{const n=N.toFiniteNumber(e.getContentLength());return n??IA(t)},DA=Vc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:l,onUploadProgress:a,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:p}=AC(e);u=u?(u+"").toLowerCase():"text";let[h,m]=o||s||i?jA([o,s],i):[],w,S;const y=()=>{!w&&setTimeout(()=>{h&&h.unsubscribe()}),w=!0};let v;try{if(a&&OA&&n!=="get"&&n!=="head"&&(v=await FA(c,r))!==0){let P=new Request(t,{method:"POST",body:r,duplex:"half"}),k;N.isFormData(r)&&(k=P.headers.get("content-type"))&&c.setContentType(k),P.body&&(r=oy(P.body,iy,sy(v,Gu(a)),null,yp))}N.isString(d)||(d=d?"cors":"omit"),S=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",withCredentials:d});let x=await fetch(S);const C=wp&&(u==="stream"||u==="response");if(wp&&(l||C)){const P={};["status","statusText","headers"].forEach(E=>{P[E]=x[E]});const k=N.toFiniteNumber(x.headers.get("content-length"));x=new Response(oy(x.body,iy,l&&sy(k,Gu(l,!0)),C&&y,yp),P)}u=u||"text";let _=await Ku[N.findKey(Ku,u)||"text"](x,e);return!C&&y(),m&&m(),await new Promise((P,k)=>{NC(P,k,{data:_,headers:Ut.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:S})})}catch(x){throw y(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,e,S),{cause:x.cause||x}):fe.from(x,x&&x.code,e,S)}}),xp={http:eA,xhr:NA,fetch:DA};N.forEach(xp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ly=e=>`- ${e}`,LA=e=>N.isFunction(e)||e===null||e===!1,OC={getAdapter:e=>{e=N.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s`adapter ${l} `+(a===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since : +`+s.map(ly).join(` +`):" "+ly(s[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:xp};function zd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ki(null,e)}function ay(e){return zd(e),e.headers=Ut.from(e.headers),e.data=$d.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),OC.getAdapter(e.adapter||aa.adapter)(e).then(function(r){return zd(e),r.data=$d.call(e,e.transformResponse,r),r.headers=Ut.from(r.headers),r},function(r){return TC(r)||(zd(e),r&&r.response&&(r.response.data=$d.call(e,e.transformResponse,r.response),r.response.headers=Ut.from(r.response.headers))),Promise.reject(r)})}const IC="1.7.2",gm={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{gm[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const uy={};gm.transitional=function(t,n,r){function o(s,i){return"[Axios v"+IC+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,l)=>{if(t===!1)throw new fe(o(i," has been removed"+(n?" in "+n:"")),fe.ERR_DEPRECATED);return n&&!uy[i]&&(uy[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,l):!0}};function VA(e,t,n){if(typeof e!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const l=e[s],a=l===void 0||i(l,s,e);if(a!==!0)throw new fe("option "+s+" must be "+a,fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new fe("Unknown option "+s,fe.ERR_BAD_OPTION)}}const Sp={assertOptions:VA,validators:gm},Tr=Sp.validators;class Do{constructor(t){this.defaults=t,this.interceptors={request:new ty,response:new ty}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Zo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Sp.assertOptions(r,{silentJSONParsing:Tr.transitional(Tr.boolean),forcedJSONParsing:Tr.transitional(Tr.boolean),clarifyTimeoutError:Tr.transitional(Tr.boolean)},!1),o!=null&&(N.isFunction(o)?n.paramsSerializer={serialize:o}:Sp.assertOptions(o,{encode:Tr.function,serialize:Tr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&N.merge(s.common,s[n.method]);s&&N.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=Ut.concat(i,s);const l=[];let a=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(a=a&&w.synchronous,l.unshift(w.fulfilled,w.rejected))});const u=[];this.interceptors.response.forEach(function(w){u.push(w.fulfilled,w.rejected)});let c,d=0,p;if(!a){const m=[ay.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,u),p=m.length,c=Promise.resolve(n);d{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(l=>{r.subscribe(l),s=l}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,l){r.reason||(r.reason=new ki(s,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new vm(function(o){t=o}),cancel:t}}}function $A(e){return function(n){return e.apply(null,n)}}function zA(e){return N.isObject(e)&&e.isAxiosError===!0}const Cp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cp).forEach(([e,t])=>{Cp[t]=e});function FC(e){const t=new Do(e),n=hC(Do.prototype.request,t);return N.extend(n,Do.prototype,t,{allOwnKeys:!0}),N.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return FC(Zo(e,o))},n}const Oe=FC(aa);Oe.Axios=Do;Oe.CanceledError=ki;Oe.CancelToken=vm;Oe.isCancel=TC;Oe.VERSION=IC;Oe.toFormData=Lc;Oe.AxiosError=fe;Oe.Cancel=Oe.CanceledError;Oe.all=function(t){return Promise.all(t)};Oe.spread=$A;Oe.isAxiosError=zA;Oe.mergeConfig=Zo;Oe.AxiosHeaders=Ut;Oe.formToJSON=e=>PC(N.isHTMLForm(e)?new FormData(e):e);Oe.getAdapter=OC.getAdapter;Oe.HttpStatusCode=Cp;Oe.default=Oe;var Ce;(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(l=>typeof o[o[l]]!="number"),i={};for(const l of s)i[l]=o[l];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Ce||(Ce={}));var _p;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(_p||(_p={}));const W=Ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fr=e=>{switch(typeof e){case"undefined":return W.undefined;case"string":return W.string;case"number":return isNaN(e)?W.nan:W.number;case"boolean":return W.boolean;case"function":return W.function;case"bigint":return W.bigint;case"symbol":return W.symbol;case"object":return Array.isArray(e)?W.array:e===null?W.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?W.promise:typeof Map<"u"&&e instanceof Map?W.map:typeof Set<"u"&&e instanceof Set?W.set:typeof Date<"u"&&e instanceof Date?W.date:W.object;default:return W.unknown}},L=Ce.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),BA=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class tn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let l=r,a=0;for(;an.message){const n={},r=[];for(const o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}tn.create=e=>new tn(e);const hi=(e,t)=>{let n;switch(e.code){case L.invalid_type:e.received===W.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ce.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ce.joinValues(e.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ce.joinValues(e.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${Ce.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ce.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case L.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case L.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ce.assertNever(e)}return{message:n}};let DC=hi;function UA(e){DC=e}function Zu(){return DC}const qu=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let l="";const a=r.filter(u=>!!u).slice().reverse();for(const u of a)l=u(i,{data:t,defaultError:l}).message;return{...o,path:s,message:l}},HA=[];function U(e,t){const n=Zu(),r=qu({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===hi?void 0:hi].filter(o=>!!o)});e.common.issues.push(r)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return ce;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return bt.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return ce;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const ce=Object.freeze({status:"aborted"}),Ps=e=>({status:"dirty",value:e}),jt=e=>({status:"valid",value:e}),bp=e=>e.status==="aborted",Rp=e=>e.status==="dirty",Ml=e=>e.status==="valid",Ol=e=>typeof Promise<"u"&&e instanceof Promise;function Qu(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function LC(e,t,n,r,o){if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ne;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ne||(ne={}));var Xi,Yi;class Yn{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cy=(e,t)=>{if(Ml(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new tn(e.common.issues);return this._error=n,this._error}}};function pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,l)=>{var a,u;const{message:c}=e;return i.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:(a=c??r)!==null&&a!==void 0?a:l.defaultError}:i.code!=="invalid_type"?{message:l.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:l.defaultError}},description:o}}class ve{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Fr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Fr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new bt,ctx:{common:t.parent.common,data:t.data,parsedType:Fr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Ol(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const o={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fr(t)},s=this._parseSync({data:t,path:o.path,parent:o});return cy(o,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fr(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(Ol(o)?o:Promise.resolve(o));return cy(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),l=()=>s.addIssue({code:L.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(a=>a?!0:(l(),!1)):i?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new In({schema:this,typeName:ue.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Qn.create(this,this._def)}nullable(){return po.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Nn.create(this,this._def)}promise(){return gi.create(this,this._def)}or(t){return Ll.create([this,t],this._def)}and(t){return Vl.create(this,t,this._def)}transform(t){return new In({...pe(this._def),schema:this,typeName:ue.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Hl({...pe(this._def),innerType:this,defaultValue:n,typeName:ue.ZodDefault})}brand(){return new ym({typeName:ue.ZodBranded,type:this,...pe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Wl({...pe(this._def),innerType:this,catchValue:n,typeName:ue.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return ua.create(this,t)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const WA=/^c[^\s-]{8,}$/i,GA=/^[0-9a-z]+$/,KA=/^[0-9A-HJKMNP-TV-Z]{26}$/,ZA=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qA=/^[a-z0-9_-]{21}$/i,QA=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,XA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Bd;const JA=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eM=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,tM=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,VC="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nM=new RegExp(`^${VC}$`);function $C(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function rM(e){return new RegExp(`^${$C(e)}$`)}function zC(e){let t=`${VC}T${$C(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function oM(e,t){return!!((t==="v4"||!t)&&JA.test(e)||(t==="v6"||!t)&&eM.test(e))}class En extends ve{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==W.string){const s=this._getOrReturnCtx(t);return U(s,{code:L.invalid_type,expected:W.string,received:s.parsedType}),ce}const r=new bt;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.lengths.value&&(o=this._getOrReturnCtx(t,o),U(o,{code:L.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,l=t.data.lengtht.test(o),{validation:n,code:L.invalid_string,...ne.errToObj(r)})}_addCheck(t){return new En({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ne.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ne.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ne.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ne.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ne.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ne.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ne.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ne.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ne.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ne.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...ne.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ne.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ne.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ne.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ne.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ne.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ne.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ne.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ne.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ne.errToObj(n)})}nonempty(t){return this.min(1,ne.errToObj(t))}trim(){return new En({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new En({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new En({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new En({checks:[],typeName:ue.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...pe(e)})};function sM(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=parseInt(e.toFixed(o).replace(".","")),i=parseInt(t.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}class uo extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==W.number){const s=this._getOrReturnCtx(t);return U(s,{code:L.invalid_type,expected:W.number,received:s.parsedType}),ce}let r;const o=new bt;for(const s of this._def.checks)s.kind==="int"?Ce.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:L.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:L.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?sM(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),U(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),U(r,{code:L.not_finite,message:s.message}),o.dirty()):Ce.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ne.toString(n))}setLimit(t,n,r,o){return new uo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ne.toString(o)}]})}_addCheck(t){return new uo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ne.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ne.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ne.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ne.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ne.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuet.kind==="int"||t.kind==="multipleOf"&&Ce.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.valuenew uo({checks:[],typeName:ue.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...pe(e)});class co extends ve{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==W.bigint){const s=this._getOrReturnCtx(t);return U(s,{code:L.invalid_type,expected:W.bigint,received:s.parsedType}),ce}let r;const o=new bt;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.datas.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),U(r,{code:L.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),U(r,{code:L.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):Ce.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ne.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ne.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ne.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ne.toString(n))}setLimit(t,n,r,o){return new co({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ne.toString(o)}]})}_addCheck(t){return new co({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ne.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ne.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ne.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ne.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ne.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value{var t;return new co({checks:[],typeName:ue.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...pe(e)})};class Il extends ve{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==W.boolean){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.boolean,received:r.parsedType}),ce}return jt(t.data)}}Il.create=e=>new Il({typeName:ue.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...pe(e)});class qo extends ve{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==W.date){const s=this._getOrReturnCtx(t);return U(s,{code:L.invalid_type,expected:W.date,received:s.parsedType}),ce}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return U(s,{code:L.invalid_date}),ce}const r=new bt;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()s.value&&(o=this._getOrReturnCtx(t,o),U(o,{code:L.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Ce.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new qo({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ne.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ne.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.valuenew qo({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ue.ZodDate,...pe(e)});class Xu extends ve{_parse(t){if(this._getType(t)!==W.symbol){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.symbol,received:r.parsedType}),ce}return jt(t.data)}}Xu.create=e=>new Xu({typeName:ue.ZodSymbol,...pe(e)});class Fl extends ve{_parse(t){if(this._getType(t)!==W.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.undefined,received:r.parsedType}),ce}return jt(t.data)}}Fl.create=e=>new Fl({typeName:ue.ZodUndefined,...pe(e)});class Dl extends ve{_parse(t){if(this._getType(t)!==W.null){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.null,received:r.parsedType}),ce}return jt(t.data)}}Dl.create=e=>new Dl({typeName:ue.ZodNull,...pe(e)});class mi extends ve{constructor(){super(...arguments),this._any=!0}_parse(t){return jt(t.data)}}mi.create=e=>new mi({typeName:ue.ZodAny,...pe(e)});class Lo extends ve{constructor(){super(...arguments),this._unknown=!0}_parse(t){return jt(t.data)}}Lo.create=e=>new Lo({typeName:ue.ZodUnknown,...pe(e)});class Cr extends ve{_parse(t){const n=this._getOrReturnCtx(t);return U(n,{code:L.invalid_type,expected:W.never,received:n.parsedType}),ce}}Cr.create=e=>new Cr({typeName:ue.ZodNever,...pe(e)});class Yu extends ve{_parse(t){if(this._getType(t)!==W.undefined){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.void,received:r.parsedType}),ce}return jt(t.data)}}Yu.create=e=>new Yu({typeName:ue.ZodVoid,...pe(e)});class Nn extends ve{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==W.array)return U(n,{code:L.invalid_type,expected:W.array,received:n.parsedType}),ce;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,l=n.data.lengtho.maxLength.value&&(U(n,{code:L.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,l)=>o.type._parseAsync(new Yn(n,i,n.path,l)))).then(i=>bt.mergeArray(r,i));const s=[...n.data].map((i,l)=>o.type._parseSync(new Yn(n,i,n.path,l)));return bt.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Nn({...this._def,minLength:{value:t,message:ne.toString(n)}})}max(t,n){return new Nn({...this._def,maxLength:{value:t,message:ne.toString(n)}})}length(t,n){return new Nn({...this._def,exactLength:{value:t,message:ne.toString(n)}})}nonempty(t){return this.min(1,t)}}Nn.create=(e,t)=>new Nn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ue.ZodArray,...pe(t)});function fs(e){if(e instanceof Be){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Qn.create(fs(r))}return new Be({...e._def,shape:()=>t})}else return e instanceof Nn?new Nn({...e._def,type:fs(e.element)}):e instanceof Qn?Qn.create(fs(e.unwrap())):e instanceof po?po.create(fs(e.unwrap())):e instanceof Jn?Jn.create(e.items.map(t=>fs(t))):e}class Be extends ve{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ce.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==W.object){const u=this._getOrReturnCtx(t);return U(u,{code:L.invalid_type,expected:W.object,received:u.parsedType}),ce}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),l=[];if(!(this._def.catchall instanceof Cr&&this._def.unknownKeys==="strip"))for(const u in o.data)i.includes(u)||l.push(u);const a=[];for(const u of i){const c=s[u],d=o.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new Yn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof Cr){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of l)a.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")l.length>0&&(U(o,{code:L.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of l){const d=o.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new Yn(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of a){const d=await c.key,p=await c.value;u.push({key:d,value:p,alwaysSet:c.alwaysSet})}return u}).then(u=>bt.mergeObjectSync(r,u)):bt.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return ne.errToObj,new Be({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s,i,l;const a=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(l=ne.errToObj(t).message)!==null&&l!==void 0?l:a}:{message:a}}}:{}})}strip(){return new Be({...this._def,unknownKeys:"strip"})}passthrough(){return new Be({...this._def,unknownKeys:"passthrough"})}extend(t){return new Be({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Be({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ue.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Be({...this._def,catchall:t})}pick(t){const n={};return Ce.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Be({...this._def,shape:()=>n})}omit(t){const n={};return Ce.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Be({...this._def,shape:()=>n})}deepPartial(){return fs(this)}partial(t){const n={};return Ce.objectKeys(this.shape).forEach(r=>{const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new Be({...this._def,shape:()=>n})}required(t){const n={};return Ce.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Qn;)s=s._def.innerType;n[r]=s}}),new Be({...this._def,shape:()=>n})}keyof(){return BC(Ce.objectKeys(this.shape))}}Be.create=(e,t)=>new Be({shape:()=>e,unknownKeys:"strip",catchall:Cr.create(),typeName:ue.ZodObject,...pe(t)});Be.strictCreate=(e,t)=>new Be({shape:()=>e,unknownKeys:"strict",catchall:Cr.create(),typeName:ue.ZodObject,...pe(t)});Be.lazycreate=(e,t)=>new Be({shape:e,unknownKeys:"strip",catchall:Cr.create(),typeName:ue.ZodObject,...pe(t)});class Ll extends ve{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const l of s)if(l.result.status==="valid")return l.result;for(const l of s)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const i=s.map(l=>new tn(l.ctx.common.issues));return U(n,{code:L.invalid_union,unionErrors:i}),ce}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const a of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=a._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const l=i.map(a=>new tn(a));return U(n,{code:L.invalid_union,unionErrors:l}),ce}}get options(){return this._def.options}}Ll.create=(e,t)=>new Ll({options:e,typeName:ue.ZodUnion,...pe(t)});const sr=e=>e instanceof zl?sr(e.schema):e instanceof In?sr(e.innerType()):e instanceof Bl?[e.value]:e instanceof fo?e.options:e instanceof Ul?Ce.objectValues(e.enum):e instanceof Hl?sr(e._def.innerType):e instanceof Fl?[void 0]:e instanceof Dl?[null]:e instanceof Qn?[void 0,...sr(e.unwrap())]:e instanceof po?[null,...sr(e.unwrap())]:e instanceof ym||e instanceof Gl?sr(e.unwrap()):e instanceof Wl?sr(e._def.innerType):[];class $c extends ve{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==W.object)return U(n,{code:L.invalid_type,expected:W.object,received:n.parsedType}),ce;const r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(U(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const s of n){const i=sr(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of i){if(o.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);o.set(l,s)}}return new $c({typeName:ue.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...pe(r)})}}function Ep(e,t){const n=Fr(e),r=Fr(t);if(e===t)return{valid:!0,data:e};if(n===W.object&&r===W.object){const o=Ce.objectKeys(t),s=Ce.objectKeys(e).filter(l=>o.indexOf(l)!==-1),i={...e,...t};for(const l of s){const a=Ep(e[l],t[l]);if(!a.valid)return{valid:!1};i[l]=a.data}return{valid:!0,data:i}}else if(n===W.array&&r===W.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s{if(bp(s)||bp(i))return ce;const l=Ep(s.value,i.value);return l.valid?((Rp(s)||Rp(i))&&n.dirty(),{status:n.value,value:l.data}):(U(r,{code:L.invalid_intersection_types}),ce)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Vl.create=(e,t,n)=>new Vl({left:e,right:t,typeName:ue.ZodIntersection,...pe(n)});class Jn extends ve{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==W.array)return U(r,{code:L.invalid_type,expected:W.array,received:r.parsedType}),ce;if(r.data.lengththis._def.items.length&&(U(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new Yn(r,i,r.path,l)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>bt.mergeArray(n,i)):bt.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Jn({...this._def,rest:t})}}Jn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Jn({items:e,typeName:ue.ZodTuple,rest:null,...pe(t)})};class $l extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==W.object)return U(r,{code:L.invalid_type,expected:W.object,received:r.parsedType}),ce;const o=[],s=this._def.keyType,i=this._def.valueType;for(const l in r.data)o.push({key:s._parse(new Yn(r,l,r.path,l)),value:i._parse(new Yn(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?bt.mergeObjectAsync(n,o):bt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ve?new $l({keyType:t,valueType:n,typeName:ue.ZodRecord,...pe(r)}):new $l({keyType:En.create(),valueType:t,typeName:ue.ZodRecord,...pe(n)})}}class Ju extends ve{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==W.map)return U(r,{code:L.invalid_type,expected:W.map,received:r.parsedType}),ce;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([l,a],u)=>({key:o._parse(new Yn(r,l,r.path,[u,"key"])),value:s._parse(new Yn(r,a,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const a of i){const u=await a.key,c=await a.value;if(u.status==="aborted"||c.status==="aborted")return ce;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),l.set(u.value,c.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const a of i){const u=a.key,c=a.value;if(u.status==="aborted"||c.status==="aborted")return ce;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),l.set(u.value,c.value)}return{status:n.value,value:l}}}}Ju.create=(e,t,n)=>new Ju({valueType:t,keyType:e,typeName:ue.ZodMap,...pe(n)});class Qo extends ve{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==W.set)return U(r,{code:L.invalid_type,expected:W.set,received:r.parsedType}),ce;const o=this._def;o.minSize!==null&&r.data.sizeo.maxSize.value&&(U(r,{code:L.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(a){const u=new Set;for(const c of a){if(c.status==="aborted")return ce;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((a,u)=>s._parse(new Yn(r,a,r.path,u)));return r.common.async?Promise.all(l).then(a=>i(a)):i(l)}min(t,n){return new Qo({...this._def,minSize:{value:t,message:ne.toString(n)}})}max(t,n){return new Qo({...this._def,maxSize:{value:t,message:ne.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Qo.create=(e,t)=>new Qo({valueType:e,minSize:null,maxSize:null,typeName:ue.ZodSet,...pe(t)});class Vs extends ve{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==W.function)return U(n,{code:L.invalid_type,expected:W.function,received:n.parsedType}),ce;function r(l,a){return qu({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zu(),hi].filter(u=>!!u),issueData:{code:L.invalid_arguments,argumentsError:a}})}function o(l,a){return qu({data:l,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Zu(),hi].filter(u=>!!u),issueData:{code:L.invalid_return_type,returnTypeError:a}})}const s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof gi){const l=this;return jt(async function(...a){const u=new tn([]),c=await l._def.args.parseAsync(a,s).catch(h=>{throw u.addIssue(r(a,h)),u}),d=await Reflect.apply(i,this,c);return await l._def.returns._def.type.parseAsync(d,s).catch(h=>{throw u.addIssue(o(d,h)),u})})}else{const l=this;return jt(function(...a){const u=l._def.args.safeParse(a,s);if(!u.success)throw new tn([r(a,u.error)]);const c=Reflect.apply(i,this,u.data),d=l._def.returns.safeParse(c,s);if(!d.success)throw new tn([o(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Vs({...this._def,args:Jn.create(t).rest(Lo.create())})}returns(t){return new Vs({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new Vs({args:t||Jn.create([]).rest(Lo.create()),returns:n||Lo.create(),typeName:ue.ZodFunction,...pe(r)})}}class zl extends ve{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}zl.create=(e,t)=>new zl({getter:e,typeName:ue.ZodLazy,...pe(t)});class Bl extends ve{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return U(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),ce}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bl.create=(e,t)=>new Bl({value:e,typeName:ue.ZodLiteral,...pe(t)});function BC(e,t){return new fo({values:e,typeName:ue.ZodEnum,...pe(t)})}class fo extends ve{constructor(){super(...arguments),Xi.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{expected:Ce.joinValues(r),received:n.parsedType,code:L.invalid_type}),ce}if(Qu(this,Xi)||LC(this,Xi,new Set(this._def.values)),!Qu(this,Xi).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return U(n,{received:n.data,code:L.invalid_enum_value,options:r}),ce}return jt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return fo.create(t,{...this._def,...n})}exclude(t,n=this._def){return fo.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Xi=new WeakMap;fo.create=BC;class Ul extends ve{constructor(){super(...arguments),Yi.set(this,void 0)}_parse(t){const n=Ce.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==W.string&&r.parsedType!==W.number){const o=Ce.objectValues(n);return U(r,{expected:Ce.joinValues(o),received:r.parsedType,code:L.invalid_type}),ce}if(Qu(this,Yi)||LC(this,Yi,new Set(Ce.getValidEnumValues(this._def.values))),!Qu(this,Yi).has(t.data)){const o=Ce.objectValues(n);return U(r,{received:r.data,code:L.invalid_enum_value,options:o}),ce}return jt(t.data)}get enum(){return this._def.values}}Yi=new WeakMap;Ul.create=(e,t)=>new Ul({values:e,typeName:ue.ZodNativeEnum,...pe(t)});class gi extends ve{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==W.promise&&n.common.async===!1)return U(n,{code:L.invalid_type,expected:W.promise,received:n.parsedType}),ce;const r=n.parsedType===W.promise?n.data:Promise.resolve(n.data);return jt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}gi.create=(e,t)=>new gi({type:e,typeName:ue.ZodPromise,...pe(t)});class In extends ve{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{U(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async l=>{if(n.value==="aborted")return ce;const a=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return a.status==="aborted"?ce:a.status==="dirty"||n.value==="dirty"?Ps(a.value):a});{if(n.value==="aborted")return ce;const l=this._def.schema._parseSync({data:i,path:r.path,parent:r});return l.status==="aborted"?ce:l.status==="dirty"||n.value==="dirty"?Ps(l.value):l}}if(o.type==="refinement"){const i=l=>{const a=o.refinement(l,s);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?ce:(l.status==="dirty"&&n.dirty(),i(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?ce:(l.status==="dirty"&&n.dirty(),i(l.value).then(()=>({status:n.value,value:l.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Ml(i))return i;const l=o.transform(i.value,s);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Ml(i)?Promise.resolve(o.transform(i.value,s)).then(l=>({status:n.value,value:l})):i);Ce.assertNever(o)}}In.create=(e,t,n)=>new In({schema:e,typeName:ue.ZodEffects,effect:t,...pe(n)});In.createWithPreprocess=(e,t,n)=>new In({schema:t,effect:{type:"preprocess",transform:e},typeName:ue.ZodEffects,...pe(n)});class Qn extends ve{_parse(t){return this._getType(t)===W.undefined?jt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Qn.create=(e,t)=>new Qn({innerType:e,typeName:ue.ZodOptional,...pe(t)});class po extends ve{_parse(t){return this._getType(t)===W.null?jt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}po.create=(e,t)=>new po({innerType:e,typeName:ue.ZodNullable,...pe(t)});class Hl extends ve{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===W.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Hl.create=(e,t)=>new Hl({innerType:e,typeName:ue.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...pe(t)});class Wl extends ve{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ol(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new tn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Wl.create=(e,t)=>new Wl({innerType:e,typeName:ue.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...pe(t)});class ec extends ve{_parse(t){if(this._getType(t)!==W.nan){const r=this._getOrReturnCtx(t);return U(r,{code:L.invalid_type,expected:W.nan,received:r.parsedType}),ce}return{status:"valid",value:t.data}}}ec.create=e=>new ec({typeName:ue.ZodNaN,...pe(e)});const iM=Symbol("zod_brand");class ym extends ve{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class ua extends ve{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?ce:s.status==="dirty"?(n.dirty(),Ps(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?ce:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new ua({in:t,out:n,typeName:ue.ZodPipeline})}}class Gl extends ve{_parse(t){const n=this._def.innerType._parse(t),r=o=>(Ml(o)&&(o.value=Object.freeze(o.value)),o);return Ol(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Gl.create=(e,t)=>new Gl({innerType:e,typeName:ue.ZodReadonly,...pe(t)});function UC(e,t={},n){return e?mi.create().superRefine((r,o)=>{var s,i;if(!e(r)){const l=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,a=(i=(s=l.fatal)!==null&&s!==void 0?s:n)!==null&&i!==void 0?i:!0,u=typeof l=="string"?{message:l}:l;o.addIssue({code:"custom",...u,fatal:a})}}):mi.create()}const lM={object:Be.lazycreate};var ue;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ue||(ue={}));const aM=(e,t={message:`Input not instance of ${e.name}`})=>UC(n=>n instanceof e,t),HC=En.create,WC=uo.create,uM=ec.create,cM=co.create,GC=Il.create,dM=qo.create,fM=Xu.create,pM=Fl.create,hM=Dl.create,mM=mi.create,gM=Lo.create,vM=Cr.create,yM=Yu.create,wM=Nn.create,xM=Be.create,SM=Be.strictCreate,CM=Ll.create,_M=$c.create,bM=Vl.create,RM=Jn.create,EM=$l.create,kM=Ju.create,PM=Qo.create,TM=Vs.create,NM=zl.create,jM=Bl.create,AM=fo.create,MM=Ul.create,OM=gi.create,dy=In.create,IM=Qn.create,FM=po.create,DM=In.createWithPreprocess,LM=ua.create,VM=()=>HC().optional(),$M=()=>WC().optional(),zM=()=>GC().optional(),BM={string:e=>En.create({...e,coerce:!0}),number:e=>uo.create({...e,coerce:!0}),boolean:e=>Il.create({...e,coerce:!0}),bigint:e=>co.create({...e,coerce:!0}),date:e=>qo.create({...e,coerce:!0})},UM=ce;var z=Object.freeze({__proto__:null,defaultErrorMap:hi,setErrorMap:UA,getErrorMap:Zu,makeIssue:qu,EMPTY_PATH:HA,addIssueToContext:U,ParseStatus:bt,INVALID:ce,DIRTY:Ps,OK:jt,isAborted:bp,isDirty:Rp,isValid:Ml,isAsync:Ol,get util(){return Ce},get objectUtil(){return _p},ZodParsedType:W,getParsedType:Fr,ZodType:ve,datetimeRegex:zC,ZodString:En,ZodNumber:uo,ZodBigInt:co,ZodBoolean:Il,ZodDate:qo,ZodSymbol:Xu,ZodUndefined:Fl,ZodNull:Dl,ZodAny:mi,ZodUnknown:Lo,ZodNever:Cr,ZodVoid:Yu,ZodArray:Nn,ZodObject:Be,ZodUnion:Ll,ZodDiscriminatedUnion:$c,ZodIntersection:Vl,ZodTuple:Jn,ZodRecord:$l,ZodMap:Ju,ZodSet:Qo,ZodFunction:Vs,ZodLazy:zl,ZodLiteral:Bl,ZodEnum:fo,ZodNativeEnum:Ul,ZodPromise:gi,ZodEffects:In,ZodTransformer:In,ZodOptional:Qn,ZodNullable:po,ZodDefault:Hl,ZodCatch:Wl,ZodNaN:ec,BRAND:iM,ZodBranded:ym,ZodPipeline:ua,ZodReadonly:Gl,custom:UC,Schema:ve,ZodSchema:ve,late:lM,get ZodFirstPartyTypeKind(){return ue},coerce:BM,any:mM,array:wM,bigint:cM,boolean:GC,date:dM,discriminatedUnion:_M,effect:dy,enum:AM,function:TM,instanceof:aM,intersection:bM,lazy:NM,literal:jM,map:kM,nan:uM,nativeEnum:MM,never:vM,null:hM,nullable:FM,number:WC,object:xM,oboolean:zM,onumber:$M,optional:IM,ostring:VM,pipeline:LM,preprocess:DM,promise:OM,record:EM,set:PM,strictObject:SM,string:HC,symbol:fM,transformer:dy,tuple:RM,undefined:pM,union:CM,unknown:gM,void:yM,NEVER:UM,ZodIssueCode:L,quotelessJson:BA,ZodError:tn});const zc="",HM=z.object({splitter:z.literal("Markdown"),splitter_config:z.object({num_workers:z.number()})}),WM=z.object({splitter:z.literal("Semantic"),splitter_config:z.object({buffer_size:z.number(),breakpoint_percentile_threshold:z.number()})}),GM=z.object({splitter:z.literal("Sentence"),splitter_config:z.object({chunk_size:z.number(),chunk_overlap:z.number()})}),KM=z.object({embed_provider:z.literal("OpenAI"),embed_model:z.enum(["text-embedding-3-small","text-embedding-3-large"])}),ZM=z.object({embed_provider:z.literal("Cohere"),embed_model:z.enum(["embed-english-light-v3.0","embed-english-v3.0","embed-multilingual-light-v3.0","embed-multilingual-v3.0"])}),qM=z.discriminatedUnion("splitter",[HM,WM,GM]),fy=z.discriminatedUnion("embed_provider",[KM,ZM]),QM=z.discriminatedUnion("llm_provider",[z.object({llm_provider:z.literal("OpenAI"),llm_model:z.enum(["gpt-3.5-turbo","gpt-4-turbo","gpt-4o-mini","gpt-4o"])}),z.object({llm_provider:z.literal("Anthropic"),llm_model:z.enum(["claude-4-haiku-20240307","claude-3-sonnet-20240229","claude-3-5-sonnet-20240620"])})]),KC=z.intersection(z.discriminatedUnion("ingest_method",[z.object({kb_name:z.string(),ingest_method:z.literal("LlamaParse"),llm_config:QM,embed_config:fy}),z.object({kb_name:z.string(),ingest_method:z.literal("Simple"),embed_config:fy})]),qM),XM=z.object({file_name:z.string(),content_type:z.string(),date_uploaded:z.string(),time_uploaded:z.string()}),YM=z.object({id:z.string(),files:z.array(XM)});z.intersection(KC,YM);async function JM(){const e=await Oe.get(`${zc}/api/knowledge-bases`);return console.log(e.data),e.data}async function eO(e){const t=await Oe.get(`${zc}/api/knowledge-bases/${e}`);return console.log(t.data),t.data}async function tO(e){const t=await Oe.post(`${zc}/api/knowledge-bases`,e);return console.log(t.data),t.data}async function nO(e,t){const n=new FormData;n.append("file",t);try{return(await Oe.post(`${zc}/api/knowledge-bases/${e}/upload`,n,{headers:{"Content-Type":"multipart/form-data"}})).data}catch(r){throw Oe.isAxiosError(r)?(console.error("Axios error:",r.message),r.response&&(console.error("Response data:",r.response.data),console.error("Response status:",r.response.status))):console.error("Unexpected error:",r),r}}const ca={fetchKnowledgeBases:JM,fetchKnowledgeBaseById:eO,createKnowledgeBase:tO,uploadFile:nO},py=(e,t,n)=>{if(e&&"reportValidity"in e){const r=$(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},ZC=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?py(r.ref,n,e):r.refs&&r.refs.forEach(o=>py(o,n,e))}},rO=(e,t)=>{t.shouldUseNativeValidation&&ZC(e,t);const n={};for(const r in e){const o=$(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.ref});if(oO(t.names||Object.keys(e),r)){const i=Object.assign({},$(n,r));Ne(i,"root",s),Ne(n,r,i)}else Ne(n,r,s)}return n},oO=(e,t)=>e.some(n=>n.startsWith(t+"."));var sO=function(e,t){for(var n={};e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var l=r.unionErrors[0].errors[0];n[i]={message:l.message,type:l.code}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(c){return c.errors.forEach(function(d){return e.push(d)})}),t){var a=n[i].types,u=a&&a[r.code];n[i]=tC(i,t,n,o,u?[].concat(u,r.message):r.message)}e.shift()}return n},wm=function(e,t,n){return n===void 0&&(n={}),function(r,o,s){try{return Promise.resolve(function(i,l){try{var a=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return s.shouldUseNativeValidation&&ZC({},s),{errors:{},values:n.raw?r:u}})}catch(u){return l(u)}return a&&a.then?a.then(void 0,l):a}(0,function(i){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(i))return{values:{},errors:rO(sO(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}}};function iO({setModalVisible:e}){const t=dm({resolver:wm(KC),defaultValues:{kb_name:""}}),n=Cc({mutationFn:s=>ca.createKnowledgeBase(s)});function r(){e(!1)}const o=t.handleSubmit(s=>{console.log(t.getValues()),console.log(s),n.mutate(s)},s=>{console.log(s)});return f.jsxs(f.Fragment,{children:[f.jsx(pC,{setModalVisible:e}),f.jsxs(ci,{className:"min-w-0.5 max-w-2xl fixed top-1/2 -translate-x-1/2 -translate-y-1/2 left-1/2 z-20",children:[f.jsxs(Lh,{children:[f.jsx(Vh,{children:"Create new knowledge base"}),f.jsx($h,{children:"Select the chunking strategies for the files that you'll upload into this knowledge base."})]}),f.jsx(zh,{children:f.jsx(fm,{...t,children:f.jsxs("form",{className:"space-y-6",onSubmit:o,children:[f.jsx(Xe,{name:"kb_name",render:({field:s})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Knowledge Base Name"}),f.jsx(tt,{children:f.jsx(dn,{...s,placeholder:"Enter knowledge base name"})}),f.jsx(Xt,{})]})}),f.jsx(Xe,{name:"ingest_method",render:({field:s})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Ingestion Method"}),f.jsxs(Zi,{onValueChange:i=>{s.onChange(i),t.resetField("splitter")},defaultValue:s.value,children:[f.jsx(tt,{children:f.jsx(Rs,{children:f.jsx(qi,{placeholder:"Select ingestion method"})})}),f.jsxs(Es,{children:[f.jsx(Ke,{value:"LlamaParse",children:"LlamaParse"}),f.jsx(Ke,{value:"Simple",children:"Simple"})]})]}),f.jsx(Xt,{})]})}),f.jsx(Xe,{name:"splitter",render:({field:s})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Splitter"}),f.jsxs(Zi,{onValueChange:i=>{s.onChange(i),t.resetField("splitter_config"),i==="Markdown"?t.setValue("splitter_config.num_workers",8):i==="Semantic"?(t.setValue("splitter_config.buffer_size",100),t.setValue("splitter_config.breakpoint_percentile_threshold",95)):(t.setValue("splitter_config.chunk_size",1024),t.setValue("splitter_config.chunk_overlap",200))},defaultValue:s.value,children:[f.jsx(tt,{children:f.jsx(Rs,{children:f.jsx(qi,{placeholder:"Select splitter"})})}),f.jsx(Es,{children:t.getValues("ingest_method")==="LlamaParse"?f.jsx(Ke,{value:"Markdown",children:"Markdown"}):f.jsxs(f.Fragment,{children:[f.jsx(Ke,{value:"Sentence",children:"Sentence"}),f.jsx(Ke,{value:"Semantic",children:"Semantic"})]})})]}),f.jsx(Xt,{})]})}),f.jsx(Xe,{name:"splitter_config",render:()=>{const s=t.watch("splitter");return f.jsxs(Ze,{children:[s==="Markdown"?f.jsx(Xe,{name:"splitter_config.num_workers",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Number of Workers"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",...i,onChange:l=>i.onChange(Number(l.target.value)),placeholder:"Enter number of workers"})})]})}):f.jsxs(f.Fragment,{children:[s==="Semantic"&&f.jsxs(f.Fragment,{children:[f.jsx(Xe,{name:"splitter_config.buffer_size",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Buffer Size"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",...i,onChange:l=>i.onChange(Number(l.target.value))})})]})}),f.jsx(Xe,{name:"splitter_config.breakpoint_percentile_threshold",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Breakpoint Percentile Threshold"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",...i,onChange:l=>i.onChange(Number(l.target.value))})})]})})]}),s==="Sentence"&&f.jsxs(f.Fragment,{children:[f.jsx(Xe,{name:"splitter_config.chunk_size",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Chunk Size"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",...i,onChange:l=>i.onChange(Number(l.target.value))})})]})}),f.jsx(Xe,{name:"splitter_config.chunk_overlap",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Chunk Overlap"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",...i,onChange:l=>i.onChange(Number(l.target.value))})})]})})]})]}),f.jsx(Xt,{})]})}}),f.jsx(Xe,{name:"embed_config.embed_model",render:({field:s})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Embed Model"}),f.jsxs(Zi,{onValueChange:i=>{s.onChange(i);const l=i.startsWith("text")?"OpenAI":"Cohere";t.setValue("embed_config.embed_provider",l)},defaultValue:s.value,children:[f.jsx(tt,{children:f.jsx(Rs,{children:f.jsx(qi,{placeholder:"Select embed model"})})}),f.jsxs(Es,{children:[f.jsxs(La,{children:[f.jsx(Qi,{children:"OpenAI Models"}),f.jsx(Ke,{value:"text-embedding-3-small",children:"text-embedding-3-small"}),f.jsx(Ke,{value:"text-embedding-3-large",children:"text-embedding-3-large"})]}),f.jsx(mp,{}),f.jsxs(La,{children:[f.jsx(Qi,{children:"Cohere Models"}),f.jsx(Ke,{value:"embed-english-light-v3.0",children:"embed-english-light-v3.0"}),f.jsx(Ke,{value:"embed-english-v3.0",children:"embed-english-v3.0"}),f.jsx(Ke,{value:"embed-multilingual-light-v3.0",children:"embed-multilingual-light-v3.0"}),f.jsx(Ke,{value:"embed-multilingual-v3.0",children:"embed-multilingual-v3.0"})]})]})]}),f.jsx(Xt,{})]})}),t.watch("ingest_method")==="LlamaParse"&&f.jsx(Xe,{name:"llm_config",render:()=>f.jsx(Ze,{children:f.jsx(Xe,{name:"llm_config.llm_model",render:({field:s})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"LLM Model"}),f.jsxs(Zi,{onValueChange:i=>{s.onChange(i),t.setValue("llm_config.llm_provider",i.startsWith("gpt")?"OpenAI":"Anthropic")},defaultValue:s.value,children:[f.jsx(tt,{children:f.jsx(Rs,{children:f.jsx(qi,{placeholder:"Select LLM model"})})}),f.jsxs(Es,{children:[f.jsxs(La,{children:[f.jsx(Qi,{children:"OpenAI Models"}),f.jsx(Ke,{value:"gpt-3.5-turbo",children:"gpt-3.5-turbo"}),f.jsx(Ke,{value:"gpt-4-turbo",children:"gpt-4-turbo"}),f.jsx(Ke,{value:"gpt-4o-mini",children:"gpt-4o-mini"}),f.jsx(Ke,{value:"gpt-4o",children:"gpt-4o"})]}),f.jsx(mp,{}),f.jsxs(La,{children:[f.jsx(Qi,{children:"Anthropic Models"}),f.jsx(Ke,{value:"claude-4-haiku-20240307",children:"claude-4-haiku-20240307"}),f.jsx(Ke,{value:"claude-3-sonnet-20240229",children:"claude-3-sonnet-20240229"}),f.jsx(Ke,{value:"claude-3-5-sonnet-20240620",children:"claude-3-5-sonnet-20240620"})]})]})]}),f.jsx(Xt,{})]})})})}),f.jsxs("div",{className:"flex justify-end space-x-4",children:[f.jsx(dt,{variant:"outline",onClick:r,children:"Cancel"}),f.jsx(dt,{type:"submit",children:"Create"})]})]})})})]})]})}function lO(){const[e,t]=g.useState(!1);function n(){t(!0)}const{data:r,isLoading:o,isError:s}=ui({queryKey:["knowledge-bases"],queryFn:ca.fetchKnowledgeBases});if(o)return f.jsx("div",{children:"Loading..."});if(s)return console.error("Error fetching knowledge bases:",s),f.jsx("div",{children:"Error loading knowledge bases"});if(r)return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"flex justify-between items-baseline mb-8",children:[f.jsx(qt,{variant:"h3",children:"Knowledge Bases"}),f.jsx(dt,{variant:"default",onClick:n,children:"Create new knowledge base"})]}),o?f.jsx("div",{children:"Loading..."}):f.jsx("div",{className:"grid grid-cols-3 gap-8",children:r.map(i=>f.jsx(Mu,{href:`/knowledge-bases/${i.id}`,children:f.jsx("div",{className:"bg-gray-100 p-4 rounded-md",children:i.kb_name})},i.id))}),e&&f.jsx(iO,{setModalVisible:t})]})}const xm=g.forwardRef(({className:e,...t},n)=>f.jsx("div",{className:"relative w-full overflow-auto",children:f.jsx("table",{ref:n,className:de("w-full caption-bottom text-sm",e),...t})}));xm.displayName="Table";const Sm=g.forwardRef(({className:e,...t},n)=>f.jsx("thead",{ref:n,className:de("[&_tr]:border-b",e),...t}));Sm.displayName="TableHeader";const Cm=g.forwardRef(({className:e,...t},n)=>f.jsx("tbody",{ref:n,className:de("[&_tr:last-child]:border-0",e),...t}));Cm.displayName="TableBody";const aO=g.forwardRef(({className:e,...t},n)=>f.jsx("tfoot",{ref:n,className:de("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));aO.displayName="TableFooter";const $s=g.forwardRef(({className:e,...t},n)=>f.jsx("tr",{ref:n,className:de("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));$s.displayName="TableRow";const Ts=g.forwardRef(({className:e,...t},n)=>f.jsx("th",{ref:n,className:de("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Ts.displayName="TableHead";const ko=g.forwardRef(({className:e,...t},n)=>f.jsx("td",{ref:n,className:de("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ko.displayName="TableCell";const uO=g.forwardRef(({className:e,...t},n)=>f.jsx("caption",{ref:n,className:de("mt-4 text-sm text-muted-foreground",e),...t}));uO.displayName="TableCaption";const cO=z.object({file:z.instanceof(File).refine(e=>e.size<=25e6,{message:"File size must be less than 25MB."})});function dO({setModalVisible:e,id:t}){const n=dm({resolver:wm(cO)});function r(){e(!1)}function o(i){s.mutate(i.file)}const s=Cc({mutationFn:async i=>{ca.uploadFile(t,i)},onSuccess:()=>{e(!1)},onError:i=>{console.error("Error uploading file:",i)}});return f.jsxs(f.Fragment,{children:[f.jsx(pC,{setModalVisible:e}),f.jsxs(ci,{className:"min-w-0.5 max-w-2xl fixed top-1/2 -translate-x-1/2 -translate-y-1/2 left-1/2 z-20",children:[f.jsxs(Lh,{children:[f.jsx(Vh,{children:"Upload a file"}),f.jsx($h,{children:"Upload a file to the knowledge base for your chatbot to reference."})]}),f.jsx(zh,{children:f.jsx(fm,{...n,children:f.jsxs("form",{onSubmit:n.handleSubmit(o),className:"space-y-8",children:[f.jsx(Xe,{control:n.control,name:"file",render:({field:i})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"File"}),f.jsx(tt,{children:f.jsx(dn,{type:"file",onChange:l=>{var a;return i.onChange((a=l.target.files)==null?void 0:a[0])}})}),f.jsx(Xt,{})]})}),f.jsxs("div",{className:"flex justify-between",children:[f.jsx(dt,{type:"button",variant:"secondary",onClick:r,children:"Cancel"}),f.jsx(dt,{type:"submit",children:"Upload"})]})]})})})]})]})}function fO({id:e}){const{data:t,isLoading:n,error:r}=ui({queryKey:["knowledge-base",e],queryFn:()=>ca.fetchKnowledgeBaseById(e)}),[,o]=AE(),[s,i]=g.useState(!1);function l(a){a.preventDefault(),o("/knowledge-bases/")}if(n)return f.jsx("div",{children:"Loading..."});if(r)return f.jsx("div",{children:"Error loading knowledge base"});if(t)return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"mb-8",children:[f.jsx(dt,{variant:"ghost",onClick:l,children:"Back"}),f.jsx(qt,{variant:"h2",children:"Knowledge Base Details"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsxs("div",{children:[f.jsx(qt,{variant:"h4",children:"Ingest Method:"}),f.jsx(qt,{variant:"p",children:t.ingest_method})]}),f.jsxs("div",{children:[f.jsx(qt,{variant:"h4",children:"Splitter:"}),f.jsx(qt,{variant:"p",children:t.splitter})]}),f.jsxs("div",{children:[f.jsx(qt,{variant:"h4",children:"Embed Model:"}),f.jsx(qt,{variant:"p",children:t.embed_config.embed_model})]})]})]}),f.jsxs("header",{className:"flex items-center justify-between",children:[f.jsx(qt,{variant:"h3",children:"Files"}),f.jsx(dt,{onClick:()=>i(!0),children:"Upload File"})]}),f.jsxs(xm,{children:[f.jsx(Sm,{children:f.jsxs($s,{children:[f.jsx(Ts,{children:"File Name"}),f.jsx(Ts,{children:"File Type"}),f.jsx(Ts,{children:"Source"}),f.jsx(Ts,{children:"Date"})]})}),f.jsx(Cm,{children:t.files.map(a=>f.jsxs($s,{children:[f.jsx(ko,{children:a.file_name}),f.jsx(ko,{children:a.content_type}),f.jsx(ko,{children:a.date_uploaded}),f.jsx(ko,{children:a.time_uploaded})]},a.file_name))})]}),s&&f.jsx(dO,{setModalVisible:i,id:e})]})}function pO({chatbot:e}){return f.jsx("li",{children:f.jsx(Mu,{href:`/chatbots/${e.id}`,children:f.jsx("div",{className:"card p-4 border rounded-lg shadow-sm hover:shadow-md transition-shadow",children:e.name})})},e.id)}const _m="",hO=z.object({id:z.string(),name:z.string(),knowledge_bases:z.array(z.string()),generative_model:z.string(),similarity:z.object({on:z.boolean(),cutoff:z.number().optional()}),colbert_rerank:z.object({on:z.boolean(),top_n:z.number().optional()}),long_context_reorder:z.object({on:z.boolean()}),prompt:z.string()});z.object({id:z.string(),name:z.string(),generative_model:z.string(),knowledgebases:z.array(z.string()),postprocessing:z.object({similarity:z.object({on:z.string(),cutoff:z.number().optional()}),colbertRerank:z.object({on:z.string(),top_n:z.number().optional()}),longContextReorder:z.object({on:z.string()})})});async function mO(e,t){return(await Oe.put(`${_m}/api/chatbots/${e}`,t)).data}async function gO(){const e=await Oe.get(`${_m}/api/chatbots`);return console.log(e.data),e.data}async function vO(e){const t=await Oe.get(`${_m}/api/chatbots/${e}`);return console.log(t.data),t.data}const kp={updateChatbot:mO,fetchChatbots:gO,fetchChatbotById:vO};function yO(){const{data:e,isLoading:t}=ui({queryKey:["chatbots"],queryFn:()=>kp.fetchChatbots()});if(t)return f.jsx("div",{children:"Loading..."});if(e)return f.jsxs(f.Fragment,{children:[f.jsxs("header",{className:"flex justify-between items-baseline mb-8",children:[f.jsx(qt,{variant:"h3",children:"Chatbots"}),f.jsx(dt,{variant:"default",children:"Create new chatbot"})]}),e?f.jsx("ul",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:e.map(n=>f.jsx(pO,{chatbot:n},n.id))}):f.jsx("p",{children:"No chatbots found"})]})}function wO(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var er=e=>{const{present:t,children:n}=e,r=xO(t),o=typeof n=="function"?n({present:r.isPresent}):g.Children.only(n),s=Re(r.ref,SO(o));return typeof n=="function"||r.isPresent?g.cloneElement(o,{ref:s}):null};er.displayName="Presence";function xO(e){const[t,n]=g.useState(),r=g.useRef({}),o=g.useRef(e),s=g.useRef("none"),i=e?"mounted":"unmounted",[l,a]=wO(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return g.useEffect(()=>{const u=$a(r.current);s.current=l==="mounted"?u:"none"},[l]),_t(()=>{const u=r.current,c=o.current;if(c!==e){const p=s.current,h=$a(u);e?a("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?a("UNMOUNT"):a(c&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),_t(()=>{if(t){const u=d=>{const h=$a(r.current).includes(d.animationName);d.target===t&&h&&Jo.flushSync(()=>a("ANIMATION_END"))},c=d=>{d.target===t&&(s.current=$a(r.current))};return t.addEventListener("animationstart",c),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",c),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:g.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function $a(e){return(e==null?void 0:e.animationName)||"none"}function SO(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function CO(e,t){return g.useReducer((n,r)=>t[n][r]??n,e)}var bm="ScrollArea",[qC,ND]=br(bm),[_O,yn]=qC(bm),QC=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:s=600,...i}=e,[l,a]=g.useState(null),[u,c]=g.useState(null),[d,p]=g.useState(null),[h,m]=g.useState(null),[w,S]=g.useState(null),[y,v]=g.useState(0),[x,C]=g.useState(0),[_,P]=g.useState(!1),[k,E]=g.useState(!1),I=Re(t,Y=>a(Y)),O=bc(o);return f.jsx(_O,{scope:n,type:r,dir:O,scrollHideDelay:s,scrollArea:l,viewport:u,onViewportChange:c,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:_,onScrollbarXEnabledChange:P,scrollbarY:w,onScrollbarYChange:S,scrollbarYEnabled:k,onScrollbarYEnabledChange:E,onCornerWidthChange:v,onCornerHeightChange:C,children:f.jsx(ye.div,{dir:O,...i,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});QC.displayName=bm;var XC="ScrollAreaViewport",YC=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...s}=e,i=yn(XC,n),l=g.useRef(null),a=Re(t,l,i.onViewportChange);return f.jsxs(f.Fragment,{children:[f.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),f.jsx(ye.div,{"data-radix-scroll-area-viewport":"",...s,ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:f.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});YC.displayName=XC;var tr="ScrollAreaScrollbar",Rm=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yn(tr,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return g.useEffect(()=>(l?s(!0):i(!0),()=>{l?s(!1):i(!1)}),[l,s,i]),o.type==="hover"?f.jsx(bO,{...r,ref:t,forceMount:n}):o.type==="scroll"?f.jsx(RO,{...r,ref:t,forceMount:n}):o.type==="auto"?f.jsx(JC,{...r,ref:t,forceMount:n}):o.type==="always"?f.jsx(Em,{...r,ref:t}):null});Rm.displayName=tr;var bO=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yn(tr,e.__scopeScrollArea),[s,i]=g.useState(!1);return g.useEffect(()=>{const l=o.scrollArea;let a=0;if(l){const u=()=>{window.clearTimeout(a),i(!0)},c=()=>{a=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",c),()=>{window.clearTimeout(a),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",c)}}},[o.scrollArea,o.scrollHideDelay]),f.jsx(er,{present:n||s,children:f.jsx(JC,{"data-state":s?"visible":"hidden",...r,ref:t})})}),RO=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yn(tr,e.__scopeScrollArea),s=e.orientation==="horizontal",i=Uc(()=>a("SCROLL_END"),100),[l,a]=CO("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>a("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,a]),g.useEffect(()=>{const u=o.viewport,c=s?"scrollLeft":"scrollTop";if(u){let d=u[c];const p=()=>{const h=u[c];d!==h&&(a("SCROLL"),i()),d=h};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,s,a,i]),f.jsx(er,{present:n||l!=="hidden",children:f.jsx(Em,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:te(e.onPointerEnter,()=>a("POINTER_ENTER")),onPointerLeave:te(e.onPointerLeave,()=>a("POINTER_LEAVE"))})})}),JC=g.forwardRef((e,t)=>{const n=yn(tr,e.__scopeScrollArea),{forceMount:r,...o}=e,[s,i]=g.useState(!1),l=e.orientation==="horizontal",a=Uc(()=>{if(n.viewport){const u=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,o=yn(tr,e.__scopeScrollArea),s=g.useRef(null),i=g.useRef(0),[l,a]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=o_(l.viewport,l.content),c={...r,sizes:l,onSizesChange:a,hasThumb:u>0&&u<1,onThumbChange:p=>s.current=p,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:p=>i.current=p};function d(p,h){return jO(p,i.current,l,h)}return n==="horizontal"?f.jsx(EO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollLeft,h=hy(p,l,o.dir);s.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=d(p,o.dir))}}):n==="vertical"?f.jsx(kO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&s.current){const p=o.viewport.scrollTop,h=hy(p,l);s.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=d(p))}}):null}),EO=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=yn(tr,e.__scopeScrollArea),[i,l]=g.useState(),a=g.useRef(null),u=Re(t,a,s.onScrollbarXChange);return g.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),f.jsx(t_,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:s.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:s.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Bc(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.x),onDragScroll:c=>e.onDragScroll(c.x),onWheelScroll:(c,d)=>{if(s.viewport){const p=s.viewport.scrollLeft+c.deltaX;e.onWheelScroll(p),i_(p,d)&&c.preventDefault()}},onResize:()=>{a.current&&s.viewport&&i&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:a.current.clientWidth,paddingStart:nc(i.paddingLeft),paddingEnd:nc(i.paddingRight)}})}})}),kO=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,s=yn(tr,e.__scopeScrollArea),[i,l]=g.useState(),a=g.useRef(null),u=Re(t,a,s.onScrollbarYChange);return g.useEffect(()=>{a.current&&l(getComputedStyle(a.current))},[a]),f.jsx(t_,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Bc(n)+"px",...e.style},onThumbPointerDown:c=>e.onThumbPointerDown(c.y),onDragScroll:c=>e.onDragScroll(c.y),onWheelScroll:(c,d)=>{if(s.viewport){const p=s.viewport.scrollTop+c.deltaY;e.onWheelScroll(p),i_(p,d)&&c.preventDefault()}},onResize:()=>{a.current&&s.viewport&&i&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:a.current.clientHeight,paddingStart:nc(i.paddingTop),paddingEnd:nc(i.paddingBottom)}})}})}),[PO,e_]=qC(tr),t_=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:s,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:a,onDragScroll:u,onWheelScroll:c,onResize:d,...p}=e,h=yn(tr,n),[m,w]=g.useState(null),S=Re(t,I=>w(I)),y=g.useRef(null),v=g.useRef(""),x=h.viewport,C=r.content-r.viewport,_=it(c),P=it(a),k=Uc(d,10);function E(I){if(y.current){const O=I.clientX-y.current.left,Y=I.clientY-y.current.top;u({x:O,y:Y})}}return g.useEffect(()=>{const I=O=>{const Y=O.target;(m==null?void 0:m.contains(Y))&&_(O,C)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[x,m,C,_]),g.useEffect(P,[r,P]),vi(m,k),vi(h.content,k),f.jsx(PO,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:it(s),onThumbPointerUp:it(i),onThumbPositionChange:P,onThumbPointerDown:it(l),children:f.jsx(ye.div,{...p,ref:S,style:{position:"absolute",...p.style},onPointerDown:te(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),y.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),E(I))}),onPointerMove:te(e.onPointerMove,E),onPointerUp:te(e.onPointerUp,I=>{const O=I.target;O.hasPointerCapture(I.pointerId)&&O.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=v.current,h.viewport&&(h.viewport.style.scrollBehavior=""),y.current=null})})})}),tc="ScrollAreaThumb",n_=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=e_(tc,e.__scopeScrollArea);return f.jsx(er,{present:n||o.hasThumb,children:f.jsx(TO,{ref:t,...r})})}),TO=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,s=yn(tc,n),i=e_(tc,n),{onThumbPositionChange:l}=i,a=Re(t,d=>i.onThumbChange(d)),u=g.useRef(),c=Uc(()=>{u.current&&(u.current(),u.current=void 0)},100);return g.useEffect(()=>{const d=s.viewport;if(d){const p=()=>{if(c(),!u.current){const h=AO(d,l);u.current=h,l()}};return l(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[s.viewport,c,l]),f.jsx(ye.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:a,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:te(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,w=d.clientY-h.top;i.onThumbPointerDown({x:m,y:w})}),onPointerUp:te(e.onPointerUp,i.onThumbPointerUp)})});n_.displayName=tc;var km="ScrollAreaCorner",r_=g.forwardRef((e,t)=>{const n=yn(km,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?f.jsx(NO,{...e,ref:t}):null});r_.displayName=km;var NO=g.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=yn(km,n),[s,i]=g.useState(0),[l,a]=g.useState(0),u=!!(s&&l);return vi(o.scrollbarX,()=>{var d;const c=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(c),a(c)}),vi(o.scrollbarY,()=>{var d;const c=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(c),i(c)}),u?f.jsx(ye.div,{...r,ref:t,style:{width:s,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function nc(e){return e?parseInt(e,10):0}function o_(e,t){const n=e/t;return isNaN(n)?0:n}function Bc(e){const t=o_(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function jO(e,t,n,r="ltr"){const o=Bc(n),s=o/2,i=t||s,l=o-i,a=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,c=n.content-n.viewport,d=r==="ltr"?[0,c]:[c*-1,0];return s_([a,u],d)(e)}function hy(e,t,n="ltr"){const r=Bc(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-o,i=t.content-t.viewport,l=s-r,a=n==="ltr"?[0,i]:[i*-1,0],u=sp(e,a);return s_([0,i],[0,l])(u)}function s_(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function i_(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const s={left:e.scrollLeft,top:e.scrollTop},i=n.left!==s.left,l=n.top!==s.top;(i||l)&&t(),n=s,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Uc(e,t){const n=it(e),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function vi(e,t){const n=it(t);_t(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var l_=QC,MO=YC,OO=r_;const a_=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(l_,{ref:r,className:de("relative overflow-hidden",e),...n,children:[f.jsx(MO,{className:"h-full w-full rounded-[inherit]",children:t}),f.jsx(u_,{}),f.jsx(OO,{})]}));a_.displayName=l_.displayName;const u_=g.forwardRef(({className:e,orientation:t="vertical",...n},r)=>f.jsx(Rm,{ref:r,orientation:t,className:de("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]",e),...n,children:f.jsx(n_,{className:"relative flex-1 rounded-full bg-border"})}));u_.displayName=Rm.displayName;const IO="";async function FO(e,t){const n=await Oe.post(`${IO}/api/query`,{query:t,chatbot_id:e});return console.log(n.data),n.data}const DO={sendMessage:FO};function LO({id:e}){const[t,n]=g.useState([{role:"assistant",content:"Hello, how can I help you?"}]),[r,o]=g.useState(""),s=Cc({mutationFn:l=>DO.sendMessage(e,l),onSuccess:l=>{const a={role:"assistant",content:l.response,source_nodes:l.source_nodes};n(u=>[...u,a])},onError:l=>{console.error("Error sending message:",l)}}),i=async()=>{if(r.trim()==="")return;const l={role:"user",content:r};n(a=>[...a,l]),o(""),s.mutate(r)};return f.jsxs("div",{className:"flex flex-col h-[75vh]",children:[f.jsx("div",{className:"flex-grow mb-4 overflow-hidden",children:f.jsx(ci,{className:"h-full flex flex-col",children:f.jsx(a_,{className:"flex-grow",children:f.jsx("div",{className:"p-4",children:t.map((l,a)=>f.jsx("div",{className:`mb-4 flex ${l.role==="user"?"justify-end":"justify-start"}`,children:f.jsx("div",{className:`max-w-[75%] ${l.role==="user"?"ml-auto":""}`,children:f.jsx(ci,{className:`py-2 px-4 ${l.role==="user"?"bg-blue-100":"bg-gray-100"}`,children:f.jsx(qt,{variant:"p",className:"text-left",children:l.content})})})},a))})})})}),f.jsxs("div",{className:"flex space-x-2",children:[f.jsx(dn,{value:r,onChange:l=>o(l.target.value),onKeyDown:l=>l.key==="Enter"&&i(),placeholder:"Type your message here...",className:"flex-grow"}),f.jsx(dt,{onClick:i,children:"Send"})]})]})}var Ud="rovingFocusGroup.onEntryFocus",VO={bubbles:!1,cancelable:!0},Hc="RovingFocusGroup",[Pp,c_,$O]=Bh(Hc),[zO,d_]=br(Hc,[$O]),[BO,UO]=zO(Hc),f_=g.forwardRef((e,t)=>f.jsx(Pp.Provider,{scope:e.__scopeRovingFocusGroup,children:f.jsx(Pp.Slot,{scope:e.__scopeRovingFocusGroup,children:f.jsx(HO,{...e,ref:t})})}));f_.displayName=Hc;var HO=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:s,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:a,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=e,p=g.useRef(null),h=Re(t,p),m=bc(s),[w=null,S]=pi({prop:i,defaultProp:l,onChange:a}),[y,v]=g.useState(!1),x=it(u),C=c_(n),_=g.useRef(!1),[P,k]=g.useState(0);return g.useEffect(()=>{const E=p.current;if(E)return E.addEventListener(Ud,x),()=>E.removeEventListener(Ud,x)},[x]),f.jsx(BO,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:w,onItemFocus:g.useCallback(E=>S(E),[S]),onItemShiftTab:g.useCallback(()=>v(!0),[]),onFocusableItemAdd:g.useCallback(()=>k(E=>E+1),[]),onFocusableItemRemove:g.useCallback(()=>k(E=>E-1),[]),children:f.jsx(ye.div,{tabIndex:y||P===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:te(e.onMouseDown,()=>{_.current=!0}),onFocus:te(e.onFocus,E=>{const I=!_.current;if(E.target===E.currentTarget&&I&&!y){const O=new CustomEvent(Ud,VO);if(E.currentTarget.dispatchEvent(O),!O.defaultPrevented){const Y=C().filter(re=>re.focusable),F=Y.find(re=>re.active),G=Y.find(re=>re.id===w),J=[F,G,...Y].filter(Boolean).map(re=>re.ref.current);m_(J,c)}}_.current=!1}),onBlur:te(e.onBlur,()=>v(!1))})})}),p_="RovingFocusGroupItem",h_=g.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:s,...i}=e,l=di(),a=s||l,u=UO(p_,n),c=u.currentTabStopId===a,d=c_(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=u;return g.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),f.jsx(Pp.ItemSlot,{scope:n,id:a,focusable:r,active:o,children:f.jsx(ye.span,{tabIndex:c?0:-1,"data-orientation":u.orientation,...i,ref:t,onMouseDown:te(e.onMouseDown,m=>{r?u.onItemFocus(a):m.preventDefault()}),onFocus:te(e.onFocus,()=>u.onItemFocus(a)),onKeyDown:te(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=KO(m,u.orientation,u.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let y=d().filter(v=>v.focusable).map(v=>v.ref.current);if(w==="last")y.reverse();else if(w==="prev"||w==="next"){w==="prev"&&y.reverse();const v=y.indexOf(m.currentTarget);y=u.loop?ZO(y,v+1):y.slice(v+1)}setTimeout(()=>m_(y))}})})})});h_.displayName=p_;var WO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function GO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function KO(e,t,n){const r=GO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return WO[r]}function m_(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function ZO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var qO=f_,QO=h_,Tp=["Enter"," "],XO=["ArrowDown","PageUp","Home"],g_=["ArrowUp","PageDown","End"],YO=[...XO,...g_],JO={ltr:[...Tp,"ArrowRight"],rtl:[...Tp,"ArrowLeft"]},eI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},da="Menu",[Kl,tI,nI]=Bh(da),[ts,v_]=br(da,[nI,kc,d_]),Wc=kc(),y_=d_(),[rI,ns]=ts(da),[oI,fa]=ts(da),w_=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,l=Wc(t),[a,u]=g.useState(null),c=g.useRef(!1),d=it(s),p=bc(o);return g.useEffect(()=>{const h=()=>{c.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>c.current=!1;return document.addEventListener("keydown",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),f.jsx(K0,{...l,children:f.jsx(rI,{scope:t,open:n,onOpenChange:d,content:a,onContentChange:u,children:f.jsx(oI,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:p,modal:i,children:r})})})};w_.displayName=da;var sI="MenuAnchor",Pm=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wc(n);return f.jsx(Z0,{...o,...r,ref:t})});Pm.displayName=sI;var Tm="MenuPortal",[iI,x_]=ts(Tm,{forceMount:void 0}),S_=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=ns(Tm,t);return f.jsx(iI,{scope:t,forceMount:n,children:f.jsx(er,{present:n||s.open,children:f.jsx(em,{asChild:!0,container:o,children:r})})})};S_.displayName=Tm;var mn="MenuContent",[lI,Nm]=ts(mn),C_=g.forwardRef((e,t)=>{const n=x_(mn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=ns(mn,e.__scopeMenu),i=fa(mn,e.__scopeMenu);return f.jsx(Kl.Provider,{scope:e.__scopeMenu,children:f.jsx(er,{present:r||s.open,children:f.jsx(Kl.Slot,{scope:e.__scopeMenu,children:i.modal?f.jsx(aI,{...o,ref:t}):f.jsx(uI,{...o,ref:t})})})})}),aI=g.forwardRef((e,t)=>{const n=ns(mn,e.__scopeMenu),r=g.useRef(null),o=Re(t,r);return g.useEffect(()=>{const s=r.current;if(s)return J0(s)},[]),f.jsx(jm,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:te(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),uI=g.forwardRef((e,t)=>{const n=ns(mn,e.__scopeMenu);return f.jsx(jm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),jm=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEntryFocus:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,disableOutsideScroll:m,...w}=e,S=ns(mn,n),y=fa(mn,n),v=Wc(n),x=y_(n),C=tI(n),[_,P]=g.useState(null),k=g.useRef(null),E=Re(t,k,S.onContentChange),I=g.useRef(0),O=g.useRef(""),Y=g.useRef(0),F=g.useRef(null),G=g.useRef("right"),X=g.useRef(0),J=m?nm:g.Fragment,re=m?{as:so,allowPinchZoom:!0}:void 0,Q=j=>{var ee,be;const K=O.current+j,se=C().filter(Ae=>!Ae.disabled),he=document.activeElement,mt=(ee=se.find(Ae=>Ae.ref.current===he))==null?void 0:ee.textValue,ze=se.map(Ae=>Ae.textValue),Rt=SI(ze,K,mt),Fe=(be=se.find(Ae=>Ae.textValue===Rt))==null?void 0:be.ref.current;(function Ae(Ee){O.current=Ee,window.clearTimeout(I.current),Ee!==""&&(I.current=window.setTimeout(()=>Ae(""),1e3))})(K),Fe&&setTimeout(()=>Fe.focus())};g.useEffect(()=>()=>window.clearTimeout(I.current),[]),E0();const M=g.useCallback(j=>{var se,he;return G.current===((se=F.current)==null?void 0:se.side)&&_I(j,(he=F.current)==null?void 0:he.area)},[]);return f.jsx(lI,{scope:n,searchRef:O,onItemEnter:g.useCallback(j=>{M(j)&&j.preventDefault()},[M]),onItemLeave:g.useCallback(j=>{var K;M(j)||((K=k.current)==null||K.focus(),P(null))},[M]),onTriggerLeave:g.useCallback(j=>{M(j)&&j.preventDefault()},[M]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:g.useCallback(j=>{F.current=j},[]),children:f.jsx(J,{...re,children:f.jsx(Hh,{asChild:!0,trapped:o,onMountAutoFocus:te(s,j=>{var K;j.preventDefault(),(K=k.current)==null||K.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:f.jsx(Uh,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:f.jsx(qO,{asChild:!0,...x,dir:y.dir,orientation:"vertical",loop:r,currentTabStopId:_,onCurrentTabStopIdChange:P,onEntryFocus:te(a,j=>{y.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:f.jsx(q0,{role:"menu","aria-orientation":"vertical","data-state":L_(S.open),"data-radix-menu-content":"",dir:y.dir,...v,...w,ref:E,style:{outline:"none",...w.style},onKeyDown:te(w.onKeyDown,j=>{const se=j.target.closest("[data-radix-menu-content]")===j.currentTarget,he=j.ctrlKey||j.altKey||j.metaKey,mt=j.key.length===1;se&&(j.key==="Tab"&&j.preventDefault(),!he&&mt&&Q(j.key));const ze=k.current;if(j.target!==ze||!YO.includes(j.key))return;j.preventDefault();const Fe=C().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);g_.includes(j.key)&&Fe.reverse(),wI(Fe)}),onBlur:te(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(I.current),O.current="")}),onPointerMove:te(e.onPointerMove,Zl(j=>{const K=j.target,se=X.current!==j.clientX;if(j.currentTarget.contains(K)&&se){const he=j.clientX>X.current?"right":"left";G.current=he,X.current=j.clientX}}))})})})})})})});C_.displayName=mn;var cI="MenuGroup",Am=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(ye.div,{role:"group",...r,ref:t})});Am.displayName=cI;var dI="MenuLabel",__=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(ye.div,{...r,ref:t})});__.displayName=dI;var rc="MenuItem",my="menu.itemSelect",Gc=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,s=g.useRef(null),i=fa(rc,e.__scopeMenu),l=Nm(rc,e.__scopeMenu),a=Re(t,s),u=g.useRef(!1),c=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(my,{bubbles:!0,cancelable:!0});d.addEventListener(my,h=>r==null?void 0:r(h),{once:!0}),_0(d,p),p.defaultPrevented?u.current=!1:i.onClose()}};return f.jsx(b_,{...o,ref:a,disabled:n,onClick:te(e.onClick,c),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),u.current=!0},onPointerUp:te(e.onPointerUp,d=>{var p;u.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:te(e.onKeyDown,d=>{const p=l.searchRef.current!=="";n||p&&d.key===" "||Tp.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Gc.displayName=rc;var b_=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...s}=e,i=Nm(rc,n),l=y_(n),a=g.useRef(null),u=Re(t,a),[c,d]=g.useState(!1),[p,h]=g.useState("");return g.useEffect(()=>{const m=a.current;m&&h((m.textContent??"").trim())},[s.children]),f.jsx(Kl.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:f.jsx(QO,{asChild:!0,...l,focusable:!r,children:f.jsx(ye.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:te(e.onPointerMove,Zl(m=>{r?i.onItemLeave(m):(i.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:te(e.onPointerLeave,Zl(m=>i.onItemLeave(m))),onFocus:te(e.onFocus,()=>d(!0)),onBlur:te(e.onBlur,()=>d(!1))})})})}),fI="MenuCheckboxItem",R_=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return f.jsx(N_,{scope:e.__scopeMenu,checked:n,children:f.jsx(Gc,{role:"menuitemcheckbox","aria-checked":oc(n)?"mixed":n,...o,ref:t,"data-state":Om(n),onSelect:te(o.onSelect,()=>r==null?void 0:r(oc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});R_.displayName=fI;var E_="MenuRadioGroup",[pI,hI]=ts(E_,{value:void 0,onValueChange:()=>{}}),k_=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,s=it(r);return f.jsx(pI,{scope:e.__scopeMenu,value:n,onValueChange:s,children:f.jsx(Am,{...o,ref:t})})});k_.displayName=E_;var P_="MenuRadioItem",T_=g.forwardRef((e,t)=>{const{value:n,...r}=e,o=hI(P_,e.__scopeMenu),s=n===o.value;return f.jsx(N_,{scope:e.__scopeMenu,checked:s,children:f.jsx(Gc,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":Om(s),onSelect:te(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});T_.displayName=P_;var Mm="MenuItemIndicator",[N_,mI]=ts(Mm,{checked:!1}),j_=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,s=mI(Mm,n);return f.jsx(er,{present:r||oc(s.checked)||s.checked===!0,children:f.jsx(ye.span,{...o,ref:t,"data-state":Om(s.checked)})})});j_.displayName=Mm;var gI="MenuSeparator",A_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return f.jsx(ye.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});A_.displayName=gI;var vI="MenuArrow",M_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Wc(n);return f.jsx(Q0,{...o,...r,ref:t})});M_.displayName=vI;var yI="MenuSub",[jD,O_]=ts(yI),Ji="MenuSubTrigger",I_=g.forwardRef((e,t)=>{const n=ns(Ji,e.__scopeMenu),r=fa(Ji,e.__scopeMenu),o=O_(Ji,e.__scopeMenu),s=Nm(Ji,e.__scopeMenu),i=g.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:a}=s,u={__scopeMenu:e.__scopeMenu},c=g.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return g.useEffect(()=>c,[c]),g.useEffect(()=>{const d=l.current;return()=>{window.clearTimeout(d),a(null)}},[l,a]),f.jsx(Pm,{asChild:!0,...u,children:f.jsx(b_,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":L_(n.open),...e,ref:_c(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:te(e.onPointerMove,Zl(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(s.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),c()},100))})),onPointerLeave:te(e.onPointerLeave,Zl(d=>{var h,m;c();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const w=(m=n.content)==null?void 0:m.dataset.side,S=w==="right",y=S?-5:5,v=p[S?"left":"right"],x=p[S?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+y,y:d.clientY},{x:v,y:p.top},{x,y:p.top},{x,y:p.bottom},{x:v,y:p.bottom}],side:w}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:te(e.onKeyDown,d=>{var h;const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||JO[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});I_.displayName=Ji;var F_="MenuSubContent",D_=g.forwardRef((e,t)=>{const n=x_(mn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,s=ns(mn,e.__scopeMenu),i=fa(mn,e.__scopeMenu),l=O_(F_,e.__scopeMenu),a=g.useRef(null),u=Re(t,a);return f.jsx(Kl.Provider,{scope:e.__scopeMenu,children:f.jsx(er,{present:r||s.open,children:f.jsx(Kl.Slot,{scope:e.__scopeMenu,children:f.jsx(jm,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:u,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{var d;i.isUsingKeyboardRef.current&&((d=a.current)==null||d.focus()),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:te(e.onFocusOutside,c=>{c.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:te(e.onEscapeKeyDown,c=>{i.onClose(),c.preventDefault()}),onKeyDown:te(e.onKeyDown,c=>{var h;const d=c.currentTarget.contains(c.target),p=eI[i.dir].includes(c.key);d&&p&&(s.onOpenChange(!1),(h=l.trigger)==null||h.focus(),c.preventDefault())})})})})})});D_.displayName=F_;function L_(e){return e?"open":"closed"}function oc(e){return e==="indeterminate"}function Om(e){return oc(e)?"indeterminate":e?"checked":"unchecked"}function wI(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function xI(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function SI(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=xI(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const a=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return a!==n?a:void 0}function CI(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;sr!=c>r&&n<(u-l)*(r-a)/(c-a)+l&&(o=!o)}return o}function _I(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return CI(n,t)}function Zl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var bI=w_,RI=Pm,EI=S_,kI=C_,PI=Am,TI=__,NI=Gc,jI=R_,AI=k_,MI=T_,OI=j_,II=A_,FI=M_,DI=I_,LI=D_,Im="DropdownMenu",[VI,AD]=br(Im,[v_]),Ot=v_(),[$I,V_]=VI(Im),$_=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:l=!0}=e,a=Ot(t),u=g.useRef(null),[c=!1,d]=pi({prop:o,defaultProp:s,onChange:i});return f.jsx($I,{scope:t,triggerId:di(),triggerRef:u,contentId:di(),open:c,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(p=>!p),[d]),modal:l,children:f.jsx(bI,{...a,open:c,onOpenChange:d,dir:r,modal:l,children:n})})};$_.displayName=Im;var z_="DropdownMenuTrigger",B_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,s=V_(z_,n),i=Ot(n);return f.jsx(RI,{asChild:!0,...i,children:f.jsx(ye.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:_c(t,s.triggerRef),onPointerDown:te(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(s.onOpenToggle(),s.open||l.preventDefault())}),onKeyDown:te(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&s.onOpenToggle(),l.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});B_.displayName=z_;var zI="DropdownMenuPortal",U_=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ot(t);return f.jsx(EI,{...r,...n})};U_.displayName=zI;var H_="DropdownMenuContent",W_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=V_(H_,n),s=Ot(n),i=g.useRef(!1);return f.jsx(kI,{id:o.contentId,"aria-labelledby":o.triggerId,...s,...r,ref:t,onCloseAutoFocus:te(e.onCloseAutoFocus,l=>{var a;i.current||(a=o.triggerRef.current)==null||a.focus(),i.current=!1,l.preventDefault()}),onInteractOutside:te(e.onInteractOutside,l=>{const a=l.detail.originalEvent,u=a.button===0&&a.ctrlKey===!0,c=a.button===2||u;(!o.modal||c)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});W_.displayName=H_;var BI="DropdownMenuGroup",UI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(PI,{...o,...r,ref:t})});UI.displayName=BI;var HI="DropdownMenuLabel",G_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(TI,{...o,...r,ref:t})});G_.displayName=HI;var WI="DropdownMenuItem",K_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(NI,{...o,...r,ref:t})});K_.displayName=WI;var GI="DropdownMenuCheckboxItem",Z_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(jI,{...o,...r,ref:t})});Z_.displayName=GI;var KI="DropdownMenuRadioGroup",ZI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(AI,{...o,...r,ref:t})});ZI.displayName=KI;var qI="DropdownMenuRadioItem",q_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(MI,{...o,...r,ref:t})});q_.displayName=qI;var QI="DropdownMenuItemIndicator",Q_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(OI,{...o,...r,ref:t})});Q_.displayName=QI;var XI="DropdownMenuSeparator",X_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(II,{...o,...r,ref:t})});X_.displayName=XI;var YI="DropdownMenuArrow",JI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(FI,{...o,...r,ref:t})});JI.displayName=YI;var eF="DropdownMenuSubTrigger",Y_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(DI,{...o,...r,ref:t})});Y_.displayName=eF;var tF="DropdownMenuSubContent",J_=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ot(n);return f.jsx(LI,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});J_.displayName=tF;var nF=$_,rF=B_,oF=U_,eb=W_,tb=G_,nb=K_,rb=Z_,ob=q_,sb=Q_,ib=X_,lb=Y_,ab=J_;const Fm=nF,Dm=rF,sF=g.forwardRef(({className:e,inset:t,children:n,...r},o)=>f.jsxs(lb,{ref:o,className:de("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",e),...r,children:[n,f.jsx(KN,{className:"ml-auto h-4 w-4"})]}));sF.displayName=lb.displayName;const iF=g.forwardRef(({className:e,...t},n)=>f.jsx(ab,{ref:n,className:de("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",e),...t}));iF.displayName=ab.displayName;const Kc=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>f.jsx(oF,{children:f.jsx(eb,{ref:r,sideOffset:t,className:de("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",e),...n})}));Kc.displayName=eb.displayName;const Np=g.forwardRef(({className:e,inset:t,...n},r)=>f.jsx(nb,{ref:r,className:de("relative flex cursor-default 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",e),...n}));Np.displayName=nb.displayName;const Lm=g.forwardRef(({className:e,children:t,checked:n,...r},o)=>f.jsxs(rb,{ref:o,className:de("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",e),checked:n,...r,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(sb,{children:f.jsx(om,{className:"h-4 w-4"})})}),t]}));Lm.displayName=rb.displayName;const lF=g.forwardRef(({className:e,children:t,...n},r)=>f.jsxs(ob,{ref:r,className:de("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",e),...n,children:[f.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:f.jsx(sb,{children:f.jsx(qN,{className:"h-2 w-2 fill-current"})})}),t]}));lF.displayName=ob.displayName;const Vm=g.forwardRef(({className:e,inset:t,...n},r)=>f.jsx(tb,{ref:r,className:de("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Vm.displayName=tb.displayName;const $m=g.forwardRef(({className:e,...t},n)=>f.jsx(ib,{ref:n,className:de("-mx-1 my-1 h-px bg-muted",e),...t}));$m.displayName=ib.displayName;function aF({control:e,knowledgeBases:t}){return f.jsx(Xe,{control:e,name:"knowledge_bases",render:({field:n})=>{var r;return f.jsxs(Ze,{children:[f.jsx(et,{children:"Knowledge Bases"}),f.jsx(tt,{children:f.jsx("div",{children:f.jsxs(Fm,{children:[f.jsx(Dm,{asChild:!0,children:f.jsxs(dt,{variant:"outline",children:[((r=n.value)==null?void 0:r.length)??0," knowledge base(s) selected"]})}),f.jsxs(Kc,{className:"w-56",children:[f.jsx(Vm,{children:"Knowledge Bases"}),f.jsx($m,{}),t.map(o=>{var s;return f.jsx(Lm,{checked:(s=n.value)==null?void 0:s.includes(o.kb_name),onCheckedChange:i=>{const l=i?[...n.value??[],o.kb_name]:(n.value??[]).filter(a=>a!==o.kb_name);n.onChange(l)},onSelect:i=>i.preventDefault(),children:o.kb_name},o.id)})]})]})})}),f.jsx(Sr,{children:"The knowledge base(s) that the chatbot will reference to generate responses."}),f.jsx(Xt,{})]})}})}function uF({control:e}){return f.jsx(Xe,{control:e,name:"generative_model",render:({field:t})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Generative Model"}),f.jsx(tt,{children:f.jsxs(Zi,{onValueChange:t.onChange,value:t.value,children:[f.jsx(Rs,{children:f.jsx(qi,{placeholder:"Generative Model"})}),f.jsxs(Es,{children:[f.jsx(Ke,{value:"gpt-3.5-turbo",children:"gpt-3.5-turbo"}),f.jsx(Ke,{value:"option-2",children:"Option 2"}),f.jsx(Ke,{value:"option-3",children:"Option 3"})]})]})}),f.jsx(Sr,{children:"The model that is provided context and generates the response."}),f.jsx(Xt,{})]})})}var zm="Switch",[cF,MD]=br(zm),[dF,fF]=cF(zm),ub=g.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:s,required:i,disabled:l,value:a="on",onCheckedChange:u,...c}=e,[d,p]=g.useState(null),h=Re(t,v=>p(v)),m=g.useRef(!1),w=d?!!d.closest("form"):!0,[S=!1,y]=pi({prop:o,defaultProp:s,onChange:u});return f.jsxs(dF,{scope:n,checked:S,disabled:l,children:[f.jsx(ye.button,{type:"button",role:"switch","aria-checked":S,"aria-required":i,"data-state":fb(S),"data-disabled":l?"":void 0,disabled:l,value:a,...c,ref:h,onClick:te(e.onClick,v=>{y(x=>!x),w&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),w&&f.jsx(pF,{control:d,bubbles:!m.current,name:r,value:a,checked:S,required:i,disabled:l,style:{transform:"translateX(-100%)"}})]})});ub.displayName=zm;var cb="SwitchThumb",db=g.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=fF(cb,n);return f.jsx(ye.span,{"data-state":fb(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});db.displayName=cb;var pF=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=g.useRef(null),i=tm(n),l=Xh(t);return g.useEffect(()=>{const a=s.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&d){const p=new Event("click",{bubbles:r});d.call(a,n),a.dispatchEvent(p)}},[i,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function fb(e){return e?"checked":"unchecked"}var pb=ub,hF=db;const Zc=g.forwardRef(({className:e,...t},n)=>f.jsx(pb,{className:de("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent 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",e),...t,ref:n,children:f.jsx(hF,{className:de("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Zc.displayName=pb.displayName;function mF({control:e,displayCutoff:t,setDisplayCutoff:n}){return f.jsxs(f.Fragment,{children:[f.jsx(Xe,{control:e,name:"similarity.on",render:({field:r})=>f.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[f.jsxs("div",{className:"space-y-0.5",children:[f.jsx(et,{children:"Similarity Search"}),f.jsx(Sr,{children:"Enable similarity search for context retrieval."})]}),f.jsx(tt,{children:f.jsx(Zc,{checked:r.value,onCheckedChange:o=>{r.onChange(o),n(o)}})})]})}),t&&f.jsx(Xe,{control:e,name:"similarity.cutoff",render:({field:r})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Similarity Cutoff"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",min:0,max:1,step:.01,value:r.value??0,onChange:o=>r.onChange(o.target.value)})}),f.jsx(Sr,{children:"Set the similarity cutoff threshold."}),f.jsx(Xt,{})]})})]})}function gF({control:e,displayTopN:t,setDisplayTopN:n}){return f.jsxs(f.Fragment,{children:[f.jsx(Xe,{control:e,name:"colbert_rerank.on",render:({field:r})=>f.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[f.jsxs("div",{className:"space-y-0.5",children:[f.jsx(et,{children:"Colbert Rerank"}),f.jsx(Sr,{children:"Enable Colbert reranking for improved context retrieval."})]}),f.jsx(tt,{children:f.jsx(Zc,{checked:r.value,onCheckedChange:o=>{r.onChange(o),n(o)}})})]})}),t&&f.jsx(Xe,{control:e,name:"colbert_rerank.top_n",render:({field:r})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Top N"}),f.jsx(tt,{children:f.jsx(dn,{type:"number",value:r.value??0,onChange:o=>r.onChange(o.target.value)})}),f.jsx(Sr,{children:"Set the number of top results to rerank."}),f.jsx(Xt,{})]})})]})}function vF({control:e}){return f.jsx(Xe,{control:e,name:"long_context_reorder.on",render:({field:t})=>f.jsxs(Ze,{className:"flex flex-row items-center justify-between",children:[f.jsxs("div",{className:"space-y-0.5",children:[f.jsx(et,{children:"Long Context Reorder"}),f.jsx(Sr,{children:"Enable long context reordering for improved context handling."})]}),f.jsx(tt,{children:f.jsx(Zc,{checked:t.value,onCheckedChange:t.onChange})})]})})}const hb=g.forwardRef(({className:e,...t},n)=>f.jsx("textarea",{className:de("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));hb.displayName="Textarea";function yF({control:e}){return f.jsx(Xe,{control:e,name:"prompt",render:({field:t})=>f.jsxs(Ze,{children:[f.jsx(et,{children:"Prompt"}),f.jsx(tt,{children:f.jsx(hb,{placeholder:"Enter your prompt here...",className:"resize-vertical",...t})}),f.jsx(Sr,{children:"The prompt to be used for generating responses."}),f.jsx(Xt,{})]})})}function wF({id:e}){const t=Cc({mutationFn:m=>kp.updateChatbot(e,m)}),{data:n,isLoading:r,error:o}=ui({queryKey:["knowledgeBases"],queryFn:ca.fetchKnowledgeBases}),{data:s,isLoading:i,error:l}=ui({queryKey:["chatbot",e],queryFn:()=>kp.fetchChatbotById(e)}),[a,u]=g.useState(!1),[c,d]=g.useState(!1),p=dm({resolver:wm(hO)});g.useEffect(()=>{var m,w;s&&!i&&(p.reset(s),u(!!((m=s.similarity)!=null&&m.on)),d(!!((w=s.colbert_rerank)!=null&&w.on)))},[s,i,p]);const h=p.handleSubmit(m=>{t.mutate(m)},m=>{console.error("Form submission failed. Errors:",m)});if(r||i)return f.jsx("div",{children:"Loading..."});if(o)return f.jsx("div",{children:"Error loading knowledge bases"});if(l)return f.jsx("div",{children:"Error loading chatbot"});if(n&&s)return f.jsxs(ci,{className:"h-full flex flex-col px-6",children:[f.jsxs("header",{className:"flex justify-between items-baseline",children:[f.jsx(qt,{variant:"h4",children:"Configuration"}),f.jsx(dt,{type:"submit",onClick:m=>{m.preventDefault(),h()},children:"Save"})]}),f.jsx(fm,{...p,children:f.jsxs("form",{className:"space-y-8 mb-8",children:[f.jsx(aF,{control:p.control,knowledgeBases:n}),f.jsx(uF,{control:p.control}),f.jsx(mF,{control:p.control,displayCutoff:a,setDisplayCutoff:u}),f.jsx(gF,{control:p.control,displayTopN:c,setDisplayTopN:d}),f.jsx(vF,{control:p.control}),f.jsx(yF,{control:p.control})]})})]})}function xF({id:e}){return f.jsxs("header",{children:[f.jsx(qt,{variant:"h2",className:"mb-4",children:"Chatbot Name"}),f.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[f.jsx(LO,{id:e}),f.jsx(wF,{id:e})]})]})}/** + * table-core + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Zr(e,t){return typeof e=="function"?e(t):e}function rn(e,t){return n=>{t.setState(r=>({...r,[e]:Zr(n,r[e])}))}}function qc(e){return e instanceof Function}function SF(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function CF(e,t){const n=[],r=o=>{o.forEach(s=>{n.push(s);const i=t(s);i!=null&&i.length&&r(i)})};return r(e),n}function le(e,t,n){let r=[],o;return s=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(s);if(!(l.length!==r.length||l.some((c,d)=>r[d]!==c)))return o;r=l;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...l),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-u)*100)/100,p=d/16,h=(m,w)=>{for(m=String(m);m.length{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function _F(e,t,n,r){const o=()=>{var i;return(i=s.getValue())!=null?i:e.options.renderFallbackValue},s={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:le(()=>[e,n,t,s],(i,l,a,u)=>({table:i,column:l,row:a,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ae(e.options,"debugCells"))};return e._features.forEach(i=>{i.createCell==null||i.createCell(s,n,t,e)},{}),s}function bF(e,t,n,r){var o,s;const l={...e._getDefaultColumnDef(),...t},a=l.accessorKey;let u=(o=(s=l.id)!=null?s:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?o:typeof l.header=="string"?l.header:void 0,c;if(l.accessorFn?c=l.accessorFn:a&&(a.includes(".")?c=p=>{let h=p;for(const w of a.split(".")){var m;h=(m=h)==null?void 0:m[w]}return h}:c=p=>p[l.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:l,columns:[],getFlatColumns:le(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},ae(e.options,"debugColumns")),getLeafColumns:le(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(w=>w.getLeafColumns());return p(m)}return[d]},ae(e.options,"debugColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const wt="debugHeaders";function gy(e,t,n){var r;let s={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const i=[],l=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(l),i.push(a)};return l(s),i},getContext:()=>({table:e,header:s,column:t})};return e._features.forEach(i=>{i.createHeader==null||i.createHeader(s,e)}),s}const RF={createTable:e=>{e.getHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var s,i;const l=(s=r==null?void 0:r.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],a=(i=o==null?void 0:o.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?i:[],u=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return za(t,[...l,...u,...a],e)},ae(e.options,wt)),e.getCenterHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(s=>!(r!=null&&r.includes(s.id))&&!(o!=null&&o.includes(s.id))),za(t,n,e,"center")),ae(e.options,wt)),e.getLeftHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?o:[];return za(t,s,e,"left")},ae(e.options,wt)),e.getRightHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const s=(o=r==null?void 0:r.map(i=>n.find(l=>l.id===i)).filter(Boolean))!=null?o:[];return za(t,s,e,"right")},ae(e.options,wt)),e.getFooterGroups=le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ae(e.options,wt)),e.getLeftFooterGroups=le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ae(e.options,wt)),e.getCenterFooterGroups=le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ae(e.options,wt)),e.getRightFooterGroups=le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ae(e.options,wt)),e.getFlatHeaders=le(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,wt)),e.getLeftFlatHeaders=le(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,wt)),e.getCenterFlatHeaders=le(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,wt)),e.getRightFlatHeaders=le(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ae(e.options,wt)),e.getCenterLeafHeaders=le(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,wt)),e.getLeftLeafHeaders=le(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,wt)),e.getRightLeafHeaders=le(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ae(e.options,wt)),e.getLeafHeaders=le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,s,i,l,a,u;return[...(o=(s=t[0])==null?void 0:s.headers)!=null?o:[],...(i=(l=n[0])==null?void 0:l.headers)!=null?i:[],...(a=(u=r[0])==null?void 0:u.headers)!=null?a:[]].map(c=>c.getLeafHeaders()).flat()},ae(e.options,wt))}};function za(e,t,n,r){var o,s;let i=0;const l=function(p,h){h===void 0&&(h=1),i=Math.max(i,h),p.filter(m=>m.getIsVisible()).forEach(m=>{var w;(w=m.columns)!=null&&w.length&&l(m.columns,h+1)},0)};l(e);let a=[];const u=(p,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},w=[];p.forEach(S=>{const y=[...w].reverse()[0],v=S.column.depth===m.depth;let x,C=!1;if(v&&S.column.parent?x=S.column.parent:(x=S.column,C=!0),y&&(y==null?void 0:y.column)===x)y.subHeaders.push(S);else{const _=gy(n,x,{id:[r,h,x.id,S==null?void 0:S.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${w.filter(P=>P.column===x).length}`:void 0,depth:h,index:w.length});_.subHeaders.push(S),w.push(_)}m.headers.push(S),S.headerGroup=m}),a.push(m),h>0&&u(w,h-1)},c=t.map((p,h)=>gy(n,p,{depth:i,index:h}));u(c,i-1),a.reverse();const d=p=>p.filter(m=>m.column.getIsVisible()).map(m=>{let w=0,S=0,y=[0];m.subHeaders&&m.subHeaders.length?(y=[],d(m.subHeaders).forEach(x=>{let{colSpan:C,rowSpan:_}=x;w+=C,y.push(_)})):w=1;const v=Math.min(...y);return S=S+v,m.colSpan=w,m.rowSpan=S,{colSpan:w,rowSpan:S}});return d((o=(s=a[0])==null?void 0:s.headers)!=null?o:[]),a}const Bm=(e,t,n,r,o,s,i)=>{let l={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(l._valuesCache.hasOwnProperty(a))return l._valuesCache[a];const u=e.getColumn(a);if(u!=null&&u.accessorFn)return l._valuesCache[a]=u.accessorFn(l.original,r),l._valuesCache[a]},getUniqueValues:a=>{if(l._uniqueValuesCache.hasOwnProperty(a))return l._uniqueValuesCache[a];const u=e.getColumn(a);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(l._uniqueValuesCache[a]=u.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[a]):(l._uniqueValuesCache[a]=[l.getValue(a)],l._uniqueValuesCache[a])},renderValue:a=>{var u;return(u=l.getValue(a))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>CF(l.subRows,a=>a.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let a=[],u=l;for(;;){const c=u.getParentRow();if(!c)break;a.push(c),u=c}return a.reverse()},getAllCells:le(()=>[e.getAllLeafColumns()],a=>a.map(u=>_F(e,l,u,u.id)),ae(e.options,"debugRows")),_getAllCellsByColumnId:le(()=>[l.getAllCells()],a=>a.reduce((u,c)=>(u[c.column.id]=c,u),{}),ae(e.options,"debugRows"))};for(let a=0;a{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},mb=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};mb.autoRemove=e=>jn(e);const gb=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};gb.autoRemove=e=>jn(e);const vb=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};vb.autoRemove=e=>jn(e);const yb=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};yb.autoRemove=e=>jn(e)||!(e!=null&&e.length);const wb=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});wb.autoRemove=e=>jn(e)||!(e!=null&&e.length);const xb=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});xb.autoRemove=e=>jn(e)||!(e!=null&&e.length);const Sb=(e,t,n)=>e.getValue(t)===n;Sb.autoRemove=e=>jn(e);const Cb=(e,t,n)=>e.getValue(t)==n;Cb.autoRemove=e=>jn(e);const Um=(e,t,n)=>{let[r,o]=n;const s=e.getValue(t);return s>=r&&s<=o};Um.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,s=t===null||Number.isNaN(r)?-1/0:r,i=n===null||Number.isNaN(o)?1/0:o;if(s>i){const l=s;s=i,i=l}return[s,i]};Um.autoRemove=e=>jn(e)||jn(e[0])&&jn(e[1]);const ar={includesString:mb,includesStringSensitive:gb,equalsString:vb,arrIncludes:yb,arrIncludesAll:wb,arrIncludesSome:xb,equals:Sb,weakEquals:Cb,inNumberRange:Um};function jn(e){return e==null||e===""}const kF={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:rn("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ar.includesString:typeof r=="number"?ar.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ar.equals:Array.isArray(r)?ar.arrIncludes:ar.weakEquals},e.getFilterFn=()=>{var n,r;return qc(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ar[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),s=r==null?void 0:r.find(c=>c.id===e.id),i=Zr(n,s?s.value:void 0);if(vy(o,i,e)){var l;return(l=r==null?void 0:r.filter(c=>c.id!==e.id))!=null?l:[]}const a={id:e.id,value:i};if(s){var u;return(u=r==null?void 0:r.map(c=>c.id===e.id?a:c))!=null?u:[]}return r!=null&&r.length?[...r,a]:[a]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var s;return(s=Zr(t,o))==null?void 0:s.filter(i=>{const l=n.find(a=>a.id===i.id);if(l){const a=l.getFilterFn();if(vy(a,i.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function vy(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const PF=(e,t,n)=>n.reduce((r,o)=>{const s=o.getValue(e);return r+(typeof s=="number"?s:0)},0),TF=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r>s||r===void 0&&s>=s)&&(r=s)}),r},NF=(e,t,n)=>{let r;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r=s)&&(r=s)}),r},jF=(e,t,n)=>{let r,o;return n.forEach(s=>{const i=s.getValue(e);i!=null&&(r===void 0?i>=i&&(r=o=i):(r>i&&(r=i),o{let n=0,r=0;if(t.forEach(o=>{let s=o.getValue(e);s!=null&&(s=+s)>=s&&(++n,r+=s)}),n)return r/n},MF=(e,t)=>{if(!t.length)return;const n=t.map(s=>s.getValue(e));if(!SF(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((s,i)=>s-i);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},OF=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),IF=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,FF=(e,t)=>t.length,Hd={sum:PF,min:TF,max:NF,extent:jF,mean:AF,median:MF,unique:OF,uniqueCount:IF,count:FF},DF={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:rn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Hd.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Hd.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return qc(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Hd[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function LF(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(s=>!t.includes(s.id));return n==="remove"?r:[...t.map(s=>e.find(i=>i.id===s)).filter(Boolean),...r]}const VF={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:rn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=le(n=>[dl(t,n)],n=>n.findIndex(r=>r.id===e.id),ae(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=dl(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=dl(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let s=[];if(!(t!=null&&t.length))s=o;else{const i=[...t],l=[...o];for(;l.length&&i.length;){const a=i.shift(),u=l.findIndex(c=>c.id===a);u>-1&&s.push(l.splice(u,1)[0])}s=[...s,...l]}return LF(s,n,r)},ae(e.options,"debugTable"))}},Wd=()=>({left:[],right:[]}),$F={getInitialState:e=>({columnPinning:Wd(),...e}),getDefaultOptions:e=>({onColumnPinningChange:rn("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var s,i;if(n==="right"){var l,a;return{left:((l=o==null?void 0:o.left)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((a=o==null?void 0:o.right)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var u,c;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=o==null?void 0:o.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((s=o==null?void 0:o.left)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d))),right:((i=o==null?void 0:o.right)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,s,i;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((s=(i=t.options.enableColumnPinning)!=null?i:t.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(l=>l.id),{left:r,right:o}=t.getState().columnPinning,s=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>o==null?void 0:o.includes(l));return s?"left":i?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const s=[...r??[],...o??[]];return n.filter(i=>!s.includes(i.column.id))},ae(t.options,"debugRows")),e.getLeftVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),ae(t.options,"debugRows")),e.getRightVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(s=>n.find(i=>i.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),ae(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Wd():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Wd())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,s;return!!((o=r.left)!=null&&o.length||(s=r.right)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ae(e.options,"debugColumns")),e.getRightLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ae(e.options,"debugColumns")),e.getCenterLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(s=>!o.includes(s.id))},ae(e.options,"debugColumns"))}},Ba={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Gd=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zF={getDefaultColumnDef:()=>Ba,getInitialState:e=>({columnSizing:{},columnSizingInfo:Gd(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:rn("columnSizing",e),onColumnSizingInfoChange:rn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const s=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ba.minSize,(r=s??e.columnDef.size)!=null?r:Ba.size),(o=e.columnDef.maxSize)!=null?o:Ba.maxSize)},e.getStart=le(n=>[n,dl(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,s)=>o+s.getSize(),0),ae(t.options,"debugColumns")),e.getAfter=le(n=>[n,dl(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,s)=>o+s.getSize(),0),ae(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var s;n+=(s=o.column.getSize())!=null?s:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return s=>{if(!r||!o||(s.persist==null||s.persist(),Kd(s)&&s.touches&&s.touches.length>1))return;const i=e.getSize(),l=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],a=Kd(s)?Math.round(s.touches[0].clientX):s.clientX,u={},c=(y,v)=>{typeof v=="number"&&(t.setColumnSizingInfo(x=>{var C,_;const P=t.options.columnResizeDirection==="rtl"?-1:1,k=(v-((C=x==null?void 0:x.startOffset)!=null?C:0))*P,E=Math.max(k/((_=x==null?void 0:x.startSize)!=null?_:0),-.999999);return x.columnSizingStart.forEach(I=>{let[O,Y]=I;u[O]=Math.round(Math.max(Y+Y*E,0)*100)/100}),{...x,deltaOffset:k,deltaPercentage:E}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(x=>({...x,...u})))},d=y=>c("move",y),p=y=>{c("end",y),t.setColumnSizingInfo(v=>({...v,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:y=>d(y.clientX),upHandler:y=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(y.clientX)}},w={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var v;h==null||h.removeEventListener("touchmove",w.moveHandler),h==null||h.removeEventListener("touchend",w.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),p((v=y.touches[0])==null?void 0:v.clientX)}},S=BF()?{passive:!1}:!1;Kd(s)?(h==null||h.addEventListener("touchmove",w.moveHandler,S),h==null||h.addEventListener("touchend",w.upHandler,S)):(h==null||h.addEventListener("mousemove",m.moveHandler,S),h==null||h.addEventListener("mouseup",m.upHandler,S)),t.setColumnSizingInfo(y=>({...y,startOffset:a,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Gd():(n=e.initialState.columnSizingInfo)!=null?n:Gd())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Ua=null;function BF(){if(typeof Ua=="boolean")return Ua;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ua=e,Ua}function Kd(e){return e.type==="touchstart"}const UF={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:rn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(s=>s.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=le(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ae(t.options,"debugRows")),e.getVisibleCells=le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ae(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>le(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),ae(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,s)=>({...o,[s.id]:n||!(s.getCanHide!=null&&s.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function dl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const HF={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},WF={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:rn("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,s;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((s=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ar.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return qc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ar[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},GF={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:rn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,s;e.setExpanded(r?{}:(o=(s=e.initialState)==null?void 0:s.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const i=s.split(".");r=Math.max(r,i.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const s=r===!0?!0:!!(r!=null&&r[e.id]);let i={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{i[l]=!0}):i=r,n=(o=n)!=null?o:!s,!s&&n)return{...i,[e.id]:!0};if(s&&!n){const{[e.id]:l,...a}=i;return a}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},jp=0,Ap=10,Zd=()=>({pageIndex:jp,pageSize:Ap}),KF={getInitialState:e=>({...e,pagination:{...Zd(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:rn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=s=>Zr(r,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Zd():(o=e.initialState.pagination)!=null?o:Zd())},e.setPageIndex=r=>{e.setPagination(o=>{let s=Zr(r,o.pageIndex);const i=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,i)),{...o,pageIndex:s}})},e.resetPageIndex=r=>{var o,s;e.setPageIndex(r?jp:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?o:jp)},e.resetPageSize=r=>{var o,s;e.setPageSize(r?Ap:(o=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?o:Ap)},e.setPageSize=r=>{e.setPagination(o=>{const s=Math.max(1,Zr(r,o.pageSize)),i=o.pageSize*o.pageIndex,l=Math.floor(i/s);return{...o,pageIndex:l,pageSize:s}})},e.setPageCount=r=>e.setPagination(o=>{var s;let i=Zr(r,(s=e.options.pageCount)!=null?s:-1);return typeof i=="number"&&(i=Math.max(-1,i)),{...o,pageCount:i}}),e.getPageOptions=le(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((s,i)=>i)),o},ae(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},qd=()=>({top:[],bottom:[]}),ZF={getInitialState:e=>({rowPinning:qd(),...e}),getDefaultOptions:e=>({onRowPinningChange:rn("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const s=r?e.getLeafRows().map(a=>{let{id:u}=a;return u}):[],i=o?e.getParentRows().map(a=>{let{id:u}=a;return u}):[],l=new Set([...i,e.id,...s]);t.setRowPinning(a=>{var u,c;if(n==="bottom"){var d,p;return{top:((d=a==null?void 0:a.top)!=null?d:[]).filter(w=>!(l!=null&&l.has(w))),bottom:[...((p=a==null?void 0:a.bottom)!=null?p:[]).filter(w=>!(l!=null&&l.has(w))),...Array.from(l)]}}if(n==="top"){var h,m;return{top:[...((h=a==null?void 0:a.top)!=null?h:[]).filter(w=>!(l!=null&&l.has(w))),...Array.from(l)],bottom:((m=a==null?void 0:a.bottom)!=null?m:[]).filter(w=>!(l!=null&&l.has(w)))}}return{top:((u=a==null?void 0:a.top)!=null?u:[]).filter(w=>!(l!=null&&l.has(w))),bottom:((c=a==null?void 0:a.bottom)!=null?c:[]).filter(w=>!(l!=null&&l.has(w)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,s=n.some(l=>r==null?void 0:r.includes(l)),i=n.some(l=>o==null?void 0:o.includes(l));return s?"top":i?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const s=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(i=>{let{id:l}=i;return l});return(r=s==null?void 0:s.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?qd():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:qd())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,s;return!!((o=r.top)!=null&&o.length||(s=r.bottom)!=null&&s.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(i=>{const l=e.getRow(i,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(i=>t.find(l=>l.id===i))).filter(Boolean).map(i=>({...i,position:r}))},e.getTopRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ae(e.options,"debugRows")),e.getBottomRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ae(e.options,"debugRows")),e.getCenterRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(s=>!o.has(s.id))},ae(e.options,"debugRows"))}},qF={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:rn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(s=>{s.getCanSelect()&&(r[s.id]=!0)}):o.forEach(s=>{delete r[s.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(s=>{Mp(o,s.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getFilteredSelectedRowModel=le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getGroupedSelectedRowModel=le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ae(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(s=>{var i;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return s;const l={...s};return Mp(l,e.id,n,(i=r==null?void 0:r.selectChildren)!=null?i:!0,t),l})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Hm(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Op(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Op(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Mp=(e,t,n,r,o)=>{var s;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(s=i.subRows)!=null&&s.length&&i.getCanSelectSubRows()&&i.subRows.forEach(l=>Mp(e,l.id,n,r,o))};function Qd(e,t){const n=e.getState().rowSelection,r=[],o={},s=function(i,l){return i.map(a=>{var u;const c=Hm(a,n);if(c&&(r.push(a),o[a.id]=a),(u=a.subRows)!=null&&u.length&&(a={...a,subRows:s(a.subRows)}),c)return a}).filter(Boolean)};return{rows:s(t.rows),flatRows:r,rowsById:o}}function Hm(e,t){var n;return(n=t[e.id])!=null?n:!1}function Op(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,s=!1;return e.subRows.forEach(i=>{if(!(s&&!o)&&(i.getCanSelect()&&(Hm(i,t)?s=!0:o=!1),i.subRows&&i.subRows.length)){const l=Op(i,t);l==="all"?s=!0:(l==="some"&&(s=!0),o=!1)}}),o?"all":s?"some":!1}const Ip=/([0-9]+)/gm,QF=(e,t,n)=>_b(ho(e.getValue(n)).toLowerCase(),ho(t.getValue(n)).toLowerCase()),XF=(e,t,n)=>_b(ho(e.getValue(n)),ho(t.getValue(n))),YF=(e,t,n)=>Wm(ho(e.getValue(n)).toLowerCase(),ho(t.getValue(n)).toLowerCase()),JF=(e,t,n)=>Wm(ho(e.getValue(n)),ho(t.getValue(n))),eD=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:rWm(e.getValue(n),t.getValue(n));function Wm(e,t){return e===t?0:e>t?1:-1}function ho(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function _b(e,t){const n=e.split(Ip).filter(Boolean),r=t.split(Ip).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),s=r.shift(),i=parseInt(o,10),l=parseInt(s,10),a=[i,l].sort();if(isNaN(a[0])){if(o>s)return 1;if(s>o)return-1;continue}if(isNaN(a[1]))return isNaN(i)?-1:1;if(i>l)return 1;if(l>i)return-1}return n.length-r.length}const zi={alphanumeric:QF,alphanumericCaseSensitive:XF,text:YF,textCaseSensitive:JF,datetime:eD,basic:tD},nD={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:rn("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const s=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return zi.datetime;if(typeof s=="string"&&(r=!0,s.split(Ip).length>1))return zi.alphanumeric}return r?zi.text:zi.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return qc(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:zi[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),s=typeof n<"u"&&n!==null;t.setSorting(i=>{const l=i==null?void 0:i.find(h=>h.id===e.id),a=i==null?void 0:i.findIndex(h=>h.id===e.id);let u=[],c,d=s?n:o==="desc";if(i!=null&&i.length&&e.getCanMultiSort()&&r?l?c="toggle":c="add":i!=null&&i.length&&a!==i.length-1?c="replace":l?c="toggle":c="replace",c==="toggle"&&(s||o||(c="remove")),c==="add"){var p;u=[...i,{id:e.id,desc:d}],u.splice(0,u.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=i.map(h=>h.id===e.id?{...h,desc:d}:h):c==="remove"?u=i.filter(h=>h.id!==e.id):u=[{id:e.id,desc:d}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const s=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==s&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:i==="desc"?"asc":"desc":s},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},rD=[RF,UF,VF,$F,EF,kF,HF,WF,nD,DF,GF,KF,ZF,qF,zF];function oD(e){var t,n;const r=[...rD,...(t=e._features)!=null?t:[]];let o={_features:r};const s=o._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),i=p=>o.options.mergeOptions?o.options.mergeOptions(s,p):{...s,...p};let a={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(p=>{var h;a=(h=p.getInitialState==null?void 0:p.getInitialState(a))!=null?h:a});const u=[];let c=!1;const d={_features:r,options:{...s,...e},initialState:a,_queue:p=>{u.push(p),c||(c=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();c=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:p=>{const h=Zr(p,o.options);o.options=i(h)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,h,m)=>{var w;return(w=o.options.getRowId==null?void 0:o.options.getRowId(p,h,m))!=null?w:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!m&&(m=o.getCoreRowModel().rowsById[p],!m))throw new Error;return m},_getDefaultColumnDef:le(()=>[o.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:m=>{const w=m.header.column.columnDef;return w.accessorKey?w.accessorKey:w.accessorFn?w.id:null},cell:m=>{var w,S;return(w=(S=m.renderValue())==null||S.toString==null?void 0:S.toString())!=null?w:null},...o._features.reduce((m,w)=>Object.assign(m,w.getDefaultColumnDef==null?void 0:w.getDefaultColumnDef()),{}),...p}},ae(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:le(()=>[o._getColumnDefs()],p=>{const h=function(m,w,S){return S===void 0&&(S=0),m.map(y=>{const v=bF(o,y,S,w),x=y;return v.columns=x.columns?h(x.columns,v,S+1):[],v})};return h(p)},ae(e,"debugColumns")),getAllFlatColumns:le(()=>[o.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),ae(e,"debugColumns")),_getAllFlatColumnsById:le(()=>[o.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),ae(e,"debugColumns")),getAllLeafColumns:le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(w=>w.getLeafColumns());return h(m)},ae(e,"debugColumns")),getColumn:p=>o._getAllFlatColumnsById()[p]};Object.assign(o,d);for(let p=0;ple(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,s,i){s===void 0&&(s=0);const l=[];for(let u=0;ue._autoResetPageIndex()))}function iD(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function lD(e,t,n){return n.options.filterFromLeafRows?aD(e,t,n):uD(e,t,n)}function aD(e,t,n){var r;const o=[],s={},i=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,l=function(a,u){u===void 0&&(u=0);const c=[];for(let p=0;ple(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let p=0;p{var h;const m=e.getColumn(p.id);if(!m)return;const w=m.getFilterFn();w&&o.push({id:p.id,filterFn:w,resolvedValue:(h=w.resolveFilterValue==null?void 0:w.resolveFilterValue(p.value))!=null?h:p.value})});const i=(n??[]).map(p=>p.id),l=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(p=>p.getCanGlobalFilter());r&&l&&a.length&&(i.push("__global__"),a.forEach(p=>{var h;s.push({id:p.id,filterFn:l,resolvedValue:(h=l.resolveFilterValue==null?void 0:l.resolveFilterValue(r))!=null?h:r})}));let u,c;for(let p=0;p{h.columnFiltersMeta[w]=S})}if(s.length){for(let m=0;m{h.columnFiltersMeta[w]=S})){h.columnFilters.__global__=!0;break}}h.columnFilters.__global__!==!0&&(h.columnFilters.__global__=!1)}}const d=p=>{for(let h=0;he._autoResetPageIndex()))}function dD(e){return t=>le(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:s}=n;let{rows:i,flatRows:l,rowsById:a}=r;const u=o*s,c=u+o;i=i.slice(u,c);let d;t.options.paginateExpandedRows?d={rows:i,flatRows:l,rowsById:a}:d=iD({rows:i,flatRows:l,rowsById:a}),d.flatRows=[];const p=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return d.rows.forEach(p),d},ae(t.options,"debugTable"))}function fD(){return e=>le(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],s=r.filter(a=>{var u;return(u=e.getColumn(a.id))==null?void 0:u.getCanSort()}),i={};s.forEach(a=>{const u=e.getColumn(a.id);u&&(i[a.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const l=a=>{const u=a.map(c=>({...c}));return u.sort((c,d)=>{for(let h=0;h{var d;o.push(c),(d=c.subRows)!=null&&d.length&&(c.subRows=l(c.subRows))}),u};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}},ae(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/** + * react-table + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function yy(e,t){return e?pD(e)?g.createElement(e,t):e:null}function pD(e){return hD(e)||typeof e=="function"||mD(e)}function hD(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function mD(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function gD(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=g.useState(()=>({current:oD(t)})),[r,o]=g.useState(()=>n.current.initialState);return n.current.setOptions(s=>({...s,...e,state:{...r,...e.state},onStateChange:i=>{o(i),e.onStateChange==null||e.onStateChange(i)}})),n.current}var Gm="Checkbox",[vD,OD]=br(Gm),[yD,wD]=vD(Gm),bb=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:s,required:i,disabled:l,value:a="on",onCheckedChange:u,...c}=e,[d,p]=g.useState(null),h=Re(t,x=>p(x)),m=g.useRef(!1),w=d?!!d.closest("form"):!0,[S=!1,y]=pi({prop:o,defaultProp:s,onChange:u}),v=g.useRef(S);return g.useEffect(()=>{const x=d==null?void 0:d.form;if(x){const C=()=>y(v.current);return x.addEventListener("reset",C),()=>x.removeEventListener("reset",C)}},[d,y]),f.jsxs(yD,{scope:n,state:S,disabled:l,children:[f.jsx(ye.button,{type:"button",role:"checkbox","aria-checked":Vo(S)?"mixed":S,"aria-required":i,"data-state":kb(S),"data-disabled":l?"":void 0,disabled:l,value:a,...c,ref:h,onKeyDown:te(e.onKeyDown,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:te(e.onClick,x=>{y(C=>Vo(C)?!0:!C),w&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})}),w&&f.jsx(xD,{control:d,bubbles:!m.current,name:r,value:a,checked:S,required:i,disabled:l,style:{transform:"translateX(-100%)"}})]})});bb.displayName=Gm;var Rb="CheckboxIndicator",Eb=g.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,s=wD(Rb,n);return f.jsx(er,{present:r||Vo(s.state)||s.state===!0,children:f.jsx(ye.span,{"data-state":kb(s.state),"data-disabled":s.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Eb.displayName=Rb;var xD=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,s=g.useRef(null),i=tm(n),l=Xh(t);return g.useEffect(()=>{const a=s.current,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==n&&d){const p=new Event("click",{bubbles:r});a.indeterminate=Vo(n),d.call(a,Vo(n)?!1:n),a.dispatchEvent(p)}},[i,n,r]),f.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:Vo(n)?!1:n,...o,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Vo(e){return e==="indeterminate"}function kb(e){return Vo(e)?"indeterminate":e?"checked":"unchecked"}var Pb=bb,SD=Eb;const Fp=g.forwardRef(({className:e,...t},n)=>f.jsx(Pb,{ref:n,className:de("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:f.jsx(SD,{className:de("flex items-center justify-center text-current"),children:f.jsx(om,{className:"h-4 w-4"})})}));Fp.displayName=Pb.displayName;const wy="";async function CD(){console.log("BASE URL",wy);const e=await Oe.get(`${wy}/api/history`);return console.log("RESPONSE IS:",e),console.log("RESPONSE.DATA IS:",e.data),e.data}const _D={fetchChatbotHistory:CD},xy=[{id:"select",header:({table:e})=>f.jsx(Fp,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:t=>e.toggleAllPageRowsSelected(!!t),"aria-label":"Select all"}),cell:({row:e})=>f.jsx(Fp,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(!!t),"aria-label":"Select row"}),enableSorting:!1,enableHiding:!1},{accessorKey:"chatbot_id",header:"Chatbot ID",cell:({row:e})=>f.jsx("div",{className:"capitalize",children:e.getValue("chatbot_id")})},{accessorKey:"time",header:({column:e})=>f.jsxs(dt,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Time",f.jsx(Bv,{className:"ml-2 h-4 w-4"})]}),cell:({row:e})=>f.jsx("div",{className:"lowercase",children:new Date(e.getValue("time")).toLocaleString()})},{accessorKey:"input",header:({column:e})=>f.jsxs(dt,{variant:"ghost",onClick:()=>e.toggleSorting(e.getIsSorted()==="asc"),children:["Input",f.jsx(Bv,{className:"ml-2 h-4 w-4"})]}),cell:({row:e})=>f.jsx("div",{className:"lowercase",children:e.getValue("input")})},{accessorKey:"output",header:"Output",cell:({row:e})=>{const t=e.getValue("output");return f.jsx("div",{className:"text-right font-medium",children:t.slice(0,150)+(t.length>150?"...":"")})}},{accessorKey:"context",header:()=>f.jsx("div",{className:"text-right",children:"Context"}),cell:({row:e})=>{const t=e.getValue("context");return f.jsx("div",{className:"text-right font-medium",children:t.slice(0,150)+(t.length>150?"...":"")})}},{accessorKey:"faithfulness",header:()=>f.jsx("div",{className:"text-right",children:"Faithfulness"}),cell:({row:e})=>{const t=parseFloat(e.getValue("faithfulness"));return f.jsx("div",{className:"text-right font-medium",children:t.toFixed(2)})}},{accessorKey:"answer_relevancy",header:()=>f.jsx("div",{className:"text-right",children:"Answer Relevancy"}),cell:({row:e})=>{const t=parseFloat(e.getValue("answer_relevancy"));return f.jsx("div",{className:"text-right font-medium",children:t.toFixed(2)})}},{id:"actions",enableHiding:!1,cell:({row:e})=>{const t=e.original;return console.log("ColumnDef rerendering...?"),f.jsxs(Fm,{children:[f.jsx(Dm,{asChild:!0,children:f.jsxs(dt,{variant:"ghost",className:"h-8 w-8 p-0",children:[f.jsx("span",{className:"sr-only",children:"Open menu"}),f.jsx(QN,{className:"h-4 w-4"})]})}),f.jsxs(Kc,{align:"end",children:[f.jsx(Vm,{children:"Actions"}),f.jsx(Np,{onClick:()=>navigator.clipboard.writeText(t[0]),children:"Copy ID"}),f.jsx($m,{}),f.jsx(Np,{children:"View Details"})]})]})}}];function bD(){var d,p;const{data:e,isLoading:t}=ui({queryKey:["chatHistory"],queryFn:()=>_D.fetchChatbotHistory()}),[n,r]=g.useState([]),[o,s]=g.useState([]),[i,l]=g.useState({}),[a,u]=g.useState({});console.log("CHATHISTORY IS",e);const c=gD({data:e||[],columns:xy,onSortingChange:r,onColumnFiltersChange:s,getCoreRowModel:sD(),getPaginationRowModel:dD(),getSortedRowModel:fD(),getFilteredRowModel:cD(),onColumnVisibilityChange:l,onRowSelectionChange:u,state:{sorting:n,columnFilters:o,columnVisibility:i,rowSelection:a}});return t?f.jsx("div",{children:"Loading..."}):f.jsxs("div",{className:"w-full",children:[f.jsxs("div",{className:"flex items-center py-4",children:[f.jsx(dn,{placeholder:"Filter chatbot id...",value:((d=c.getColumn("chatbot_id"))==null?void 0:d.getFilterValue())??"",onChange:h=>{var m;return(m=c.getColumn("chatbot_id"))==null?void 0:m.setFilterValue(h.target.value)},className:"max-w-sm"}),f.jsxs(Fm,{children:[f.jsx(Dm,{asChild:!0,children:f.jsxs(dt,{variant:"outline",className:"ml-auto",children:["Columns ",f.jsx(sm,{className:"ml-2 h-4 w-4"})]})}),f.jsx(Kc,{align:"end",children:c.getAllColumns().filter(h=>h.getCanHide()).map(h=>f.jsx(Lm,{className:"capitalize",checked:h.getIsVisible(),onCheckedChange:m=>h.toggleVisibility(!!m),children:h.id},h.id))})]})]}),f.jsx("div",{className:"rounded-md border",children:f.jsxs(xm,{children:[f.jsx(Sm,{children:c.getHeaderGroups().map(h=>f.jsx($s,{children:h.headers.map(m=>f.jsx(Ts,{children:m.isPlaceholder?null:yy(m.column.columnDef.header,m.getContext())},m.id))},h.id))}),f.jsx(Cm,{children:(p=c.getRowModel().rows)!=null&&p.length?c.getRowModel().rows.map(h=>f.jsx($s,{"data-state":h.getIsSelected()&&"selected",children:h.getVisibleCells().map(m=>f.jsx(ko,{children:yy(m.column.columnDef.cell,m.getContext())},m.id))},h.id)):f.jsx($s,{children:f.jsx(ko,{colSpan:xy.length,className:"h-24 text-center",children:"No results."})})})]})}),f.jsxs("div",{className:"flex items-center justify-end space-x-2 py-4",children:[f.jsxs("div",{className:"flex-1 text-sm text-muted-foreground",children:[c.getFilteredSelectedRowModel().rows.length," of"," ",c.getFilteredRowModel().rows.length," row(s) selected."]}),f.jsxs("div",{className:"space-x-2",children:[f.jsx(dt,{variant:"outline",size:"sm",onClick:()=>c.previousPage(),disabled:!c.getCanPreviousPage(),children:"Previous"}),f.jsx(dt,{variant:"outline",size:"sm",onClick:()=>c.nextPage(),disabled:!c.getCanNextPage(),children:"Next"})]})]})]})}const RD=new QE;function ED(){return f.jsxs(tk,{client:RD,children:[f.jsx(vk,{}),f.jsx("main",{className:"ml-72 p-12",children:f.jsxs(Jx,{children:[f.jsx(Fi,{path:"/knowledge-bases",children:f.jsx(lO,{})}),f.jsx(Fi,{path:"/knowledge-bases/:id",children:e=>f.jsx(fO,{id:e.id})}),f.jsx(Fi,{path:"/chatbots",children:f.jsx(yO,{})}),f.jsx(Fi,{path:"/chatbots/:id",children:e=>f.jsx(xF,{id:e.id})}),f.jsx(Fi,{path:"/evaluations",children:f.jsx(bD,{})})]})})]})}Xd.createRoot(document.getElementById("root")).render(f.jsx(xe.StrictMode,{children:f.jsx(ED,{})})); diff --git a/ui/dist/index.html b/ui/dist/index.html new file mode 100644 index 0000000..391606d --- /dev/null +++ b/ui/dist/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite + React + TS + + + + +
+ + diff --git a/ui/dist/vite.svg b/ui/dist/vite.svg new file mode 100644 index 0000000..e7b8dfb --- /dev/null +++ b/ui/dist/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file From e052fe2c438fd80c6dac8c07fc3b968031cd8994 Mon Sep 17 00:00:00 2001 From: bboinay <117600738+bboinay@users.noreply.github.com> Date: Wed, 7 Aug 2024 17:08:54 -0400 Subject: [PATCH 4/6] Update evaluations-service.ts --- ui/src/services/evaluations-service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/services/evaluations-service.ts b/ui/src/services/evaluations-service.ts index ad8e691..4760e4d 100644 --- a/ui/src/services/evaluations-service.ts +++ b/ui/src/services/evaluations-service.ts @@ -7,8 +7,9 @@ async function fetchChatbotHistory() { const response = await axios.get(`${baseUrl}/api/history`); console.log('RESPONSE IS:', response) console.log('RESPONSE.DATA IS:', response.data) - - return response.data; + console.log('RESPONSE.DATA[TABLE_DATA] IS:', response.data['table_data']) + + return response.data['table_data']; } export const evaluationsService = { From 6cadb7c08dcd02ecc63231f730ad1ab8a91b9bfa Mon Sep 17 00:00:00 2001 From: yg-lim Date: Wed, 7 Aug 2024 23:59:58 +0000 Subject: [PATCH 5/6] fix: updated systemd service file for new syntax --- systemd/test.service | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/systemd/test.service b/systemd/test.service index 1177e35..f6c1852 100644 --- a/systemd/test.service +++ b/systemd/test.service @@ -1,14 +1,15 @@ -[Unit] -Description=Skateboard backend -After=network-online.target + [Unit] + Description=Skateboard backend + After=network-online.target -[Service] -Type=simple -Restart=always -User=ubuntu -WorkingDirectory=/home/ubuntu/db/ -Environment="PYTHONPATH=/home/ubuntu/.pyenv/versions/3.10.12/bin" -ExecStart=/home/ubuntu/.pyenv/shims/pipenv run python /home/ubuntu/db/server.py + [Service] + Type=simple + Restart=always + User=ubuntu + WorkingDirectory=/home/ubuntu/ + Environment="PYTHONPATH=/home/ubuntu/.local/share/virtualenvs/db-grdQ2Ybz/bin" + Environment="PIPENV_PIPFILE=/home/ubuntu/db/Pipfile" + ExecStart=/home/ubuntu/.local/bin/pipenv run python -m db.server -[Install] -WantedBy=multi-user.target + [Install] + WantedBy=multi-user.target From ded60c48d085a41071fda3225b3a0c1c98da4f65 Mon Sep 17 00:00:00 2001 From: yg-lim Date: Thu, 8 Aug 2024 00:03:59 +0000 Subject: [PATCH 6/6] fix: test.service file updated for new python -m syntax Co-authored-by: tlane25 <163203257+tlane25@users.noreply.github.com> --- systemd/test.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemd/test.service b/systemd/test.service index f6c1852..e9959cd 100644 --- a/systemd/test.service +++ b/systemd/test.service @@ -7,8 +7,8 @@ Restart=always User=ubuntu WorkingDirectory=/home/ubuntu/ - Environment="PYTHONPATH=/home/ubuntu/.local/share/virtualenvs/db-grdQ2Ybz/bin" Environment="PIPENV_PIPFILE=/home/ubuntu/db/Pipfile" + Environment="PYTHONPATH=/home/ubuntu/.local/share/virtualenvs/db-grdQ2Ybz/bin" ExecStart=/home/ubuntu/.local/bin/pipenv run python -m db.server [Install]