From b656f62f9b6cd1271d148ee49c86671429c5ce09 Mon Sep 17 00:00:00 2001 From: olimsaidov Date: Wed, 30 Oct 2024 07:36:15 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Aidbox/e?= =?UTF-8?q?xamples@2877c52eb30197adca85c18a5e73a0762b28d634=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aidbox-forms-smart-launch/404.html | 40 +++ .../assets/index-B3s_32Tb.css | 1 + .../assets/index-Cm2lO2QQ.css | 1 - .../assets/index-Dnb2QBBZ.js | 266 ---------------- .../assets/index-jUC6lyQk.js | 283 ++++++++++++++++++ aidbox-forms-smart-launch/index.html | 4 +- 6 files changed, 326 insertions(+), 269 deletions(-) create mode 100644 aidbox-forms-smart-launch/404.html create mode 100644 aidbox-forms-smart-launch/assets/index-B3s_32Tb.css delete mode 100644 aidbox-forms-smart-launch/assets/index-Cm2lO2QQ.css delete mode 100644 aidbox-forms-smart-launch/assets/index-Dnb2QBBZ.js create mode 100644 aidbox-forms-smart-launch/assets/index-jUC6lyQk.js diff --git a/aidbox-forms-smart-launch/404.html b/aidbox-forms-smart-launch/404.html new file mode 100644 index 0000000..ce342cb --- /dev/null +++ b/aidbox-forms-smart-launch/404.html @@ -0,0 +1,40 @@ + + + + + Aidbox Forms Smart App Launch + + + + + diff --git a/aidbox-forms-smart-launch/assets/index-B3s_32Tb.css b/aidbox-forms-smart-launch/assets/index-B3s_32Tb.css new file mode 100644 index 0000000..af0bc1f --- /dev/null +++ b/aidbox-forms-smart-launch/assets/index-B3s_32Tb.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 0 0% 3.9%;--card: 0 0% 100%;--card-foreground: 0 0% 3.9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 3.9%;--primary: 0 0% 9%;--primary-foreground: 0 0% 98%;--secondary: 0 0% 96.1%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96.1%;--muted-foreground: 0 0% 45.1%;--accent: 0 0% 96.1%;--accent-foreground: 0 0% 9%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 0 0% 89.8%;--input: 0 0% 89.8%;--ring: 0 0% 3.9%;--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%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8% }*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[100\]{z-index:100}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-4{width:1rem;height:1rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[calc\(100vh_-_4rem\)\]{height:calc(100vh - 4rem)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[60px\]{min-height:60px}.min-h-\[calc\(100svh_-_4rem\)\]{min-height:calc(100svh - 4rem)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[8rem\]{min-width:8rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[24rem\]{max-width:24rem}.max-w-\[calc\(100vw_-_4rem\)\]{max-width:calc(100vw - 4rem)}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.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-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.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-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.text-pretty{text-wrap:pretty}.rounded{border-radius:.25rem}.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)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-destructive{border-color:hsl(var(--destructive))}.border-input{border-color:hsl(var(--input))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-teal-400{--tw-bg-opacity: 1;background-color:rgb(45 212 191 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-2\.5{padding-left:.625rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-6{padding-right:1.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.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-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity))}.text-pink-50{--tw-text-opacity: 1;color:rgb(253 242 248 / var(--tw-text-opacity))}.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))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-teal-50{--tw-text-opacity: 1;color:rgb(240 253 250 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.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}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pl-4:first-child{padding-left:1rem}.empty\:hidden:empty{display:none}.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:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--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-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);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-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);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-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.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],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{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\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.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}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=closed\]\:slide-out-to-top-full[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--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))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}@media (min-width: 640px){.sm\:flex{display:flex}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:max-w-\[420px\]{max-width:420px}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/aidbox-forms-smart-launch/assets/index-Cm2lO2QQ.css b/aidbox-forms-smart-launch/assets/index-Cm2lO2QQ.css deleted file mode 100644 index 74c5423..0000000 --- a/aidbox-forms-smart-launch/assets/index-Cm2lO2QQ.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 0 0% 3.9%;--card: 0 0% 100%;--card-foreground: 0 0% 3.9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 3.9%;--primary: 0 0% 9%;--primary-foreground: 0 0% 98%;--secondary: 0 0% 96.1%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96.1%;--muted-foreground: 0 0% 45.1%;--accent: 0 0% 96.1%;--accent-foreground: 0 0% 9%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 0 0% 89.8%;--input: 0 0% 89.8%;--ring: 0 0% 3.9%;--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%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8% }*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[100\]{z-index:100}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-4{width:1rem;height:1rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[calc\(100vh_-_4rem\)\]{height:calc(100vh - 4rem)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[calc\(100svh_-_4rem\)\]{min-height:calc(100svh - 4rem)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-14{width:3.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[8rem\]{min-width:8rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[calc\(100vw_-_4rem\)\]{max-width:calc(100vw - 4rem)}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.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-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-disc{list-style-type:disc}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.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-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-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))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-destructive{border-color:hsl(var(--destructive))}.border-input{border-color:hsl(var(--input))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-teal-400{--tw-bg-opacity: 1;background-color:rgb(45 212 191 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-2\.5{padding-left:.625rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-6{padding-right:1.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.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-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-pink-400{--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity))}.text-pink-50{--tw-text-opacity: 1;color:rgb(253 242 248 / var(--tw-text-opacity))}.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))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-teal-50{--tw-text-opacity: 1;color:rgb(240 253 250 / var(--tw-text-opacity))}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.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}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pl-4:first-child{padding-left:1rem}.empty\:hidden:empty{display:none}.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:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--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-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);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-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);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-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.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],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{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\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.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}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=closed\]\:slide-out-to-top-full[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--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))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}@media (min-width: 640px){.sm\:flex{display:flex}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:max-w-\[420px\]{max-width:420px}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/aidbox-forms-smart-launch/assets/index-Dnb2QBBZ.js b/aidbox-forms-smart-launch/assets/index-Dnb2QBBZ.js deleted file mode 100644 index 5be1f2b..0000000 --- a/aidbox-forms-smart-launch/assets/index-Dnb2QBBZ.js +++ /dev/null @@ -1,266 +0,0 @@ -var Pg=e=>{throw TypeError(e)};var Lb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var _c=(e,t,n)=>t.has(e)||Pg("Cannot "+n);var _=(e,t,n)=>(_c(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?Pg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(_c(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(_c(e,t,"access private method"),n);var Ha=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return _(e,t,r)}});var SD=Lb((AD,Vl)=>{function fy(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 i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Os=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function py(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $b(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var hy={exports:{}},Mu={},gy={exports:{}},me={};/** - * @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 Ca=Symbol.for("react.element"),Ub=Symbol.for("react.portal"),zb=Symbol.for("react.fragment"),Bb=Symbol.for("react.strict_mode"),Vb=Symbol.for("react.profiler"),Hb=Symbol.for("react.provider"),Kb=Symbol.for("react.context"),Gb=Symbol.for("react.forward_ref"),Wb=Symbol.for("react.suspense"),qb=Symbol.for("react.memo"),Qb=Symbol.for("react.lazy"),_g=Symbol.iterator;function Yb(e){return e===null||typeof e!="object"?null:(e=_g&&e[_g]||e["@@iterator"],typeof e=="function"?e:null)}var my={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},vy=Object.assign,yy={};function qi(e,t,n){this.props=e,this.context=t,this.refs=yy,this.updater=n||my}qi.prototype.isReactComponent={};qi.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")};qi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wy(){}wy.prototype=qi.prototype;function vp(e,t,n){this.props=e,this.context=t,this.refs=yy,this.updater=n||my}var yp=vp.prototype=new wy;yp.constructor=vp;vy(yp,qi.prototype);yp.isPureReactComponent=!0;var kg=Array.isArray,xy=Object.prototype.hasOwnProperty,wp={current:null},Sy={key:!0,ref:!0,__self:!0,__source:!0};function Cy(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)xy.call(t,r)&&!Sy.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,te=D[q];if(0>>1;qo(z,B))Go(pe,z)?(D[q]=pe,D[G]=B,q=G):(D[q]=z,D[he]=B,q=he);else if(Go(pe,B))D[q]=pe,D[G]=B,q=G;else break e}}return O}function o(D,O){var B=D.sortIndex-O.sortIndex;return B!==0?B:D.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,f=3,g=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(D){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=D)r(u),O.sortIndex=O.expirationTime,t(l,O);else break;O=n(u)}}function C(D){if(v=!1,S(D),!y)if(n(l)!==null)y=!0,j(P);else{var O=n(u);O!==null&&V(C,O.startTime-D)}}function P(D,O){y=!1,v&&(v=!1,w(k),k=-1),g=!0;var B=f;try{for(S(O),c=n(l);c!==null&&(!(c.expirationTime>O)||D&&!N());){var q=c.callback;if(typeof q=="function"){c.callback=null,f=c.priorityLevel;var te=q(c.expirationTime<=O);O=e.unstable_now(),typeof te=="function"?c.callback=te:c===n(l)&&r(l),S(O)}else r(l);c=n(l)}if(c!==null)var fe=!0;else{var he=n(u);he!==null&&V(C,he.startTime-O),fe=!1}return fe}finally{c=null,f=B,g=!1}}var b=!1,A=null,k=-1,$=5,R=-1;function N(){return!(e.unstable_now()-R<$)}function F(){if(A!==null){var D=e.unstable_now();R=D;var O=!0;try{O=A(!0,D)}finally{O?L():(b=!1,A=null)}}else b=!1}var L;if(typeof m=="function")L=function(){m(F)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,M=E.port2;E.port1.onmessage=F,L=function(){M.postMessage(null)}}else L=function(){x(F,0)};function j(D){A=D,b||(b=!0,L())}function V(D,O){k=x(function(){D(e.unstable_now())},O)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,j(P))},e.unstable_forceFrameRate=function(D){0>D||125q?(D.sortIndex=B,t(u,D),n(l)===null&&D===n(u)&&(v?(w(k),k=-1):v=!0,V(C,B-q))):(D.sortIndex=te,t(l,D),y||g||(y=!0,j(P))),D},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(D){var O=f;return function(){var B=f;f=O;try{return D.apply(this,arguments)}finally{f=B}}}})(ky);_y.exports=ky;var aR=_y.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 lR=p,Vt=aR;function K(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"),Ad=Object.prototype.hasOwnProperty,uR=/^[: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]*$/,Tg={},Ag={};function cR(e){return Ad.call(Ag,e)?!0:Ad.call(Tg,e)?!1:uR.test(e)?Ag[e]=!0:(Tg[e]=!0,!1)}function dR(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 fR(e,t,n,r){if(t===null||typeof t>"u"||dR(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 Ct(e,t,n,r,o,i,s){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=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Ct(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){ut[e]=new Ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sp=/[\-:]([a-z])/g;function Cp(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(Sp,Cp);ut[t]=new Ct(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(Sp,Cp);ut[t]=new Ct(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(Sp,Cp);ut[t]=new Ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function bp(e,t,n,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Tc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Rs(e):""}function pR(e){switch(e.tag){case 5:return Rs(e.type);case 16:return Rs("Lazy");case 13:return Rs("Suspense");case 19:return Rs("SuspenseList");case 0:case 2:case 15:return e=Ac(e.type,!1),e;case 11:return e=Ac(e.type.render,!1),e;case 1:return e=Ac(e.type,!0),e;default:return""}}function Id(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 ti:return"Fragment";case ei:return"Portal";case Od:return"Profiler";case Rp:return"StrictMode";case Nd:return"Suspense";case jd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ay:return(e.displayName||"Context")+".Consumer";case Ty:return(e._context.displayName||"Context")+".Provider";case Ep:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pp:return t=e.displayName||null,t!==null?t:Id(e.type)||"Memo";case yr:t=e._payload,e=e._init;try{return Id(e(t))}catch{}}return null}function hR(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 Id(t);case 8:return t===Rp?"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 Kr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ny(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gR(e){var t=Ny(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wa(e){e._valueTracker||(e._valueTracker=gR(e))}function jy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ny(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hl(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 Dd(e,t){var n=t.checked;return ze({},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=Kr(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 Iy(e,t){t=t.checked,t!=null&&bp(e,"checked",t,!1)}function Fd(e,t){Iy(e,t);var n=Kr(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")?Ld(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ld(e,t.type,Kr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jg(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 Ld(e,t,n){(t!=="number"||Hl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Es=Array.isArray;function fi(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=qa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ws(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ns={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},mR=["Webkit","ms","Moz","O"];Object.keys(Ns).forEach(function(e){mR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ns[t]=Ns[e]})});function $y(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ns.hasOwnProperty(e)&&Ns[e]?(""+t).trim():t+"px"}function Uy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=$y(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var vR=ze({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 zd(e,t){if(t){if(vR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function Bd(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 Vd=null;function _p(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Hd=null,pi=null,hi=null;function Fg(e){if(e=Ea(e)){if(typeof Hd!="function")throw Error(K(280));var t=e.stateNode;t&&(t=ju(t),Hd(e.stateNode,e.type,t))}}function zy(e){pi?hi?hi.push(e):hi=[e]:pi=e}function By(){if(pi){var e=pi,t=hi;if(hi=pi=null,Fg(e),t)for(e=0;e>>=0,e===0?32:31-(kR(e)/MR|0)|0}var Qa=64,Ya=4194304;function Ps(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 ql(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Ps(a):(i&=s,i!==0&&(r=Ps(i)))}else s=n&~o,s!==0?r=Ps(s):i!==0&&(r=Ps(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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 ba(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mn(t),e[t]=n}function NR(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=Is),Gg=" ",Wg=!1;function l0(e,t){switch(e){case"keyup":return aE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function u0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ni=!1;function uE(e,t){switch(e){case"compositionend":return u0(t);case"keypress":return t.which!==32?null:(Wg=!0,Gg);case"textInput":return e=t.data,e===Gg&&Wg?null:e;default:return null}}function cE(e,t){if(ni)return e==="compositionend"||!Ip&&l0(e,t)?(e=s0(),El=Op=Nr=null,ni=!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 p0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function h0(){for(var e=window,t=Hl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hl(e.document)}return t}function Dp(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 wE(e){var t=h0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&p0(n.ownerDocument.documentElement,n)){if(r!==null&&Dp(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,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Jg(n,i);var s=Jg(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,ri=null,Yd=null,Fs=null,Xd=!1;function Zg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xd||ri==null||ri!==Hl(r)||(r=ri,"selectionStart"in r&&Dp(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}),Fs&&Zs(Fs,r)||(Fs=r,r=Xl(Yd,"onSelect"),0si||(e.current=rf[si],rf[si]=null,si--)}function Oe(e,t){si++,rf[si]=e.current,e.current=t}var Gr={},gt=eo(Gr),Mt=eo(!1),_o=Gr;function $i(e,t){var n=e.type.contextTypes;if(!n)return Gr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Tt(e){return e=e.childContextTypes,e!=null}function Zl(){Ie(Mt),Ie(gt)}function sm(e,t,n){if(gt.current!==Gr)throw Error(K(168));Oe(gt,t),Oe(Mt,n)}function b0(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(K(108,hR(e)||"Unknown",o));return ze({},n,r)}function eu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gr,_o=gt.current,Oe(gt,e),Oe(Mt,Mt.current),!0}function am(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=b0(e,t,_o),r.__reactInternalMemoizedMergedChildContext=e,Ie(Mt),Ie(gt),Oe(gt,e)):Ie(Mt),Oe(Mt,n)}var qn=null,Iu=!1,Kc=!1;function R0(e){qn===null?qn=[e]:qn.push(e)}function AE(e){Iu=!0,R0(e)}function to(){if(!Kc&&qn!==null){Kc=!0;var e=0,t=Me;try{var n=qn;for(Me=1;e>=s,o-=s,Yn=1<<32-mn(t)+o|n<k?($=A,A=null):$=A.sibling;var R=f(w,A,S[k],C);if(R===null){A===null&&(A=$);break}e&&A&&R.alternate===null&&t(w,A),m=i(R,m,k),b===null?P=R:b.sibling=R,b=R,A=$}if(k===S.length)return n(w,A),Fe&&so(w,k),P;if(A===null){for(;kk?($=A,A=null):$=A.sibling;var N=f(w,A,R.value,C);if(N===null){A===null&&(A=$);break}e&&A&&N.alternate===null&&t(w,A),m=i(N,m,k),b===null?P=N:b.sibling=N,b=N,A=$}if(R.done)return n(w,A),Fe&&so(w,k),P;if(A===null){for(;!R.done;k++,R=S.next())R=c(w,R.value,C),R!==null&&(m=i(R,m,k),b===null?P=R:b.sibling=R,b=R);return Fe&&so(w,k),P}for(A=r(w,A);!R.done;k++,R=S.next())R=g(A,w,k,R.value,C),R!==null&&(e&&R.alternate!==null&&A.delete(R.key===null?k:R.key),m=i(R,m,k),b===null?P=R:b.sibling=R,b=R);return e&&A.forEach(function(F){return t(w,F)}),Fe&&so(w,k),P}function x(w,m,S,C){if(typeof S=="object"&&S!==null&&S.type===ti&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Ga:e:{for(var P=S.key,b=m;b!==null;){if(b.key===P){if(P=S.type,P===ti){if(b.tag===7){n(w,b.sibling),m=o(b,S.props.children),m.return=w,w=m;break e}}else if(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===yr&&cm(P)===b.type){n(w,b.sibling),m=o(b,S.props),m.ref=gs(w,b,S),m.return=w,w=m;break e}n(w,b);break}else t(w,b);b=b.sibling}S.type===ti?(m=Eo(S.props.children,w.mode,C,S.key),m.return=w,w=m):(C=Nl(S.type,S.key,S.props,null,w.mode,C),C.ref=gs(w,m,S),C.return=w,w=C)}return s(w);case ei:e:{for(b=S.key;m!==null;){if(m.key===b)if(m.tag===4&&m.stateNode.containerInfo===S.containerInfo&&m.stateNode.implementation===S.implementation){n(w,m.sibling),m=o(m,S.children||[]),m.return=w,w=m;break e}else{n(w,m);break}else t(w,m);m=m.sibling}m=Zc(S,w.mode,C),m.return=w,w=m}return s(w);case yr:return b=S._init,x(w,m,b(S._payload),C)}if(Es(S))return y(w,m,S,C);if(cs(S))return v(w,m,S,C);rl(w,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,m!==null&&m.tag===6?(n(w,m.sibling),m=o(m,S),m.return=w,w=m):(n(w,m),m=Jc(S,w.mode,C),m.return=w,w=m),s(w)):n(w,m)}return x}var zi=k0(!0),M0=k0(!1),ru=eo(null),ou=null,ui=null,Up=null;function zp(){Up=ui=ou=null}function Bp(e){var t=ru.current;Ie(ru),e._currentValue=t}function af(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 mi(e,t){ou=e,Up=ui=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(kt=!0),e.firstContext=null)}function rn(e){var t=e._currentValue;if(Up!==e)if(e={context:e,memoizedValue:t,next:null},ui===null){if(ou===null)throw Error(K(308));ui=e,ou.dependencies={lanes:0,firstContext:e}}else ui=ui.next=e;return t}var ho=null;function Vp(e){ho===null?ho=[e]:ho.push(e)}function T0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Vp(t)):(n.next=o.next,o.next=n),t.interleaved=n,rr(e,r)}function rr(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 wr=!1;function Hp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function A0(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 Jn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,be&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,rr(e,n)}return o=r.interleaved,o===null?(t.next=t,Vp(r)):(t.next=o.next,o.next=t),r.interleaved=t,rr(e,n)}function _l(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,Mp(e,n)}}function dm(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 iu(e,t,n,r){var o=e.updateQueue;wr=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var f=a.lane,g=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(f=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(g,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(g,c,f):y,f==null)break e;c=ze({},c,f);break e;case 2:wr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else g={eventTime:g,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);To|=s,e.lanes=s,e.memoizedState=c}}function fm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Wc.transition;Wc.transition={};try{e(!1),t()}finally{Me=n,Wc.transition=r}}function q0(){return on().memoizedState}function IE(e,t,n){var r=Vr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Q0(e))Y0(t,n);else if(n=T0(e,t,n,r),n!==null){var o=xt();vn(n,e,r,o),X0(n,t,r)}}function DE(e,t,n){var r=Vr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Q0(e))Y0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,wn(a,s)){var l=t.interleaved;l===null?(o.next=o,Vp(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=T0(e,t,o,r),n!==null&&(o=xt(),vn(n,e,r,o),X0(n,t,r))}}function Q0(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Y0(e,t){Ls=au=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function X0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mp(e,n)}}var lu={readContext:rn,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},FE={readContext:rn,useCallback:function(e,t){return Mn().memoizedState=[e,t===void 0?null:t],e},useContext:rn,useEffect:hm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ml(4194308,4,V0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ml(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ml(4,2,e,t)},useMemo:function(e,t){var n=Mn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Mn();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=IE.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=Mn();return e={current:e},t.memoizedState=e},useState:pm,useDebugValue:Jp,useDeferredValue:function(e){return Mn().memoizedState=e},useTransition:function(){var e=pm(!1),t=e[0];return e=jE.bind(null,e[1]),Mn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,o=Mn();if(Fe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ot===null)throw Error(K(349));Mo&30||I0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,hm(F0.bind(null,r,i,e),[e]),r.flags|=2048,aa(9,D0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Mn(),t=ot.identifierPrefix;if(Fe){var n=Xn,r=Yn;n=(r&~(1<<32-mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ia++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[jn]=t,e[na]=r,aw(e,t,!1,!1),t.stateNode=e;e:{switch(s=Bd(n,r),n){case"dialog":je("cancel",e),je("close",e),o=r;break;case"iframe":case"object":case"embed":je("load",e),o=r;break;case"video":case"audio":for(o=0;o<_s.length;o++)je(_s[o],e);o=r;break;case"source":je("error",e),o=r;break;case"img":case"image":case"link":je("error",e),je("load",e),o=r;break;case"details":je("toggle",e),o=r;break;case"input":Ng(e,r),o=Dd(e,r),je("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ze({},r,{value:void 0}),je("invalid",e);break;case"textarea":Ig(e,r),o=$d(e,r),je("invalid",e);break;default:o=r}zd(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Uy(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Ly(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ws(e,l):typeof l=="number"&&Ws(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Gs.hasOwnProperty(i)?l!=null&&i==="onScroll"&&je("scroll",e):l!=null&&bp(e,i,l,s))}switch(n){case"input":Wa(e),jg(e,r,!1);break;case"textarea":Wa(e),Dg(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Kr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fi(e,!!r.multiple,i,!1):r.defaultValue!=null&&fi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Jl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return dt(t),null;case 6:if(e&&t.stateNode!=null)uw(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(K(166));if(n=go(oa.current),go(Fn.current),nl(t)){if(r=t.stateNode,n=t.memoizedProps,r[jn]=t,(i=r.nodeValue!==n)&&(e=zt,e!==null))switch(e.tag){case 3:tl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&tl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[jn]=t,t.stateNode=r}return dt(t),null;case 13:if(Ie($e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Fe&&Ut!==null&&t.mode&1&&!(t.flags&128))_0(),Ui(),t.flags|=98560,i=!1;else if(i=nl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(K(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(K(317));i[jn]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;dt(t),i=!1}else pn!==null&&(bf(pn),pn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||$e.current&1?et===0&&(et=3):ih())),t.updateQueue!==null&&(t.flags|=4),dt(t),null);case 4:return Bi(),gf(e,t),e===null&&ea(t.stateNode.containerInfo),dt(t),null;case 10:return Bp(t.type._context),dt(t),null;case 17:return Tt(t.type)&&Zl(),dt(t),null;case 19:if(Ie($e),i=t.memoizedState,i===null)return dt(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)ms(i,!1);else{if(et!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=su(e),s!==null){for(t.flags|=128,ms(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Oe($e,$e.current&1|2),t.child}e=e.sibling}i.tail!==null&&We()>Hi&&(t.flags|=128,r=!0,ms(i,!1),t.lanes=4194304)}else{if(!r)if(e=su(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ms(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Fe)return dt(t),null}else 2*We()-i.renderingStartTime>Hi&&n!==1073741824&&(t.flags|=128,r=!0,ms(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=We(),t.sibling=null,n=$e.current,Oe($e,r?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return oh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ft&1073741824&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function KE(e,t){switch(Lp(t),t.tag){case 1:return Tt(t.type)&&Zl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Bi(),Ie(Mt),Ie(gt),Wp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gp(t),null;case 13:if(Ie($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie($e),null;case 4:return Bi(),null;case 10:return Bp(t.type._context),null;case 22:case 23:return oh(),null;case 24:return null;default:return null}}var il=!1,ht=!1,GE=typeof WeakSet=="function"?WeakSet:Set,Y=null;function ci(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ke(e,t,r)}else n.current=null}function mf(e,t,n){try{n()}catch(r){Ke(e,t,r)}}var Em=!1;function WE(e,t){if(Jd=Ql,e=h0(),Dp(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,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var g;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},Ql=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,x=y.memoizedState,w=t.stateNode,m=w.getSnapshotBeforeUpdate(t.elementType===t.type?v:un(t.type,v),x);w.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(C){Ke(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return y=Em,Em=!1,y}function $s(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 i=o.destroy;o.destroy=void 0,i!==void 0&&mf(t,n,i)}o=o.next}while(o!==r)}}function Lu(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 vf(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 cw(e){var t=e.alternate;t!==null&&(e.alternate=null,cw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jn],delete t[na],delete t[nf],delete t[ME],delete t[TE])),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 dw(e){return e.tag===5||e.tag===3||e.tag===4}function Pm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dw(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 yf(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=Jl));else if(r!==4&&(e=e.child,e!==null))for(yf(e,t,n),e=e.sibling;e!==null;)yf(e,t,n),e=e.sibling}function wf(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(wf(e,t,n),e=e.sibling;e!==null;)wf(e,t,n),e=e.sibling}var at=null,dn=!1;function dr(e,t,n){for(n=n.child;n!==null;)fw(e,t,n),n=n.sibling}function fw(e,t,n){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Tu,n)}catch{}switch(n.tag){case 5:ht||ci(n,t);case 6:var r=at,o=dn;at=null,dr(e,t,n),at=r,dn=o,at!==null&&(dn?(e=at,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):at.removeChild(n.stateNode));break;case 18:at!==null&&(dn?(e=at,n=n.stateNode,e.nodeType===8?Hc(e.parentNode,n):e.nodeType===1&&Hc(e,n),Xs(e)):Hc(at,n.stateNode));break;case 4:r=at,o=dn,at=n.stateNode.containerInfo,dn=!0,dr(e,t,n),at=r,dn=o;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&mf(n,t,s),o=o.next}while(o!==r)}dr(e,t,n);break;case 1:if(!ht&&(ci(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ke(n,t,a)}dr(e,t,n);break;case 21:dr(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,dr(e,t,n),ht=r):dr(e,t,n);break;default:dr(e,t,n)}}function _m(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new GE),t.forEach(function(r){var o=nP.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ln(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=We()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*QE(r/1960))-r,10e?16:e,jr===null)var r=!1;else{if(e=jr,jr=null,du=0,be&6)throw Error(K(331));var o=be;for(be|=4,Y=e.current;Y!==null;){var i=Y,s=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lWe()-nh?Ro(e,0):th|=n),At(e,t)}function xw(e,t){t===0&&(e.mode&1?(t=Ya,Ya<<=1,!(Ya&130023424)&&(Ya=4194304)):t=1);var n=xt();e=rr(e,t),e!==null&&(ba(e,t,n),At(e,n))}function tP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xw(e,n)}function nP(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(K(314))}r!==null&&r.delete(t),xw(e,n)}var Sw;Sw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Mt.current)kt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return kt=!1,VE(e,t,n);kt=!!(e.flags&131072)}else kt=!1,Fe&&t.flags&1048576&&E0(t,nu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Tl(e,t),e=t.pendingProps;var o=$i(t,gt.current);mi(t,n),o=Qp(null,t,r,e,o,n);var i=Yp();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,Tt(r)?(i=!0,eu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Hp(t),o.updater=Fu,t.stateNode=o,o._reactInternals=t,uf(t,r,e,n),t=ff(null,t,r,!0,i,n)):(t.tag=0,Fe&&i&&Fp(t),wt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Tl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=oP(r),e=un(r,e),o){case 0:t=df(null,t,r,e,n);break e;case 1:t=Cm(null,t,r,e,n);break e;case 11:t=xm(null,t,r,e,n);break e;case 14:t=Sm(null,t,r,un(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:un(r,o),df(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:un(r,o),Cm(e,t,r,o,n);case 3:e:{if(ow(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,A0(e,t),iu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Vi(Error(K(423)),t),t=bm(e,t,r,n,o);break e}else if(r!==o){o=Vi(Error(K(424)),t),t=bm(e,t,r,n,o);break e}else for(Ut=Ur(t.stateNode.containerInfo.firstChild),zt=t,Fe=!0,pn=null,n=M0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ui(),r===o){t=or(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 5:return O0(t),e===null&&sf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,ef(r,o)?s=null:i!==null&&ef(r,i)&&(t.flags|=32),rw(e,t),wt(e,t,s,n),t.child;case 6:return e===null&&sf(t),null;case 13:return iw(e,t,n);case 4:return Kp(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=zi(t,null,r,n):wt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:un(r,o),xm(e,t,r,o,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Oe(ru,r._currentValue),r._currentValue=s,i!==null)if(wn(i.value,s)){if(i.children===o.children&&!Mt.current){t=or(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Jn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),af(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),af(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}wt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,mi(t,n),o=rn(o),r=r(o),t.flags|=1,wt(e,t,r,n),t.child;case 14:return r=t.type,o=un(r,t.pendingProps),o=un(r.type,o),Sm(e,t,r,o,n);case 15:return tw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:un(r,o),Tl(e,t),t.tag=1,Tt(r)?(e=!0,eu(t)):e=!1,mi(t,n),J0(t,r,o),uf(t,r,o,n),ff(null,t,r,!0,e,n);case 19:return sw(e,t,n);case 22:return nw(e,t,n)}throw Error(K(156,t.tag))};function Cw(e,t){return Qy(e,t)}function rP(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 Zt(e,t,n,r){return new rP(e,t,n,r)}function sh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function oP(e){if(typeof e=="function")return sh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ep)return 11;if(e===Pp)return 14}return 2}function Hr(e,t){var n=e.alternate;return n===null?(n=Zt(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 Nl(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")sh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ti:return Eo(n.children,o,i,t);case Rp:s=8,o|=8;break;case Od:return e=Zt(12,n,t,o|2),e.elementType=Od,e.lanes=i,e;case Nd:return e=Zt(13,n,t,o),e.elementType=Nd,e.lanes=i,e;case jd:return e=Zt(19,n,t,o),e.elementType=jd,e.lanes=i,e;case Oy:return Uu(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ty:s=10;break e;case Ay:s=9;break e;case Ep:s=11;break e;case Pp:s=14;break e;case yr:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Zt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Eo(e,t,n,r){return e=Zt(7,e,r,t),e.lanes=n,e}function Uu(e,t,n,r){return e=Zt(22,e,r,t),e.elementType=Oy,e.lanes=n,e.stateNode={isHidden:!1},e}function Jc(e,t,n){return e=Zt(6,e,null,t),e.lanes=n,e}function Zc(e,t,n){return t=Zt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function iP(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=Nc(0),this.expirationTimes=Nc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ah(e,t,n,r,o,i,s,a,l){return e=new iP(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Zt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hp(i),e}function sP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pw)}catch(e){console.error(e)}}Pw(),Py.exports=Kt;var Xi=Py.exports;const _w=py(Xi),dP=fy({__proto__:null,default:_w},[Xi]);var kw,Im=Xi;kw=Im.createRoot,Im.hydrateRoot;/** - * @remix-run/router v1.20.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ki(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function pP(){return Math.random().toString(36).substr(2,8)}function Fm(e,t){return{usr:e.state,key:e.key,idx:t}}function ua(e,t,n,r){return n===void 0&&(n=null),De({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?no(t):t,{state:n,key:t&&t.key||r||pP()})}function Oo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function no(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function hP(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=Ye.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(De({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function c(){a=Ye.Pop;let x=d(),w=x==null?null:x-u;u=x,l&&l({action:a,location:v.location,delta:w})}function f(x,w){a=Ye.Push;let m=ua(v.location,x,w);u=d()+1;let S=Fm(m,u),C=v.createHref(m);try{s.pushState(S,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&l&&l({action:a,location:v.location,delta:1})}function g(x,w){a=Ye.Replace;let m=ua(v.location,x,w);u=d();let S=Fm(m,u),C=v.createHref(m);s.replaceState(S,"",C),i&&l&&l({action:a,location:v.location,delta:0})}function y(x){let w=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof x=="string"?x:Oo(x);return m=m.replace(/ $/,"%20"),ge(w,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,w)}let v={get action(){return a},get location(){return e(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Dm,c),l=x,()=>{o.removeEventListener(Dm,c),l=null}},createHref(x){return t(o,x)},createURL:y,encodeLocation(x){let w=y(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:f,replace:g,go(x){return s.go(x)}};return v}var Te;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Te||(Te={}));const gP=new Set(["lazy","caseSensitive","path","id","index","children"]);function mP(e){return e.index===!0}function hu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,String(i)],a=typeof o.id=="string"?o.id:s.join("-");if(ge(o.index!==!0||!o.children,"Cannot specify children on an index route"),ge(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),mP(o)){let l=De({},o,t(o),{id:a});return r[a]=l,l}else{let l=De({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=hu(o.children,t,s,r)),l}})}function co(e,t,n){return n===void 0&&(n="/"),jl(e,t,n,!1)}function jl(e,t,n,r){let o=typeof t=="string"?no(t):t,i=Ji(o.pathname||"/",n);if(i==null)return null;let s=Mw(e);yP(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(ge(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Zn([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(ge(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Mw(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:EP(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of Tw(i.path))o(i,s,l)}),t}function Tw(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=Tw(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function yP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:PP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wP=/^:[\w-]+$/,xP=3,SP=2,CP=1,bP=10,RP=-2,Lm=e=>e==="*";function EP(e,t){let n=e.split("/"),r=n.length;return n.some(Lm)&&(r+=RP),t&&(r+=SP),n.filter(o=>!Lm(o)).reduce((o,i)=>o+(wP.test(i)?xP:i===""?CP:bP),r)}function PP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function _P(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a{let{paramName:f,isOptional:g}=d;if(f==="*"){let v=a[c]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const y=a[c];return g&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function kP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ki(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function MP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ki(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ji(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function TP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?no(e):e;return{pathname:n?n.startsWith("/")?n:AP(n,t):t,search:NP(r),hash:jP(o)}}function AP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ed(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Aw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ku(e,t){let n=Aw(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Gu(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=no(e):(o=De({},e),ge(!o.pathname||!o.pathname.includes("?"),ed("?","pathname","search",o)),ge(!o.pathname||!o.pathname.includes("#"),ed("#","pathname","hash",o)),ge(!o.search||!o.search.includes("#"),ed("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let c=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),c-=1;o.pathname=f.join("/")}a=c>=0?t[c]:"/"}let l=TP(o,a),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const Zn=e=>e.join("/").replace(/\/\/+/g,"/"),OP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),NP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,jP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class gu{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Wu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ow=["post","put","patch","delete"],IP=new Set(Ow),DP=["get",...Ow],FP=new Set(DP),LP=new Set([301,302,303,307,308]),$P=new Set([307,308]),td={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},UP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ys={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,zP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Nw="remix-router-transitions";function BP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;ge(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let T=e.detectErrorBoundary;o=I=>({hasErrorBoundary:T(I)})}else o=zP;let i={},s=hu(e.routes,o,void 0,i),a,l=e.basename||"/",u=e.dataStrategy||GP,d=e.patchRoutesOnNavigation,c=De({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,y=null,v=null,x=null,w=e.hydrationData!=null,m=co(s,e.history.location,l),S=null;if(m==null&&!d){let T=Pt(404,{pathname:e.history.location.pathname}),{matches:I,route:U}=Ym(s);m=I,S={[U.id]:T}}m&&!e.hydrationData&&Ua(m,s,e.history.location.pathname).active&&(m=null);let C;if(m)if(m.some(T=>T.route.lazy))C=!1;else if(!m.some(T=>T.route.loader))C=!0;else if(c.v7_partialHydration){let T=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let U=m.findIndex(H=>I[H.route.id]!==void 0);C=m.slice(0,U+1).every(H=>!Ef(H.route,T,I))}else C=m.every(U=>!Ef(U.route,T,I))}else C=e.hydrationData!=null;else if(C=!1,m=[],c.v7_partialHydration){let T=Ua(null,s,e.history.location.pathname);T.active&&T.matches&&(m=T.matches)}let P,b={historyAction:e.history.action,location:e.history.location,matches:m,initialized:C,navigation:td,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},A=Ye.Pop,k=!1,$,R=!1,N=new Map,F=null,L=!1,E=!1,M=[],j=new Set,V=new Map,D=0,O=-1,B=new Map,q=new Set,te=new Map,fe=new Map,he=new Set,z=new Map,G=new Map,pe;function ke(){if(f=e.history.listen(T=>{let{action:I,location:U,delta:H}=T;if(pe){pe(),pe=void 0;return}Ki(G.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let X=Cg({currentLocation:b.location,nextLocation:U,historyAction:I});if(X&&H!=null){let re=new Promise(ce=>{pe=ce});e.history.go(H*-1),$a(X,{state:"blocked",location:U,proceed(){$a(X,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),re.then(()=>e.history.go(H))},reset(){let ce=new Map(b.blockers);ce.set(X,ys),Se({blockers:ce})}});return}return nt(I,U)}),n){s_(t,N);let T=()=>a_(t,N);t.addEventListener("pagehide",T),F=()=>t.removeEventListener("pagehide",T)}return b.initialized||nt(Ye.Pop,b.location,{initialHydration:!0}),P}function ye(){f&&f(),F&&F(),g.clear(),$&&$.abort(),b.fetchers.forEach((T,I)=>La(I)),b.blockers.forEach((T,I)=>Sg(I))}function tt(T){return g.add(T),()=>g.delete(T)}function Se(T,I){I===void 0&&(I={}),b=De({},b,T);let U=[],H=[];c.v7_fetcherPersist&&b.fetchers.forEach((X,re)=>{X.state==="idle"&&(he.has(re)?H.push(re):U.push(re))}),[...g].forEach(X=>X(b,{deletedFetchers:H,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),c.v7_fetcherPersist&&(U.forEach(X=>b.fetchers.delete(X)),H.forEach(X=>La(X)))}function it(T,I,U){var H,X;let{flushSync:re}=U===void 0?{}:U,ce=b.actionData!=null&&b.navigation.formMethod!=null&&fn(b.navigation.formMethod)&&b.navigation.state==="loading"&&((H=T.state)==null?void 0:H._isRedirect)!==!0,Z;I.actionData?Object.keys(I.actionData).length>0?Z=I.actionData:Z=null:ce?Z=b.actionData:Z=null;let ee=I.loaderData?qm(b.loaderData,I.loaderData,I.matches||[],I.errors):b.loaderData,J=b.blockers;J.size>0&&(J=new Map(J),J.forEach((Ce,st)=>J.set(st,ys)));let oe=k===!0||b.navigation.formMethod!=null&&fn(b.navigation.formMethod)&&((X=T.state)==null?void 0:X._isRedirect)!==!0;a&&(s=a,a=void 0),L||A===Ye.Pop||(A===Ye.Push?e.history.push(T,T.state):A===Ye.Replace&&e.history.replace(T,T.state));let ve;if(A===Ye.Pop){let Ce=N.get(b.location.pathname);Ce&&Ce.has(T.pathname)?ve={currentLocation:b.location,nextLocation:T}:N.has(T.pathname)&&(ve={currentLocation:T,nextLocation:b.location})}else if(R){let Ce=N.get(b.location.pathname);Ce?Ce.add(T.pathname):(Ce=new Set([T.pathname]),N.set(b.location.pathname,Ce)),ve={currentLocation:b.location,nextLocation:T}}Se(De({},I,{actionData:Z,loaderData:ee,historyAction:A,location:T,initialized:!0,navigation:td,revalidation:"idle",restoreScrollPosition:Rg(T,I.matches||b.matches),preventScrollReset:oe,blockers:J}),{viewTransitionOpts:ve,flushSync:re===!0}),A=Ye.Pop,k=!1,R=!1,L=!1,E=!1,M=[]}async function Nt(T,I){if(typeof T=="number"){e.history.go(T);return}let U=Rf(b.location,b.matches,l,c.v7_prependBasename,T,c.v7_relativeSplatPath,I==null?void 0:I.fromRouteId,I==null?void 0:I.relative),{path:H,submission:X,error:re}=Um(c.v7_normalizeFormMethod,!1,U,I),ce=b.location,Z=ua(b.location,H,I&&I.state);Z=De({},Z,e.history.encodeLocation(Z));let ee=I&&I.replace!=null?I.replace:void 0,J=Ye.Push;ee===!0?J=Ye.Replace:ee===!1||X!=null&&fn(X.formMethod)&&X.formAction===b.location.pathname+b.location.search&&(J=Ye.Replace);let oe=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,ve=(I&&I.flushSync)===!0,Ce=Cg({currentLocation:ce,nextLocation:Z,historyAction:J});if(Ce){$a(Ce,{state:"blocked",location:Z,proceed(){$a(Ce,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Nt(T,I)},reset(){let st=new Map(b.blockers);st.set(Ce,ys),Se({blockers:st})}});return}return await nt(J,Z,{submission:X,pendingError:re,preventScrollReset:oe,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:ve})}function Le(){if(bc(),Se({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){nt(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}nt(A||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation,enableViewTransition:R===!0})}}async function nt(T,I,U){$&&$.abort(),$=null,A=T,L=(U&&U.startUninterruptedRevalidation)===!0,jb(b.location,b.matches),k=(U&&U.preventScrollReset)===!0,R=(U&&U.enableViewTransition)===!0;let H=a||s,X=U&&U.overrideNavigation,re=co(H,I,l),ce=(U&&U.flushSync)===!0,Z=Ua(re,H,I.pathname);if(Z.active&&Z.matches&&(re=Z.matches),!re){let{error:Ae,notFoundMatches:Pe,route:Be}=Rc(I.pathname);it(I,{matches:Pe,loaderData:{},errors:{[Be.id]:Ae}},{flushSync:ce});return}if(b.initialized&&!E&&JP(b.location,I)&&!(U&&U.submission&&fn(U.submission.formMethod))){it(I,{matches:re},{flushSync:ce});return}$=new AbortController;let ee=Yo(e.history,I,$.signal,U&&U.submission),J;if(U&&U.pendingError)J=[fo(re).route.id,{type:Te.error,error:U.pendingError}];else if(U&&U.submission&&fn(U.submission.formMethod)){let Ae=await an(ee,I,U.submission,re,Z.active,{replace:U.replace,flushSync:ce});if(Ae.shortCircuited)return;if(Ae.pendingActionResult){let[Pe,Be]=Ae.pendingActionResult;if(Lt(Be)&&Wu(Be.error)&&Be.error.status===404){$=null,it(I,{matches:Ae.matches,loaderData:{},errors:{[Pe]:Be.error}});return}}re=Ae.matches||re,J=Ae.pendingActionResult,X=nd(I,U.submission),ce=!1,Z.active=!1,ee=Yo(e.history,ee.url,ee.signal)}let{shortCircuited:oe,matches:ve,loaderData:Ce,errors:st}=await Cc(ee,I,re,Z.active,X,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,ce,J);oe||($=null,it(I,De({matches:ve||re},Qm(J),{loaderData:Ce,errors:st})))}async function an(T,I,U,H,X,re){re===void 0&&(re={}),bc();let ce=o_(I,U);if(Se({navigation:ce},{flushSync:re.flushSync===!0}),X){let J=await za(H,I.pathname,T.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let oe=fo(J.partialMatches).route.id;return{matches:J.partialMatches,pendingActionResult:[oe,{type:Te.error,error:J.error}]}}else if(J.matches)H=J.matches;else{let{notFoundMatches:oe,error:ve,route:Ce}=Rc(I.pathname);return{matches:oe,pendingActionResult:[Ce.id,{type:Te.error,error:ve}]}}}let Z,ee=ks(H,I);if(!ee.route.action&&!ee.route.lazy)Z={type:Te.error,error:Pt(405,{method:T.method,pathname:I.pathname,routeId:ee.route.id})};else if(Z=(await ss("action",b,T,[ee],H,null))[ee.route.id],T.signal.aborted)return{shortCircuited:!0};if(mo(Z)){let J;return re&&re.replace!=null?J=re.replace:J=Km(Z.response.headers.get("Location"),new URL(T.url),l)===b.location.pathname+b.location.search,await oo(T,Z,!0,{submission:U,replace:J}),{shortCircuited:!0}}if(Ir(Z))throw Pt(400,{type:"defer-action"});if(Lt(Z)){let J=fo(H,ee.route.id);return(re&&re.replace)!==!0&&(A=Ye.Push),{matches:H,pendingActionResult:[J.route.id,Z]}}return{matches:H,pendingActionResult:[ee.route.id,Z]}}async function Cc(T,I,U,H,X,re,ce,Z,ee,J,oe){let ve=X||nd(I,re),Ce=re||ce||Jm(ve),st=!L&&(!c.v7_partialHydration||!ee);if(H){if(st){let Ve=Fa(oe);Se(De({navigation:ve},Ve!==void 0?{actionData:Ve}:{}),{flushSync:J})}let Re=await za(U,I.pathname,T.signal);if(Re.type==="aborted")return{shortCircuited:!0};if(Re.type==="error"){let Ve=fo(Re.partialMatches).route.id;return{matches:Re.partialMatches,loaderData:{},errors:{[Ve]:Re.error}}}else if(Re.matches)U=Re.matches;else{let{error:Ve,notFoundMatches:Wo,route:us}=Rc(I.pathname);return{matches:Wo,loaderData:{},errors:{[us.id]:Ve}}}}let Ae=a||s,[Pe,Be]=Bm(e.history,b,U,Ce,I,c.v7_partialHydration&&ee===!0,c.v7_skipActionErrorRevalidation,E,M,j,he,te,q,Ae,l,oe);if(Ec(Re=>!(U&&U.some(Ve=>Ve.route.id===Re))||Pe&&Pe.some(Ve=>Ve.route.id===Re)),O=++D,Pe.length===0&&Be.length===0){let Re=wg();return it(I,De({matches:U,loaderData:{},errors:oe&&Lt(oe[1])?{[oe[0]]:oe[1].error}:null},Qm(oe),Re?{fetchers:new Map(b.fetchers)}:{}),{flushSync:J}),{shortCircuited:!0}}if(st){let Re={};if(!H){Re.navigation=ve;let Ve=Fa(oe);Ve!==void 0&&(Re.actionData=Ve)}Be.length>0&&(Re.fetchers=Ko(Be)),Se(Re,{flushSync:J})}Be.forEach(Re=>{cr(Re.key),Re.controller&&V.set(Re.key,Re.controller)});let Go=()=>Be.forEach(Re=>cr(Re.key));$&&$.signal.addEventListener("abort",Go);let{loaderResults:as,fetcherResults:Vn}=await mg(b,U,Pe,Be,T);if(T.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Go),Be.forEach(Re=>V.delete(Re.key));let Rn=ll(as);if(Rn)return await oo(T,Rn.result,!0,{replace:Z}),{shortCircuited:!0};if(Rn=ll(Vn),Rn)return q.add(Rn.key),await oo(T,Rn.result,!0,{replace:Z}),{shortCircuited:!0};let{loaderData:Pc,errors:ls}=Wm(b,U,as,oe,Be,Vn,z);z.forEach((Re,Ve)=>{Re.subscribe(Wo=>{(Wo||Re.done)&&z.delete(Ve)})}),c.v7_partialHydration&&ee&&b.errors&&(ls=De({},b.errors,ls));let io=wg(),Ba=xg(O),Va=io||Ba||Be.length>0;return De({matches:U,loaderData:Pc,errors:ls},Va?{fetchers:new Map(b.fetchers)}:{})}function Fa(T){if(T&&!Lt(T[1]))return{[T[0]]:T[1].data};if(b.actionData)return Object.keys(b.actionData).length===0?null:b.actionData}function Ko(T){return T.forEach(I=>{let U=b.fetchers.get(I.key),H=ws(void 0,U?U.data:void 0);b.fetchers.set(I.key,H)}),new Map(b.fetchers)}function kb(T,I,U,H){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");cr(T);let X=(H&&H.flushSync)===!0,re=a||s,ce=Rf(b.location,b.matches,l,c.v7_prependBasename,U,c.v7_relativeSplatPath,I,H==null?void 0:H.relative),Z=co(re,ce,l),ee=Ua(Z,re,ce);if(ee.active&&ee.matches&&(Z=ee.matches),!Z){Bn(T,I,Pt(404,{pathname:ce}),{flushSync:X});return}let{path:J,submission:oe,error:ve}=Um(c.v7_normalizeFormMethod,!0,ce,H);if(ve){Bn(T,I,ve,{flushSync:X});return}let Ce=ks(Z,J),st=(H&&H.preventScrollReset)===!0;if(oe&&fn(oe.formMethod)){Mb(T,I,J,Ce,Z,ee.active,X,st,oe);return}te.set(T,{routeId:I,path:J}),Tb(T,I,J,Ce,Z,ee.active,X,st,oe)}async function Mb(T,I,U,H,X,re,ce,Z,ee){bc(),te.delete(T);function J(Qe){if(!Qe.route.action&&!Qe.route.lazy){let qo=Pt(405,{method:ee.formMethod,pathname:U,routeId:I});return Bn(T,I,qo,{flushSync:ce}),!0}return!1}if(!re&&J(H))return;let oe=b.fetchers.get(T);ur(T,i_(ee,oe),{flushSync:ce});let ve=new AbortController,Ce=Yo(e.history,U,ve.signal,ee);if(re){let Qe=await za(X,U,Ce.signal);if(Qe.type==="aborted")return;if(Qe.type==="error"){Bn(T,I,Qe.error,{flushSync:ce});return}else if(Qe.matches){if(X=Qe.matches,H=ks(X,U),J(H))return}else{Bn(T,I,Pt(404,{pathname:U}),{flushSync:ce});return}}V.set(T,ve);let st=D,Pe=(await ss("action",b,Ce,[H],X,T))[H.route.id];if(Ce.signal.aborted){V.get(T)===ve&&V.delete(T);return}if(c.v7_fetcherPersist&&he.has(T)){if(mo(Pe)||Lt(Pe)){ur(T,gr(void 0));return}}else{if(mo(Pe))if(V.delete(T),O>st){ur(T,gr(void 0));return}else return q.add(T),ur(T,ws(ee)),oo(Ce,Pe,!1,{fetcherSubmission:ee,preventScrollReset:Z});if(Lt(Pe)){Bn(T,I,Pe.error);return}}if(Ir(Pe))throw Pt(400,{type:"defer-action"});let Be=b.navigation.location||b.location,Go=Yo(e.history,Be,ve.signal),as=a||s,Vn=b.navigation.state!=="idle"?co(as,b.navigation.location,l):b.matches;ge(Vn,"Didn't find any matches after fetcher action");let Rn=++D;B.set(T,Rn);let Pc=ws(ee,Pe.data);b.fetchers.set(T,Pc);let[ls,io]=Bm(e.history,b,Vn,ee,Be,!1,c.v7_skipActionErrorRevalidation,E,M,j,he,te,q,as,l,[H.route.id,Pe]);io.filter(Qe=>Qe.key!==T).forEach(Qe=>{let qo=Qe.key,Eg=b.fetchers.get(qo),Fb=ws(void 0,Eg?Eg.data:void 0);b.fetchers.set(qo,Fb),cr(qo),Qe.controller&&V.set(qo,Qe.controller)}),Se({fetchers:new Map(b.fetchers)});let Ba=()=>io.forEach(Qe=>cr(Qe.key));ve.signal.addEventListener("abort",Ba);let{loaderResults:Va,fetcherResults:Re}=await mg(b,Vn,ls,io,Go);if(ve.signal.aborted)return;ve.signal.removeEventListener("abort",Ba),B.delete(T),V.delete(T),io.forEach(Qe=>V.delete(Qe.key));let Ve=ll(Va);if(Ve)return oo(Go,Ve.result,!1,{preventScrollReset:Z});if(Ve=ll(Re),Ve)return q.add(Ve.key),oo(Go,Ve.result,!1,{preventScrollReset:Z});let{loaderData:Wo,errors:us}=Wm(b,Vn,Va,void 0,io,Re,z);if(b.fetchers.has(T)){let Qe=gr(Pe.data);b.fetchers.set(T,Qe)}xg(Rn),b.navigation.state==="loading"&&Rn>O?(ge(A,"Expected pending action"),$&&$.abort(),it(b.navigation.location,{matches:Vn,loaderData:Wo,errors:us,fetchers:new Map(b.fetchers)})):(Se({errors:us,loaderData:qm(b.loaderData,Wo,Vn,us),fetchers:new Map(b.fetchers)}),E=!1)}async function Tb(T,I,U,H,X,re,ce,Z,ee){let J=b.fetchers.get(T);ur(T,ws(ee,J?J.data:void 0),{flushSync:ce});let oe=new AbortController,ve=Yo(e.history,U,oe.signal);if(re){let Pe=await za(X,U,ve.signal);if(Pe.type==="aborted")return;if(Pe.type==="error"){Bn(T,I,Pe.error,{flushSync:ce});return}else if(Pe.matches)X=Pe.matches,H=ks(X,U);else{Bn(T,I,Pt(404,{pathname:U}),{flushSync:ce});return}}V.set(T,oe);let Ce=D,Ae=(await ss("loader",b,ve,[H],X,T))[H.route.id];if(Ir(Ae)&&(Ae=await fh(Ae,ve.signal,!0)||Ae),V.get(T)===oe&&V.delete(T),!ve.signal.aborted){if(he.has(T)){ur(T,gr(void 0));return}if(mo(Ae))if(O>Ce){ur(T,gr(void 0));return}else{q.add(T),await oo(ve,Ae,!1,{preventScrollReset:Z});return}if(Lt(Ae)){Bn(T,I,Ae.error);return}ge(!Ir(Ae),"Unhandled fetcher deferred data"),ur(T,gr(Ae.data))}}async function oo(T,I,U,H){let{submission:X,fetcherSubmission:re,preventScrollReset:ce,replace:Z}=H===void 0?{}:H;I.response.headers.has("X-Remix-Revalidate")&&(E=!0);let ee=I.response.headers.get("Location");ge(ee,"Expected a Location header on the redirect Response"),ee=Km(ee,new URL(T.url),l);let J=ua(b.location,ee,{_isRedirect:!0});if(n){let Pe=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Pe=!0;else if(dh.test(ee)){const Be=e.history.createURL(ee);Pe=Be.origin!==t.location.origin||Ji(Be.pathname,l)==null}if(Pe){Z?t.location.replace(ee):t.location.assign(ee);return}}$=null;let oe=Z===!0||I.response.headers.has("X-Remix-Replace")?Ye.Replace:Ye.Push,{formMethod:ve,formAction:Ce,formEncType:st}=b.navigation;!X&&!re&&ve&&Ce&&st&&(X=Jm(b.navigation));let Ae=X||re;if($P.has(I.response.status)&&Ae&&fn(Ae.formMethod))await nt(oe,J,{submission:De({},Ae,{formAction:ee}),preventScrollReset:ce||k,enableViewTransition:U?R:void 0});else{let Pe=nd(J,X);await nt(oe,J,{overrideNavigation:Pe,fetcherSubmission:re,preventScrollReset:ce||k,enableViewTransition:U?R:void 0})}}async function ss(T,I,U,H,X,re){let ce,Z={};try{ce=await WP(u,T,I,U,H,X,re,i,o)}catch(ee){return H.forEach(J=>{Z[J.route.id]={type:Te.error,error:ee}}),Z}for(let[ee,J]of Object.entries(ce))if(ZP(J)){let oe=J.result;Z[ee]={type:Te.redirect,response:YP(oe,U,ee,X,l,c.v7_relativeSplatPath)}}else Z[ee]=await QP(J);return Z}async function mg(T,I,U,H,X){let re=T.matches,ce=ss("loader",T,X,U,I,null),Z=Promise.all(H.map(async oe=>{if(oe.matches&&oe.match&&oe.controller){let Ce=(await ss("loader",T,Yo(e.history,oe.path,oe.controller.signal),[oe.match],oe.matches,oe.key))[oe.match.route.id];return{[oe.key]:Ce}}else return Promise.resolve({[oe.key]:{type:Te.error,error:Pt(404,{pathname:oe.path})}})})),ee=await ce,J=(await Z).reduce((oe,ve)=>Object.assign(oe,ve),{});return await Promise.all([n_(I,ee,X.signal,re,T.loaderData),r_(I,J,H)]),{loaderResults:ee,fetcherResults:J}}function bc(){E=!0,M.push(...Ec()),te.forEach((T,I)=>{V.has(I)&&j.add(I),cr(I)})}function ur(T,I,U){U===void 0&&(U={}),b.fetchers.set(T,I),Se({fetchers:new Map(b.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Bn(T,I,U,H){H===void 0&&(H={});let X=fo(b.matches,I);La(T),Se({errors:{[X.route.id]:U},fetchers:new Map(b.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function vg(T){return c.v7_fetcherPersist&&(fe.set(T,(fe.get(T)||0)+1),he.has(T)&&he.delete(T)),b.fetchers.get(T)||UP}function La(T){let I=b.fetchers.get(T);V.has(T)&&!(I&&I.state==="loading"&&B.has(T))&&cr(T),te.delete(T),B.delete(T),q.delete(T),he.delete(T),j.delete(T),b.fetchers.delete(T)}function Ab(T){if(c.v7_fetcherPersist){let I=(fe.get(T)||0)-1;I<=0?(fe.delete(T),he.add(T)):fe.set(T,I)}else La(T);Se({fetchers:new Map(b.fetchers)})}function cr(T){let I=V.get(T);I&&(I.abort(),V.delete(T))}function yg(T){for(let I of T){let U=vg(I),H=gr(U.data);b.fetchers.set(I,H)}}function wg(){let T=[],I=!1;for(let U of q){let H=b.fetchers.get(U);ge(H,"Expected fetcher: "+U),H.state==="loading"&&(q.delete(U),T.push(U),I=!0)}return yg(T),I}function xg(T){let I=[];for(let[U,H]of B)if(H0}function Ob(T,I){let U=b.blockers.get(T)||ys;return G.get(T)!==I&&G.set(T,I),U}function Sg(T){b.blockers.delete(T),G.delete(T)}function $a(T,I){let U=b.blockers.get(T)||ys;ge(U.state==="unblocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="proceeding"||U.state==="blocked"&&I.state==="unblocked"||U.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+I.state);let H=new Map(b.blockers);H.set(T,I),Se({blockers:H})}function Cg(T){let{currentLocation:I,nextLocation:U,historyAction:H}=T;if(G.size===0)return;G.size>1&&Ki(!1,"A router only supports one blocker at a time");let X=Array.from(G.entries()),[re,ce]=X[X.length-1],Z=b.blockers.get(re);if(!(Z&&Z.state==="proceeding")&&ce({currentLocation:I,nextLocation:U,historyAction:H}))return re}function Rc(T){let I=Pt(404,{pathname:T}),U=a||s,{matches:H,route:X}=Ym(U);return Ec(),{notFoundMatches:H,route:X,error:I}}function Ec(T){let I=[];return z.forEach((U,H)=>{(!T||T(H))&&(U.cancel(),I.push(H),z.delete(H))}),I}function Nb(T,I,U){if(y=T,x=I,v=U||null,!w&&b.navigation===td){w=!0;let H=Rg(b.location,b.matches);H!=null&&Se({restoreScrollPosition:H})}return()=>{y=null,x=null,v=null}}function bg(T,I){return v&&v(T,I.map(H=>vP(H,b.loaderData)))||T.key}function jb(T,I){if(y&&x){let U=bg(T,I);y[U]=x()}}function Rg(T,I){if(y){let U=bg(T,I),H=y[U];if(typeof H=="number")return H}return null}function Ua(T,I,U){if(d)if(T){if(Object.keys(T[0].params).length>0)return{active:!0,matches:jl(I,U,l,!0)}}else return{active:!0,matches:jl(I,U,l,!0)||[]};return{active:!1,matches:null}}async function za(T,I,U){if(!d)return{type:"success",matches:T};let H=T;for(;;){let X=a==null,re=a||s,ce=i;try{await d({path:I,matches:H,patch:(J,oe)=>{U.aborted||Hm(J,oe,re,ce,o)}})}catch(J){return{type:"error",error:J,partialMatches:H}}finally{X&&!U.aborted&&(s=[...s])}if(U.aborted)return{type:"aborted"};let Z=co(re,I,l);if(Z)return{type:"success",matches:Z};let ee=jl(re,I,l,!0);if(!ee||H.length===ee.length&&H.every((J,oe)=>J.route.id===ee[oe].route.id))return{type:"success",matches:null};H=ee}}function Ib(T){i={},a=hu(T,o,void 0,i)}function Db(T,I){let U=a==null;Hm(T,I,a||s,i,o),U&&(s=[...s],Se({}))}return P={get basename(){return l},get future(){return c},get state(){return b},get routes(){return s},get window(){return t},initialize:ke,subscribe:tt,enableScrollRestoration:Nb,navigate:Nt,fetch:kb,revalidate:Le,createHref:T=>e.history.createHref(T),encodeLocation:T=>e.history.encodeLocation(T),getFetcher:vg,deleteFetcher:Ab,dispose:ye,getBlocker:Ob,deleteBlocker:Sg,patchRoutes:Db,_internalFetchControllers:V,_internalActiveDeferreds:z,_internalSetRoutes:Ib},P}function VP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Rf(e,t,n,r,o,i,s,a){let l,u;if(s){l=[];for(let c of t)if(l.push(c),c.route.id===s){u=c;break}}else l=t,u=t[t.length-1];let d=Gu(o||".",Ku(l,i),Ji(e.pathname,n)||e.pathname,a==="path");if(o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u){let c=ph(d.search);if(u.route.index&&!c)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let f=new URLSearchParams(d.search),g=f.getAll("index");f.delete("index"),g.filter(v=>v).forEach(v=>f.append("index",v));let y=f.toString();d.search=y?"?"+y:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Zn([n,d.pathname])),Oo(d)}function Um(e,t,n,r){if(!r||!VP(r))return{path:n};if(r.formMethod&&!t_(r.formMethod))return{path:n,error:Pt(405,{method:r.formMethod})};let o=()=>({path:n,error:Pt(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=Dw(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!fn(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[v,x]=y;return""+g+v+"="+x+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!fn(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}ge(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Pf(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Pf(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Gm(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Gm(l)}catch{return o()}let d={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(fn(d.formMethod))return{path:n,submission:d};let c=no(n);return t&&c.search&&ph(c.search)&&l.append("index",""),c.search="?"+l,{path:Oo(c),submission:d}}function zm(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Bm(e,t,n,r,o,i,s,a,l,u,d,c,f,g,y,v){let x=v?Lt(v[1])?v[1].error:v[1].data:void 0,w=e.createURL(t.location),m=e.createURL(o),S=n;i&&t.errors?S=zm(n,Object.keys(t.errors)[0],!0):v&&Lt(v[1])&&(S=zm(n,v[0]));let C=v?v[1].statusCode:void 0,P=s&&C&&C>=400,b=S.filter((k,$)=>{let{route:R}=k;if(R.lazy)return!0;if(R.loader==null)return!1;if(i)return Ef(R,t.loaderData,t.errors);if(HP(t.loaderData,t.matches[$],k)||l.some(L=>L===k.route.id))return!0;let N=t.matches[$],F=k;return Vm(k,De({currentUrl:w,currentParams:N.params,nextUrl:m,nextParams:F.params},r,{actionResult:x,actionStatus:C,defaultShouldRevalidate:P?!1:a||w.pathname+w.search===m.pathname+m.search||w.search!==m.search||jw(N,F)}))}),A=[];return c.forEach((k,$)=>{if(i||!n.some(E=>E.route.id===k.routeId)||d.has($))return;let R=co(g,k.path,y);if(!R){A.push({key:$,routeId:k.routeId,path:k.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get($),F=ks(R,k.path),L=!1;f.has($)?L=!1:u.has($)?(u.delete($),L=!0):N&&N.state!=="idle"&&N.data===void 0?L=a:L=Vm(F,De({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:C,defaultShouldRevalidate:P?!1:a})),L&&A.push({key:$,routeId:k.routeId,path:k.path,matches:R,match:F,controller:new AbortController})}),[b,A]}function Ef(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function HP(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function jw(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Vm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Hm(e,t,n,r,o){var i;let s;if(e){let u=r[e];ge(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=n;let a=t.filter(u=>!s.some(d=>Iw(u,d))),l=hu(a,o,[e||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],r);s.push(...l)}function Iw(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(i=>Iw(n,i))}):!1}async function KP(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];ge(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";Ki(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!gP.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,De({},t(o),{lazy:void 0}))}async function GP(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,s)=>Object.assign(o,{[n[s].route.id]:i}),{})}async function WP(e,t,n,r,o,i,s,a,l,u){let d=i.map(g=>g.route.lazy?KP(g.route,l,a):void 0),c=i.map((g,y)=>{let v=d[y],x=o.some(m=>m.route.id===g.route.id);return De({},g,{shouldLoad:x,resolve:async m=>(m&&r.method==="GET"&&(g.route.lazy||g.route.loader)&&(x=!0),x?qP(t,r,g,v,m,u):Promise.resolve({type:Te.data,result:void 0}))})}),f=await e({matches:c,request:r,params:i[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return f}async function qP(e,t,n,r,o,i){let s,a,l=u=>{let d,c=new Promise((y,v)=>d=v);a=()=>d(),t.signal.addEventListener("abort",a);let f=y=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...y!==void 0?[y]:[]),g=(async()=>{try{return{type:"data",result:await(o?o(v=>f(v)):f())}}catch(y){return{type:"error",result:y}}})();return Promise.race([g,c])};try{let u=n.route[e];if(r)if(u){let d,[c]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;s=c}else if(await r,u=n.route[e],u)s=await l(u);else if(e==="action"){let d=new URL(t.url),c=d.pathname+d.search;throw Pt(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:Te.data,result:void 0};else if(u)s=await l(u);else{let d=new URL(t.url),c=d.pathname+d.search;throw Pt(404,{pathname:c})}ge(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Te.error,result:u}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function QP(e){let{result:t,type:n}=e;if(Fw(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:Te.error,error:d}}return n===Te.error?{type:Te.error,error:new gu(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:Te.data,data:u,statusCode:t.status,headers:t.headers}}if(n===Te.error){if(Xm(t)){var r;if(t.data instanceof Error){var o;return{type:Te.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new gu(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Te.error,error:t,statusCode:Wu(t)?t.status:void 0}}if(e_(t)){var i,s;return{type:Te.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(Xm(t)){var a,l;return{type:Te.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:Te.data,data:t}}function YP(e,t,n,r,o,i){let s=e.headers.get("Location");if(ge(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!dh.test(s)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=Rf(new URL(t.url),a,o,!0,s,i),e.headers.set("Location",s)}return e}function Km(e,t,n){if(dh.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=Ji(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function Yo(e,t,n,r){let o=e.createURL(Dw(t)).toString(),i={signal:n};if(r&&fn(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Pf(r.formData):i.body=r.formData}return new Request(o,i)}function Pf(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Gm(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function XP(e,t,n,r,o){let i={},s=null,a,l=!1,u={},d=n&&Lt(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let f=c.route.id,g=t[f];if(ge(!mo(g),"Cannot handle redirect results in processLoaderData"),Lt(g)){let y=g.error;d!==void 0&&(y=d,d=void 0),s=s||{};{let v=fo(e,f);s[v.route.id]==null&&(s[v.route.id]=y)}i[f]=void 0,l||(l=!0,a=Wu(g.error)?g.error.status:500),g.headers&&(u[f]=g.headers)}else Ir(g)?(r.set(f,g.deferredData),i[f]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(u[f]=g.headers)):(i[f]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(u[f]=g.headers))}),d!==void 0&&n&&(s={[n[0]]:d},i[n[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}function Wm(e,t,n,r,o,i,s){let{loaderData:a,errors:l}=XP(t,n,r,s);return o.forEach(u=>{let{key:d,match:c,controller:f}=u,g=i[d];if(ge(g,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if(Lt(g)){let y=fo(e.matches,c==null?void 0:c.route.id);l&&l[y.route.id]||(l=De({},l,{[y.route.id]:g.error})),e.fetchers.delete(d)}else if(mo(g))ge(!1,"Unhandled fetcher revalidation redirect");else if(Ir(g))ge(!1,"Unhandled fetcher deferred data");else{let y=gr(g.data);e.fetchers.set(d,y)}}),{loaderData:a,errors:l}}function qm(e,t,n,r){let o=De({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function Qm(e){return e?Lt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function fo(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Ym(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Pt(e,t){let{pathname:n,routeId:r,method:o,type:i,message:s}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new gu(e||500,a,new Error(l),!0)}function ll(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(mo(o))return{key:r,result:o}}}function Dw(e){let t=typeof e=="string"?no(e):e;return Oo(De({},t,{hash:""}))}function JP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function ZP(e){return Fw(e.result)&&LP.has(e.result.status)}function Ir(e){return e.type===Te.deferred}function Lt(e){return e.type===Te.error}function mo(e){return(e&&e.type)===Te.redirect}function Xm(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function e_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Fw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function t_(e){return FP.has(e.toLowerCase())}function fn(e){return IP.has(e.toLowerCase())}async function n_(e,t,n,r,o){let i=Object.entries(t);for(let s=0;s(f==null?void 0:f.route.id)===a);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id),c=d!=null&&!jw(d,u)&&(o&&o[u.route.id])!==void 0;Ir(l)&&c&&await fh(l,n,!1).then(f=>{f&&(t[a]=f)})}}async function r_(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===i)&&Ir(a)&&(ge(s,"Expected an AbortController for revalidating fetcher deferred result"),await fh(a,s.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function fh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Te.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Te.error,error:o}}return{type:Te.data,data:e.deferredData.data}}}function ph(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ks(e,t){let n=typeof t=="string"?no(t).search:t.search;if(e[e.length-1].route.index&&ph(n||""))return e[e.length-1];let r=Aw(e);return r[r.length-1]}function Jm(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function nd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function o_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ws(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function i_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function gr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function s_(e,t){try{let n=e.sessionStorage.getItem(Nw);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function a_(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(Nw,JSON.stringify(n))}catch(r){Ki(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let c=Gu(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Zn([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,s,i,e])}const u_=p.createContext(null);function c_(e){let t=p.useContext(Un).outlet;return t&&p.createElement(u_.Provider,{value:e},t)}function Bw(){let{matches:e}=p.useContext(Un),t=e[e.length-1];return t?t.params:{}}function Vw(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(ro),{matches:o}=p.useContext(Un),{pathname:i}=Uo(),s=JSON.stringify(Ku(o,r.v7_relativeSplatPath));return p.useMemo(()=>Gu(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function d_(e,t,n,r){Zi()||ge(!1);let{navigator:o}=p.useContext(ro),{matches:i}=p.useContext(Un),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Uo(),d;d=u;let c=d.pathname||"/",f=c;if(l!=="/"){let v=l.replace(/^\//,"").split("/");f="/"+c.replace(/^\//,"").split("/").slice(v.length).join("/")}let g=co(e,{pathname:f});return m_(g&&g.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:Zn([l,o.encodeLocation?o.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:Zn([l,o.encodeLocation?o.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r)}function f_(){let e=Gw(),t=Wu(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const p_=p.createElement(f_,null);class h_ extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Un.Provider,{value:this.props.routeContext},p.createElement($w.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function g_(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(qu);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Un.Provider,{value:t},r)}function m_(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let d=s.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);d>=0||ge(!1),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,c,f)=>{let g,y=!1,v=null,x=null;n&&(g=a&&c.route.id?a[c.route.id]:void 0,v=c.route.errorElement||p_,l&&(u<0&&f===0?(S_("route-fallback"),y=!0,x=null):u===f&&(y=!0,x=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,f+1)),m=()=>{let S;return g?S=v:y?S=x:c.route.Component?S=p.createElement(c.route.Component,null):c.route.element?S=c.route.element:S=d,p.createElement(g_,{match:c,routeContext:{outlet:d,matches:w,isDataRoute:n!=null},children:S})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?p.createElement(h_,{location:n.location,revalidation:n.revalidation,component:v,error:g,children:m(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):m()},null)}var Hw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Hw||{}),vu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(vu||{});function v_(e){let t=p.useContext(qu);return t||ge(!1),t}function y_(e){let t=p.useContext(Lw);return t||ge(!1),t}function w_(e){let t=p.useContext(Un);return t||ge(!1),t}function Kw(e){let t=w_(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}function Gw(){var e;let t=p.useContext($w),n=y_(vu.UseRouteError),r=Kw(vu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function x_(){let{router:e}=v_(Hw.UseNavigateStable),t=Kw(vu.UseNavigateStable),n=p.useRef(!1);return zw(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,mu({fromRouteId:t},i)))},[e,t])}const Zm={};function S_(e,t,n){Zm[e]||(Zm[e]=!0)}function C_(e){let{to:t,replace:n,state:r,relative:o}=e;Zi()||ge(!1);let{future:i,static:s}=p.useContext(ro),{matches:a}=p.useContext(Un),{pathname:l}=Uo(),u=_a(),d=Gu(t,Ku(a,i.v7_relativeSplatPath),l,o==="path"),c=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(c),{replace:n,state:r,relative:o}),[u,c,o,n,r]),null}function Ww(e){return c_(e.context)}function b_(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ye.Pop,navigator:i,static:s=!1,future:a}=e;Zi()&&ge(!1);let l=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:l,navigator:i,static:s,future:mu({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=no(r));let{pathname:d="/",search:c="",hash:f="",state:g=null,key:y="default"}=r,v=p.useMemo(()=>{let x=Ji(d,l);return x==null?null:{location:{pathname:x,search:c,hash:f,state:g,key:y},navigationType:o}},[l,d,c,f,g,y,o]);return v==null?null:p.createElement(ro.Provider,{value:u},p.createElement(hh.Provider,{children:n,value:v}))}new Promise(()=>{});function R_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ca(){return ca=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function P_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function __(e,t){return e.button===0&&(!t||t==="_self")&&!P_(e)}function _f(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function k_(e,t){let n=_f(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const M_=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],T_="6";try{window.__reactRouterVersion=T_}catch{}function A_(e,t){return BP({basename:t==null?void 0:t.basename,future:ca({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:fP({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||O_(),routes:e,mapRouteProperties:R_,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function O_(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ca({},t,{errors:N_(t.errors)})),t}function N_(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new gu(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const j_=p.createContext({isTransitioning:!1}),I_=p.createContext(new Map),D_="startTransition",ev=Ry[D_],F_="flushSync",tv=dP[F_];function L_(e){ev?ev(e):e()}function xs(e){tv?tv(e):e()}class $_{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function U_(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[s,a]=p.useState(),[l,u]=p.useState({isTransitioning:!1}),[d,c]=p.useState(),[f,g]=p.useState(),[y,v]=p.useState(),x=p.useRef(new Map),{v7_startTransition:w}=r||{},m=p.useCallback(k=>{w?L_(k):k()},[w]),S=p.useCallback((k,$)=>{let{deletedFetchers:R,flushSync:N,viewTransitionOpts:F}=$;R.forEach(E=>x.current.delete(E)),k.fetchers.forEach((E,M)=>{E.data!==void 0&&x.current.set(M,E.data)});let L=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!F||L){N?xs(()=>i(k)):m(()=>i(k));return}if(N){xs(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:F.currentLocation,nextLocation:F.nextLocation})});let E=n.window.document.startViewTransition(()=>{xs(()=>i(k))});E.finished.finally(()=>{xs(()=>{c(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),xs(()=>g(E));return}f?(d&&d.resolve(),f.skipTransition(),v({state:k,currentLocation:F.currentLocation,nextLocation:F.nextLocation})):(a(k),u({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}))},[n.window,f,d,x,m]);p.useLayoutEffect(()=>n.subscribe(S),[n,S]),p.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new $_)},[l]),p.useEffect(()=>{if(d&&s&&n.window){let k=s,$=d.promise,R=n.window.document.startViewTransition(async()=>{m(()=>i(k)),await $});R.finished.finally(()=>{c(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(R)}},[m,s,d,n.window]),p.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,f,o.location,s]),p.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),v(void 0))},[l.isTransitioning,y]),p.useEffect(()=>{},[]);let C=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:k=>n.navigate(k),push:(k,$,R)=>n.navigate(k,{state:$,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(k,$,R)=>n.navigate(k,{replace:!0,state:$,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),P=n.basename||"/",b=p.useMemo(()=>({router:n,navigator:C,static:!1,basename:P}),[n,C,P]),A=p.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return p.createElement(p.Fragment,null,p.createElement(qu.Provider,{value:b},p.createElement(Lw.Provider,{value:o},p.createElement(I_.Provider,{value:x.current},p.createElement(j_.Provider,{value:l},p.createElement(b_,{basename:P,location:o.location,navigationType:o.historyAction,navigator:C,future:A},o.initialized||n.future.v7_partialHydration?p.createElement(z_,{routes:n.routes,future:n.future,state:o}):t))))),null)}const z_=p.memo(B_);function B_(e){let{routes:t,future:n,state:r}=e;return d_(t,void 0,r,n)}const V_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Bs=p.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:d,viewTransition:c}=t,f=E_(t,M_),{basename:g}=p.useContext(ro),y,v=!1;if(typeof u=="string"&&H_.test(u)&&(y=u,V_))try{let S=new URL(window.location.href),C=u.startsWith("//")?new URL(S.protocol+u):new URL(u),P=Ji(C.pathname,g);C.origin===S.origin&&P!=null?u=P+C.search+C.hash:v=!0}catch{}let x=Uw(u,{relative:o}),w=K_(u,{replace:s,state:a,target:l,preventScrollReset:d,relative:o,viewTransition:c});function m(S){r&&r(S),S.defaultPrevented||w(S)}return p.createElement("a",ca({},f,{href:y||x,onClick:v||i?r:m,ref:n,target:l}))});var nv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(nv||(nv={}));var rv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(rv||(rv={}));function K_(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=_a(),u=Uo(),d=Vw(e,{relative:s});return p.useCallback(c=>{if(__(c,n)){c.preventDefault();let f=r!==void 0?r:Oo(u)===Oo(d);l(e,{replace:f,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,d,r,o,n,e,i,s,a])}function qw(e){let t=p.useRef(_f(e)),n=p.useRef(!1),r=Uo(),o=p.useMemo(()=>k_(r.search,n.current?null:t.current),[r.search]),i=_a(),s=p.useCallback((a,l)=>{const u=_f(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}var gh={},Qw={},ae={},mh={};Object.defineProperty(mh,"__esModule",{value:!0});class G_ extends Error{constructor(t){super(`${t.status} ${t.statusText} -URL: ${t.url}`),this.name="HttpError",this.response=t,this.statusCode=t.status,this.status=t.status,this.statusText=t.statusText}async parse(){if(!this.response.bodyUsed)try{const t=this.response.headers.get("content-type")||"text/plain";if(t.match(/\bjson\b/i)){let n=await this.response.json();n.error?(this.message+=` -`+n.error,n.error_description&&(this.message+=": "+n.error_description)):this.message+=` - -`+JSON.stringify(n,null,4)}else if(t.match(/^text\//i)){let n=await this.response.text();n&&(this.message+=` - -`+n)}}catch{}return this}toJSON(){return{name:this.name,statusCode:this.statusCode,status:this.status,statusText:this.statusText,message:this.message}}}mh.default=G_;var en={};Object.defineProperty(en,"__esModule",{value:!0});en.SMART_KEY=en.patientParams=en.fhirVersions=en.patientCompartment=void 0;en.patientCompartment=["Account","AdverseEvent","AllergyIntolerance","Appointment","AppointmentResponse","AuditEvent","Basic","BodySite","BodyStructure","CarePlan","CareTeam","ChargeItem","Claim","ClaimResponse","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Consent","Coverage","CoverageEligibilityRequest","CoverageEligibilityResponse","DetectedIssue","DeviceRequest","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","EligibilityRequest","Encounter","EnrollmentRequest","EpisodeOfCare","ExplanationOfBenefit","FamilyMemberHistory","Flag","Goal","Group","ImagingManifest","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationEvaluation","ImmunizationRecommendation","Invoice","List","MeasureReport","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationRequest","MedicationStatement","MolecularSequence","NutritionOrder","Observation","Order","Patient","Person","Procedure","ProcedureRequest","Provenance","QuestionnaireResponse","ReferralRequest","RelatedPerson","RequestGroup","ResearchSubject","RiskAssessment","Schedule","ServiceRequest","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];en.fhirVersions={"0.4.0":2,"0.5.0":2,"1.0.0":2,"1.0.1":2,"1.0.2":2,"1.1.0":3,"1.4.0":3,"1.6.0":3,"1.8.0":3,"3.0.0":3,"3.0.1":3,"3.3.0":4,"3.5.0":4,"4.0.0":4,"4.0.1":4};en.patientParams=["patient","subject","requester","member","actor","beneficiary"];en.SMART_KEY="SMART_KEY";var kf={exports:{}},rd,ov;function W_(){if(ov)return rd;ov=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,i=r*365.25;rd=function(d,c){c=c||{};var f=typeof d;if(f==="string"&&d.length>0)return s(d);if(f==="number"&&isFinite(d))return c.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function s(d){if(d=String(d),!(d.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(c){var f=parseFloat(c[1]),g=(c[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*i;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(d){var c=Math.abs(d);return c>=r?Math.round(d/r)+"d":c>=n?Math.round(d/n)+"h":c>=t?Math.round(d/t)+"m":c>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var c=Math.abs(d);return c>=r?u(d,c,r,"day"):c>=n?u(d,c,n,"hour"):c>=t?u(d,c,t,"minute"):c>=e?u(d,c,e,"second"):d+" ms"}function u(d,c,f,g){var y=c>=f*1.5;return Math.round(d/f)+" "+g+(y?"s":"")}return rd}function q_(e){n.debug=n,n.default=n,n.coerce=l,n.disable=i,n.enable=o,n.enabled=s,n.humanize=W_(),n.destroy=u,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let c=0;for(let f=0;f{if(b==="%%")return"%";C++;const k=n.formatters[A];if(typeof k=="function"){const $=x[C];b=k.call(w,$),x.splice(C,1),C--}return b}),n.formatArgs.call(w,x),(w.log||n.log).apply(w,x)}return v.namespace=d,v.useColors=n.useColors(),v.color=n.selectColor(d),v.extend=r,v.destroy=n.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==n.namespaces&&(g=n.namespaces,y=n.enabled(d)),y),set:x=>{f=x}}),typeof n.init=="function"&&n.init(v),v}function r(d,c){const f=n(this.namespace+(typeof c>"u"?":":c)+d);return f.log=this.log,f}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let c;const f=(typeof d=="string"?d:"").split(/[\s,]+/),g=f.length;for(c=0;c"-"+c)].join(",");return n.enable(""),d}function s(d){if(d[d.length-1]==="*")return!0;let c,f;for(c=0,f=n.skips.length;c{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;u.splice(1,0,d,"color: inherit");let c=0,f=0;u[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(c++,g==="%c"&&(f=c))}),u.splice(f,0,d)}t.log=console.debug||console.log||(()=>{});function i(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function s(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=Q_(t);const{formatters:l}=e.exports;l.j=function(u){try{return JSON.stringify(u)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(kf,kf.exports);var Y_=kf.exports,ul={exports:{}},iv;function vh(){return iv||(iv=1,function(e,t){var n=typeof self<"u"?self:Os,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(s){var a={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function c(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function f(E){return typeof E!="string"&&(E=String(E)),E}function g(E){var M={next:function(){var j=E.shift();return{done:j===void 0,value:j}}};return a.iterable&&(M[Symbol.iterator]=function(){return M}),M}function y(E){this.map={},E instanceof y?E.forEach(function(M,j){this.append(j,M)},this):Array.isArray(E)?E.forEach(function(M){this.append(M[0],M[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(M){this.append(M,E[M])},this)}y.prototype.append=function(E,M){E=c(E),M=f(M);var j=this.map[E];this.map[E]=j?j+", "+M:M},y.prototype.delete=function(E){delete this.map[c(E)]},y.prototype.get=function(E){return E=c(E),this.has(E)?this.map[E]:null},y.prototype.has=function(E){return this.map.hasOwnProperty(c(E))},y.prototype.set=function(E,M){this.map[c(E)]=f(M)},y.prototype.forEach=function(E,M){for(var j in this.map)this.map.hasOwnProperty(j)&&E.call(M,this.map[j],j,this)},y.prototype.keys=function(){var E=[];return this.forEach(function(M,j){E.push(j)}),g(E)},y.prototype.values=function(){var E=[];return this.forEach(function(M){E.push(M)}),g(E)},y.prototype.entries=function(){var E=[];return this.forEach(function(M,j){E.push([j,M])}),g(E)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function v(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function x(E){return new Promise(function(M,j){E.onload=function(){M(E.result)},E.onerror=function(){j(E.error)}})}function w(E){var M=new FileReader,j=x(M);return M.readAsArrayBuffer(E),j}function m(E){var M=new FileReader,j=x(M);return M.readAsText(E),j}function S(E){for(var M=new Uint8Array(E),j=new Array(M.length),V=0;V-1?M:E}function k(E,M){M=M||{};var j=M.body;if(E instanceof k){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,M.headers||(this.headers=new y(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!j&&E._bodyInit!=null&&(j=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new y(M.headers)),this.method=A(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(j)}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})};function $(E){var M=new FormData;return E.trim().split("&").forEach(function(j){if(j){var V=j.split("="),D=V.shift().replace(/\+/g," "),O=V.join("=").replace(/\+/g," ");M.append(decodeURIComponent(D),decodeURIComponent(O))}}),M}function R(E){var M=new y,j=E.replace(/\r?\n[\t ]+/g," ");return j.split(/\r?\n/).forEach(function(V){var D=V.split(":"),O=D.shift().trim();if(O){var B=D.join(":").trim();M.append(O,B)}}),M}P.call(k.prototype);function N(E,M){M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in M?M.statusText:"OK",this.headers=new y(M.headers),this.url=M.url||"",this._initBody(E)}P.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},N.error=function(){var E=new N(null,{status:0,statusText:""});return E.type="error",E};var F=[301,302,303,307,308];N.redirect=function(E,M){if(F.indexOf(M)===-1)throw new RangeError("Invalid status code");return new N(null,{status:M,headers:{location:E}})},s.DOMException=i.DOMException;try{new s.DOMException}catch{s.DOMException=function(M,j){this.message=M,this.name=j;var V=Error(M);this.stack=V.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function L(E,M){return new Promise(function(j,V){var D=new k(E,M);if(D.signal&&D.signal.aborted)return V(new s.DOMException("Aborted","AbortError"));var O=new XMLHttpRequest;function B(){O.abort()}O.onload=function(){var q={status:O.status,statusText:O.statusText,headers:R(O.getAllResponseHeaders()||"")};q.url="responseURL"in O?O.responseURL:q.headers.get("X-Request-URL");var te="response"in O?O.response:O.responseText;j(new N(te,q))},O.onerror=function(){V(new TypeError("Network request failed"))},O.ontimeout=function(){V(new TypeError("Network request failed"))},O.onabort=function(){V(new s.DOMException("Aborted","AbortError"))},O.open(D.method,D.url,!0),D.credentials==="include"?O.withCredentials=!0:D.credentials==="omit"&&(O.withCredentials=!1),"responseType"in O&&a.blob&&(O.responseType="blob"),D.headers.forEach(function(q,te){O.setRequestHeader(te,q)}),D.signal&&(D.signal.addEventListener("abort",B),O.onreadystatechange=function(){O.readyState===4&&D.signal.removeEventListener("abort",B)}),O.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return L.polyfill=!0,i.fetch||(i.fetch=L,i.Headers=y,i.Request=k,i.Response=N),s.Headers=y,s.Request=k,s.Response=N,s.fetch=L,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(ul,ul.exports)),ul.exports}var X_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);ot.length?JSON.parse(t):"")}ae.responseToJSON=Xw;function yu(e){if(!e)return e;if(Array.isArray(e))return e.map(n=>n&&typeof n=="object"?yu(n):n);let t={};return Object.keys(e).forEach(n=>{const r=n.toLowerCase(),o=e[n];t[r]=o&&typeof o=="object"?yu(o):o}),t}ae.loweCaseKeys=yu;function yh(e,t={}){const{includeResponse:n}=t,r=X_(t,["includeResponse"]);return tk(e,Object.assign(Object.assign({mode:"cors"},r),{headers:Object.assign({accept:"application/json"},yu(r.headers))})).then(Yw).then(o=>{const i=o.headers.get("content-type")+"";return i.match(/\bjson\b/i)?Xw(o).then(s=>({res:o,body:s})):i.match(/^text\//i)?o.text().then(s=>({res:o,body:s})):{res:o}}).then(({res:o,body:i})=>{if(!i&&o.status==201){const s=o.headers.get("location");if(s)return yh(s,Object.assign(Object.assign({},r),{method:"GET",body:null,includeResponse:n}))}return n?{body:i,response:o}:i===void 0?o:i})}ae.request=yh;function Jw(e,t,n=!1){return n||!cl[e]?(cl[e]=yh(e,t),cl[e]):Promise.resolve(cl[e])}ae.getAndCache=Jw;function nk(e="/",t){const n=String(e).replace(/\/*$/,"/")+"metadata";return Jw(n,t).catch(r=>{throw new Error(`Failed to fetch the conformance statement from "${n}". ${r}`)})}ae.fetchConformanceStatement=nk;function wh(e,t=""){if(t=t.trim(),!t)return e;let n=t.split("."),r=e;for(;r&&n.length;){const o=n.shift();if(!o&&Array.isArray(r))return r.map(i=>wh(i,n.join(".")));r=r[o]}return r}ae.getPath=wh;function rk(e,t,n,r=!1){return t.trim().split(".").reduce((o,i,s,a)=>{if(o&&s===a.length-1)o[i]=n;else return o&&o[i]===void 0&&r&&(o[i]=a[s+1].match(/^[0-9]+$/)?[]:{}),o?o[i]:void 0},e),e}ae.setPath=rk;function Zw(e){return Array.isArray(e)?e:[e]}ae.makeArray=Zw;function ok(e,t){return e.match(/^http/)||e.match(/^urn/)?e:String(t||"").replace(/\/+$/,"")+"/"+e.replace(/^\/+/,"")}ae.absolute=ok;function ik(e=8,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){const n=[],r=t.length;for(;e--;)n.push(t.charAt(Math.floor(Math.random()*r)));return n.join("")}ae.randomString=ik;function ex(e,t){const n=e.split(".")[1];return n?JSON.parse(t.atob(n)):null}ae.jwtDecode=ex;function sk(e=120,t){return Math.floor(+(t||new Date)/1e3+e)}ae.getTimeInFuture=sk;function ak(e,t){const n=Math.floor(Date.now()/1e3);if(e.expires_in)return n+e.expires_in;if(e.access_token){let r=ex(e.access_token,t);if(r&&r.exp)return r.exp}return n+300}ae.getAccessTokenExpiration=ak;function tx(e,t){const n={};function r(o,i){o&&Array.isArray(o.coding)&&o.coding.forEach(({code:s})=>{s&&(n[s]=n[s]||[],n[s].push(i))})}return Zw(e).forEach(o=>{o.resourceType==="Observation"&&o[t]&&(Array.isArray(o[t])?o[t].forEach(i=>r(i,o)):r(o[t],o))}),n}ae.byCode=tx;function lk(e,t){const n=tx(e,t);return(...r)=>r.filter(o=>o+""in n).reduce((o,i)=>o.concat(n[i+""]),[])}ae.byCodes=lk;function uk(e,t){const r=(wh(e,"rest.0.resource")||[]).find(i=>i.type===t);if(!r)throw new Error(`Resource "${t}" is not supported by this FHIR server`);if(!Array.isArray(r.searchParam))throw new Error(`No search parameters supported for "${t}" on this FHIR server`);if(t=="Patient"&&r.searchParam.find(i=>i.name=="_id"))return"_id";const o=Z_.patientParams.find(i=>r.searchParam.find(s=>s.name==i));if(!o)throw new Error("I don't know what param to use for "+t);return o}ae.getPatientParam=uk;async function ck(e,t=800,n=720){if(typeof e=="function"&&(e=await e()),e&&typeof e=="object")return e;if(typeof e!="string")return Ms("Invalid target type '%s'. Failing back to '_self'.",typeof e),self;if(e=="_self")return self;if(e=="_parent")return parent;if(e=="_top")return top||self;if(e=="_blank"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup"),!i)throw new Error("Perhaps window.open was blocked")}catch(s){o=s}return i||(Ms("Cannot open window. Failing back to '_self'. %s",o),self)}if(e=="popup"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup",["height="+n,"width="+t,"menubar=0","resizable=1","status=0","top="+(screen.height-n)/2,"left="+(screen.width-t)/2].join(",")),!i)throw new Error("Perhaps the popup window was blocked")}catch(s){o=s}return i||(Ms("Cannot open window. Failing back to '_self'. %s",o),self)}const r=frames[e];return r||(Ms("Unknown target '%s'. Failing back to '_self'.",e),self)}ae.getTargetWindow=ck;function _n(e,t){if(!e)throw new Error(t)}ae.assert=_n;function dk(e){_n(Array.isArray(e),"The JSON patch must be an array"),_n(e.length>0,"The JSON patch array should not be empty"),e.forEach(t=>{_n(["add","replace","test","move","copy","remove"].indexOf(t.op)>-1,'Each patch operation must have an "op" property which must be one of: "add", "replace", "test", "move", "copy", "remove"'),_n(t.path&&typeof t.path,`Invalid "${t.op}" operation. Missing "path" property`),t.op=="add"||t.op=="replace"||t.op=="test"?(_n("value"in t,`Invalid "${t.op}" operation. Missing "value" property`),_n(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):t.op=="move"||t.op=="copy"?(_n(typeof t.from=="string",`Invalid "${t.op}" operation. Requires a string "from" property`),_n(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):_n(Object.keys(t).length==2,`Invalid "${t.op}" operation. Contains unknown properties`)})}ae.assertJsonPatch=dk;var Qu={},xh={};Object.defineProperty(xh,"__esModule",{value:!0});xh.default={expired:"Session expired! Please re-launch the app",noScopeForId:"Trying to get the ID of the selected %s. Please add 'launch' or 'launch/%s' to the requested scopes and try again.",noIfNoAuth:"You are trying to get %s but the app is not authorized yet.",noFreeContext:"Please don't use open fhir servers if you need to access launch context items like the %S."};Object.defineProperty(Qu,"__esModule",{value:!0});const xe=ae,Pn=xh,Il=en,{Response:fk}=typeof FHIRCLIENT_PURE<"u"?window:vh(),jt=xe.debug.extend("client");async function pk(e,t){const n=(0,xe.absolute)("/",t.state.serverUrl);async function r(o){const i=o.pathname.split("/").pop();(0,xe.assert)(i,`Invalid url "${o}"`),(0,xe.assert)(Il.patientCompartment.indexOf(i)>-1,`Cannot filter "${i}" resources by patient`);const s=await(0,xe.fetchConformanceStatement)(t.state.serverUrl),a=(0,xe.getPatientParam)(s,i);return o.searchParams.set(a,t.patient.id),o.href}return typeof e=="string"||e instanceof URL?{url:await r(new URL(e+"",n))}:(e.url=await r(new URL(e.url+"",n)),e)}function hk(e,t,n,r){if(!t[e]){const{signal:o,headers:i}=r;t[e]=n.request({url:e,headers:i,signal:o}).then(s=>(t[e]=s,s),s=>{throw delete t[e],s})}return Promise.resolve(t[e])}function gk(e,t,n,r,o,i){const s=(0,xe.getPath)(e,t);if(s){const a=Array.isArray(s);return Promise.all((0,xe.makeArray)(s).filter(Boolean).map((l,u)=>{const d=l.reference;if(d)return hk(d,r,o,i).then(c=>{n&&(a?t.indexOf("..")>-1?(0,xe.setPath)(e,`${t.replace("..",`.${u}.`)}`,c):(0,xe.setPath)(e,`${t}.${u}`,c):(0,xe.setPath)(e,t,c))}).catch(c=>{if(c.status!==404)throw c})}))}}function sv(e,t,n,r,o){let i=(0,xe.makeArray)(t.resolveReferences).filter(Boolean).map(l=>String(l).trim()).filter(Boolean);if(i=i.filter((l,u)=>i.indexOf(l,u+1)>-1?(jt('Duplicated reference path "%s"',l),!1):!0),!i.length)return Promise.resolve();const s={};i.forEach(l=>{const u=l.split(".").length;s[u]||(s[u]=[]),s[u].push(l)});let a=Promise.resolve();return Object.keys(s).sort().forEach(l=>{const u=s[l];a=a.then(()=>Promise.all(u.map(d=>gk(e,d,!!t.graph,n,r,o))))}),a}class mk{constructor(t,n){this.units=xe.units;const r=typeof n=="string"?{serverUrl:n}:n;(0,xe.assert)(r.serverUrl&&r.serverUrl.match(/https?:\/\/.+/),'A "serverUrl" option is required and must begin with "http(s)"'),this.state=r,this.environment=t,this._refreshTask=null;const o=this;this.patient={get id(){return o.getPatientId()},read:i=>{const s=this.patient.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Patient/${s}`})):Promise.reject(new Error("Patient is not available"))},request:(i,s={})=>this.patient.id?(async()=>{const a=await pk(i,this);return this.request(a,s)})():Promise.reject(new Error("Patient is not available"))},this.encounter={get id(){return o.getEncounterId()},read:i=>{const s=this.encounter.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Encounter/${s}`})):Promise.reject(new Error("Encounter is not available"))}},this.user={get fhirUser(){return o.getFhirUser()},get id(){return o.getUserId()},get resourceType(){return o.getUserType()},read:i=>{const s=this.user.fhirUser;return s?this.request(Object.assign(Object.assign({},i),{url:s})):Promise.reject(new Error("User is not available"))}},this.connect(t.fhir)}connect(t){if(typeof t=="function"){const n={baseUrl:this.state.serverUrl.replace(/\/$/,"")},r=this.getState("tokenResponse.access_token");if(r)n.auth={token:r};else{const{username:i,password:s}=this.state;i&&s&&(n.auth={user:i,pass:s})}this.api=t(n);const o=this.getState("tokenResponse.patient");o&&(this.patient.api=t(Object.assign(Object.assign({},n),{patient:o})))}return this}getPatientId(){const t=this.state.tokenResponse;return t?t.patient?t.patient:((this.state.scope||"").match(/\blaunch(\/patient)?\b/)?jt("The ID of the selected patient is not available. Please check if your server supports that."):jt(Pn.default.noScopeForId,"patient","patient"),null):(this.state.authorizeUri?jt(Pn.default.noIfNoAuth,"the ID of the selected patient"):jt(Pn.default.noFreeContext,"selected patient"),null)}getEncounterId(){const t=this.state.tokenResponse;return t?t.encounter?t.encounter:((this.state.scope||"").match(/\blaunch(\/encounter)?\b/)?jt("The ID of the selected encounter is not available. Please check if your server supports that, and that the selected patient has any recorded encounters."):jt(Pn.default.noScopeForId,"encounter","encounter"),null):(this.state.authorizeUri?jt(Pn.default.noIfNoAuth,"the ID of the selected encounter"):jt(Pn.default.noFreeContext,"selected encounter"),null)}getIdToken(){const t=this.state.tokenResponse;if(t){const n=t.id_token,r=this.state.scope||"";if(!n){const o=r.match(/\bopenid\b/),i=r.match(/\bprofile\b/),s=r.match(/\bfhirUser\b/);return jt(!o||!(s||i)?"You are trying to get the id_token but you are not using the right scopes. Please add 'openid' and 'fhirUser' or 'profile' to the scopes you are requesting.":"The id_token is not available. Please check if your server supports that."),null}return(0,xe.jwtDecode)(n,this.environment)}return this.state.authorizeUri?jt(Pn.default.noIfNoAuth,"the id_token"):jt(Pn.default.noFreeContext,"id_token"),null}getFhirUser(){const t=this.getIdToken();return t?t.fhirUser?t.fhirUser.split("/").slice(-2).join("/"):t.profile:null}getUserId(){const t=this.getFhirUser();return t?t.split("/")[1]:null}getUserType(){const t=this.getFhirUser();return t?t.split("/")[0]:null}getAuthorizationHeader(){const t=this.getState("tokenResponse.access_token");if(t)return"Bearer "+t;const{username:n,password:r}=this.state;return n&&r?"Basic "+this.environment.btoa(n+":"+r):null}async _clearState(){const t=this.environment.getStorage(),n=await t.get(Il.SMART_KEY);n&&await t.unset(n),await t.unset(Il.SMART_KEY),this.state.tokenResponse={}}create(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}`,method:"POST",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}update(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}/${t.id}`,method:"PUT",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}delete(t,n={}){return this.request(Object.assign(Object.assign({},n),{url:t,method:"DELETE"}))}async patch(t,n,r={}){return(0,xe.assertJsonPatch)(n),this.request(Object.assign(Object.assign({},r),{url:t,method:"PATCH",body:JSON.stringify(n),headers:Object.assign({prefer:"return=presentation","content-type":"application/json-patch+json; charset=UTF-8"},r.headers)}))}async request(t,n={},r={}){var o;const i=xe.debug.extend("client:request");(0,xe.assert)(t,"request requires an url or request options as argument");let s;typeof t=="string"||t instanceof URL?(s=String(t),t={}):s=String(t.url),s=(0,xe.absolute)(s,this.state.serverUrl);const a={graph:n.graph!==!1,flat:!!n.flat,pageLimit:(o=n.pageLimit)!==null&&o!==void 0?o:1,resolveReferences:n.resolveReferences||[],useRefreshToken:n.useRefreshToken!==!1,onPage:typeof n.onPage=="function"?n.onPage:void 0},l=t.signal||void 0,u=a.useRefreshToken?this.refreshIfNeeded({signal:l}).then(()=>t):Promise.resolve(t);let d;return u.then(c=>{const f=this.getAuthorizationHeader();return f&&(c.headers=Object.assign(Object.assign({},c.headers),{authorization:f})),c}).then(c=>(i("%s, options: %O, fhirOptions: %O",s,c,a),(0,xe.request)(s,c).then(f=>c.includeResponse?(d=f.response,f.body):f))).catch(async c=>{throw c.status==401?this.getState("tokenResponse.access_token")?a.useRefreshToken?(i("Auto-refresh failed! Please re-launch the app."),await this._clearState(),c.message+=` -`+Pn.default.expired,c):(i("Your session has expired and the useRefreshToken option is set to false. Please re-launch the app."),await this._clearState(),c.message+=` -`+Pn.default.expired,c):(c.message+=` -This app cannot be accessed directly. Please launch it as SMART app!`,c):c}).catch(c=>{throw c.status==403&&i("Permission denied! Please make sure that you have requested the proper scopes."),c}).then(c=>!c||typeof c=="string"||c instanceof fk?t.includeResponse?{body:c,response:d}:c:(async f=>(f.resourceType=="Bundle"?await Promise.all((f.entry||[]).map(g=>sv(g.resource,a,r,this,t))):await sv(f,a,r,this,t),f))(c).then(async f=>{if(f&&f.resourceType=="Bundle"){const g=f.link||[];if(a.flat&&(f=(f.entry||[]).map(y=>y.resource)),a.onPage&&await a.onPage(f,Object.assign({},r)),--a.pageLimit){const y=g.find(v=>v.relation=="next");if(f=(0,xe.makeArray)(f),y&&y.url){const v=await this.request({url:y.url,signal:l},a,r);return a.onPage?null:a.resolveReferences.length?(Object.assign(r,v.references),f.concat((0,xe.makeArray)(v.data||v))):f.concat((0,xe.makeArray)(v))}}}return f}).then(f=>{if(a.graph)r={};else if(!a.onPage&&a.resolveReferences.length)return{data:f,references:r};return f}).then(f=>t.includeResponse?{body:f,response:d}:f))}refreshIfNeeded(t={}){const n=this.getState("tokenResponse.access_token"),r=this.getState("tokenResponse.refresh_token"),o=this.state.expiresAt||0;return n&&r&&o-10-1,u=a.search(/\bonline_access\b/)>-1;if((0,xe.assert)(l||u,"Unable to refresh. No offline_access or online_access scope found."),!this._refreshTask){const d=Object.assign(Object.assign({credentials:this.environment.options.refreshTokenWithCredentials||"same-origin"},t),{method:"POST",mode:"cors",headers:Object.assign(Object.assign({},t.headers||{}),{"content-type":"application/x-www-form-urlencoded"}),body:`grant_type=refresh_token&refresh_token=${encodeURIComponent(i)}`});if(!("authorization"in d.headers)){const{clientSecret:c,clientId:f}=this.state;c&&(d.headers.authorization="Basic "+this.environment.btoa(f+":"+c))}this._refreshTask=(0,xe.request)(s,d).then(c=>((0,xe.assert)(c.access_token,"No access token received"),o("Received new access token response %O",c),this.state.tokenResponse=Object.assign(Object.assign({},this.state.tokenResponse),c),this.state.expiresAt=(0,xe.getAccessTokenExpiration)(c,this.environment),this.state)).catch(c=>{var f,g;throw!((g=(f=this.state)===null||f===void 0?void 0:f.tokenResponse)===null||g===void 0)&&g.refresh_token&&(o("Deleting the expired or invalid refresh token."),delete this.state.tokenResponse.refresh_token),c}).finally(()=>{this._refreshTask=null;const c=this.state.key;c?this.environment.getStorage().set(c,this.state):o("No 'key' found in Clint.state. Cannot persist the instance.")})}return this._refreshTask}byCode(t,n){return(0,xe.byCode)(t,n)}byCodes(t,n){return(0,xe.byCodes)(t,n)}getPath(t,n=""){return(0,xe.getPath)(t,n)}getState(t=""){return(0,xe.getPath)(Object.assign({},this.state),t)}getFhirVersion(){return(0,xe.fetchConformanceStatement)(this.state.serverUrl).then(t=>t.fhirVersion)}getFhirRelease(){return this.getFhirVersion().then(t=>{var n;return(n=Il.fhirVersions[t])!==null&&n!==void 0?n:0})}}Qu.default=mk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.init=e.buildTokenRequest=e.ready=e.onMessage=e.isInPopUp=e.isInFrame=e.authorize=e.getSecurityExtensions=e.fetchWellKnownJson=e.KEY=void 0;const t=ae,n=Qu,r=en;Object.defineProperty(e,"KEY",{enumerable:!0,get:function(){return r.SMART_KEY}});const o=t.debug.extend("oauth2");function i(){return typeof window=="object"}function s(m="/",S){const C=String(m).replace(/\/*$/,"/")+".well-known/smart-configuration";return(0,t.getAndCache)(C,S).catch(P=>{throw new Error(`Failed to fetch the well-known json "${C}". ${P.message}`)})}e.fetchWellKnownJson=s;function a(m="/",S){return s(m,S).then(C=>{if(!C.authorization_endpoint||!C.token_endpoint)throw new Error("Invalid wellKnownJson");return{registrationUri:C.registration_endpoint||"",authorizeUri:C.authorization_endpoint,tokenUri:C.token_endpoint,codeChallengeMethods:C.code_challenge_methods_supported||[]}})}function l(m="/",S){return(0,t.fetchConformanceStatement)(m,S).then(C=>{const P="http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris",b=((0,t.getPath)(C||{},"rest.0.security.extension")||[]).filter(k=>k.url===P).map(k=>k.extension)[0],A={registrationUri:"",authorizeUri:"",tokenUri:"",codeChallengeMethods:[]};return b&&b.forEach(k=>{k.url==="register"&&(A.registrationUri=k.valueUri),k.url==="authorize"&&(A.authorizeUri=k.valueUri),k.url==="token"&&(A.tokenUri=k.valueUri)}),A})}function u(m="/"){return a(m).catch(()=>l(m))}e.getSecurityExtensions=u;async function d(m,S={}){const C=m.getUrl();if(Array.isArray(S)){const Le=C.searchParams.get("iss")||C.searchParams.get("fhirServiceUrl");if(!Le)throw new Error('Passing in an "iss" url parameter is required if authorize uses multiple configurations');const nt=S.find(an=>{if(an.issMatch){if(typeof an.issMatch=="function")return!!an.issMatch(Le);if(typeof an.issMatch=="string")return an.issMatch===Le;if(an.issMatch instanceof RegExp)return an.issMatch.test(Le)}return!1});return(0,t.assert)(nt,`No configuration found matching the current "iss" parameter "${Le}"`),await d(m,nt)}const{clientSecret:P,fakeTokenResponse:b,encounterId:A,target:k,width:$,height:R,pkceMode:N,clientPublicKeySetUrl:F,redirect_uri:L,client_id:E}=S;let{iss:M,launch:j,patientId:V,fhirServiceUrl:D,redirectUri:O,noRedirect:B,scope:q="",clientId:te,completeInTarget:fe,clientPrivateJwk:he}=S;const z=m.getStorage();M=C.searchParams.get("iss")||M,D=C.searchParams.get("fhirServiceUrl")||D,j=C.searchParams.get("launch")||j,V=C.searchParams.get("patientId")||V,te=C.searchParams.get("clientId")||te,te||(te=E),O||(O=L),O?O.match(/^https?\:\/\//)||(O=m.relative(O)):O=m.relative(".");const G=String(M||D||"");if(!G)throw new Error("No server url found. It must be specified as `iss` or as `fhirServiceUrl` parameter");if(M&&o("Making %s launch...",j?"EHR":"standalone"),j&&!q.match(/launch/)&&(q+=" launch"),i()){const Le=f(),nt=g();(Le||nt)&&fe!==!0&&fe!==!1&&(fe=Le,console.warn('Your app is being authorized from within an iframe or popup window. Please be explicit and provide a "completeInTarget" option. Use "true" to complete the authorization in the same window, or "false" to try to complete it in the parent or the opener window. See http://docs.smarthealthit.org/client-js/api.html'))}const pe=await z.get(r.SMART_KEY);await z.unset(pe);const ke=(0,t.randomString)(16),ye={clientId:te,scope:q,redirectUri:O,serverUrl:G,clientSecret:P,clientPrivateJwk:he,tokenResponse:{},key:ke,completeInTarget:fe,clientPublicKeySetUrl:F};(i()?(0,t.getPath)(m,"options.fullSessionStorageSupport"):!0)&&await z.set(r.SMART_KEY,ke),b&&Object.assign(ye.tokenResponse,b),V&&Object.assign(ye.tokenResponse,{patient:V}),A&&Object.assign(ye.tokenResponse,{encounter:A});let Se=O+"?state="+encodeURIComponent(ke);if(D&&!M)return o("Making fake launch..."),await z.set(ke,ye),B?Se:await m.redirect(Se);const it=await u(G);if(Object.assign(ye,it),await z.set(ke,ye),!ye.authorizeUri)return B?Se:await m.redirect(Se);const Nt=["response_type=code","client_id="+encodeURIComponent(te||""),"scope="+encodeURIComponent(q),"redirect_uri="+encodeURIComponent(O),"aud="+encodeURIComponent(G),"state="+encodeURIComponent(ke)];if(j&&Nt.push("launch="+encodeURIComponent(j)),c(it.codeChallengeMethods.includes("S256"),N)){let Le=await m.security.generatePKCEChallenge();Object.assign(ye,Le),await z.set(ke,ye),Nt.push("code_challenge="+ye.codeChallenge),Nt.push("code_challenge_method=S256")}if(Se=ye.authorizeUri+"?"+Nt.join("&"),B)return Se;if(k&&i()){let Le;if(Le=await(0,t.getTargetWindow)(k,$,R),Le!==self)try{Le.sessionStorage.removeItem(pe),Le.sessionStorage.setItem(ke,JSON.stringify(ye))}catch(nt){(0,t.debug)('Failed to modify window.sessionStorage. Perhaps it is from different origin?. Failing back to "_self". %s',nt),Le=self}if(Le!==self)try{Le.location.href=Se,self.addEventListener("message",y)}catch(nt){(0,t.debug)('Failed to modify window.location. Perhaps it is from different origin?. Failing back to "_self". %s',nt),self.location.href=Se}else self.location.href=Se;return}else return await m.redirect(Se)}e.authorize=d;function c(m,S){if(S==="disabled")return!1;if(S==="unsafeV1")return!0;if(S==="required"){if(!m)throw new Error("Required PKCE code challenge method (`S256`) was not found in the server's codeChallengeMethods declaration.");return!0}return m}function f(){try{return self!==top&&parent!==self}catch{return!0}}e.isInFrame=f;function g(){try{return self===top&&!!opener&&opener!==self&&!!window.name}catch{return!1}}e.isInPopUp=g;function y(m){m.data.type=="completeAuth"&&m.origin===new URL(self.location.href).origin&&(window.removeEventListener("message",y),window.location.href=m.data.url)}e.onMessage=y;async function v(m,S={}){var C,P;const b=m.getUrl(),A=m.getStorage(),k=b.searchParams;let $=k.get("state");const R=k.get("code"),N=k.get("error"),F=k.get("error_description");if($||($=await A.get(r.SMART_KEY)),N||F)throw new Error([N,F].filter(Boolean).join(": "));o("key: %s, code: %s",$,R),(0,t.assert)($,"No 'state' parameter found. Please (re)launch the app.");let L=await A.get($);const E=i()?(0,t.getPath)(m,"options.fullSessionStorageSupport"):!0;if(i()&&L&&!L.completeInTarget){const D=f(),O=g();if((D||O)&&!b.searchParams.get("complete")){b.searchParams.set("complete","1");const{href:B,origin:q}=b;return D&&parent.postMessage({type:"completeAuth",url:B},q),O&&(opener.postMessage({type:"completeAuth",url:B},q),window.close()),new Promise(()=>{})}}b.searchParams.delete("complete");const M=k.has("state");if(i()&&(0,t.getPath)(m,"options.replaceBrowserHistory")&&(R||M)&&(R&&(k.delete("code"),o("Removed code parameter from the url.")),M&&E&&(k.delete("state"),o("Removed state parameter from the url.")),window.history.replaceState&&window.history.replaceState({},"",b.href)),(0,t.assert)(L,"No state found! Please (re)launch the app."),!(!R||((C=L.tokenResponse)===null||C===void 0?void 0:C.access_token))&&L.tokenUri){(0,t.assert)(R,"'code' url parameter is required"),o("Preparing to exchange the code for access token...");const D=await x(m,{code:R,state:L,clientPublicKeySetUrl:S.clientPublicKeySetUrl,privateKey:S.privateKey||L.clientPrivateJwk});o("Token request options: %O",D);const O=await(0,t.request)(L.tokenUri,D);o("Token response: %O",O),(0,t.assert)(O.access_token,"Failed to obtain access token."),L.expiresAt=(0,t.getAccessTokenExpiration)(O,m),L=Object.assign(Object.assign({},L),{tokenResponse:O}),await A.set($,L),o("Authorization successful!")}else o(!((P=L.tokenResponse)===null||P===void 0)&&P.access_token?"Already authorized":"No authorization needed");E&&await A.set(r.SMART_KEY,$);const V=new n.default(m,L);return o("Created client instance: %O",V),V}e.ready=v;async function x(m,{code:S,state:C,clientPublicKeySetUrl:P,privateKey:b}){const{redirectUri:A,clientSecret:k,tokenUri:$,clientId:R,codeVerifier:N}=C;(0,t.assert)(A,"Missing state.redirectUri"),(0,t.assert)($,"Missing state.tokenUri"),(0,t.assert)(R,"Missing state.clientId");const F={method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:`code=${S}&grant_type=authorization_code&redirect_uri=${encodeURIComponent(A)}`};if(k)F.headers.authorization="Basic "+m.btoa(R+":"+k),o("Using state.clientSecret to construct the authorization header: %s",F.headers.authorization);else if(b){const L="key"in b?b.key:await m.security.importJWK(b),E={typ:"JWT",kid:b.kid,jku:P||C.clientPublicKeySetUrl},M={iss:R,sub:R,aud:$,jti:m.base64urlencode(m.security.randomBytes(32)),exp:(0,t.getTimeInFuture)(120)},j=await m.security.signCompactJws(b.alg,L,E,M);F.body+=`&client_assertion_type=${encodeURIComponent("urn:ietf:params:oauth:client-assertion-type:jwt-bearer")}`,F.body+=`&client_assertion=${encodeURIComponent(j)}`,o("Using state.clientPrivateJwk to add a client_assertion to the POST body")}else o("Public client detected; adding state.clientId to the POST body"),F.body+=`&client_id=${encodeURIComponent(R)}`;return N&&(o("Found state.codeVerifier, adding to the POST body"),F.body+="&code_verifier="+N),F}e.buildTokenRequest=x;async function w(m,S,C){const P=m.getUrl(),b=P.searchParams.get("code"),A=P.searchParams.get("state");if(b&&A)return v(m,C);const k=m.getStorage(),$=A||await k.get(r.SMART_KEY),R=await k.get($);return R?new n.default(m,R):d(m,S).then(()=>new Promise(()=>{}))}e.init=w})(Qw);var Sh={};Object.defineProperty(Sh,"__esModule",{value:!0});class vk{async get(t){const n=sessionStorage[t];return n?JSON.parse(n):null}async set(t,n){return sessionStorage[t]=JSON.stringify(n),n}async unset(t){return t in sessionStorage?(delete sessionStorage[t],!0):!1}}Sh.default=vk;var Jt={},nx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:typeof window<"u"?window:Os,function(){var n="3.7.7",r=n,o=typeof Buffer=="function",i=typeof TextDecoder=="function"?new TextDecoder:void 0,s=typeof TextEncoder=="function"?new TextEncoder:void 0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=Array.prototype.slice.call(a),u=function(z){var G={};return z.forEach(function(pe,ke){return G[pe]=ke}),G}(l),d=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(z){return new Uint8Array(Array.prototype.slice.call(z,0))},g=function(z){return z.replace(/=/g,"").replace(/[+\/]/g,function(G){return G=="+"?"-":"_"})},y=function(z){return z.replace(/[^A-Za-z0-9\+\/]/g,"")},v=function(z){for(var G,pe,ke,ye,tt="",Se=z.length%3,it=0;it255||(ke=z.charCodeAt(it++))>255||(ye=z.charCodeAt(it++))>255)throw new TypeError("invalid character found");G=pe<<16|ke<<8|ye,tt+=l[G>>18&63]+l[G>>12&63]+l[G>>6&63]+l[G&63]}return Se?tt.slice(0,Se-3)+"===".substring(Se):tt},x=typeof btoa=="function"?function(z){return btoa(z)}:o?function(z){return Buffer.from(z,"binary").toString("base64")}:v,w=o?function(z){return Buffer.from(z).toString("base64")}:function(z){for(var G=4096,pe=[],ke=0,ye=z.length;ke>>6)+c(128|G&63):c(224|G>>>12&15)+c(128|G>>>6&63)+c(128|G&63)}else{var G=65536+(z.charCodeAt(0)-55296)*1024+(z.charCodeAt(1)-56320);return c(240|G>>>18&7)+c(128|G>>>12&63)+c(128|G>>>6&63)+c(128|G&63)}},C=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,P=function(z){return z.replace(C,S)},b=o?function(z){return Buffer.from(z,"utf8").toString("base64")}:s?function(z){return w(s.encode(z))}:function(z){return x(P(z))},A=function(z,G){return G===void 0&&(G=!1),G?g(b(z)):b(z)},k=function(z){return A(z,!0)},$=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(z){switch(z.length){case 4:var G=(7&z.charCodeAt(0))<<18|(63&z.charCodeAt(1))<<12|(63&z.charCodeAt(2))<<6|63&z.charCodeAt(3),pe=G-65536;return c((pe>>>10)+55296)+c((pe&1023)+56320);case 3:return c((15&z.charCodeAt(0))<<12|(63&z.charCodeAt(1))<<6|63&z.charCodeAt(2));default:return c((31&z.charCodeAt(0))<<6|63&z.charCodeAt(1))}},N=function(z){return z.replace($,R)},F=function(z){if(z=z.replace(/\s+/g,""),!d.test(z))throw new TypeError("malformed base64.");z+="==".slice(2-(z.length&3));for(var G,pe="",ke,ye,tt=0;tt>16&255):ye===64?c(G>>16&255,G>>8&255):c(G>>16&255,G>>8&255,G&255);return pe},L=typeof atob=="function"?function(z){return atob(y(z))}:o?function(z){return Buffer.from(z,"base64").toString("binary")}:F,E=o?function(z){return f(Buffer.from(z,"base64"))}:function(z){return f(L(z).split("").map(function(G){return G.charCodeAt(0)}))},M=function(z){return E(V(z))},j=o?function(z){return Buffer.from(z,"base64").toString("utf8")}:i?function(z){return i.decode(E(z))}:function(z){return N(L(z))},V=function(z){return y(z.replace(/[-_]/g,function(G){return G=="-"?"+":"/"}))},D=function(z){return j(V(z))},O=function(z){if(typeof z!="string")return!1;var G=z.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(G)||!/[^\s0-9a-zA-Z\-_]/.test(G)},B=function(z){return{value:z,enumerable:!1,writable:!0,configurable:!0}},q=function(){var z=function(G,pe){return Object.defineProperty(String.prototype,G,B(pe))};z("fromBase64",function(){return D(this)}),z("toBase64",function(G){return A(this,G)}),z("toBase64URI",function(){return A(this,!0)}),z("toBase64URL",function(){return A(this,!0)}),z("toUint8Array",function(){return M(this)})},te=function(){var z=function(G,pe){return Object.defineProperty(Uint8Array.prototype,G,B(pe))};z("toBase64",function(G){return m(this,G)}),z("toBase64URI",function(){return m(this,!0)}),z("toBase64URL",function(){return m(this,!0)})},fe=function(){q(),te()},he={version:n,VERSION:r,atob:L,atobPolyfill:F,btoa:x,btoaPolyfill:v,fromBase64:D,toBase64:A,encode:A,encodeURI:k,encodeURL:k,utob:P,btou:N,decode:D,isValid:O,fromUint8Array:m,toUint8Array:M,extendString:q,extendUint8Array:te,extendBuiltins:fe};return he.Base64={},Object.keys(he).forEach(function(z){return he.Base64[z]=he[z]}),he})})(nx);var rx=nx.exports;/** - * @file Web Cryptography API shim - * @author Artem S Vybornov - * @license MIT - */(function(e,t){typeof define=="function"&&define.amd?define([],function(){return t(e)}):typeof Vl=="object"&&Vl.exports?Vl.exports=t(e):t(e)})(typeof self<"u"?self:void 0,function(e){if(typeof Promise!="function")throw"Promise support required";var t=e.crypto||e.msCrypto;if(!t)return;var n=t.subtle||t.webkitSubtle;if(!n)return;var r=e.Crypto||t.constructor||Object,o=e.SubtleCrypto||n.constructor||Object;e.CryptoKey||e.Key;var i=e.navigator.userAgent.indexOf("Edge/")>-1,s=!!e.msCrypto&&!i,a=!t.subtle&&!!t.webkitSubtle;if(!s&&!a)return;function l(R){return btoa(R).replace(/\=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(R){return R+="===",R=R.slice(0,-R.length%4),atob(R.replace(/-/g,"+").replace(/_/g,"/"))}function d(R){for(var N=new Uint8Array(R.length),F=0;F2&&(F=!0,N.shift());var L={ext:!0};switch(N[0][0]){case"1.2.840.113549.1.1.1":var E=["n","e","d","p","q","dp","dq","qi"],M=C(N[1]);F&&M.shift();for(var j=0;j2&&(L=!0,M.unshift(new Uint8Array([0]))),F[0][0]="1.2.840.113549.1.1.1",N=M;break;default:throw new TypeError("Unsupported key type")}return F.push(new Uint8Array(P(N)).buffer),L?F.unshift(new Uint8Array([0])):F[1]={tag:3,value:F[1]},new Uint8Array(P(F)).buffer}var m={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},S={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};function C(R,N){if(R instanceof ArrayBuffer&&(R=new Uint8Array(R)),N||(N={pos:0,end:R.length}),N.end-N.pos<2||N.end>R.length)throw new RangeError("Malformed DER");var F=R[N.pos++],L=R[N.pos++];if(L>=128){if(L&=127,N.end-N.pos=128){var V=L,L=4;for(N.splice(E,0,V>>24&255,V>>16&255,V>>8&255,V&255);L>1&&!(V>>24);)V<<=8,L--;L<4&&N.splice(E,4-L),L|=128}return N.splice(E-2,2,F,L),N}function b(R,N,F,L){Object.defineProperties(this,{_key:{value:R},type:{value:R.type,enumerable:!0},extractable:{value:F===void 0?R.extractable:F,enumerable:!0},algorithm:{value:N===void 0?R.algorithm:N,enumerable:!0},usages:{value:L===void 0?R.usages:L,enumerable:!0}})}function A(R){return R==="verify"||R==="encrypt"||R==="wrapKey"}function k(R){return R==="sign"||R==="decrypt"||R==="unwrapKey"}if(["generateKey","importKey","unwrapKey"].forEach(function(R){var N=n[R];n[R]=function(F,L,E){var M=[].slice.call(arguments),j,V,D;switch(R){case"generateKey":j=f(F),V=L,D=E;break;case"importKey":j=f(E),V=M[3],D=M[4],F==="jwk"&&(L=y(L),L.alg||(L.alg=g(j)),L.key_ops||(L.key_ops=L.kty!=="oct"?"d"in L?D.filter(k):D.filter(A):D.slice()),M[1]=v(L));break;case"unwrapKey":j=M[4],V=M[5],D=M[6],M[2]=E._key;break}if(R==="generateKey"&&j.name==="HMAC"&&j.hash)return j.length=j.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[j.hash.name],n.importKey("raw",t.getRandomValues(new Uint8Array(j.length+7>>3)),j,V,D);if(a&&R==="generateKey"&&j.name==="RSASSA-PKCS1-v1_5"&&(!j.modulusLength||j.modulusLength>=2048))return F=f(F),F.name="RSAES-PKCS1-v1_5",delete F.hash,n.generateKey(F,!0,["encrypt","decrypt"]).then(function(B){return Promise.all([n.exportKey("jwk",B.publicKey),n.exportKey("jwk",B.privateKey)])}).then(function(B){return B[0].alg=B[1].alg=g(j),B[0].key_ops=D.filter(A),B[1].key_ops=D.filter(k),Promise.all([n.importKey("jwk",B[0],j,!0,B[0].key_ops),n.importKey("jwk",B[1],j,V,B[1].key_ops)])}).then(function(B){return{publicKey:B[0],privateKey:B[1]}});if((a||s&&(j.hash||{}).name==="SHA-1")&&R==="importKey"&&F==="jwk"&&j.name==="HMAC"&&L.kty==="oct")return n.importKey("raw",d(u(L.k)),E,M[3],M[4]);if(a&&R==="importKey"&&(F==="spki"||F==="pkcs8"))return n.importKey("jwk",x(L),E,M[3],M[4]);if(s&&R==="unwrapKey")return n.decrypt(M[3],E,L).then(function(B){return n.importKey(F,B,M[4],M[5],M[6])});var O;try{O=N.apply(n,M)}catch(B){return Promise.reject(B)}return s&&(O=new Promise(function(B,q){O.onabort=O.onerror=function(te){q(te)},O.oncomplete=function(te){B(te.target.result)}})),O=O.then(function(B){return j.name==="HMAC"&&(j.length||(j.length=8*B.algorithm.length)),j.name.search("RSA")==0&&(j.modulusLength||(j.modulusLength=(B.publicKey||B).algorithm.modulusLength),j.publicExponent||(j.publicExponent=(B.publicKey||B).algorithm.publicExponent)),B.publicKey&&B.privateKey?B={publicKey:new b(B.publicKey,j,V,D.filter(A)),privateKey:new b(B.privateKey,j,V,D.filter(k))}:B=new b(B,j,V,D),B}),O}}),["exportKey","wrapKey"].forEach(function(R){var N=n[R];n[R]=function(F,L,E){var M=[].slice.call(arguments);switch(R){case"exportKey":M[1]=L._key;break;case"wrapKey":M[1]=L._key,M[2]=E._key;break}if((a||s&&(L.algorithm.hash||{}).name==="SHA-1")&&R==="exportKey"&&F==="jwk"&&L.algorithm.name==="HMAC"&&(M[0]="raw"),a&&R==="exportKey"&&(F==="spki"||F==="pkcs8")&&(M[0]="jwk"),s&&R==="wrapKey")return n.exportKey(F,L).then(function(V){return F==="jwk"&&(V=d(unescape(encodeURIComponent(JSON.stringify(y(V)))))),n.encrypt(M[3],E,V)});var j;try{j=N.apply(n,M)}catch(V){return Promise.reject(V)}return s&&(j=new Promise(function(V,D){j.onabort=j.onerror=function(O){D(O)},j.oncomplete=function(O){V(O.target.result)}})),R==="exportKey"&&F==="jwk"&&(j=j.then(function(V){return(a||s&&(L.algorithm.hash||{}).name==="SHA-1")&&L.algorithm.name==="HMAC"?{kty:"oct",alg:g(L.algorithm),key_ops:L.usages.slice(),ext:!0,k:l(c(V))}:(V=y(V),V.alg||(V.alg=g(L.algorithm)),V.key_ops||(V.key_ops=L.type==="public"?L.usages.filter(A):L.type==="private"?L.usages.filter(k):L.usages.slice()),V)})),a&&R==="exportKey"&&(F==="spki"||F==="pkcs8")&&(j=j.then(function(V){return V=w(y(V)),V})),j}}),["encrypt","decrypt","sign","verify"].forEach(function(R){var N=n[R];n[R]=function(F,L,E,M){if(s&&(!E.byteLength||M&&!M.byteLength))throw new Error("Empy input is not allowed");var j=[].slice.call(arguments),V=f(F);if(s&&R==="decrypt"&&V.name==="AES-GCM"){var D=F.tagLength>>3;j[2]=(E.buffer||E).slice(0,E.byteLength-D),F.tag=(E.buffer||E).slice(E.byteLength-D)}j[1]=L._key;var O;try{O=N.apply(n,j)}catch(B){return Promise.reject(B)}return s&&(O=new Promise(function(B,q){O.onabort=O.onerror=function(te){q(te)},O.oncomplete=function(fe){var fe=fe.target.result;if(R==="encrypt"&&fe instanceof AesGcmEncryptResult){var he=fe.ciphertext,z=fe.tag;fe=new Uint8Array(he.byteLength+z.byteLength),fe.set(new Uint8Array(he),0),fe.set(new Uint8Array(z),he.byteLength),fe=fe.buffer}B(fe)}})),O}}),s){var $=n.digest;n.digest=function(R,N){if(!N.byteLength)throw new Error("Empy input is not allowed");var F;try{F=$.call(n,R,N)}catch(L){return Promise.reject(L)}return F=new Promise(function(L,E){F.onabort=F.onerror=function(M){E(M)},F.oncomplete=function(M){L(M.target.result)}}),F},e.crypto=Object.create(t,{getRandomValues:{value:function(R){return t.getRandomValues(R)}},subtle:{value:n}}),e.CryptoKey=b}a&&(t.subtle=n,e.Crypto=r,e.SubtleCrypto=o,e.CryptoKey=b)});const yk=window.crypto,wk=Object.freeze(Object.defineProperty({__proto__:null,default:yk},Symbol.toStringTag,{value:"Module"})),xk=$b(wk);Object.defineProperty(Jt,"__esModule",{value:!0});Jt.signCompactJws=Jt.importJWK=Jt.generatePKCEChallenge=Jt.digestSha256=Jt.randomBytes=void 0;const Vs=rx,Mf=typeof globalThis=="object"&&globalThis.crypto?globalThis.crypto:xk.default,Ch=()=>{if(!Mf.subtle)throw globalThis.isSecureContext?new Error("Some of the required subtle crypto functionality is not available in the current environment (no crypto.subtle)"):new Error("Some of the required subtle crypto functionality is not available unless you run this app in secure context (using HTTPS or running locally). See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts");return Mf.subtle},Sk={ES384:{name:"ECDSA",namedCurve:"P-384"},RS384:{name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-384"}}};function ox(e){return Mf.getRandomValues(new Uint8Array(e))}Jt.randomBytes=ox;async function ix(e){const t=new TextEncoder().encode(e),n=await Ch().digest("SHA-256",t);return new Uint8Array(n)}Jt.digestSha256=ix;const Ck=async(e=96)=>{const t=ox(e),n=(0,Vs.fromUint8Array)(t,!0);return{codeChallenge:(0,Vs.fromUint8Array)(await ix(n),!0),codeVerifier:n}};Jt.generatePKCEChallenge=Ck;async function bk(e){if(!e.alg)throw new Error('The "alg" property of the JWK must be set to "ES384" or "RS384"');if(Array.isArray(e.key_ops)||(e.key_ops=["sign"]),!e.key_ops.includes("sign"))throw new Error('The "key_ops" property of the JWK does not contain "sign"');try{return await Ch().importKey("jwk",e,Sk[e.alg],e.ext===!0,e.key_ops)}catch(t){throw new Error(`The ${e.alg} is not supported by this browser: ${t}`)}}Jt.importJWK=bk;async function Rk(e,t,n,r){const o=JSON.stringify(Object.assign(Object.assign({},n),{alg:e})),i=JSON.stringify(r),s=`${(0,Vs.encodeURL)(o)}.${(0,Vs.encodeURL)(i)}`,a=await Ch().sign(Object.assign(Object.assign({},t.algorithm),{hash:"SHA-384"}),t,new TextEncoder().encode(s));return`${s}.${(0,Vs.fromUint8Array)(new Uint8Array(a),!0)}`}Jt.signCompactJws=Rk;Object.defineProperty(gh,"__esModule",{value:!0});const id=Qw,Ek=Qu,Pk=Sh,av=Jt,sd=rx;class _k{constructor(t={}){this._url=null,this._storage=null,this.security=av,this.options=Object.assign({replaceBrowserHistory:!0,fullSessionStorageSupport:!0,refreshTokenWithCredentials:"same-origin"},t)}relative(t){return new URL(t,this.getUrl().href).href}get fhir(){return typeof fhir=="function"?fhir:null}getUrl(){return this._url||(this._url=new URL(location+"")),this._url}redirect(t){location.href=t}getStorage(){return this._storage||(this._storage=new Pk.default),this._storage}getAbortController(){return AbortController}atob(t){return window.atob(t)}btoa(t){return window.btoa(t)}base64urlencode(t){return typeof t=="string"?(0,sd.encodeURL)(t):(0,sd.fromUint8Array)(t,!0)}base64urldecode(t){return(0,sd.decode)(t)}getSmartApi(){return{ready:(...t)=>(0,id.ready)(this,...t),authorize:t=>(0,id.authorize)(this,t),init:t=>(0,id.init)(this,t),client:t=>new Ek.default(this,t),options:this.options,utils:{security:av}}}}gh.default=_k;var lv={},uv;function kk(){return uv||(uv=1,function(e){e()}(function(){function e(x,w){if(!(x instanceof w))throw new TypeError("Cannot call a class as a function")}function t(x,w){for(var m=0;m"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function l(x,w){if(w&&(typeof w=="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a(x)}function u(x){var w=s();return function(){var S=o(x),C;if(w){var P=o(this).constructor;C=Reflect.construct(S,arguments,P)}else C=S.apply(this,arguments);return l(this,C)}}function d(x,w){for(;!Object.prototype.hasOwnProperty.call(x,w)&&(x=o(x),x!==null););return x}function c(){return typeof Reflect<"u"&&Reflect.get?c=Reflect.get.bind():c=function(w,m,S){var C=d(w,m);if(C){var P=Object.getOwnPropertyDescriptor(C,m);return P.get?P.get.call(arguments.length<3?w:S):P.value}},c.apply(this,arguments)}var f=function(){function x(){e(this,x),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(x,[{key:"addEventListener",value:function(m,S,C){m in this.listeners||(this.listeners[m]=[]),this.listeners[m].push({callback:S,options:C})}},{key:"removeEventListener",value:function(m,S){if(m in this.listeners){for(var C=this.listeners[m],P=0,b=C.length;P"u")C=new Error("This operation was aborted"),C.name="AbortError";else try{C=new DOMException("signal is aborted without reason")}catch{C=new Error("This operation was aborted"),C.name="AbortError"}this.signal.reason=C,this.signal.dispatchEvent(S)}},{key:"toString",value:function(){return"[object AbortController]"}}]),x}();typeof Symbol<"u"&&Symbol.toStringTag&&(y.prototype[Symbol.toStringTag]="AbortController",g.prototype[Symbol.toStringTag]="AbortSignal");function v(x){return x.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof x.Request=="function"&&!x.Request.prototype.hasOwnProperty("signal")||!x.AbortController}(function(x){v(x)&&(x.AbortController=y,x.AbortSignal=g)})(typeof self<"u"?self:Os)})),lv}const Mk=gh,Tk=new Mk.default,{ready:Ak,authorize:Ok,init:Nk,client:jk,options:Ik,utils:Dk}=Tk.getSmartApi();if(typeof FHIRCLIENT_PURE>"u"){const e=vh();kk(),window.fetch||(window.fetch=e.default,window.Headers=e.Headers,window.Request=e.Request,window.Response=e.Response)}const Fk={AbortController:window.AbortController,client:jk,utils:Dk,oauth2:{settings:Ik,ready:Ak,authorize:Ok,init:Nk}};var sx=Fk,zo=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(){}},No=typeof window>"u"||"Deno"in globalThis;function Qt(){}function Lk(e,t){return typeof e=="function"?e(t):e}function Tf(e){return typeof e=="number"&&e>=0&&e!==1/0}function ax(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yi(e,t){return typeof e=="function"?e(t):e}function hn(e,t){return typeof e=="function"?e(t):e}function cv(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==bh(s,t.options))return!1}else if(!da(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function dv(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(jo(t.options.mutationKey)!==jo(i))return!1}else if(!da(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function bh(e,t){return((t==null?void 0:t.queryKeyHashFn)||jo)(e)}function jo(e){return JSON.stringify(e,(t,n)=>Af(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function da(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!da(e[n],t[n])):!1}function Rh(e,t){if(e===t)return e;const n=fv(e)&&fv(t);if(n||Af(e)&&Af(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function Of(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Rh(e,t):t}function Uk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function zk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Eh=Symbol();function lx(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Eh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var vo,br,Ci,ty,Bk=(ty=class extends zo{constructor(){super();ne(this,vo);ne(this,br);ne(this,Ci);W(this,Ci,t=>{if(!No&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,br)||this.setEventListener(_(this,Ci))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,br))==null||t.call(this),W(this,br,void 0))}setEventListener(t){var n;W(this,Ci,t),(n=_(this,br))==null||n.call(this),W(this,br,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,vo)!==t&&(W(this,vo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,vo)=="boolean"?_(this,vo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},vo=new WeakMap,br=new WeakMap,Ci=new WeakMap,ty),Ph=new Bk,bi,Rr,Ri,ny,Vk=(ny=class extends zo{constructor(){super();ne(this,bi,!0);ne(this,Rr);ne(this,Ri);W(this,Ri,t=>{if(!No&&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(){_(this,Rr)||this.setEventListener(_(this,Ri))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Rr))==null||t.call(this),W(this,Rr,void 0))}setEventListener(t){var n;W(this,Ri,t),(n=_(this,Rr))==null||n.call(this),W(this,Rr,t(this.setOnline.bind(this)))}setOnline(t){_(this,bi)!==t&&(W(this,bi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,bi)}},bi=new WeakMap,Rr=new WeakMap,Ri=new WeakMap,ny),xu=new Vk;function Nf(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Hk(e){return Math.min(1e3*2**e,3e4)}function ux(e){return(e??"online")==="online"?xu.isOnline():!0}var cx=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function ad(e){return e instanceof cx}function dx(e){let t=!1,n=0,r=!1,o;const i=Nf(),s=v=>{var x;r||(f(new cx(v)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Ph.isFocused()&&(e.networkMode==="always"||xu.isOnline())&&e.canRun(),d=()=>ux(e.networkMode)&&e.canRun(),c=v=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,v),o==null||o(),i.resolve(v))},f=v=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,v),o==null||o(),i.reject(v))},g=()=>new Promise(v=>{var x;o=w=>{(r||u())&&v(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),y=()=>{if(r)return;let v;const x=n===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(w){v=Promise.reject(w)}Promise.resolve(v).then(c).catch(w=>{var b;if(r)return;const m=e.retry??(No?0:3),S=e.retryDelay??Hk,C=typeof S=="function"?S(n,w):S,P=m===!0||typeof m=="number"&&nu()?void 0:g()).then(()=>{t?f(w):y()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():g().then(y),i)}}function Kk(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var Ge=Kk(),yo,ry,fx=(ry=class{constructor(){ne(this,yo)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tf(this.gcTime)&&W(this,yo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(No?1/0:5*60*1e3))}clearGcTimeout(){_(this,yo)&&(clearTimeout(_(this,yo)),W(this,yo,void 0))}},yo=new WeakMap,ry),Ei,Pi,Wt,pt,ma,wo,cn,Kn,oy,Gk=(oy=class extends fx{constructor(t){super();ne(this,cn);ne(this,Ei);ne(this,Pi);ne(this,Wt);ne(this,pt);ne(this,ma);ne(this,wo);W(this,wo,!1),W(this,ma,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,Wt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,Ei,Wk(this.options)),this.state=t.state??_(this,Ei),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,pt))==null?void 0:t.promise}setOptions(t){this.options={..._(this,ma),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Wt).remove(this)}setData(t,n){const r=Of(this.state.data,t,this.options);return se(this,cn,Kn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,cn,Kn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,pt))==null?void 0:r.promise;return(o=_(this,pt))==null||o.cancel(t),n?n.then(Qt).catch(Qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ei))}isActive(){return this.observers.some(t=>hn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Eh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}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||!ax(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Wt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,pt)&&(_(this,wo)?_(this,pt).cancel({revert:!0}):_(this,pt).cancelRetry()),this.scheduleGc()),_(this,Wt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,cn,Kn).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,pt))return _(this,pt).continueRetry(),_(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,o=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(W(this,wo,!0),r.signal)})},i=()=>{const c=lx(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return o(f),W(this,wo,!1),this.options.persister?this.options.persister(c,f,this):c(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),W(this,Pi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&se(this,cn,Kn).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,g,y,v;ad(c)&&c.silent||se(this,cn,Kn).call(this,{type:"error",error:c}),ad(c)||((g=(f=_(this,Wt).config).onError)==null||g.call(f,c,this),(v=(y=_(this,Wt).config).onSettled)==null||v.call(y,this.state.data,c,this)),this.scheduleGc()};return W(this,pt,dx({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,g,y,v;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(x){a(x);return}(g=(f=_(this,Wt).config).onSuccess)==null||g.call(f,c,this),(v=(y=_(this,Wt).config).onSettled)==null||v.call(y,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{se(this,cn,Kn).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,cn,Kn).call(this,{type:"pause"})},onContinue:()=>{se(this,cn,Kn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),_(this,pt).start()}},Ei=new WeakMap,Pi=new WeakMap,Wt=new WeakMap,pt=new WeakMap,ma=new WeakMap,wo=new WeakMap,cn=new WeakSet,Kn=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,...px(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 ad(o)&&o.revert&&_(this,Pi)?{..._(this,Pi),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),Ge.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Wt).notify({query:this,type:"updated",action:t})})},oy);function px(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ux(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Wk(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 Tn,iy,qk=(iy=class extends zo{constructor(t={}){super();ne(this,Tn);this.config=t,W(this,Tn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??bh(o,n);let s=this.get(i);return s||(s=new Gk({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){_(this,Tn).has(t.queryHash)||(_(this,Tn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Tn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Tn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ge.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Tn).get(t)}getAll(){return[..._(this,Tn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>cv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>cv(t,r)):n}notify(t){Ge.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ge.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ge.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tn=new WeakMap,iy),An,vt,xo,On,mr,sy,Qk=(sy=class extends fx{constructor(t){super();ne(this,On);ne(this,An);ne(this,vt);ne(this,xo);this.mutationId=t.mutationId,W(this,vt,t.mutationCache),W(this,An,[]),this.state=t.state||hx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,An).includes(t)||(_(this,An).push(t),this.clearGcTimeout(),_(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,An,_(this,An).filter(n=>n!==t)),this.scheduleGc(),_(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,An).length||(this.state.status==="pending"?this.scheduleGc():_(this,vt).remove(this))}continue(){var t;return((t=_(this,xo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,c,f,g,y,v,x,w,m,S,C,P,b,A;W(this,xo,dx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,$)=>{se(this,On,mr).call(this,{type:"failed",failureCount:k,error:$})},onPause:()=>{se(this,On,mr).call(this,{type:"pause"})},onContinue:()=>{se(this,On,mr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,vt).canRun(this)}));const n=this.state.status==="pending",r=!_(this,xo).canStart();try{if(!n){se(this,On,mr).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=_(this,vt).config).onMutate)==null?void 0:i.call(o,t,this));const $=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));$!==this.state.context&&se(this,On,mr).call(this,{type:"pending",context:$,variables:t,isPaused:r})}const k=await _(this,xo).start();return await((u=(l=_(this,vt).config).onSuccess)==null?void 0:u.call(l,k,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,k,t,this.state.context)),await((g=(f=_(this,vt).config).onSettled)==null?void 0:g.call(f,k,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,k,null,t,this.state.context)),se(this,On,mr).call(this,{type:"success",data:k}),k}catch(k){try{throw await((w=(x=_(this,vt).config).onError)==null?void 0:w.call(x,k,t,this.state.context,this)),await((S=(m=this.options).onError)==null?void 0:S.call(m,k,t,this.state.context)),await((P=(C=_(this,vt).config).onSettled)==null?void 0:P.call(C,void 0,k,this.state.variables,this.state.context,this)),await((A=(b=this.options).onSettled)==null?void 0:A.call(b,void 0,k,t,this.state.context)),k}finally{se(this,On,mr).call(this,{type:"error",error:k})}}finally{_(this,vt).runNext(this)}}},An=new WeakMap,vt=new WeakMap,xo=new WeakMap,On=new WeakSet,mr=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),Ge.batch(()=>{_(this,An).forEach(r=>{r.onMutationUpdate(t)}),_(this,vt).notify({mutation:this,type:"updated",action:t})})},sy);function hx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,va,ay,Yk=(ay=class extends zo{constructor(t={}){super();ne(this,It);ne(this,va);this.config=t,W(this,It,new Map),W(this,va,Date.now())}build(t,n,r){const o=new Qk({mutationCache:this,mutationId:++Ha(this,va)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=dl(t),r=_(this,It).get(n)??[];r.push(t),_(this,It).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=dl(t);if(_(this,It).has(n)){const o=(r=_(this,It).get(n))==null?void 0:r.filter(i=>i!==t);o&&(o.length===0?_(this,It).delete(n):_(this,It).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=_(this,It).get(dl(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=_(this,It).get(dl(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){Ge.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,It).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>dv(n,r))}findAll(t={}){return this.getAll().filter(n=>dv(t,n))}notify(t){Ge.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ge.batch(()=>Promise.all(t.map(n=>n.continue().catch(Qt))))}},It=new WeakMap,va=new WeakMap,ay);function dl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function hv(e){return{onFetch:(t,n)=>{var d,c,f,g,y;const r=t.options,o=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const x=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},w=lx(t.options,t.fetchOptions),m=async(S,C,P)=>{if(v)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const b={queryKey:t.queryKey,pageParam:C,direction:P?"backward":"forward",meta:t.options.meta};x(b);const A=await w(b),{maxPages:k}=t.options,$=P?zk:Uk;return{pages:$(S.pages,A,k),pageParams:$(S.pageParams,C,k)}};if(o&&i.length){const S=o==="backward",C=S?Xk:gv,P={pages:i,pageParams:s},b=C(r,P);a=await m(P,b,S)}else{const S=e??i.length;do{const C=l===0?s[0]??r.initialPageParam:gv(r,a);if(l>0&&C==null)break;a=await m(a,C),l++}while(l{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function gv(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 Xk(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 He,Er,Pr,_i,ki,_r,Mi,Ti,ly,Jk=(ly=class{constructor(e={}){ne(this,He);ne(this,Er);ne(this,Pr);ne(this,_i);ne(this,ki);ne(this,_r);ne(this,Mi);ne(this,Ti);W(this,He,e.queryCache||new qk),W(this,Er,e.mutationCache||new Yk),W(this,Pr,e.defaultOptions||{}),W(this,_i,new Map),W(this,ki,new Map),W(this,_r,0)}mount(){Ha(this,_r)._++,_(this,_r)===1&&(W(this,Mi,Ph.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,He).onFocus())})),W(this,Ti,xu.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,He).onOnline())})))}unmount(){var e,t;Ha(this,_r)._--,_(this,_r)===0&&((e=_(this,Mi))==null||e.call(this),W(this,Mi,void 0),(t=_(this,Ti))==null||t.call(this),W(this,Ti,void 0))}isFetching(e){return _(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Er).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,He).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=_(this,He).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(yi(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return _(this,He).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=_(this,He).get(r.queryHash),i=o==null?void 0:o.state.data,s=Lk(t,i);if(s!==void 0)return _(this,He).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Ge.batch(()=>_(this,He).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,He).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,He);Ge.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,He),r={type:"active",...e};return Ge.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Ge.batch(()=>_(this,He).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Qt).catch(Qt)}invalidateQueries(e={},t={}){return Ge.batch(()=>{if(_(this,He).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=Ge.batch(()=>_(this,He).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Qt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Qt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,He).build(this,t);return n.isStaleByTime(yi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Qt).catch(Qt)}fetchInfiniteQuery(e){return e.behavior=hv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Qt).catch(Qt)}ensureInfiniteQueryData(e){return e.behavior=hv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return xu.isOnline()?_(this,Er).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,He)}getMutationCache(){return _(this,Er)}getDefaultOptions(){return _(this,Pr)}setDefaultOptions(e){W(this,Pr,e)}setQueryDefaults(e,t){_(this,_i).set(jo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,_i).values()];let n={};return t.forEach(r=>{da(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){_(this,ki).set(jo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,ki).values()];let n={};return t.forEach(r=>{da(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Pr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=bh(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===Eh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Pr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,He).clear(),_(this,Er).clear()}},He=new WeakMap,Er=new WeakMap,Pr=new WeakMap,_i=new WeakMap,ki=new WeakMap,_r=new WeakMap,Mi=new WeakMap,Ti=new WeakMap,ly),Rt,we,ya,yt,So,Ai,kr,Nn,wa,Oi,Ni,Co,bo,Mr,ji,_e,Ts,jf,If,Df,Ff,Lf,$f,Uf,gx,uy,_h=(uy=class extends zo{constructor(t,n){super();ne(this,_e);ne(this,Rt);ne(this,we);ne(this,ya);ne(this,yt);ne(this,So);ne(this,Ai);ne(this,kr);ne(this,Nn);ne(this,wa);ne(this,Oi);ne(this,Ni);ne(this,Co);ne(this,bo);ne(this,Mr);ne(this,ji,new Set);this.options=n,W(this,Rt,t),W(this,Nn,null),W(this,kr,Nf()),this.options.experimental_prefetchInRender||_(this,kr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,we).addObserver(this),mv(_(this,we),this.options)?se(this,_e,Ts).call(this):this.updateResult(),se(this,_e,Ff).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zf(_(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zf(_(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,_e,Lf).call(this),se(this,_e,$f).call(this),_(this,we).removeObserver(this)}setOptions(t,n){const r=this.options,o=_(this,we);if(this.options=_(this,Rt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof hn(this.options.enabled,_(this,we))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,_e,Uf).call(this),_(this,we).setOptions(this.options),r._defaulted&&!wu(this.options,r)&&_(this,Rt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,we),observer:this});const i=this.hasListeners();i&&vv(_(this,we),o,this.options,r)&&se(this,_e,Ts).call(this),this.updateResult(n),i&&(_(this,we)!==o||hn(this.options.enabled,_(this,we))!==hn(r.enabled,_(this,we))||yi(this.options.staleTime,_(this,we))!==yi(r.staleTime,_(this,we)))&&se(this,_e,jf).call(this);const s=se(this,_e,If).call(this);i&&(_(this,we)!==o||hn(this.options.enabled,_(this,we))!==hn(r.enabled,_(this,we))||s!==_(this,Mr))&&se(this,_e,Df).call(this,s)}getOptimisticResult(t){const n=_(this,Rt).getQueryCache().build(_(this,Rt),t),r=this.createResult(n,t);return eM(this,r)&&(W(this,yt,r),W(this,Ai,this.options),W(this,So,_(this,we).state)),r}getCurrentResult(){return _(this,yt)}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){_(this,ji).add(t)}getCurrentQuery(){return _(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Rt).defaultQueryOptions(t),r=_(this,Rt).getQueryCache().build(_(this,Rt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,_e,Ts).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,yt)))}createResult(t,n){var k;const r=_(this,we),o=this.options,i=_(this,yt),s=_(this,So),a=_(this,Ai),u=t!==r?t.state:_(this,ya),{state:d}=t;let c={...d},f=!1,g;if(n._optimisticResults){const $=this.hasListeners(),R=!$&&mv(t,n),N=$&&vv(t,r,n,o);(R||N)&&(c={...c,...px(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:x}=c;if(n.select&&c.data!==void 0)if(i&&c.data===(s==null?void 0:s.data)&&n.select===_(this,wa))g=_(this,Oi);else try{W(this,wa,n.select),g=n.select(c.data),g=Of(i==null?void 0:i.data,g,n),W(this,Oi,g),W(this,Nn,null)}catch($){W(this,Nn,$)}else g=c.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let $;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))$=i.data;else if($=typeof n.placeholderData=="function"?n.placeholderData((k=_(this,Ni))==null?void 0:k.state.data,_(this,Ni)):n.placeholderData,n.select&&$!==void 0)try{$=n.select($),W(this,Nn,null)}catch(R){W(this,Nn,R)}$!==void 0&&(x="success",g=Of(i==null?void 0:i.data,$,n),f=!0)}_(this,Nn)&&(y=_(this,Nn),g=_(this,Oi),v=Date.now(),x="error");const w=c.fetchStatus==="fetching",m=x==="pending",S=x==="error",C=m&&w,P=g!==void 0,A={status:x,fetchStatus:c.fetchStatus,isPending:m,isSuccess:x==="success",isError:S,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:S&&!P,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&P,isStale:kh(t,n),refetch:this.refetch,promise:_(this,kr)};if(this.options.experimental_prefetchInRender){const $=F=>{A.status==="error"?F.reject(A.error):A.data!==void 0&&F.resolve(A.data)},R=()=>{const F=W(this,kr,A.promise=Nf());$(F)},N=_(this,kr);switch(N.status){case"pending":t.queryHash===r.queryHash&&$(N);break;case"fulfilled":(A.status==="error"||A.data!==N.value)&&R();break;case"rejected":(A.status!=="error"||A.error!==N.reason)&&R();break}}return A}updateResult(t){const n=_(this,yt),r=this.createResult(_(this,we),this.options);if(W(this,So,_(this,we).state),W(this,Ai,this.options),_(this,So).data!==void 0&&W(this,Ni,_(this,we)),wu(r,n))return;W(this,yt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!_(this,ji).size)return!0;const l=new Set(a??_(this,ji));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,yt)).some(u=>{const d=u;return _(this,yt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),se(this,_e,gx).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,_e,Ff).call(this)}},Rt=new WeakMap,we=new WeakMap,ya=new WeakMap,yt=new WeakMap,So=new WeakMap,Ai=new WeakMap,kr=new WeakMap,Nn=new WeakMap,wa=new WeakMap,Oi=new WeakMap,Ni=new WeakMap,Co=new WeakMap,bo=new WeakMap,Mr=new WeakMap,ji=new WeakMap,_e=new WeakSet,Ts=function(t){se(this,_e,Uf).call(this);let n=_(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Qt)),n},jf=function(){se(this,_e,Lf).call(this);const t=yi(this.options.staleTime,_(this,we));if(No||_(this,yt).isStale||!Tf(t))return;const r=ax(_(this,yt).dataUpdatedAt,t)+1;W(this,Co,setTimeout(()=>{_(this,yt).isStale||this.updateResult()},r))},If=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,we)):this.options.refetchInterval)??!1},Df=function(t){se(this,_e,$f).call(this),W(this,Mr,t),!(No||hn(this.options.enabled,_(this,we))===!1||!Tf(_(this,Mr))||_(this,Mr)===0)&&W(this,bo,setInterval(()=>{(this.options.refetchIntervalInBackground||Ph.isFocused())&&se(this,_e,Ts).call(this)},_(this,Mr)))},Ff=function(){se(this,_e,jf).call(this),se(this,_e,Df).call(this,se(this,_e,If).call(this))},Lf=function(){_(this,Co)&&(clearTimeout(_(this,Co)),W(this,Co,void 0))},$f=function(){_(this,bo)&&(clearInterval(_(this,bo)),W(this,bo,void 0))},Uf=function(){const t=_(this,Rt).getQueryCache().build(_(this,Rt),this.options);if(t===_(this,we))return;const n=_(this,we);W(this,we,t),W(this,ya,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},gx=function(t){Ge.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,yt))}),_(this,Rt).getQueryCache().notify({query:_(this,we),type:"observerResultsUpdated"})})},uy);function Zk(e,t){return hn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mv(e,t){return Zk(e,t)||e.state.data!==void 0&&zf(e,t,t.refetchOnMount)}function zf(e,t,n){if(hn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&kh(e,t)}return!1}function vv(e,t,n,r){return(e!==t||hn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&kh(e,n)}function kh(e,t){return hn(t.enabled,e)!==!1&&e.isStaleByTime(yi(t.staleTime,e))}function eM(e,t){return!wu(e.getCurrentResult(),t)}function yv(e,t){return e.filter(n=>!t.includes(n))}function tM(e,t,n){const r=e.slice(0);return r[t]=n,r}var Ii,qt,Di,Fi,Dt,Tr,xa,Sa,Ot,Bf,Vf,Hf,Kf,cy,nM=(cy=class extends zo{constructor(t,n,r){super();ne(this,Ot);ne(this,Ii);ne(this,qt);ne(this,Di);ne(this,Fi);ne(this,Dt);ne(this,Tr);ne(this,xa);ne(this,Sa);W(this,Ii,t),W(this,Fi,r),W(this,Di,[]),W(this,Dt,[]),W(this,qt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&_(this,Dt).forEach(t=>{t.subscribe(n=>{se(this,Ot,Hf).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,_(this,Dt).forEach(t=>{t.destroy()})}setQueries(t,n,r){W(this,Di,t),W(this,Fi,n),Ge.batch(()=>{const o=_(this,Dt),i=se(this,Ot,Vf).call(this,_(this,Di));i.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions,r));const s=i.map(u=>u.observer),a=s.map(u=>u.getCurrentResult()),l=s.some((u,d)=>u!==o[d]);o.length===s.length&&!l||(W(this,Dt,s),W(this,qt,a),this.hasListeners()&&(yv(o,s).forEach(u=>{u.destroy()}),yv(s,o).forEach(u=>{u.subscribe(d=>{se(this,Ot,Hf).call(this,u,d)})}),se(this,Ot,Kf).call(this)))})}getCurrentResult(){return _(this,qt)}getQueries(){return _(this,Dt).map(t=>t.getCurrentQuery())}getObservers(){return _(this,Dt)}getOptimisticResult(t,n){const r=se(this,Ot,Vf).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>se(this,Ot,Bf).call(this,i??o,n),()=>r.map((i,s)=>{const a=o[s];return i.defaultedQueryOptions.notifyOnChangeProps?a:i.observer.trackResult(a,l=>{r.forEach(u=>{u.observer.trackProp(l)})})})]}},Ii=new WeakMap,qt=new WeakMap,Di=new WeakMap,Fi=new WeakMap,Dt=new WeakMap,Tr=new WeakMap,xa=new WeakMap,Sa=new WeakMap,Ot=new WeakSet,Bf=function(t,n){return n?((!_(this,Tr)||_(this,qt)!==_(this,Sa)||n!==_(this,xa))&&(W(this,xa,n),W(this,Sa,_(this,qt)),W(this,Tr,Rh(_(this,Tr),n(t)))),_(this,Tr)):t},Vf=function(t){const n=new Map(_(this,Dt).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=_(this,Ii).defaultQueryOptions(o),s=n.get(i.queryHash);if(s)r.push({defaultedQueryOptions:i,observer:s});else{const a=_(this,Dt).find(l=>l.options.queryHash===i.queryHash);r.push({defaultedQueryOptions:i,observer:a??new _h(_(this,Ii),i)})}}),r.sort((o,i)=>t.findIndex(s=>s.queryHash===o.defaultedQueryOptions.queryHash)-t.findIndex(s=>s.queryHash===i.defaultedQueryOptions.queryHash))},Hf=function(t,n){const r=_(this,Dt).indexOf(t);r!==-1&&(W(this,qt,tM(_(this,qt),r,n)),se(this,Ot,Kf).call(this))},Kf=function(){var t;if(this.hasListeners()){const n=_(this,Tr),r=se(this,Ot,Bf).call(this,_(this,qt),(t=_(this,Fi))==null?void 0:t.combine);n!==r&&Ge.batch(()=>{this.listeners.forEach(o=>{o(_(this,qt))})})}},cy),Ar,Or,Et,Qn,er,Dl,Gf,dy,rM=(dy=class extends zo{constructor(n,r){super();ne(this,er);ne(this,Ar);ne(this,Or);ne(this,Et);ne(this,Qn);W(this,Ar,n),this.setOptions(r),this.bindMethods(),se(this,er,Dl).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=_(this,Ar).defaultMutationOptions(n),wu(this.options,r)||_(this,Ar).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Et),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&jo(r.mutationKey)!==jo(this.options.mutationKey)?this.reset():((o=_(this,Et))==null?void 0:o.state.status)==="pending"&&_(this,Et).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Et))==null||n.removeObserver(this)}onMutationUpdate(n){se(this,er,Dl).call(this),se(this,er,Gf).call(this,n)}getCurrentResult(){return _(this,Or)}reset(){var n;(n=_(this,Et))==null||n.removeObserver(this),W(this,Et,void 0),se(this,er,Dl).call(this),se(this,er,Gf).call(this)}mutate(n,r){var o;return W(this,Qn,r),(o=_(this,Et))==null||o.removeObserver(this),W(this,Et,_(this,Ar).getMutationCache().build(_(this,Ar),this.options)),_(this,Et).addObserver(this),_(this,Et).execute(n)}},Ar=new WeakMap,Or=new WeakMap,Et=new WeakMap,Qn=new WeakMap,er=new WeakSet,Dl=function(){var r;const n=((r=_(this,Et))==null?void 0:r.state)??hx();W(this,Or,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Gf=function(n){Ge.batch(()=>{var r,o,i,s,a,l,u,d;if(_(this,Qn)&&this.hasListeners()){const c=_(this,Or).variables,f=_(this,Or).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,Qn)).onSuccess)==null||o.call(r,n.data,c,f),(s=(i=_(this,Qn)).onSettled)==null||s.call(i,n.data,null,c,f)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,Qn)).onError)==null||l.call(a,n.error,c,f),(d=(u=_(this,Qn)).onSettled)==null||d.call(u,void 0,n.error,c,f))}this.listeners.forEach(c=>{c(_(this,Or))})})},dy),mx=p.createContext(void 0),Mh=e=>{const t=p.useContext(mx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},oM=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(mx.Provider,{value:e,children:t})),vx=p.createContext(!1),yx=()=>p.useContext(vx);vx.Provider;function iM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sM=p.createContext(iM()),wx=()=>p.useContext(sM);function xx(e,t){return typeof e=="function"?e(...t):!!e}function Sx(){}var Cx=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},bx=e=>{p.useEffect(()=>{e.clearReset()},[e])},Rx=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&xx(n,[e.error,r]),Ex=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Px=(e,t)=>e.isLoading&&e.isFetching&&!t,Wf=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Su=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function wv({queries:e,...t},n){const r=Mh(),o=yx(),i=wx(),s=p.useMemo(()=>e.map(y=>{const v=r.defaultQueryOptions(y);return v._optimisticResults=o?"isRestoring":"optimistic",v}),[e,r,o]);s.forEach(y=>{Ex(y),Cx(y,i)}),bx(i);const[a]=p.useState(()=>new nM(r,s,t)),[l,u,d]=a.getOptimisticResult(s,t.combine);p.useSyncExternalStore(p.useCallback(y=>o?()=>{}:a.subscribe(Ge.batchCalls(y)),[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const f=l.some((y,v)=>Wf(s[v],y))?l.flatMap((y,v)=>{const x=s[v];if(x){const w=new _h(r,x);if(Wf(x,y))return Su(x,w,i);Px(y,o)&&Su(x,w,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const g=l.find((y,v)=>{const x=s[v];return x&&Rx({result:y,errorResetBoundary:i,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash)})});if(g!=null&&g.error)throw g.error;return u(d())}function aM(e,t,n){var d,c,f,g,y;const r=Mh(),o=yx(),i=wx(),s=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,s),s._optimisticResults=o?"isRestoring":"optimistic",Ex(s),Cx(s,i),bx(i);const a=!r.getQueryCache().get(s.queryHash),[l]=p.useState(()=>new t(r,s)),u=l.getOptimisticResult(s);if(p.useSyncExternalStore(p.useCallback(v=>{const x=o?()=>{}:l.subscribe(Ge.batchCalls(v));return l.updateResult(),x},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),Wf(s,u))throw Su(s,l,i);if(Rx({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw u.error;if((g=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,s,u),s.experimental_prefetchInRender&&!No&&Px(u,o)){const v=a?Su(s,l,i):(y=r.getQueryCache().get(s.queryHash))==null?void 0:y.promise;v==null||v.catch(Sx).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function Wr(e,t){return aM(e,_h)}function _x(e,t){const n=Mh(),[r]=p.useState(()=>new rM(n,e));p.useEffect(()=>{r.setOptions(e)},[r,e]);const o=p.useSyncExternalStore(p.useCallback(s=>r.subscribe(Ge.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=p.useCallback((s,a)=>{r.mutate(s,a).catch(Sx)},[r]);if(o.error&&xx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const kx="aidbox-forms",lM=["openid fhirUser","profile","online_access","launch/patient","launch/questionnaire","launch/questionnaireresponse","patient/Patient.r","patient/QuestionnaireResponse.crus"].join(" "),Io=sx.client("https://form-builder.aidbox.app"),Mx=p.createContext(null),ka=()=>{const e=p.useContext(Mx);if(!e)throw new Error("No client found in the context");return e},uM=({children:e})=>{const{data:t}=Wr({queryKey:["client"],queryFn:()=>sx.oauth2.init({clientId:kx,scope:lM,redirectUri:window.location.pathname}),retry:!1});return h.jsx(Mx.Provider,{value:t,children:e})},xv=async(e,t)=>{var o;const{fhirContext:n}=(o=e==null?void 0:e.state)==null?void 0:o.tokenResponse,[r]=n==null?void 0:n.filter(({reference:i})=>{if(i.startsWith(`${t}/`))return i.split("/")[1]});if(r)return(t==="Questionnaire"?Io:e).request(`${t}/${r}`);throw new Error(`No ${t} in the launch context`)},cM=async e=>{const[t,n,r,o,i]=await Promise.allSettled([e.patient.read(),e.encounter.read(),e.user.read(),xv(e,"Questionnaire"),xv(e,"QuestionnaireResponse")]);return{patient:t.status==="fulfilled"?t.value:null,encounter:n.status==="fulfilled"?n.value:null,user:r.status==="fulfilled"?r.value:null,questionnaire:o.status==="fulfilled"?o.value:null,questionnaireResponse:i.status==="fulfilled"?i.value:null}},Tx=p.createContext(null),Bo=()=>{const e=p.useContext(Tx);if(!e)throw new Error("No launch context found in the context");return e},dM=({children:e})=>{const t=ka(),{data:n}=Wr({queryKey:["launch-context"],queryFn:()=>cM(t)});return h.jsx(Tx.Provider,{value:n,children:e})};function Ax(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;t{const t=gM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Th);return a[0]===""&&a.length!==1&&a.shift(),Ox(a,t)||hM(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},Ox=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Ox(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Th);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Sv=/^\[(.+)\]$/,hM=e=>{if(Sv.test(e)){const t=Sv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},gM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return vM(Object.entries(e.classGroups),n).forEach(([i,s])=>{qf(s,r,i,t)}),r},qf=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Cv(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(mM(o)){qf(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{qf(s,Cv(t,i),n,r)})})},Cv=(e,t)=>{let n=e;return t.split(Th).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},mM=e=>e.isThemeGetter,vM=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,yM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},Nx="!",wM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,d=0,c;for(let x=0;xd?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:s}):s},xM=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},SM=e=>({cache:yM(e.cacheSize),parseClassName:wM(e),...pM(e)}),CM=/\s+/,bM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(CM);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=n(u);let y=!!g,v=r(y?f.substring(0,g):f);if(!v){if(!y){a=u+(a.length>0?" "+a:a);continue}if(v=r(f),!v){a=u+(a.length>0?" "+a:a);continue}y=!1}const x=xM(d).join(":"),w=c?x+Nx:x,m=w+v;if(i.includes(m))continue;i.push(m);const S=o(v,y);for(let C=0;C0?" "+a:a)}return a};function RM(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rc(d),e());return n=SM(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=bM(l,n);return o(l,d),d}return function(){return i(RM.apply(null,arguments))}}const Ne=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ix=/^\[(?:([a-z-]+):)?(.+)\]$/i,PM=/^\d+\/\d+$/,_M=new Set(["px","full","screen"]),kM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,MM=/\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$/,TM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,AM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Hn=e=>wi(e)||_M.has(e)||PM.test(e),fr=e=>es(e,"length",UM),wi=e=>!!e&&!Number.isNaN(Number(e)),ld=e=>es(e,"number",wi),Ss=e=>!!e&&Number.isInteger(Number(e)),NM=e=>e.endsWith("%")&&wi(e.slice(0,-1)),de=e=>Ix.test(e),pr=e=>kM.test(e),jM=new Set(["length","size","percentage"]),IM=e=>es(e,jM,Dx),DM=e=>es(e,"position",Dx),FM=new Set(["image","url"]),LM=e=>es(e,FM,BM),$M=e=>es(e,"",zM),Cs=()=>!0,es=(e,t,n)=>{const r=Ix.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},UM=e=>MM.test(e)&&!TM.test(e),Dx=()=>!1,zM=e=>AM.test(e),BM=e=>OM.test(e),VM=()=>{const e=Ne("colors"),t=Ne("spacing"),n=Ne("blur"),r=Ne("brightness"),o=Ne("borderColor"),i=Ne("borderRadius"),s=Ne("borderSpacing"),a=Ne("borderWidth"),l=Ne("contrast"),u=Ne("grayscale"),d=Ne("hueRotate"),c=Ne("invert"),f=Ne("gap"),g=Ne("gradientColorStops"),y=Ne("gradientColorStopPositions"),v=Ne("inset"),x=Ne("margin"),w=Ne("opacity"),m=Ne("padding"),S=Ne("saturate"),C=Ne("scale"),P=Ne("sepia"),b=Ne("skew"),A=Ne("space"),k=Ne("translate"),$=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",de,t],F=()=>[de,t],L=()=>["",Hn,fr],E=()=>["auto",wi,de],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",de],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[wi,de];return{cacheSize:500,separator:":",theme:{colors:[Cs],spacing:[Hn,fr],blur:["none","",pr,de],brightness:q(),borderColor:[e],borderRadius:["none","","full",pr,de],borderSpacing:F(),borderWidth:L(),contrast:q(),grayscale:O(),hueRotate:q(),invert:O(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[NM,fr],inset:N(),margin:N(),opacity:q(),padding:F(),saturate:q(),scale:q(),sepia:O(),skew:q(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[pr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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:[...M(),de]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ss,de]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",Ss,de]}],"grid-cols":[{"grid-cols":[Cs]}],"col-start-end":[{col:["auto",{span:["full",Ss,de]},de]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[Cs]}],"row-start-end":[{row:["auto",{span:[Ss,de]},de]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[pr]},pr]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pr,fr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ld]}],"font-family":[{font:[Cs]}],"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",de]}],"line-clamp":[{"line-clamp":["none",wi,ld]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Hn,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Hn,fr]}],"underline-offset":[{"underline-offset":["auto",Hn,de]}],"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",de]}],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",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),DM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",IM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},LM]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...j()]}],"outline-offset":[{"outline-offset":[Hn,de]}],"outline-w":[{outline:[Hn,fr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Hn,fr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pr,$M]}],"shadow-color":[{shadow:[Cs]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pr,de]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[S]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ss,de]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],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",de]}],"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",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Hn,fr,ld]}],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-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"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"]}}},HM=EM(VM);function Q(...e){return HM(fM(e))}function ts(e){var t,n;if(e!=null&&e[0].text)return`${e==null?void 0:e[0].text}`;{const r=((t=e==null?void 0:e[0].prefix)==null?void 0:t[0])??"",o=((n=e==null?void 0:e[0].given)==null?void 0:n[0])??"",i=(e==null?void 0:e[0].family)??"";return`${r} ${o} ${i}`.replace(/\s+/g," ").trim()}}const KM=e=>{var s;const t=((s=e[0].line)==null?void 0:s[0])??"",n=e[0].city??"",r=e[0].state??"",o=e[0].postalCode??"",i=e[0].country??"";return`${t}, ${n}, ${r} ${o}, ${i}`};function GM(e){return e.charAt(0).toUpperCase()+e.slice(1)}function WM(e){const[t,n]=ts(e).split(" ");return n?`${t.charAt(0)}${n.charAt(0)}`.toUpperCase():t.substring(0,2).toUpperCase()}function qM(e,t){e=Math.max(1,Math.min(e,t));const i=e>1,s=e1||l1&&a--,l1,c=l2,g=lyy>e),showLastEllipsis:g,showLastPageButton:c,nextButtonEnabled:s}}async function QM({questionnaire:e,subject:t,encounter:n,author:r}){const{parameter:[{resource:o}]}=await Io.request({url:"Questionnaire/$populate",method:"POST",headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({resourceType:"Parameters",parameter:[{name:"questionnaire",resource:e},{name:"subject",resource:t},{name:"context",part:[...n?[{name:"name",valueString:"encounter"},{name:"content",resource:n}]:[],...r?[{name:"name",valueString:"author"},{name:"content",resource:r}]:[]]}]})});return o}function Fx(e,t,n){let r="QuestionnaireResponse",o="POST";return n.id&&(r+=`/${n.id}`,o="PUT"),e.request({url:r,method:o,headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({...n,questionnaire:`Questionnaire/${t.id}`,meta:{...n.meta,source:"https://aidbox.github.io/examples/aidbox-forms-smart-launch"}})})}async function YM({client:e,questionnaire:t,subject:n,encounter:r,author:o}){const i=await QM({questionnaire:t,subject:n,encounter:r,author:o});return Fx(e,t,i)}function bv({launchUrl:e,launchType:t,fhirVersion:n}){const r=["provider-ehr","patient-portal","provider-standalone","patient-standalone","backend-service"],o=new URL(e);o.search="",o.hash="";const i=new URLSearchParams;return i.set("fhir_version",n||"r4"),i.set("launch_url",o.toString()),i.set("launch",btoa(JSON.stringify([r.indexOf(t)]))),`https://launch.smarthealthit.org/?${i.toString()}`}function ud(e){var n,r;const t=e.resourceType==="Bundle"?(r=(n=e.entry)==null?void 0:n[0])==null?void 0:r.resource:e;if(!t)throw new Error("Resource not found");return t}async function Lx(e,t){const n=t.startsWith("http")?`Questionnaire?url=${t.replace(/\|.*$/,"")}`:`Questionnaire/${t.replace(/^Questionnaire\//,"")}`;return Promise.any([Io.request(n).then(ud),e.request(n).then(ud),Io.request(t).then(ud)])}function XM(){const{user:e}=Bo();return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsxs("h1",{className:"mb-4 text-2xl font-bold",children:["Welcome, ",ts(e.name)]}),h.jsx("p",{className:"text-muted-foreground",children:e.resourceType==="Patient"?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{children:"This is a demo patient portal dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),h.jsx("p",{children:"In a fully functional version, you could:"}),h.jsxs("ul",{className:"list-disc ml-6",children:[h.jsx("li",{children:"View and manage your upcoming appointments."}),h.jsx("li",{children:"Access your medical records, including lab results, diagnoses, and treatment history."}),h.jsx("li",{children:"Communicate securely with your healthcare providers."}),h.jsx("li",{children:"Maintain and update your personal health information."}),h.jsx("li",{children:"Explore educational resources related to your health conditions and treatments."})]}),h.jsx("p",{children:"For now, you can explore and submit/amend your responses."})]}):h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{children:"This is a demo practitioner EHR dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),h.jsx("p",{children:"In a fully functional version, you could:"}),h.jsxs("ul",{className:"list-disc ml-6",children:[h.jsx("li",{children:"Access and manage patient records."}),h.jsx("li",{children:"Schedule and manage patient appointments."}),h.jsx("li",{children:"Review lab results and other diagnostic information."}),h.jsx("li",{children:"Prescribe medications and generate referrals."}),h.jsx("li",{children:"Communicate with patients and other healthcare professionals."}),h.jsx("li",{children:"Generate reports and analyze data."})]}),h.jsx("p",{children:"For now, you can create and manage questionnaires, and review patient responses."})]})})]})}function JM(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Yu(...e){return t=>e.forEach(n=>JM(n,t))}function qe(...e){return p.useCallback(Yu(...e),e)}var sn=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),i=o.find(ZM);if(i){const s=i.props.children,a=o.map(l=>l===i?p.Children.count(s)>1?p.Children.only(null):p.isValidElement(s)?s.props.children:null:l);return h.jsx(Qf,{...r,ref:t,children:p.isValidElement(s)?p.cloneElement(s,void 0,a):null})}return h.jsx(Qf,{...r,ref:t,children:n})});sn.displayName="Slot";var Qf=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const o=tT(n);return p.cloneElement(n,{...eT(r,n.props),ref:t?Yu(t,o):o})}return p.Children.count(n)>1?p.Children.only(null):null});Qf.displayName="SlotClone";var $x=({children:e})=>h.jsx(h.Fragment,{children:e});function ZM(e){return p.isValidElement(e)&&e.type===$x}function eT(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function tT(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 Ux(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,Ev=nT,Xu=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Ev(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const f=Rv(d)||Rv(c);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...g}=d;return Object.entries(g).every(y=>{let[v,x]=y;return Array.isArray(x)?x.includes({...i,...a}[v]):{...i,...a}[v]===x})?[...u,c,f]:u},[]);return Ev(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const rT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zx=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var oT={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.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const iT=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>p.createElement("svg",{ref:l,...oT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:zx("lucide",o),...a},[...s.map(([u,d])=>p.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Je=(e,t)=>{const n=p.forwardRef(({className:r,...o},i)=>p.createElement(iT,{ref:i,iconNode:t,className:zx(`lucide-${rT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sT=Je("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aT=Je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pv=Je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lT=Je("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ah=Je("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oh=Je("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"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uT=Je("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const cT=Je("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dT=Je("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fT=Je("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pT=Je("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hT=Je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gT=Je("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mT=Je("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vT=Je("SquareMenu",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bx=Je("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yT=Je("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wT=Je("UserPen",[["path",{d:"M11.5 15H7a4 4 0 0 0-4 4v2",key:"15lzij"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xT=Je("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ST=Je("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),cd=768;function CT(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${cd-1}px)`),r=()=>{t(window.innerWidthn.removeEventListener("change",r)},[]),!!e}const Vx=Xu("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ir=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?sn:"button";return h.jsx(s,{className:Q(Vx({variant:t,size:n,className:e})),ref:i,...o})});ir.displayName="Button";const Hx=p.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:Q("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Hx.displayName="Input";var bT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ee=bT.reduce((e,t)=>{const n=p.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?sn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Nh(e,t){e&&Xi.flushSync(()=>e.dispatchEvent(t))}var RT="Separator",_v="horizontal",ET=["horizontal","vertical"],Kx=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=_v,...o}=e,i=PT(r)?r:_v,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return h.jsx(Ee.div,{"data-orientation":i,...a,...o,ref:t})});Kx.displayName=RT;function PT(e){return ET.includes(e)}var Gx=Kx;const Wx=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>h.jsx(Gx,{ref:o,decorative:n,orientation:t,className:Q("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Wx.displayName=Gx.displayName;function ie(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 _T(e,t){const n=p.createContext(t),r=i=>{const{children:s,...a}=i,l=p.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=p.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function ns(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];const u=c=>{var w;const{scope:f,children:g,...y}=c,v=((w=f==null?void 0:f[e])==null?void 0:w[l])||a,x=p.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:x,children:g})};u.displayName=i+"Provider";function d(c,f){var v;const g=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,y=p.useContext(g);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,kT(o,...t)]}function kT(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ln=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},MT=Ry.useId||(()=>{}),TT=0;function Po(e){const[t,n]=p.useState(MT());return Ln(()=>{e||n(r=>r??String(TT++))},[e]),e||(t?`radix-${t}`:"")}function mt(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ma({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=AT({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=mt(n),l=p.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[i,e,o,a]);return[s,l]}function AT({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,o=p.useRef(r),i=mt(t);return p.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function OT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e);p.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 NT="DismissableLayer",Yf="dismissableLayer.update",jT="dismissableLayer.pointerDownOutside",IT="dismissableLayer.focusOutside",kv,qx=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ta=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=p.useContext(qx),[d,c]=p.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=p.useState({}),y=qe(t,A=>c(A)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(x),m=d?v.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=w,P=FT(A=>{const k=A.target,$=[...u.branches].some(R=>R.contains(k));!C||$||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),b=LT(A=>{const k=A.target;[...u.branches].some(R=>R.contains(k))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return OT(A=>{m===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(kv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Mv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=kv)}},[d,f,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Mv())},[d,u]),p.useEffect(()=>{const A=()=>g({});return document.addEventListener(Yf,A),()=>document.removeEventListener(Yf,A)},[]),h.jsx(Ee.div,{...l,ref:y,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,b.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,P.onPointerDownCapture)})});Ta.displayName=NT;var DT="DismissableLayerBranch",Qx=p.forwardRef((e,t)=>{const n=p.useContext(qx),r=p.useRef(null),o=qe(t,r);return p.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(Ee.div,{...e,ref:o})});Qx.displayName=DT;function FT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Yx(jT,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function LT(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1);return p.useEffect(()=>{const o=i=>{i.target&&!r.current&&Yx(IT,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Mv(){const e=new CustomEvent(Yf);document.dispatchEvent(e)}function Yx(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Nh(o,i):o.dispatchEvent(i)}var $T=Ta,UT=Qx,dd="focusScope.autoFocusOnMount",fd="focusScope.autoFocusOnUnmount",Tv={bubbles:!1,cancelable:!0},zT="FocusScope",jh=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=p.useState(null),u=mt(o),d=mt(i),c=p.useRef(null),f=qe(t,v=>l(v)),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let v=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?c.current=C:vr(c.current,{select:!0})},x=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||vr(c.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&vr(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",x);const m=new MutationObserver(w);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,g.paused]),p.useEffect(()=>{if(a){Ov.add(g);const v=document.activeElement;if(!a.contains(v)){const w=new CustomEvent(dd,Tv);a.addEventListener(dd,u),a.dispatchEvent(w),w.defaultPrevented||(BT(WT(Xx(a)),{select:!0}),document.activeElement===v&&vr(a))}return()=>{a.removeEventListener(dd,u),setTimeout(()=>{const w=new CustomEvent(fd,Tv);a.addEventListener(fd,d),a.dispatchEvent(w),w.defaultPrevented||vr(v??document.body,{select:!0}),a.removeEventListener(fd,d),Ov.remove(g)},0)}}},[a,u,d,g]);const y=p.useCallback(v=>{if(!n&&!r||g.paused)return;const x=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(x&&w){const m=v.currentTarget,[S,C]=VT(m);S&&C?!v.shiftKey&&w===C?(v.preventDefault(),n&&vr(S,{select:!0})):v.shiftKey&&w===S&&(v.preventDefault(),n&&vr(C,{select:!0})):w===m&&v.preventDefault()}},[n,r,g.paused]);return h.jsx(Ee.div,{tabIndex:-1,...s,ref:f,onKeyDown:y})});jh.displayName=zT;function BT(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vr(r,{select:t}),document.activeElement!==n)return}function VT(e){const t=Xx(e),n=Av(t,e),r=Av(t.reverse(),e);return[n,r]}function Xx(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 Av(e,t){for(const n of e)if(!HT(n,{upTo:t}))return n}function HT(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 KT(e){return e instanceof HTMLInputElement&&"select"in e}function vr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KT(e)&&t&&e.select()}}var Ov=GT();function GT(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Nv(e,t),e.unshift(t)},remove(t){var n;e=Nv(e,t),(n=e[0])==null||n.resume()}}}function Nv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WT(e){return e.filter(t=>t.tagName!=="A")}var qT="Portal",Aa=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=p.useState(!1);Ln(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?_w.createPortal(h.jsx(Ee.div,{...r,ref:t}),s):null});Aa.displayName=qT;function QT(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Cn=e=>{const{present:t,children:n}=e,r=YT(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),i=qe(r.ref,XT(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:i}):null};Cn.displayName="Presence";function YT(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),i=p.useRef("none"),s=e?"mounted":"unmounted",[a,l]=QT(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=fl(r.current);i.current=a==="mounted"?u:"none"},[a]),Ln(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,g=fl(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ln(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=g=>{const v=fl(r.current).includes(g.animationName);if(g.target===t&&v&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=fl(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function fl(e){return(e==null?void 0:e.animationName)||"none"}function XT(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)}var pd=0;function Jx(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jv()),document.body.insertAdjacentElement("beforeend",e[1]??jv()),pd++,()=>{pd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),pd--}},[])}function jv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var In=function(){return In=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return h2;var t=g2(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])}},v2=n1(),xi="data-scroll-locked",y2=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(ZT,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(xi,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Fl,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Ll,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Fl," .").concat(Fl,` { - right: 0 `).concat(r,`; - } - - .`).concat(Ll," .").concat(Ll,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(xi,`] { - `).concat(e2,": ").concat(a,`px; - } -`)},Dv=function(){var e=parseInt(document.body.getAttribute(xi)||"0",10);return isFinite(e)?e:0},w2=function(){p.useEffect(function(){return document.body.setAttribute(xi,(Dv()+1).toString()),function(){var e=Dv()-1;e<=0?document.body.removeAttribute(xi):document.body.setAttribute(xi,e.toString())}},[])},x2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;w2();var i=p.useMemo(function(){return m2(o)},[o]);return p.createElement(v2,{styles:y2(i,!t,o,n?"":"!important")})},Xf=!1;if(typeof window<"u")try{var pl=Object.defineProperty({},"passive",{get:function(){return Xf=!0,!0}});window.addEventListener("test",pl,pl),window.removeEventListener("test",pl,pl)}catch{Xf=!1}var Xo=Xf?{passive:!1}:!1,S2=function(e){return e.tagName==="TEXTAREA"},r1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!S2(e)&&n[t]==="visible")},C2=function(e){return r1(e,"overflowY")},b2=function(e){return r1(e,"overflowX")},Fv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=o1(e,r);if(o){var i=i1(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},R2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},E2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},o1=function(e,t){return e==="v"?C2(t):b2(t)},i1=function(e,t){return e==="v"?R2(t):E2(t)},P2=function(e,t){return e==="h"&&t==="rtl"?-1:1},_2=function(e,t,n,r,o){var i=P2(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,c=0,f=0;do{var g=i1(e,a),y=g[0],v=g[1],x=g[2],w=v-x-i*y;(y||w)&&o1(e,a)&&(c+=w,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(c)<1||!o)||!d&&(Math.abs(f)<1||!o))&&(u=!0),u},hl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Lv=function(e){return[e.deltaX,e.deltaY]},$v=function(e){return e&&"current"in e?e.current:e},k2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},M2=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},T2=0,Jo=[];function A2(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(T2++)[0],i=p.useState(n1)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=JT([e.lockRef.current],(e.shards||[]).map($v),!0).filter(Boolean);return v.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(v,x){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var w=hl(v),m=n.current,S="deltaX"in v?v.deltaX:m[0]-w[0],C="deltaY"in v?v.deltaY:m[1]-w[1],P,b=v.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in v&&A==="h"&&b.type==="range")return!1;var k=Fv(A,b);if(!k)return!0;if(k?P=A:(P=A==="v"?"h":"v",k=Fv(A,b)),!k)return!1;if(!r.current&&"changedTouches"in v&&(S||C)&&(r.current=P),!P)return!0;var $=r.current||P;return _2($,x,v,$==="h"?S:C,!0)},[]),l=p.useCallback(function(v){var x=v;if(!(!Jo.length||Jo[Jo.length-1]!==i)){var w="deltaY"in x?Lv(x):hl(x),m=t.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&k2(P.delta,w)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var S=(s.current.shards||[]).map($v).filter(Boolean).filter(function(P){return P.contains(x.target)}),C=S.length>0?a(x,S[0]):!s.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),u=p.useCallback(function(v,x,w,m){var S={name:v,delta:x,target:w,should:m,shadowParent:O2(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),d=p.useCallback(function(v){n.current=hl(v),r.current=void 0},[]),c=p.useCallback(function(v){u(v.type,Lv(v),v.target,a(v,e.lockRef.current))},[]),f=p.useCallback(function(v){u(v.type,hl(v),v.target,a(v,e.lockRef.current))},[]);p.useEffect(function(){return Jo.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Xo),document.addEventListener("touchmove",l,Xo),document.addEventListener("touchstart",d,Xo),function(){Jo=Jo.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Xo),document.removeEventListener("touchmove",l,Xo),document.removeEventListener("touchstart",d,Xo)}},[]);var g=e.removeScrollBar,y=e.inert;return p.createElement(p.Fragment,null,y?p.createElement(i,{styles:M2(o)}):null,g?p.createElement(x2,{gapMode:e.gapMode}):null)}function O2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const N2=a2(t1,A2);var Ih=p.forwardRef(function(e,t){return p.createElement(Ju,In({},e,{ref:t,sideCar:N2}))});Ih.classNames=Ju.classNames;var j2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Zo=new WeakMap,gl=new WeakMap,ml={},vd=0,s1=function(e){return e&&(e.host||s1(e.parentNode))},I2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=s1(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})},D2=function(e,t,n,r){var o=I2(t,Array.isArray(e)?e:[e]);ml[n]||(ml[n]=new WeakMap);var i=ml[n],s=[],a=new Set,l=new Set(o),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(f){if(a.has(f))d(f);else try{var g=f.getAttribute(r),y=g!==null&&g!=="false",v=(Zo.get(f)||0)+1,x=(i.get(f)||0)+1;Zo.set(f,v),i.set(f,x),s.push(f),v===1&&y&&gl.set(f,!0),x===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return d(t),a.clear(),vd++,function(){s.forEach(function(c){var f=Zo.get(c)-1,g=i.get(c)-1;Zo.set(c,f),i.set(c,g),f||(gl.has(c)||c.removeAttribute(r),gl.delete(c)),g||c.removeAttribute(n)}),vd--,vd||(Zo=new WeakMap,Zo=new WeakMap,gl=new WeakMap,ml={})}},a1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=j2(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),D2(r,o,n,"aria-hidden")):function(){return null}},Dh="Dialog",[l1,RD]=ns(Dh),[F2,bn]=l1(Dh),u1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=p.useRef(null),l=p.useRef(null),[u=!1,d]=Ma({prop:r,defaultProp:o,onChange:i});return h.jsx(F2,{scope:t,triggerRef:a,contentRef:l,contentId:Po(),titleId:Po(),descriptionId:Po(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(c=>!c),[d]),modal:s,children:n})};u1.displayName=Dh;var c1="DialogTrigger",L2=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(c1,n),i=qe(t,o.triggerRef);return h.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":$h(o.open),...r,ref:i,onClick:ie(e.onClick,o.onOpenToggle)})});L2.displayName=c1;var Fh="DialogPortal",[$2,d1]=l1(Fh,{forceMount:void 0}),f1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=bn(Fh,t);return h.jsx($2,{scope:t,forceMount:n,children:p.Children.map(r,s=>h.jsx(Cn,{present:n||i.open,children:h.jsx(Aa,{asChild:!0,container:o,children:s})}))})};f1.displayName=Fh;var Cu="DialogOverlay",p1=p.forwardRef((e,t)=>{const n=d1(Cu,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=bn(Cu,e.__scopeDialog);return i.modal?h.jsx(Cn,{present:r||i.open,children:h.jsx(U2,{...o,ref:t})}):null});p1.displayName=Cu;var U2=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Cu,n);return h.jsx(Ih,{as:sn,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(Ee.div,{"data-state":$h(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Do="DialogContent",h1=p.forwardRef((e,t)=>{const n=d1(Do,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=bn(Do,e.__scopeDialog);return h.jsx(Cn,{present:r||i.open,children:i.modal?h.jsx(z2,{...o,ref:t}):h.jsx(B2,{...o,ref:t})})});h1.displayName=Do;var z2=p.forwardRef((e,t)=>{const n=bn(Do,e.__scopeDialog),r=p.useRef(null),o=qe(t,n.contentRef,r);return p.useEffect(()=>{const i=r.current;if(i)return a1(i)},[]),h.jsx(g1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,i=>i.preventDefault())})}),B2=p.forwardRef((e,t)=>{const n=bn(Do,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return h.jsx(g1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),g1=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=bn(Do,n),l=p.useRef(null),u=qe(t,l);return Jx(),h.jsxs(h.Fragment,{children:[h.jsx(jh,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(Ta,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":$h(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(V2,{titleId:a.titleId}),h.jsx(K2,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Lh="DialogTitle",m1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(Lh,n);return h.jsx(Ee.h2,{id:o.titleId,...r,ref:t})});m1.displayName=Lh;var v1="DialogDescription",y1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(v1,n);return h.jsx(Ee.p,{id:o.descriptionId,...r,ref:t})});y1.displayName=v1;var w1="DialogClose",x1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=bn(w1,n);return h.jsx(Ee.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,()=>o.onOpenChange(!1))})});x1.displayName=w1;function $h(e){return e?"open":"closed"}var S1="DialogTitleWarning",[ED,C1]=_T(S1,{contentName:Do,titleName:Lh,docsSlug:"dialog"}),V2=({titleId:e})=>{const t=C1(S1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},H2="DialogDescriptionWarning",K2=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${C1(H2).contentName}}.`;return p.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},b1=u1,R1=f1,Zu=p1,ec=h1,tc=m1,nc=y1,E1=x1;function rs(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var G2=["color"],W2=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,G2);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),q2=["color"],Q2=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,q2);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Y2=["color"],P1=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,Y2);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),X2=["color"],Uh=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,X2);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),J2=["color"],Z2=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,J2);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),eA=["color"],tA=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=rs(e,eA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const nA=b1,rA=R1,_1=p.forwardRef(({className:e,...t},n)=>h.jsx(Zu,{className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));_1.displayName=Zu.displayName;const oA=Xu("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),k1=p.forwardRef(({side:e="right",className:t,children:n,...r},o)=>h.jsxs(rA,{children:[h.jsx(_1,{}),h.jsxs(ec,{ref:o,className:Q(oA({side:e}),t),...r,children:[h.jsxs(E1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h.jsx(Uh,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]}),n]})]}));k1.displayName=ec.displayName;const iA=p.forwardRef(({className:e,...t},n)=>h.jsx(tc,{ref:n,className:Q("text-lg font-semibold text-foreground",e),...t}));iA.displayName=tc.displayName;const sA=p.forwardRef(({className:e,...t},n)=>h.jsx(nc,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));sA.displayName=nc.displayName;function Uv({className:e,...t}){return h.jsx("div",{className:Q("animate-pulse rounded-md bg-primary/10",e),...t})}const aA=["top","right","bottom","left"],qr=Math.min,$t=Math.max,bu=Math.round,vl=Math.floor,Qr=e=>({x:e,y:e}),lA={left:"right",right:"left",bottom:"top",top:"bottom"},uA={start:"end",end:"start"};function Jf(e,t,n){return $t(e,qr(t,n))}function sr(e,t){return typeof e=="function"?e(t):e}function ar(e){return e.split("-")[0]}function os(e){return e.split("-")[1]}function zh(e){return e==="x"?"y":"x"}function Bh(e){return e==="y"?"height":"width"}function Yr(e){return["top","bottom"].includes(ar(e))?"y":"x"}function Vh(e){return zh(Yr(e))}function cA(e,t,n){n===void 0&&(n=!1);const r=os(e),o=Vh(e),i=Bh(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ru(s)),[s,Ru(s)]}function dA(e){const t=Ru(e);return[Zf(e),t,Zf(t)]}function Zf(e){return e.replace(/start|end/g,t=>uA[t])}function fA(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function pA(e,t,n,r){const o=os(e);let i=fA(ar(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Zf)))),i}function Ru(e){return e.replace(/left|right|bottom|top/g,t=>lA[t])}function hA(e){return{top:0,right:0,bottom:0,left:0,...e}}function M1(e){return typeof e!="number"?hA(e):{top:e,right:e,bottom:e,left:e}}function Eu(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 zv(e,t,n){let{reference:r,floating:o}=e;const i=Yr(t),s=Vh(t),a=Bh(s),l=ar(t),u=i==="y",d=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:c};break;case"left":g={x:r.x-o.width,y:c};break;default:g={x:r.x,y:r.y}}switch(os(t)){case"start":g[s]-=f*(n&&u?-1:1);break;case"end":g[s]+=f*(n&&u?-1:1);break}return g}const gA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:c}=zv(u,r,l),f=r,g={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=sr(e,t)||{};if(u==null)return{};const c=M1(d),f={x:n,y:r},g=Vh(o),y=Bh(g),v=await s.getDimensions(u),x=g==="y",w=x?"top":"left",m=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[y]+i.reference[g]-f[g]-i.floating[y],P=f[g]-i.reference[g],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let A=b?b[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(b)))&&(A=a.floating[S]||i.floating[y]);const k=C/2-P/2,$=A/2-v[y]/2-1,R=qr(c[w],$),N=qr(c[m],$),F=R,L=A-v[y]-N,E=A/2-v[y]/2+k,M=Jf(F,E,L),j=!l.arrow&&os(o)!=null&&E!==M&&i.reference[y]/2-(EE<=0)){var N,F;const E=(((N=i.flip)==null?void 0:N.index)||0)+1,M=A[E];if(M)return{data:{index:E,overflows:R},reset:{placement:M}};let j=(F=R.filter(V=>V.overflows[0]<=0).sort((V,D)=>V.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!j)switch(g){case"bestFit":{var L;const V=(L=R.filter(D=>{if(b){const O=Yr(D.placement);return O===m||O==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(O=>O>0).reduce((O,B)=>O+B,0)]).sort((D,O)=>D[1]-O[1])[0])==null?void 0:L[0];V&&(j=V);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Bv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vv(e){return aA.some(t=>e[t]>=0)}const yA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=sr(e,t);switch(r){case"referenceHidden":{const i=await fa(t,{...o,elementContext:"reference"}),s=Bv(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Vv(s)}}}case"escaped":{const i=await fa(t,{...o,altBoundary:!0}),s=Bv(i,n.floating);return{data:{escapedOffsets:s,escaped:Vv(s)}}}default:return{}}}}};async function wA(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ar(n),a=os(n),l=Yr(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,c=sr(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),l?{x:g*d,y:f*u}:{x:f*u,y:g*d}}const xA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await wA(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},SA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:m}=x;return{x:w,y:m}}},...l}=sr(e,t),u={x:n,y:r},d=await fa(t,l),c=Yr(ar(o)),f=zh(c);let g=u[f],y=u[c];if(i){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",m=g+d[x],S=g-d[w];g=Jf(m,g,S)}if(s){const x=c==="y"?"top":"left",w=c==="y"?"bottom":"right",m=y+d[x],S=y-d[w];y=Jf(m,y,S)}const v=a.fn({...t,[f]:g,[c]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[c]:s}}}}}},CA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=sr(e,t),d={x:n,y:r},c=Yr(o),f=zh(c);let g=d[f],y=d[c];const v=sr(a,t),x=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const S=f==="y"?"height":"width",C=i.reference[f]-i.floating[S]+x.mainAxis,P=i.reference[f]+i.reference[S]-x.mainAxis;gP&&(g=P)}if(u){var w,m;const S=f==="y"?"width":"height",C=["top","left"].includes(ar(o)),P=i.reference[c]-i.floating[S]+(C&&((w=s.offset)==null?void 0:w[c])||0)+(C?0:x.crossAxis),b=i.reference[c]+i.reference[S]+(C?0:((m=s.offset)==null?void 0:m[c])||0)-(C?x.crossAxis:0);yb&&(y=b)}return{[f]:g,[c]:y}}}},bA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=sr(e,t),d=await fa(t,u),c=ar(o),f=os(o),g=Yr(o)==="y",{width:y,height:v}=i.floating;let x,w;c==="top"||c==="bottom"?(x=c,w=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=c,x=f==="end"?"top":"bottom");const m=v-d.top-d.bottom,S=y-d.left-d.right,C=qr(v-d[x],m),P=qr(y-d[w],S),b=!t.middlewareData.shift;let A=C,k=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=m),b&&!f){const R=$t(d.left,0),N=$t(d.right,0),F=$t(d.top,0),L=$t(d.bottom,0);g?k=y-2*(R!==0||N!==0?R+N:$t(d.left,d.right)):A=v-2*(F!==0||L!==0?F+L:$t(d.top,d.bottom))}await l({...t,availableWidth:k,availableHeight:A});const $=await s.getDimensions(a.floating);return y!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function rc(){return typeof window<"u"}function is(e){return T1(e)?(e.nodeName||"").toLowerCase():"#document"}function Bt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zn(e){var t;return(t=(T1(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T1(e){return rc()?e instanceof Node||e instanceof Bt(e).Node:!1}function xn(e){return rc()?e instanceof Element||e instanceof Bt(e).Element:!1}function $n(e){return rc()?e instanceof HTMLElement||e instanceof Bt(e).HTMLElement:!1}function Hv(e){return!rc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bt(e).ShadowRoot}function Oa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function RA(e){return["table","td","th"].includes(is(e))}function oc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Hh(e){const t=Kh(),n=xn(e)?Sn(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 EA(e){let t=Xr(e);for(;$n(t)&&!Gi(t);){if(Hh(t))return t;if(oc(t))return null;t=Xr(t)}return null}function Kh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gi(e){return["html","body","#document"].includes(is(e))}function Sn(e){return Bt(e).getComputedStyle(e)}function ic(e){return xn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Xr(e){if(is(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Hv(e)&&e.host||zn(e);return Hv(t)?t.host:t}function A1(e){const t=Xr(e);return Gi(t)?e.ownerDocument?e.ownerDocument.body:e.body:$n(t)&&Oa(t)?t:A1(t)}function pa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=A1(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bt(o);if(i){const a=ep(s);return t.concat(s,s.visualViewport||[],Oa(o)?o:[],a&&n?pa(a):[])}return t.concat(o,pa(o,[],n))}function ep(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function O1(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=$n(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=bu(n)!==i||bu(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Gh(e){return xn(e)?e:e.contextElement}function Si(e){const t=Gh(e);if(!$n(t))return Qr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=O1(t);let s=(i?bu(n.width):n.width)/r,a=(i?bu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const PA=Qr(0);function N1(e){const t=Bt(e);return!Kh()||!t.visualViewport?PA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _A(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bt(e)?!1:t}function Fo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gh(e);let s=Qr(1);t&&(r?xn(r)&&(s=Si(r)):s=Si(e));const a=_A(i,n,r)?N1(i):Qr(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,c=o.height/s.y;if(i){const f=Bt(i),g=r&&xn(r)?Bt(r):r;let y=f,v=ep(y);for(;v&&r&&g!==y;){const x=Si(v),w=v.getBoundingClientRect(),m=Sn(v),S=w.left+(v.clientLeft+parseFloat(m.paddingLeft))*x.x,C=w.top+(v.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,c*=x.y,l+=S,u+=C,y=Bt(v),v=ep(y)}}return Eu({width:d,height:c,x:l,y:u})}function kA(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=zn(r),a=t?oc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Qr(1);const d=Qr(0),c=$n(r);if((c||!c&&!i)&&((is(r)!=="body"||Oa(s))&&(l=ic(r)),$n(r))){const f=Fo(r);u=Si(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function MA(e){return Array.from(e.getClientRects())}function tp(e,t){const n=ic(e).scrollLeft;return t?t.left+n:Fo(zn(e)).left+n}function TA(e){const t=zn(e),n=ic(e),r=e.ownerDocument.body,o=$t(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=$t(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+tp(e);const a=-n.scrollTop;return Sn(r).direction==="rtl"&&(s+=$t(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function AA(e,t){const n=Bt(e),r=zn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Kh();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function OA(e,t){const n=Fo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=$n(e)?Si(e):Qr(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Kv(e,t,n){let r;if(t==="viewport")r=AA(e,n);else if(t==="document")r=TA(zn(e));else if(xn(t))r=OA(t,n);else{const o=N1(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Eu(r)}function j1(e,t){const n=Xr(e);return n===t||!xn(n)||Gi(n)?!1:Sn(n).position==="fixed"||j1(n,t)}function NA(e,t){const n=t.get(e);if(n)return n;let r=pa(e,[],!1).filter(a=>xn(a)&&is(a)!=="body"),o=null;const i=Sn(e).position==="fixed";let s=i?Xr(e):e;for(;xn(s)&&!Gi(s);){const a=Sn(s),l=Hh(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Oa(s)&&!l&&j1(e,s))?r=r.filter(d=>d!==s):o=a,s=Xr(s)}return t.set(e,r),r}function jA(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oc(t)?[]:NA(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const c=Kv(t,d,o);return u.top=$t(c.top,u.top),u.right=qr(c.right,u.right),u.bottom=qr(c.bottom,u.bottom),u.left=$t(c.left,u.left),u},Kv(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function IA(e){const{width:t,height:n}=O1(e);return{width:t,height:n}}function DA(e,t,n){const r=$n(t),o=zn(t),i=n==="fixed",s=Fo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Qr(0);if(r||!r&&!i)if((is(t)!=="body"||Oa(o))&&(a=ic(t)),r){const g=Fo(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&(l.x=tp(o));let u=0,d=0;if(o&&!r&&!i){const g=o.getBoundingClientRect();d=g.top+a.scrollTop,u=g.left+a.scrollLeft-tp(o,g)}const c=s.left+a.scrollLeft-l.x-u,f=s.top+a.scrollTop-l.y-d;return{x:c,y:f,width:s.width,height:s.height}}function yd(e){return Sn(e).position==="static"}function Gv(e,t){if(!$n(e)||Sn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return zn(e)===n&&(n=n.ownerDocument.body),n}function I1(e,t){const n=Bt(e);if(oc(e))return n;if(!$n(e)){let o=Xr(e);for(;o&&!Gi(o);){if(xn(o)&&!yd(o))return o;o=Xr(o)}return n}let r=Gv(e,t);for(;r&&RA(r)&&yd(r);)r=Gv(r,t);return r&&Gi(r)&&yd(r)&&!Hh(r)?n:r||EA(e)||n}const FA=async function(e){const t=this.getOffsetParent||I1,n=this.getDimensions,r=await n(e.floating);return{reference:DA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function LA(e){return Sn(e).direction==="rtl"}const $A={convertOffsetParentRelativeRectToViewportRelativeRect:kA,getDocumentElement:zn,getClippingRect:jA,getOffsetParent:I1,getElementRects:FA,getClientRects:MA,getDimensions:IA,getScale:Si,isElement:xn,isRTL:LA};function UA(e,t){let n=null,r;const o=zn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:c,height:f}=e.getBoundingClientRect();if(a||t(),!c||!f)return;const g=vl(d),y=vl(o.clientWidth-(u+c)),v=vl(o.clientHeight-(d+f)),x=vl(u),m={rootMargin:-g+"px "+-y+"px "+-v+"px "+-x+"px",threshold:$t(0,qr(1,l))||1};let S=!0;function C(P){const b=P[0].intersectionRatio;if(b!==l){if(!S)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,m)}n.observe(e)}return s(!0),i}function zA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Gh(e),d=o||i?[...u?pa(u):[],...pa(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const c=u&&a?UA(u,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(w=>{let[m]=w;m&&m.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let y,v=l?Fo(e):null;l&&x();function x(){const w=Fo(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,y=requestAnimationFrame(x)}return n(),()=>{var w;d.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),c==null||c(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const BA=xA,VA=SA,HA=vA,KA=bA,GA=yA,Wv=mA,WA=CA,qA=(e,t,n)=>{const r=new Map,o={platform:$A,...n},i={...o.platform,_c:r};return gA(e,t,{...o,platform:i})};var $l=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Pu(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(!Pu(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Pu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function D1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qv(e,t){const n=D1(e);return Math.round(t*n)/n}function wd(e){const t=p.useRef(e);return $l(()=>{t.current=e}),t}function QA(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,c]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=p.useState(r);Pu(f,r)||g(r);const[y,v]=p.useState(null),[x,w]=p.useState(null),m=p.useCallback(D=>{D!==b.current&&(b.current=D,v(D))},[]),S=p.useCallback(D=>{D!==A.current&&(A.current=D,w(D))},[]),C=i||y,P=s||x,b=p.useRef(null),A=p.useRef(null),k=p.useRef(d),$=l!=null,R=wd(l),N=wd(o),F=wd(u),L=p.useCallback(()=>{if(!b.current||!A.current)return;const D={placement:t,strategy:n,middleware:f};N.current&&(D.platform=N.current),qA(b.current,A.current,D).then(O=>{const B={...O,isPositioned:F.current!==!1};E.current&&!Pu(k.current,B)&&(k.current=B,Xi.flushSync(()=>{c(B)}))})},[f,t,n,N,F]);$l(()=>{u===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,c(D=>({...D,isPositioned:!1})))},[u]);const E=p.useRef(!1);$l(()=>(E.current=!0,()=>{E.current=!1}),[]),$l(()=>{if(C&&(b.current=C),P&&(A.current=P),C&&P){if(R.current)return R.current(C,P,L);L()}},[C,P,L,R,$]);const M=p.useMemo(()=>({reference:b,floating:A,setReference:m,setFloating:S}),[m,S]),j=p.useMemo(()=>({reference:C,floating:P}),[C,P]),V=p.useMemo(()=>{const D={position:n,left:0,top:0};if(!j.floating)return D;const O=qv(j.floating,d.x),B=qv(j.floating,d.y);return a?{...D,transform:"translate("+O+"px, "+B+"px)",...D1(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:B}},[n,a,j.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:L,refs:M,elements:j,floatingStyles:V}),[d,L,M,j,V])}const YA=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?Wv({element:r.current,padding:o}).fn(n):{}:r?Wv({element:r,padding:o}).fn(n):{}}}},XA=(e,t)=>({...BA(e),options:[e,t]}),JA=(e,t)=>({...VA(e),options:[e,t]}),ZA=(e,t)=>({...WA(e),options:[e,t]}),eO=(e,t)=>({...HA(e),options:[e,t]}),tO=(e,t)=>({...KA(e),options:[e,t]}),nO=(e,t)=>({...GA(e),options:[e,t]}),rO=(e,t)=>({...YA(e),options:[e,t]});var oO="Arrow",F1=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return h.jsx(Ee.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});F1.displayName=oO;var iO=F1;function sO(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...y}=c,v=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,y=p.useContext(g);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,aO(o,...t)]}function aO(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function lO(e){const[t,n]=p.useState(void 0);return Ln(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Wh="Popper",[L1,sc]=sO(Wh),[uO,$1]=L1(Wh),U1=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return h.jsx(uO,{scope:t,anchor:r,onAnchorChange:o,children:n})};U1.displayName=Wh;var z1="PopperAnchor",B1=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=$1(z1,n),s=p.useRef(null),a=qe(t,s);return p.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:h.jsx(Ee.div,{...o,ref:a})});B1.displayName=z1;var qh="PopperContent",[cO,dO]=L1(qh),V1=p.forwardRef((e,t)=>{var pe,ke,ye,tt,Se,it;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,x=$1(qh,n),[w,m]=p.useState(null),S=qe(t,Nt=>m(Nt)),[C,P]=p.useState(null),b=lO(C),A=(b==null?void 0:b.width)??0,k=(b==null?void 0:b.height)??0,$=r+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],F=N.length>0,L={padding:R,boundary:N.filter(pO),altBoundary:F},{refs:E,floatingStyles:M,placement:j,isPositioned:V,middlewareData:D}=QA({strategy:"fixed",placement:$,whileElementsMounted:(...Nt)=>zA(...Nt,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[XA({mainAxis:o+k,alignmentAxis:s}),l&&JA({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?ZA():void 0,...L}),l&&eO({...L}),tO({...L,apply:({elements:Nt,rects:Le,availableWidth:nt,availableHeight:an})=>{const{width:Cc,height:Fa}=Le.reference,Ko=Nt.floating.style;Ko.setProperty("--radix-popper-available-width",`${nt}px`),Ko.setProperty("--radix-popper-available-height",`${an}px`),Ko.setProperty("--radix-popper-anchor-width",`${Cc}px`),Ko.setProperty("--radix-popper-anchor-height",`${Fa}px`)}}),C&&rO({element:C,padding:a}),hO({arrowWidth:A,arrowHeight:k}),f&&nO({strategy:"referenceHidden",...L})]}),[O,B]=G1(j),q=mt(y);Ln(()=>{V&&(q==null||q())},[V,q]);const te=(pe=D.arrow)==null?void 0:pe.x,fe=(ke=D.arrow)==null?void 0:ke.y,he=((ye=D.arrow)==null?void 0:ye.centerOffset)!==0,[z,G]=p.useState();return Ln(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),h.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:V?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[(tt=D.transformOrigin)==null?void 0:tt.x,(Se=D.transformOrigin)==null?void 0:Se.y].join(" "),...((it=D.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(cO,{scope:n,placedSide:O,onArrowChange:P,arrowX:te,arrowY:fe,shouldHideArrow:he,children:h.jsx(Ee.div,{"data-side":O,"data-align":B,...v,ref:S,style:{...v.style,animation:V?void 0:"none"}})})})});V1.displayName=qh;var H1="PopperArrow",fO={top:"bottom",right:"left",bottom:"top",left:"right"},K1=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=dO(H1,r),s=fO[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(iO,{...o,ref:n,style:{...o.style,display:"block"}})})});K1.displayName=H1;function pO(e){return e!==null}var hO=e=>({name:"transformOrigin",options:e,fn(t){var x,w,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=G1(n),c={start:"0%",center:"50%",end:"100%"}[d],f=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,g=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let y="",v="";return u==="bottom"?(y=s?c:`${f}px`,v=`${-l}px`):u==="top"?(y=s?c:`${f}px`,v=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,v=s?c:`${g}px`):u==="left"&&(y=`${r.floating.width+l}px`,v=s?c:`${g}px`),{data:{x:y,y:v}}}});function G1(e){const[t,n="center"]=e.split("-");return[t,n]}var W1=U1,q1=B1,Q1=V1,Y1=K1,gO="VisuallyHidden",ac=p.forwardRef((e,t)=>h.jsx(Ee.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}}));ac.displayName=gO;var mO=ac,[lc,PD]=ns("Tooltip",[sc]),uc=sc(),X1="TooltipProvider",vO=700,np="tooltip.open",[yO,Qh]=lc(X1),J1=e=>{const{__scopeTooltip:t,delayDuration:n=vO,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=p.useState(!0),l=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),h.jsx(yO,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};J1.displayName=X1;var cc="Tooltip",[wO,Na]=lc(cc),Z1=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Qh(cc,e.__scopeTooltip),u=uc(t),[d,c]=p.useState(null),f=Po(),g=p.useRef(0),y=s??l.disableHoverableContent,v=a??l.delayDuration,x=p.useRef(!1),[w=!1,m]=Ma({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(np))):l.onClose(),i==null||i(A)}}),S=p.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),C=p.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,m(!0)},[m]),P=p.useCallback(()=>{window.clearTimeout(g.current),m(!1)},[m]),b=p.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,m(!0)},v)},[v,m]);return p.useEffect(()=>()=>window.clearTimeout(g.current),[]),h.jsx(W1,{...u,children:h.jsx(wO,{scope:t,contentId:f,open:w,stateAttribute:S,trigger:d,onTriggerChange:c,onTriggerEnter:p.useCallback(()=>{l.isOpenDelayed?b():C()},[l.isOpenDelayed,b,C]),onTriggerLeave:p.useCallback(()=>{y?P():window.clearTimeout(g.current)},[P,y]),onOpen:C,onClose:P,disableHoverableContent:y,children:n})})};Z1.displayName=cc;var rp="TooltipTrigger",eS=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Na(rp,n),i=Qh(rp,n),s=uc(n),a=p.useRef(null),l=qe(t,a,o.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),c=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),h.jsx(q1,{asChild:!0,...s,children:h.jsx(Ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:ie(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:ie(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:ie(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:ie(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:ie(e.onBlur,o.onClose),onClick:ie(e.onClick,o.onClose)})})});eS.displayName=rp;var Yh="TooltipPortal",[xO,SO]=lc(Yh,{forceMount:void 0}),tS=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Na(Yh,t);return h.jsx(xO,{scope:t,forceMount:n,children:h.jsx(Cn,{present:n||i.open,children:h.jsx(Aa,{asChild:!0,container:o,children:r})})})};tS.displayName=Yh;var Wi="TooltipContent",nS=p.forwardRef((e,t)=>{const n=SO(Wi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Na(Wi,e.__scopeTooltip);return h.jsx(Cn,{present:r||s.open,children:s.disableHoverableContent?h.jsx(rS,{side:o,...i,ref:t}):h.jsx(CO,{side:o,...i,ref:t})})}),CO=p.forwardRef((e,t)=>{const n=Na(Wi,e.__scopeTooltip),r=Qh(Wi,e.__scopeTooltip),o=p.useRef(null),i=qe(t,o),[s,a]=p.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,f=p.useCallback(()=>{a(null),c(!1)},[c]),g=p.useCallback((y,v)=>{const x=y.currentTarget,w={x:y.clientX,y:y.clientY},m=PO(w,x.getBoundingClientRect()),S=_O(w,m),C=kO(v.getBoundingClientRect()),P=TO([...S,...C]);a(P),c(!0)},[c]);return p.useEffect(()=>()=>f(),[f]),p.useEffect(()=>{if(l&&d){const y=x=>g(x,d),v=x=>g(x,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",v)}}},[l,d,g,f]),p.useEffect(()=>{if(s){const y=v=>{const x=v.target,w={x:v.clientX,y:v.clientY},m=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),S=!MO(w,s);m?f():S&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,f]),h.jsx(rS,{...e,ref:i})}),[bO,RO]=lc(cc,{isInside:!1}),rS=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Na(Wi,n),u=uc(n),{onClose:d}=l;return p.useEffect(()=>(document.addEventListener(np,d),()=>document.removeEventListener(np,d)),[d]),p.useEffect(()=>{if(l.trigger){const c=f=>{const g=f.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),h.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:h.jsxs(Q1,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx($x,{children:r}),h.jsx(bO,{scope:n,isInside:!0,children:h.jsx(mO,{id:l.contentId,role:"tooltip",children:o||r})})]})})});nS.displayName=Wi;var oS="TooltipArrow",EO=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=uc(n);return RO(oS,n).isInside?null:h.jsx(Y1,{...o,...r,ref:t})});EO.displayName=oS;function PO(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function _O(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function kO(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function MO(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function TO(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),AO(t)}function AO(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var OO=J1,NO=Z1,jO=eS,IO=tS,iS=nS;const DO=OO,FO=NO,LO=jO,sS=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(IO,{children:h.jsx(iS,{ref:r,sideOffset:t,className:Q("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));sS.displayName=iS.displayName;const $O="sidebar:state",UO=60*60*24*7,zO="16rem",BO="18rem",VO="3rem",HO="b",aS=p.createContext(null);function dc(){const e=p.useContext(aS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const lS=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:i,...s},a)=>{const l=CT(),[u,d]=p.useState(!1),[c,f]=p.useState(e),g=t??c,y=p.useCallback(m=>{if(n)return n==null?void 0:n(typeof m=="function"?m(g):m);f(m),document.cookie=`${$O}=${g}; path=/; max-age=${UO}`},[n,g]),v=p.useCallback(()=>l?d(m=>!m):y(m=>!m),[l,y,d]);p.useEffect(()=>{const m=S=>{S.key===HO&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),v())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[v]);const x=g?"expanded":"collapsed",w=p.useMemo(()=>({state:x,open:g,setOpen:y,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[x,g,y,l,u,d,v]);return h.jsx(aS.Provider,{value:w,children:h.jsx(DO,{delayDuration:0,children:h.jsx("div",{style:{"--sidebar-width":zO,"--sidebar-width-icon":VO,...o},className:Q("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...s,children:i})})})});lS.displayName="SidebarProvider";const uS=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...i},s)=>{const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=dc();return n==="none"?h.jsx("div",{className:Q("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:s,...i,children:o}):a?h.jsx(nA,{open:u,onOpenChange:d,...i,children:h.jsx(k1,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":BO},side:e,children:h.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):h.jsxs("div",{ref:s,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[h.jsx("div",{className:Q("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),h.jsx("div",{className:Q("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:h.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});uS.displayName="Sidebar";const cS=p.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:o}=dc();return h.jsxs(ir,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:Q("h-7 w-7",e),onClick:i=>{t==null||t(i),o()},...n,children:[h.jsx(pT,{}),h.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});cS.displayName="SidebarTrigger";const dS=p.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=dc();return h.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:Q("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});dS.displayName="SidebarRail";const fS=p.forwardRef(({className:e,...t},n)=>h.jsx("main",{ref:n,className:Q("relative flex min-h-[calc(100svh_-_4rem)] flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));fS.displayName="SidebarInset";const KO=p.forwardRef(({className:e,...t},n)=>h.jsx(Hx,{ref:n,"data-sidebar":"input",className:Q("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));KO.displayName="SidebarInput";const pS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"header",className:Q("flex flex-col gap-2 p-2",e),...t}));pS.displayName="SidebarHeader";const hS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"footer",className:Q("flex flex-col gap-2 p-2",e),...t}));hS.displayName="SidebarFooter";const op=p.forwardRef(({className:e,...t},n)=>h.jsx(Wx,{ref:n,"data-sidebar":"separator",className:Q("mx-2 w-auto bg-sidebar-border",e),...t}));op.displayName="SidebarSeparator";const gS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"content",className:Q("flex min-h-0 flex-1 flex-col gap-2 p-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));gS.displayName="SidebarContent";const GO=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"group",className:Q("relative flex w-full min-w-0 flex-col p-2",e),...t}));GO.displayName="SidebarGroup";const WO=p.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?sn:"div";return h.jsx(o,{ref:r,"data-sidebar":"group-label",className:Q("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});WO.displayName="SidebarGroupLabel";const qO=p.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?sn:"button";return h.jsx(o,{ref:r,"data-sidebar":"group-action",className:Q("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});qO.displayName="SidebarGroupAction";const QO=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"group-content",className:Q("w-full text-sm",e),...t}));QO.displayName="SidebarGroupContent";const mS=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,"data-sidebar":"menu",className:Q("flex w-full min-w-0 flex-col gap-1",e),...t}));mS.displayName="SidebarMenu";const lo=p.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,"data-sidebar":"menu-item",className:Q("group/menu-item relative",e),...t}));lo.displayName="SidebarMenuItem";const YO=Xu("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),uo=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:i,...s},a)=>{const l=e?sn:"button",{isMobile:u,state:d}=dc(),c=h.jsx(l,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:Q(YO({variant:n,size:r}),i),...s});return o?(typeof o=="string"&&(o={children:o}),h.jsxs(FO,{children:[h.jsx(LO,{asChild:!0,children:c}),h.jsx(sS,{side:"right",align:"center",hidden:d!=="collapsed"||u,...o})]})):c});uo.displayName="SidebarMenuButton";const XO=p.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},o)=>{const i=t?sn:"button";return h.jsx(i,{ref:o,"data-sidebar":"menu-action",className:Q("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});XO.displayName="SidebarMenuAction";const JO=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:Q("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));JO.displayName="SidebarMenuBadge";const ZO=p.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const o=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return h.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:Q("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&h.jsx(Uv,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),h.jsx(Uv,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});ZO.displayName="SidebarMenuSkeleton";const eN=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:Q("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));eN.displayName="SidebarMenuSub";const tN=p.forwardRef(({...e},t)=>h.jsx("li",{ref:t,...e}));tN.displayName="SidebarMenuSubItem";const nN=p.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...o},i)=>{const s=e?sn:"a";return h.jsx(s,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:Q("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})});nN.displayName="SidebarMenuSubButton";function rN(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...y}=c,v=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,y=p.useContext(g);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,oN(o,...t)]}function oN(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Xh(e){const t=e+"CollectionProvider",[n,r]=rN(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:y,children:v}=g,x=hr.useRef(null),w=hr.useRef(new Map).current;return h.jsx(o,{scope:y,itemMap:w,collectionRef:x,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=hr.forwardRef((g,y)=>{const{scope:v,children:x}=g,w=i(a,v),m=qe(y,w.collectionRef);return h.jsx(sn,{ref:m,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",c=hr.forwardRef((g,y)=>{const{scope:v,children:x,...w}=g,m=hr.useRef(null),S=qe(y,m),C=i(u,v);return hr.useEffect(()=>(C.itemMap.set(m,{ref:m,...w}),()=>void C.itemMap.delete(m))),h.jsx(sn,{[d]:"",ref:S,children:x})});c.displayName=u;function f(g){const y=i(e+"CollectionConsumer",g);return hr.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,P)=>w.indexOf(C.ref.current)-w.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:l,ItemSlot:c},f,r]}var iN=p.createContext(void 0);function vS(e){const t=p.useContext(iN);return e||t||"ltr"}function sN(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...y}=c,v=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>y,Object.values(y));return h.jsx(v.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,y=p.useContext(g);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,aN(o,...t)]}function aN(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var xd="rovingFocusGroup.onEntryFocus",lN={bubbles:!1,cancelable:!0},fc="RovingFocusGroup",[ip,yS,uN]=Xh(fc),[cN,wS]=sN(fc,[uN]),[dN,fN]=cN(fc),xS=p.forwardRef((e,t)=>h.jsx(ip.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(ip.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(pN,{...e,ref:t})})}));xS.displayName=fc;var pN=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=p.useRef(null),g=qe(t,f),y=vS(i),[v=null,x]=Ma({prop:s,defaultProp:a,onChange:l}),[w,m]=p.useState(!1),S=mt(u),C=yS(n),P=p.useRef(!1),[b,A]=p.useState(0);return p.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(xd,S),()=>k.removeEventListener(xd,S)},[S]),h.jsx(dN,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:p.useCallback(k=>x(k),[x]),onItemShiftTab:p.useCallback(()=>m(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>A(k=>k-1),[]),children:h.jsx(Ee.div,{tabIndex:w||b===0?-1:0,"data-orientation":r,...c,ref:g,style:{outline:"none",...e.style},onMouseDown:ie(e.onMouseDown,()=>{P.current=!0}),onFocus:ie(e.onFocus,k=>{const $=!P.current;if(k.target===k.currentTarget&&$&&!w){const R=new CustomEvent(xd,lN);if(k.currentTarget.dispatchEvent(R),!R.defaultPrevented){const N=C().filter(j=>j.focusable),F=N.find(j=>j.active),L=N.find(j=>j.id===v),M=[F,L,...N].filter(Boolean).map(j=>j.ref.current);bS(M,d)}}P.current=!1}),onBlur:ie(e.onBlur,()=>m(!1))})})}),SS="RovingFocusGroupItem",CS=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Po(),l=i||a,u=fN(SS,n),d=u.currentTabStopId===l,c=yS(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=u;return p.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),h.jsx(ip.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:h.jsx(Ee.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:ie(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:ie(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:ie(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=mN(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=c().filter(m=>m.focusable).map(m=>m.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const m=w.indexOf(y.currentTarget);w=u.loop?vN(w,m+1):w.slice(m+1)}setTimeout(()=>bS(w))}})})})});CS.displayName=SS;var hN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gN(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mN(e,t,n){const r=gN(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return hN[r]}function bS(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var yN=xS,wN=CS,sp=["Enter"," "],xN=["ArrowDown","PageUp","Home"],RS=["ArrowUp","PageDown","End"],SN=[...xN,...RS],CN={ltr:[...sp,"ArrowRight"],rtl:[...sp,"ArrowLeft"]},bN={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ja="Menu",[ha,RN,EN]=Xh(ja),[Vo,ES]=ns(ja,[EN,sc,wS]),pc=sc(),PS=wS(),[PN,Ho]=Vo(ja),[_N,Ia]=Vo(ja),_S=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=pc(t),[l,u]=p.useState(null),d=p.useRef(!1),c=mt(i),f=vS(o);return p.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),h.jsx(W1,{...a,children:h.jsx(PN,{scope:t,open:n,onOpenChange:c,content:l,onContentChange:u,children:h.jsx(_N,{scope:t,onClose:p.useCallback(()=>c(!1),[c]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};_S.displayName=ja;var kN="MenuAnchor",Jh=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pc(n);return h.jsx(q1,{...o,...r,ref:t})});Jh.displayName=kN;var Zh="MenuPortal",[MN,kS]=Vo(Zh,{forceMount:void 0}),MS=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ho(Zh,t);return h.jsx(MN,{scope:t,forceMount:n,children:h.jsx(Cn,{present:n||i.open,children:h.jsx(Aa,{asChild:!0,container:o,children:r})})})};MS.displayName=Zh;var nn="MenuContent",[TN,eg]=Vo(nn),TS=p.forwardRef((e,t)=>{const n=kS(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ho(nn,e.__scopeMenu),s=Ia(nn,e.__scopeMenu);return h.jsx(ha.Provider,{scope:e.__scopeMenu,children:h.jsx(Cn,{present:r||i.open,children:h.jsx(ha.Slot,{scope:e.__scopeMenu,children:s.modal?h.jsx(AN,{...o,ref:t}):h.jsx(ON,{...o,ref:t})})})})}),AN=p.forwardRef((e,t)=>{const n=Ho(nn,e.__scopeMenu),r=p.useRef(null),o=qe(t,r);return p.useEffect(()=>{const i=r.current;if(i)return a1(i)},[]),h.jsx(tg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ie(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ON=p.forwardRef((e,t)=>{const n=Ho(nn,e.__scopeMenu);return h.jsx(tg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tg=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:g,disableOutsideScroll:y,...v}=e,x=Ho(nn,n),w=Ia(nn,n),m=pc(n),S=PS(n),C=RN(n),[P,b]=p.useState(null),A=p.useRef(null),k=qe(t,A,x.onContentChange),$=p.useRef(0),R=p.useRef(""),N=p.useRef(0),F=p.useRef(null),L=p.useRef("right"),E=p.useRef(0),M=y?Ih:p.Fragment,j=y?{as:sn,allowPinchZoom:!0}:void 0,V=O=>{var pe,ke;const B=R.current+O,q=C().filter(ye=>!ye.disabled),te=document.activeElement,fe=(pe=q.find(ye=>ye.ref.current===te))==null?void 0:pe.textValue,he=q.map(ye=>ye.textValue),z=HN(he,B,fe),G=(ke=q.find(ye=>ye.textValue===z))==null?void 0:ke.ref.current;(function ye(tt){R.current=tt,window.clearTimeout($.current),tt!==""&&($.current=window.setTimeout(()=>ye(""),1e3))})(B),G&&setTimeout(()=>G.focus())};p.useEffect(()=>()=>window.clearTimeout($.current),[]),Jx();const D=p.useCallback(O=>{var q,te;return L.current===((q=F.current)==null?void 0:q.side)&&GN(O,(te=F.current)==null?void 0:te.area)},[]);return h.jsx(TN,{scope:n,searchRef:R,onItemEnter:p.useCallback(O=>{D(O)&&O.preventDefault()},[D]),onItemLeave:p.useCallback(O=>{var B;D(O)||((B=A.current)==null||B.focus(),b(null))},[D]),onTriggerLeave:p.useCallback(O=>{D(O)&&O.preventDefault()},[D]),pointerGraceTimerRef:N,onPointerGraceIntentChange:p.useCallback(O=>{F.current=O},[]),children:h.jsx(M,{...j,children:h.jsx(jh,{asChild:!0,trapped:o,onMountAutoFocus:ie(i,O=>{var B;O.preventDefault(),(B=A.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:h.jsx(Ta,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:g,children:h.jsx(yN,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:b,onEntryFocus:ie(l,O=>{w.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(Q1,{role:"menu","aria-orientation":"vertical","data-state":GS(x.open),"data-radix-menu-content":"",dir:w.dir,...m,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:ie(v.onKeyDown,O=>{const q=O.target.closest("[data-radix-menu-content]")===O.currentTarget,te=O.ctrlKey||O.altKey||O.metaKey,fe=O.key.length===1;q&&(O.key==="Tab"&&O.preventDefault(),!te&&fe&&V(O.key));const he=A.current;if(O.target!==he||!SN.includes(O.key))return;O.preventDefault();const G=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);RS.includes(O.key)&&G.reverse(),BN(G)}),onBlur:ie(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout($.current),R.current="")}),onPointerMove:ie(e.onPointerMove,ga(O=>{const B=O.target,q=E.current!==O.clientX;if(O.currentTarget.contains(B)&&q){const te=O.clientX>E.current?"right":"left";L.current=te,E.current=O.clientX}}))})})})})})})});TS.displayName=nn;var NN="MenuGroup",ng=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ee.div,{role:"group",...r,ref:t})});ng.displayName=NN;var jN="MenuLabel",AS=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ee.div,{...r,ref:t})});AS.displayName=jN;var _u="MenuItem",Qv="menu.itemSelect",hc=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=p.useRef(null),s=Ia(_u,e.__scopeMenu),a=eg(_u,e.__scopeMenu),l=qe(t,i),u=p.useRef(!1),d=()=>{const c=i.current;if(!n&&c){const f=new CustomEvent(Qv,{bubbles:!0,cancelable:!0});c.addEventListener(Qv,g=>r==null?void 0:r(g),{once:!0}),Nh(c,f),f.defaultPrevented?u.current=!1:s.onClose()}};return h.jsx(OS,{...o,ref:l,disabled:n,onClick:ie(e.onClick,d),onPointerDown:c=>{var f;(f=e.onPointerDown)==null||f.call(e,c),u.current=!0},onPointerUp:ie(e.onPointerUp,c=>{var f;u.current||(f=c.currentTarget)==null||f.click()}),onKeyDown:ie(e.onKeyDown,c=>{const f=a.searchRef.current!=="";n||f&&c.key===" "||sp.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});hc.displayName=_u;var OS=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=eg(_u,n),a=PS(n),l=p.useRef(null),u=qe(t,l),[d,c]=p.useState(!1),[f,g]=p.useState("");return p.useEffect(()=>{const y=l.current;y&&g((y.textContent??"").trim())},[i.children]),h.jsx(ha.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:h.jsx(wN,{asChild:!0,...a,focusable:!r,children:h.jsx(Ee.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:ie(e.onPointerMove,ga(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ie(e.onPointerLeave,ga(y=>s.onItemLeave(y))),onFocus:ie(e.onFocus,()=>c(!0)),onBlur:ie(e.onBlur,()=>c(!1))})})})}),IN="MenuCheckboxItem",NS=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(LS,{scope:e.__scopeMenu,checked:n,children:h.jsx(hc,{role:"menuitemcheckbox","aria-checked":ku(n)?"mixed":n,...o,ref:t,"data-state":og(n),onSelect:ie(o.onSelect,()=>r==null?void 0:r(ku(n)?!0:!n),{checkForDefaultPrevented:!1})})})});NS.displayName=IN;var jS="MenuRadioGroup",[DN,FN]=Vo(jS,{value:void 0,onValueChange:()=>{}}),IS=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=mt(r);return h.jsx(DN,{scope:e.__scopeMenu,value:n,onValueChange:i,children:h.jsx(ng,{...o,ref:t})})});IS.displayName=jS;var DS="MenuRadioItem",FS=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=FN(DS,e.__scopeMenu),i=n===o.value;return h.jsx(LS,{scope:e.__scopeMenu,checked:i,children:h.jsx(hc,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":og(i),onSelect:ie(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});FS.displayName=DS;var rg="MenuItemIndicator",[LS,LN]=Vo(rg,{checked:!1}),$S=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=LN(rg,n);return h.jsx(Cn,{present:r||ku(i.checked)||i.checked===!0,children:h.jsx(Ee.span,{...o,ref:t,"data-state":og(i.checked)})})});$S.displayName=rg;var $N="MenuSeparator",US=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});US.displayName=$N;var UN="MenuArrow",zS=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=pc(n);return h.jsx(Y1,{...o,...r,ref:t})});zS.displayName=UN;var zN="MenuSub",[_D,BS]=Vo(zN),As="MenuSubTrigger",VS=p.forwardRef((e,t)=>{const n=Ho(As,e.__scopeMenu),r=Ia(As,e.__scopeMenu),o=BS(As,e.__scopeMenu),i=eg(As,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const c=a.current;return()=>{window.clearTimeout(c),l(null)}},[a,l]),h.jsx(Jh,{asChild:!0,...u,children:h.jsx(OS,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":GS(n.open),...e,ref:Yu(t,o.onTriggerChange),onClick:c=>{var f;(f=e.onClick)==null||f.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ie(e.onPointerMove,ga(c=>{i.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ie(e.onPointerLeave,ga(c=>{var g,y;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,x=v==="right",w=x?-5:5,m=f[x?"left":"right"],S=f[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:c.clientX+w,y:c.clientY},{x:m,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x:m,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(c),c.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ie(e.onKeyDown,c=>{var g;const f=i.searchRef.current!=="";e.disabled||f&&c.key===" "||CN[r.dir].includes(c.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),c.preventDefault())})})})});VS.displayName=As;var HS="MenuSubContent",KS=p.forwardRef((e,t)=>{const n=kS(nn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ho(nn,e.__scopeMenu),s=Ia(nn,e.__scopeMenu),a=BS(HS,e.__scopeMenu),l=p.useRef(null),u=qe(t,l);return h.jsx(ha.Provider,{scope:e.__scopeMenu,children:h.jsx(Cn,{present:r||i.open,children:h.jsx(ha.Slot,{scope:e.__scopeMenu,children:h.jsx(tg,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var c;s.isUsingKeyboardRef.current&&((c=l.current)==null||c.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ie(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ie(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:ie(e.onKeyDown,d=>{var g;const c=d.currentTarget.contains(d.target),f=bN[s.dir].includes(d.key);c&&f&&(i.onOpenChange(!1),(g=a.trigger)==null||g.focus(),d.preventDefault())})})})})})});KS.displayName=HS;function GS(e){return e?"open":"closed"}function ku(e){return e==="indeterminate"}function og(e){return ku(e)?"indeterminate":e?"checked":"unchecked"}function BN(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function VN(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function HN(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=VN(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function KN(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function GN(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return KN(n,t)}function ga(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WN=_S,qN=Jh,QN=MS,YN=TS,XN=ng,JN=AS,ZN=hc,ej=NS,tj=IS,nj=FS,rj=$S,oj=US,ij=zS,sj=VS,aj=KS,ig="DropdownMenu",[lj,kD]=ns(ig,[ES]),bt=ES(),[uj,WS]=lj(ig),qS=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=bt(t),u=p.useRef(null),[d=!1,c]=Ma({prop:o,defaultProp:i,onChange:s});return h.jsx(uj,{scope:t,triggerId:Po(),triggerRef:u,contentId:Po(),open:d,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(f=>!f),[c]),modal:a,children:h.jsx(WN,{...l,open:d,onOpenChange:c,dir:r,modal:a,children:n})})};qS.displayName=ig;var QS="DropdownMenuTrigger",YS=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=WS(QS,n),s=bt(n);return h.jsx(qN,{asChild:!0,...s,children:h.jsx(Ee.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:Yu(t,i.triggerRef),onPointerDown:ie(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ie(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});YS.displayName=QS;var cj="DropdownMenuPortal",XS=e=>{const{__scopeDropdownMenu:t,...n}=e,r=bt(t);return h.jsx(QN,{...r,...n})};XS.displayName=cj;var JS="DropdownMenuContent",ZS=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=WS(JS,n),i=bt(n),s=p.useRef(!1);return h.jsx(YN,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:ie(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:ie(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(s.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)"}})});ZS.displayName=JS;var dj="DropdownMenuGroup",fj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(XN,{...o,...r,ref:t})});fj.displayName=dj;var pj="DropdownMenuLabel",eC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(JN,{...o,...r,ref:t})});eC.displayName=pj;var hj="DropdownMenuItem",tC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(ZN,{...o,...r,ref:t})});tC.displayName=hj;var gj="DropdownMenuCheckboxItem",nC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(ej,{...o,...r,ref:t})});nC.displayName=gj;var mj="DropdownMenuRadioGroup",vj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(tj,{...o,...r,ref:t})});vj.displayName=mj;var yj="DropdownMenuRadioItem",rC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(nj,{...o,...r,ref:t})});rC.displayName=yj;var wj="DropdownMenuItemIndicator",oC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(rj,{...o,...r,ref:t})});oC.displayName=wj;var xj="DropdownMenuSeparator",iC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(oj,{...o,...r,ref:t})});iC.displayName=xj;var Sj="DropdownMenuArrow",Cj=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(ij,{...o,...r,ref:t})});Cj.displayName=Sj;var bj="DropdownMenuSubTrigger",sC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(sj,{...o,...r,ref:t})});sC.displayName=bj;var Rj="DropdownMenuSubContent",aC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(aj,{...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)"}})});aC.displayName=Rj;var Ej=qS,Pj=YS,_j=XS,lC=ZS,uC=eC,cC=tC,dC=nC,fC=rC,pC=oC,hC=iC,gC=sC,mC=aC;const gc=Ej,mc=Pj,kj=p.forwardRef(({className:e,inset:t,children:n,...r},o)=>h.jsxs(gC,{ref:o,className:Q("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,h.jsx(P1,{className:"ml-auto h-4 w-4"})]}));kj.displayName=gC.displayName;const Mj=p.forwardRef(({className:e,...t},n)=>h.jsx(mC,{ref:n,className:Q("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}));Mj.displayName=mC.displayName;const Da=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(_j,{children:h.jsx(lC,{ref:r,sideOffset:t,className:Q("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})}));Da.displayName=lC.displayName;const gn=p.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(cC,{ref:r,className:Q("relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));gn.displayName=cC.displayName;const Tj=p.forwardRef(({className:e,children:t,checked:n,...r},o)=>h.jsxs(dC,{ref:o,className:Q("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(pC,{children:h.jsx(W2,{className:"h-4 w-4"})})}),t]}));Tj.displayName=dC.displayName;const Aj=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(fC,{ref:r,className:Q("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(pC,{children:h.jsx(Z2,{className:"h-4 w-4 fill-current"})})}),t]}));Aj.displayName=fC.displayName;const sg=p.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(uC,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));sg.displayName=uC.displayName;const vc=p.forwardRef(({className:e,...t},n)=>h.jsx(hC,{ref:n,className:Q("-mx-1 my-1 h-px bg-muted",e),...t}));vc.displayName=hC.displayName;var ag="Avatar",[Oj,MD]=ns(ag),[Nj,vC]=Oj(ag),yC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=p.useState("idle");return h.jsx(Nj,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:h.jsx(Ee.span,{...r,ref:t})})});yC.displayName=ag;var wC="AvatarImage",xC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=vC(wC,n),a=jj(r,i.referrerPolicy),l=mt(u=>{o(u),s.onImageLoadingStatusChange(u)});return Ln(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?h.jsx(Ee.img,{...i,ref:t,src:r}):null});xC.displayName=wC;var SC="AvatarFallback",CC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=vC(SC,n),[s,a]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?h.jsx(Ee.span,{...o,ref:t}):null});CC.displayName=SC;function jj(e,t){const[n,r]=p.useState("idle");return Ln(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,s=a=>()=>{o&&r(a)};return r("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var bC=yC,RC=xC,EC=CC;const PC=p.forwardRef(({className:e,...t},n)=>h.jsx(bC,{ref:n,className:Q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));PC.displayName=bC.displayName;const _C=p.forwardRef(({className:e,...t},n)=>h.jsx(RC,{ref:n,className:Q("aspect-square h-full w-full",e),...t}));_C.displayName=RC.displayName;const kC=p.forwardRef(({className:e,...t},n)=>h.jsx(EC,{ref:n,className:Q("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));kC.displayName=EC.displayName;const MC=({user:e})=>{var n,r,o,i,s,a,l,u;const t=WM(e.name);return h.jsx(PC,{className:"h-8 w-8",children:(r=(n=e.photo)==null?void 0:n[0])!=null&&r.url||(i=(o=e.photo)==null?void 0:o[0])!=null&&i.data?h.jsx(_C,{src:((a=(s=e.photo)==null?void 0:s[0])==null?void 0:a.url)||((u=(l=e.photo)==null?void 0:l[0])==null?void 0:u.data),alt:name}):h.jsx(kC,{className:e.resourceType==="Patient"?"bg-pink-400 text-pink-50":"bg-teal-400 text-teal-50",children:t})})},Ij=()=>{const{user:e}=Bo(),t=Uw("/"),n=ka(),r=()=>{var o;(o=n._clearState)==null||o.call(n),location.href=t};return h.jsxs(gc,{children:[h.jsx(mc,{asChild:!0,children:h.jsxs(ir,{variant:"ghost",className:"flex items-center h-11",children:[h.jsx(MC,{user:e}),h.jsx("span",{className:"hidden md:block",children:ts(e.name)}),h.jsx(aT,{className:"h-4 w-4 opacity-50"})]})}),h.jsxs(Da,{align:"end",className:"w-56",children:[h.jsxs(gn,{children:[h.jsx(wT,{}),e.resourceType," profile"]}),h.jsxs(gn,{children:[h.jsx(gT,{}),"Settings"]}),h.jsx(vc,{}),h.jsxs(gn,{onClick:r,children:[h.jsx(fT,{className:"h-4 w-4"}),h.jsx("span",{children:"Log out"})]})]})]})};function Dj({title:e}){return h.jsxs("header",{className:"flex h-16 items-center border-b px-4 flex-shrink-0 gap-4",children:[h.jsx(cS,{}),e,h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs(ir,{variant:"ghost",size:"icon",children:[h.jsx(sT,{className:"h-5 w-5"}),h.jsx("span",{className:"sr-only",children:"Notifications"})]}),h.jsx(Ij,{})]})]})}const TC=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Q("rounded-xl border bg-card text-card-foreground shadow",e),...t}));TC.displayName="Card";const AC=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Q("flex flex-col space-y-1.5 p-6",e),...t}));AC.displayName="CardHeader";const OC=p.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:Q("font-semibold leading-none tracking-tight",e),...t}));OC.displayName="CardTitle";const Fj=p.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));Fj.displayName="CardDescription";const NC=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Q("p-6 pt-0",e),...t}));NC.displayName="CardContent";const Lj=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:Q("flex items-center p-6 pt-0",e),...t}));Lj.displayName="CardFooter";const $j=()=>{const{patient:e,user:t}=Bo();if(!e||t.resourceType==="Patient")return;const n=ts(e.name),r=e.birthDate?new Date().getFullYear()-new Date(e.birthDate).getFullYear():"unknown",o=e.address?KM(e.address):"unknown",i=GM(e.gender);return h.jsxs(TC,{className:"mx-4 mb-4 shadow-none",children:[h.jsxs(AC,{className:"px-4 space-y-0 py-2 border-b flex-row items-center",children:[h.jsx(OC,{children:"Current Patient"}),h.jsxs(gc,{children:[h.jsx(mc,{asChild:!0,children:h.jsxs(ir,{variant:"ghost",className:"h-8 w-8 ml-auto",children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Oh,{className:"h-4 w-4"})]})}),h.jsx(Da,{align:"start",children:h.jsxs(gn,{onClick:()=>navigator.clipboard.writeText(e.id),children:[h.jsx(Ah,{}),"Copy ID"]})})]})]}),h.jsxs(NC,{className:"px-4 py-3",children:[h.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[h.jsx(MC,{user:e}),h.jsxs("div",{className:"flex flex-col text-sm",children:[h.jsx("div",{className:" font-medium",children:n}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[i,", ",r," years old"]})]})]}),h.jsx("div",{className:"text-xs text-muted-foreground",children:o})]})]})},Uj=()=>{const{user:e}=Bo(),t=Uo();return h.jsxs(uS,{className:"border-r",children:[h.jsx(pS,{className:"h-16 items-center flex-row px-4",children:h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e.resourceType==="Patient"?"Patient Portal":"Provider EHR"})}),h.jsx(gS,{children:h.jsxs(mS,{children:[h.jsx(lo,{children:h.jsx(uo,{asChild:!0,isActive:t.pathname==="/",children:h.jsxs(Bs,{to:"/",children:[h.jsx(dT,{className:"mr-2 h-5 w-5"}),"Dashboard"]})})}),e.resourceType==="Practitioner"&&h.jsxs(h.Fragment,{children:[h.jsx(lo,{children:h.jsxs(uo,{children:[h.jsx(ST,{className:"mr-2 h-5 w-5"}),"Patients"]})}),h.jsx(lo,{children:h.jsxs(uo,{children:[h.jsx(lT,{className:"mr-2 h-5 w-5"}),"Appointments"]})}),h.jsx(op,{}),h.jsx(lo,{children:h.jsx(uo,{asChild:!0,isActive:t.pathname==="/questionnaires",children:h.jsxs(Bs,{to:"/questionnaires",children:[h.jsx(cT,{className:"mr-2 h-5 w-5"}),"Questionnaires"]})})})]}),h.jsx(lo,{children:h.jsx(uo,{asChild:!0,isActive:t.pathname==="/questionnaire-responses",children:h.jsxs(Bs,{to:"/questionnaire-responses",children:[h.jsx(vT,{className:"mr-2 h-5 w-5"}),"Questionnaire Responses"]})})}),h.jsx(op,{}),h.jsx(lo,{children:h.jsxs(uo,{children:[h.jsx(mT,{className:"mr-2 h-5 w-5"}),"Settings"]})})]})}),h.jsx(hS,{children:h.jsx($j,{})}),h.jsx(dS,{})]})},jC=e=>h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 150",...e,children:h.jsx("path",{fill:"none",stroke:"#F472B6",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"300 385",strokeDashoffset:"0",d:"M275 75c0 31-27 50-50 50-58 0-92-100-150-100-28 0-50 22-50 50s23 50 50 50c58 0 92-100 150-100 24 0 50 19 50 50Z",children:h.jsx("animate",{attributeName:"stroke-dashoffset",calcMode:"spline",dur:"2",values:"685;-685",keySplines:"0 0 1 1",repeatCount:"indefinite"})})}),lg=()=>h.jsx("div",{className:"flex-1 grid place-items-center",children:h.jsx(jC,{width:"80"})}),zj=()=>h.jsx(uM,{children:h.jsx(dM,{children:h.jsx(lS,{style:{"--sidebar-width":"18rem"},children:h.jsx("div",{className:"flex h-screen flex-col w-full",children:h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsx(Uj,{}),h.jsxs(fS,{className:"flex-1",children:[h.jsx(Dj,{}),h.jsx(p.Suspense,{fallback:h.jsx(lg,{}),children:h.jsx(Ww,{})})]})]})})})})});/** - * 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 Dr(e,t){return typeof e=="function"?e(t):e}function Ht(e,t){return n=>{t.setState(r=>({...r,[e]:Dr(n,r[e])}))}}function yc(e){return e instanceof Function}function Bj(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Vj(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function le(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((d,c)=>r[c]!==d)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-s)*100)/100,c=Math.round((Date.now()-u)*100)/100,f=c/16,g=(y,v)=>{for(y=String(y);y.length{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function Hj(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:le(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ue(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Kj(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=f=>{let g=f;for(const v of l.split(".")){var y;g=(y=g)==null?void 0:y[v]}return g}:d=f=>f[a.accessorKey]),!u)throw new Error;let c={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:le(()=>[!0],()=>{var f;return[c,...(f=c.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},ue(e.options,"debugColumns")),getLeafColumns:le(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=c.columns)!=null&&g.length){let y=c.columns.flatMap(v=>v.getLeafColumns());return f(y)}return[c]},ue(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(c,e);return c}const ft="debugHeaders";function Yv(e,t,n){var r;let i={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 s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Gj={createTable:e=>{e.getHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?s:[],u=n.filter(c=>!(r!=null&&r.includes(c.id))&&!(o!=null&&o.includes(c.id)));return yl(t,[...a,...u,...l],e)},ue(e.options,ft)),e.getCenterHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),yl(t,n,e,"center")),ue(e.options,ft)),e.getLeftHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return yl(t,i,e,"left")},ue(e.options,ft)),e.getRightHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return yl(t,i,e,"right")},ue(e.options,ft)),e.getFooterGroups=le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getLeftFooterGroups=le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getCenterFooterGroups=le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getRightFooterGroups=le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getFlatHeaders=le(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getLeftFlatHeaders=le(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterFlatHeaders=le(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getRightFlatHeaders=le(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterLeafHeaders=le(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeftLeafHeaders=le(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getRightLeafHeaders=le(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeafHeaders=le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},ue(e.options,ft))}};function yl(e,t,n,r){var o,i;let s=0;const a=function(f,g){g===void 0&&(g=1),s=Math.max(s,g),f.filter(y=>y.getIsVisible()).forEach(y=>{var v;(v=y.columns)!=null&&v.length&&a(y.columns,g+1)},0)};a(e);let l=[];const u=(f,g)=>{const y={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},v=[];f.forEach(x=>{const w=[...v].reverse()[0],m=x.column.depth===y.depth;let S,C=!1;if(m&&x.column.parent?S=x.column.parent:(S=x.column,C=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(x);else{const P=Yv(n,S,{id:[r,g,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${v.filter(b=>b.column===S).length}`:void 0,depth:g,index:v.length});P.subHeaders.push(x),v.push(P)}y.headers.push(x),x.headerGroup=y}),l.push(y),g>0&&u(v,g-1)},d=t.map((f,g)=>Yv(n,f,{depth:s,index:g}));u(d,s-1),l.reverse();const c=f=>f.filter(y=>y.column.getIsVisible()).map(y=>{let v=0,x=0,w=[0];y.subHeaders&&y.subHeaders.length?(w=[],c(y.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:P}=S;v+=C,w.push(P)})):v=1;const m=Math.min(...w);return x=x+m,y.colSpan=v,y.rowSpan=x,{colSpan:v,rowSpan:x}});return c((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Wj=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Vj(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:le(()=>[e.getAllLeafColumns()],l=>l.map(u=>Hj(e,a,u,u.id)),ue(e.options,"debugRows")),_getAllCellsByColumnId:le(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),ue(e.options,"debugRows"))};for(let l=0;l{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()}}},IC=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};IC.autoRemove=e=>yn(e);const DC=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};DC.autoRemove=e=>yn(e);const FC=(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())};FC.autoRemove=e=>yn(e);const LC=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};LC.autoRemove=e=>yn(e)||!(e!=null&&e.length);const $C=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});$C.autoRemove=e=>yn(e)||!(e!=null&&e.length);const UC=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});UC.autoRemove=e=>yn(e)||!(e!=null&&e.length);const zC=(e,t,n)=>e.getValue(t)===n;zC.autoRemove=e=>yn(e);const BC=(e,t,n)=>e.getValue(t)==n;BC.autoRemove=e=>yn(e);const ug=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};ug.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};ug.autoRemove=e=>yn(e)||yn(e[0])&&yn(e[1]);const Wn={includesString:IC,includesStringSensitive:DC,equalsString:FC,arrIncludes:LC,arrIncludesAll:$C,arrIncludesSome:UC,equals:zC,weakEquals:BC,inNumberRange:ug};function yn(e){return e==null||e===""}const Qj={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ht("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"?Wn.includesString:typeof r=="number"?Wn.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Wn.equals:Array.isArray(r)?Wn.arrIncludes:Wn.weakEquals},e.getFilterFn=()=>{var n,r;return yc(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:Wn[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(),i=r==null?void 0:r.find(d=>d.id===e.id),s=Dr(n,i?i.value:void 0);if(Xv(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Dr(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(Xv(l,s.value,a))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 Xv(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Yj=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Xj=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},Jj=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r=i)&&(r=i)}),r},Zj=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},tI=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Bj(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},nI=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),rI=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,oI=(e,t)=>t.length,Sd={sum:Yj,min:Xj,max:Jj,extent:Zj,mean:eI,median:tI,unique:nI,uniqueCount:rI,count:oI},iI={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:Ht("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 Sd.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Sd.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return yc(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:Sd[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 sI(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const aI={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ht("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=le(n=>[Hs(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Hs(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Hs(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 i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return sI(i,n,r)},ue(e.options,"debugTable"))}},Cd=()=>({left:[],right:[]}),lI={getInitialState:e=>({columnPinning:Cd(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ht("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(c=>!(r!=null&&r.includes(c))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(c=>!(r!=null&&r.includes(c))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(c=>!(r!=null&&r.includes(c))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(c=>!(r!=null&&r.includes(c)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(c=>!(r!=null&&r.includes(c))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(c=>!(r!=null&&r.includes(c)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"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 i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows")),e.getLeftVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows")),e.getRightVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(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?Cd():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Cd())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.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),ue(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),ue(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(i=>!o.includes(i.id))},ue(e.options,"debugColumns"))}},wl={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},bd=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),uI={getDefaultColumnDef:()=>wl,getInitialState:e=>({columnSizing:{},columnSizingInfo:bd(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ht("columnSizing",e),onColumnSizingInfoChange:Ht("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:wl.minSize,(r=i??e.columnDef.size)!=null?r:wl.size),(o=e.columnDef.maxSize)!=null?o:wl.maxSize)},e.getStart=le(n=>[n,Hs(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns")),e.getAfter=le(n=>[n,Hs(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(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 i;n+=(i=o.column.getSize())!=null?i: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 i=>{if(!r||!o||(i.persist==null||i.persist(),Rd(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Rd(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(S=>{var C,P;const b=t.options.columnResizeDirection==="rtl"?-1:1,A=(m-((C=S==null?void 0:S.startOffset)!=null?C:0))*b,k=Math.max(A/((P=S==null?void 0:S.startSize)!=null?P:0),-.999999);return S.columnSizingStart.forEach($=>{let[R,N]=$;u[R]=Math.round(Math.max(N+N*k,0)*100)/100}),{...S,deltaOffset:A,deltaPercentage:k}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...u})))},c=w=>d("move",w),f=w=>{d("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,y={moveHandler:w=>c(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",y.moveHandler),g==null||g.removeEventListener("mouseup",y.upHandler),f(w.clientX)}},v={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),c(w.touches[0].clientX),!1),upHandler:w=>{var m;g==null||g.removeEventListener("touchmove",v.moveHandler),g==null||g.removeEventListener("touchend",v.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((m=w.touches[0])==null?void 0:m.clientX)}},x=cI()?{passive:!1}:!1;Rd(i)?(g==null||g.addEventListener("touchmove",v.moveHandler,x),g==null||g.addEventListener("touchend",v.upHandler,x)):(g==null||g.addEventListener("mousemove",y.moveHandler,x),g==null||g.addEventListener("mouseup",y.upHandler,x)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,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?bd():(n=e.initialState.columnSizingInfo)!=null?n:bd())},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 xl=null;function cI(){if(typeof xl=="boolean")return xl;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 xl=e,xl}function Rd(e){return e.type==="touchstart"}const dI={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ht("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(i=>i.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()),ue(t.options,"debugRows")),e.getVisibleCells=le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>le(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(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,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.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 Hs(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const fI={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()}}},pI={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Ht("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,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Wn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return yc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Wn[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},hI={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ht("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,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.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(i=>{const s=i.split(".");r=Math.max(r,s.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 i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}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()}}}},ap=0,lp=10,Ed=()=>({pageIndex:ap,pageSize:lp}),gI={getInitialState:e=>({...e,pagination:{...Ed(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ht("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=i=>Dr(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Ed():(o=e.initialState.pagination)!=null?o:Ed())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Dr(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?ap:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:ap)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?lp:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:lp)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Dr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Dr(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=le(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(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}}},Pd=()=>({top:[],bottom:[]}),mI={getInitialState:e=>({rowPinning:Pd(),...e}),getDefaultOptions:e=>({onRowPinningChange:Ht("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,d;if(n==="bottom"){var c,f;return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(a!=null&&a.has(v))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)]}}if(n==="top"){var g,y;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)],bottom:((y=l==null?void 0:l.bottom)!=null?y:[]).filter(v=>!(a!=null&&a.has(v)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(v=>!(a!=null&&a.has(v))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(v=>!(a!=null&&a.has(v)))}})},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,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.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?Pd():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Pd())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows")),e.getBottomRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(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(i=>!o.has(i.id))},ue(e.options,"debugRows"))}},vI={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ht("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(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{up(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?_d(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getFilteredSelectedRowModel=le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?_d(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getGroupedSelectedRowModel=le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?_d(e,n):{rows:[],flatRows:[],rowsById:{}},ue(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(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return up(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return cg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return cp(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return cp(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)}}}},up=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>up(e,a.id,n,r,o))};function _d(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=cg(l,n);if(d&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function cg(e,t){var n;return(n=t[e.id])!=null?n:!1}function cp(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(cg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=cp(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const dp=/([0-9]+)/gm,yI=(e,t,n)=>VC(Jr(e.getValue(n)).toLowerCase(),Jr(t.getValue(n)).toLowerCase()),wI=(e,t,n)=>VC(Jr(e.getValue(n)),Jr(t.getValue(n))),xI=(e,t,n)=>dg(Jr(e.getValue(n)).toLowerCase(),Jr(t.getValue(n)).toLowerCase()),SI=(e,t,n)=>dg(Jr(e.getValue(n)),Jr(t.getValue(n))),CI=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:rdg(e.getValue(n),t.getValue(n));function dg(e,t){return e===t?0:e>t?1:-1}function Jr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function VC(e,t){const n=e.split(dp).filter(Boolean),r=t.split(dp).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const bs={alphanumeric:yI,alphanumericCaseSensitive:wI,text:xI,textCaseSensitive:SI,datetime:CI,basic:bI},RI={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ht("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 i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return bs.datetime;if(typeof i=="string"&&(r=!0,i.split(dp).length>1))return bs.alphanumeric}return r?bs.text:bs.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 yc(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:bs[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let u=[],d,c=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var f;u=[...s,{id:e.id,desc:c}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=s.map(g=>g.id===e.id?{...g,desc:c}:g):d==="remove"?u=s.filter(g=>g.id!==e.id):u=[{id:e.id,desc:c}];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 i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},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())}},EI=[Gj,dI,aI,lI,qj,Qj,fI,pI,RI,iI,hI,gI,mI,vI,uI];function PI(e){var t,n;const r=[...EI,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var g;l=(g=f.getInitialState==null?void 0:f.getInitialState(l))!=null?g:l});const u=[];let d=!1;const c={_features:r,options:{...i,...e},initialState:l,_queue:f=>{u.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const g=Dr(f,o.options);o.options=s(g)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,g,y)=>{var v;return(v=o.options.getRowId==null?void 0:o.options.getRowId(f,g,y))!=null?v:`${y?[y.id,g].join("."):g}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,g)=>{let y=(g?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!y&&(y=o.getCoreRowModel().rowsById[f],!y))throw new Error;return y},_getDefaultColumnDef:le(()=>[o.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:y=>{const v=y.header.column.columnDef;return v.accessorKey?v.accessorKey:v.accessorFn?v.id:null},cell:y=>{var v,x;return(v=(x=y.renderValue())==null||x.toString==null?void 0:x.toString())!=null?v:null},...o._features.reduce((y,v)=>Object.assign(y,v.getDefaultColumnDef==null?void 0:v.getDefaultColumnDef()),{}),...f}},ue(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:le(()=>[o._getColumnDefs()],f=>{const g=function(y,v,x){return x===void 0&&(x=0),y.map(w=>{const m=Kj(o,w,x,v),S=w;return m.columns=S.columns?g(S.columns,m,x+1):[],m})};return g(f)},ue(e,"debugColumns")),getAllFlatColumns:le(()=>[o.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),ue(e,"debugColumns")),_getAllFlatColumnsById:le(()=>[o.getAllFlatColumns()],f=>f.reduce((g,y)=>(g[y.id]=y,g),{}),ue(e,"debugColumns")),getAllLeafColumns:le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,g)=>{let y=f.flatMap(v=>v.getLeafColumns());return g(y)},ue(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,c);for(let f=0;fle(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;ue._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 Jv(e,t){return e?kI(e)?p.createElement(e,t):e:null}function kI(e){return MI(e)||typeof e=="function"||TI(e)}function MI(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function TI(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function AI(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:PI(t)})),[r,o]=p.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const HC=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{className:"relative w-full overflow-auto",children:h.jsx("table",{ref:n,className:Q("w-full caption-bottom text-sm",e),...t})}));HC.displayName="Table";const KC=p.forwardRef(({className:e,...t},n)=>h.jsx("thead",{ref:n,className:Q("[&_tr]:border-b",e),...t}));KC.displayName="TableHeader";const GC=p.forwardRef(({className:e,...t},n)=>h.jsx("tbody",{ref:n,className:Q("[&_tr:last-child]:border-0",e),...t}));GC.displayName="TableBody";const OI=p.forwardRef(({className:e,...t},n)=>h.jsx("tfoot",{ref:n,className:Q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));OI.displayName="TableFooter";const Ul=p.forwardRef(({className:e,...t},n)=>h.jsx("tr",{ref:n,className:Q("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ul.displayName="TableRow";const WC=p.forwardRef(({className:e,...t},n)=>h.jsx("th",{ref:n,className:Q("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));WC.displayName="TableHead";const fp=p.forwardRef(({className:e,...t},n)=>h.jsx("td",{ref:n,className:Q("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));fp.displayName="TableCell";const NI=p.forwardRef(({className:e,...t},n)=>h.jsx("caption",{ref:n,className:Q("mt-4 text-sm text-muted-foreground",e),...t}));NI.displayName="TableCaption";const qC=({columns:e,data:t})=>{var r;const n=AI({data:t,columns:e,getCoreRowModel:_I()});return h.jsx("div",{className:"rounded-md border",children:h.jsxs(HC,{children:[h.jsx(KC,{children:n.getHeaderGroups().map(o=>h.jsx(Ul,{children:o.headers.map(i=>h.jsx(WC,{children:i.isPlaceholder?null:Jv(i.column.columnDef.header,i.getContext())},i.id))},o.id))}),h.jsx(GC,{children:(r=n.getRowModel().rows)!=null&&r.length?n.getRowModel().rows.map(o=>h.jsx(Ul,{"data-state":o.getIsSelected()&&"selected",children:o.getVisibleCells().map(i=>h.jsx(fp,{children:Jv(i.column.columnDef.cell,i.getContext())},i.id))},o.id)):h.jsx(Ul,{children:h.jsx(fp,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})},jI=b1,II=R1,QC=p.forwardRef(({className:e,...t},n)=>h.jsx(Zu,{ref:n,className:Q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));QC.displayName=Zu.displayName;const YC=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(II,{children:[h.jsx(QC,{}),h.jsxs(ec,{ref:r,className:Q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(E1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(Uh,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));YC.displayName=ec.displayName;const XC=({className:e,...t})=>h.jsx("div",{className:Q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});XC.displayName="DialogHeader";const JC=p.forwardRef(({className:e,...t},n)=>h.jsx(tc,{ref:n,className:Q("text-lg font-semibold leading-none tracking-tight",e),...t}));JC.displayName=tc.displayName;const DI=p.forwardRef(({className:e,...t},n)=>h.jsx(nc,{ref:n,className:Q("text-sm text-muted-foreground",e),...t}));DI.displayName=nc.displayName;const FI=3,LI=1e6;let kd=0;function $I(){return kd=(kd+1)%Number.MAX_SAFE_INTEGER,kd.toString()}const Md=new Map,Zv=e=>{if(Md.has(e))return;const t=setTimeout(()=>{Md.delete(e),Ks({type:"REMOVE_TOAST",toastId:e})},LI);Md.set(e,t)},UI=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,FI)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Zv(n):e.toasts.forEach(r=>{Zv(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},zl=[];let Bl={toasts:[]};function Ks(e){Bl=UI(Bl,e),zl.forEach(t=>{t(Bl)})}function zI({...e}){const t=$I(),n=o=>Ks({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Ks({type:"DISMISS_TOAST",toastId:t});return Ks({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function wc(){const[e,t]=p.useState(Bl);return p.useEffect(()=>(zl.push(t),()=>{const n=zl.indexOf(t);n>-1&&zl.splice(n,1)}),[e]),{...e,toast:zI,dismiss:n=>Ks({type:"DISMISS_TOAST",toastId:n})}}const fg=e=>{var r;const[,t]=p.useState(!1),n=p.useRef(null);if((r=n.current)!=null&&r.promise)throw n.current.promise;p.useLayoutEffect(()=>{n.current===null&&(n.current={},n.current.promise=new Promise(o=>{n.current.resolve=o}),t(!0))},[]),p.useEffect(()=>{const o=e.current;if(o){const i=()=>{setTimeout(()=>{var s;(s=n.current)==null||s.resolve(),n.current.promise=null},300)};return o.addEventListener("ready",i),()=>{o.removeEventListener("ready",i)}}},[])},BI=({id:e})=>{const t=p.useRef(),{data:n}=Wr({queryKey:["questionnaire",e],queryFn:()=>Io.request(`Questionnaire/${e}`)}),{toast:r}=wc();return p.useEffect(()=>{const o=t.current,i=s=>{(s.detail.status==="completed"||s.detail.status==="amended")&&r({title:"Not saved",description:"This is a preview, changes will not be saved"})};return o.addEventListener("change",i),()=>{o.removeEventListener("change",i)}},[]),fg(t),h.jsx("aidbox-form-renderer",{ref:t,questionnaire:JSON.stringify(n),style:{width:"100%",height:"100%",border:"none",flex:1}})},ZC=({className:e,...t})=>h.jsx("nav",{role:"navigation","aria-label":"pagination",className:Q("mx-auto flex w-full justify-center",e),...t});ZC.displayName="Pagination";const eb=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,className:Q("flex flex-row items-center gap-1",e),...t}));eb.displayName="PaginationContent";const kn=p.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,className:Q("",e),...t}));kn.displayName="PaginationItem";const Cr=({className:e,isActive:t,size:n="icon",...r})=>h.jsx(Bs,{"aria-current":t?"page":void 0,className:Q(Vx({variant:t?"outline":"ghost",size:n}),e),...r});Cr.displayName="PaginationLink";const tb=({className:e,...t})=>h.jsxs(Cr,{"aria-label":"Go to previous page",size:"default",className:Q("gap-1 pl-2.5",e),...t,children:[h.jsx(Q2,{className:"h-4 w-4"}),h.jsx("span",{children:"Previous"})]});tb.displayName="PaginationPrevious";const nb=({className:e,...t})=>h.jsxs(Cr,{"aria-label":"Go to next page",size:"default",className:Q("gap-1 pr-2.5",e),...t,children:[h.jsx("span",{children:"Next"}),h.jsx(P1,{className:"h-4 w-4"})]});nb.displayName="PaginationNext";const pp=({className:e,...t})=>h.jsxs("span",{"aria-hidden":!0,className:Q("flex h-9 w-9 items-center justify-center",e),...t,children:[h.jsx(tA,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"More pages"})]});pp.displayName="PaginationEllipsis";const rb=({currentPage:e,totalPages:t})=>{if(t<=1)return null;const n=qM(e,t);return h.jsx(ZC,{className:"mt-4",children:h.jsxs(eb,{children:[n.prevButtonEnabled&&h.jsx(kn,{children:h.jsx(tb,{to:`?page=${e-1}`})}),n.showFirstPageButton&&h.jsx(kn,{children:h.jsx(Cr,{to:"?page=1",children:1})}),n.showFirstEllipsis&&h.jsx(kn,{children:h.jsx(pp,{})}),n.pagesBeforeCurrent.map(r=>h.jsx(kn,{children:h.jsx(Cr,{to:`?page=${r}`,children:r})},r)),h.jsx(kn,{children:h.jsx(Cr,{isActive:!0,children:e})}),n.pagesAfterCurrent.map(r=>h.jsx(kn,{children:h.jsx(Cr,{to:`?page=${r}`,children:r})},r)),n.showLastEllipsis&&h.jsx(kn,{children:h.jsx(pp,{})}),n.showLastPageButton&&h.jsx(kn,{children:h.jsx(Cr,{to:`?page=${t}`,children:t})}),n.nextButtonEnabled&&h.jsx(kn,{children:h.jsx(nb,{to:`?page=${e+1}`})})]})})},VI=()=>{var x;const[e]=qw(),{user:t,patient:n,encounter:r}=Bo(),o=ka(),{toast:i}=wc(),s=_a(),a=Number(e.get("page"))||1,l=15,{data:u}=Wr({queryKey:["questionnaires",a],queryFn:()=>Io.request(`Questionnaire?_count=${l}&page=${a}`)}),d=_x({mutationFn:YM,onSuccess:w=>{i({title:"Response created",description:`New response created for ${ts(n.name)}`}),s(`/questionnaire-responses/${w.id}`)}}),c=Math.ceil(u.total/l),f=((x=u.entry)==null?void 0:x.map(w=>({publisher:"Health Samurai",...w.resource})))||[],[g,y]=p.useState(null),v=[{accessorKey:"title",header:"Title"},{accessorKey:"status",header:"Status"},{accessorKey:"version",header:"Version"},{accessorKey:"publisher",header:"Publisher"},{id:"actions",cell:({row:{original:w}})=>{const m=d.isPending&&d.variables.questionnaire.id===w.id;return m?h.jsx(jC,{className:"h-4 my-2"}):h.jsxs(gc,{children:[h.jsx(mc,{asChild:!0,children:h.jsxs(ir,{variant:"ghost",className:"h-8 w-8 p-0",disabled:m,children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Oh,{className:"h-4 w-4"})]})}),h.jsxs(Da,{align:"end",children:[h.jsx(sg,{children:"Actions"}),h.jsxs(gn,{onClick:()=>navigator.clipboard.writeText(w.id),children:[h.jsx(Ah,{}),"Copy ID"]}),h.jsx(vc,{}),h.jsxs(gn,{onClick:()=>y(w.id),children:[h.jsx(uT,{}),"View questionnaire"]}),h.jsx(gn,{asChild:!0,children:h.jsxs(Bs,{to:`/questionnaires/${w.id}`,children:[h.jsx(Bx,{}),"Edit questionnaire"]})}),h.jsxs(gn,{onClick:()=>{d.mutate({client:o,questionnaire:w,subject:n,encounter:r,author:t})},children:[h.jsx(hT,{}),"Create response"]})]})]})}}];return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsx(qC,{columns:v,data:f}),h.jsx(rb,{currentPage:a,totalPages:c}),h.jsx(jI,{onOpenChange:w=>{w||y(null)},open:!!g,children:h.jsxs(YC,{className:"flex flex-col max-w-[calc(100vw_-_4rem)] h-[calc(100vh_-_4rem)]",children:[h.jsx(XC,{children:h.jsx(JC,{children:"Preview"})}),g&&h.jsx(p.Suspense,{fallback:h.jsx(lg,{}),children:h.jsx(BI,{id:g})})]})})]})},HI=({id:e})=>{const t=p.useRef(),{data:n}=Wr({queryKey:["questionnaire",e],queryFn:()=>Io.request(`Questionnaire/${e}`)});return fg(t),h.jsx("aidbox-form-builder",{"hide-back":!0,"show-share":!1,"hide-population":!0,"hide-extraction":!0,"hide-publish":!0,"hide-add-theme":!0,"hide-edit-theme":!0,"hide-save-theme":!0,"hide-convert":!0,ref:t,value:JSON.stringify(n),style:{width:"100%",height:"100%",border:"none",flex:1}})},KI=()=>{const{id:e}=Bw();return h.jsx(HI,{id:e})};var pg="ToastProvider",[hg,GI,WI]=Xh("Toast"),[ob,TD]=ns("Toast",[WI]),[qI,xc]=ob(pg),ib=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=p.useState(null),[u,d]=p.useState(0),c=p.useRef(!1),f=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${pg}\`. Expected non-empty \`string\`.`),h.jsx(hg.Provider,{scope:t,children:h.jsx(qI,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:p.useCallback(()=>d(g=>g+1),[]),onToastRemove:p.useCallback(()=>d(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:f,children:s})})};ib.displayName=pg;var sb="ToastViewport",QI=["F8"],hp="toast.viewportPause",gp="toast.viewportResume",ab=p.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=QI,label:o="Notifications ({hotkey})",...i}=e,s=xc(sb,n),a=GI(n),l=p.useRef(null),u=p.useRef(null),d=p.useRef(null),c=p.useRef(null),f=qe(t,c,s.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;p.useEffect(()=>{const x=w=>{var S;r.length!==0&&r.every(C=>w[C]||w.code===C)&&((S=c.current)==null||S.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),p.useEffect(()=>{const x=l.current,w=c.current;if(y&&x&&w){const m=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(hp);w.dispatchEvent(b),s.isClosePausedRef.current=!0}},S=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(gp);w.dispatchEvent(b),s.isClosePausedRef.current=!1}},C=b=>{!x.contains(b.relatedTarget)&&S()},P=()=>{x.contains(document.activeElement)||S()};return x.addEventListener("focusin",m),x.addEventListener("focusout",C),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",P),window.addEventListener("blur",m),window.addEventListener("focus",S),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",C),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",P),window.removeEventListener("blur",m),window.removeEventListener("focus",S)}}},[y,s.isClosePausedRef]);const v=p.useCallback(({tabbingDirection:x})=>{const m=a().map(S=>{const C=S.ref.current,P=[C,...lD(C)];return x==="forwards"?P:P.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return p.useEffect(()=>{const x=c.current;if(x){const w=m=>{var P,b,A;const S=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!S){const k=document.activeElement,$=m.shiftKey;if(m.target===x&&$){(P=u.current)==null||P.focus();return}const F=v({tabbingDirection:$?"backwards":"forwards"}),L=F.findIndex(E=>E===k);Td(F.slice(L+1))?m.preventDefault():$?(b=u.current)==null||b.focus():(A=d.current)==null||A.focus()}};return x.addEventListener("keydown",w),()=>x.removeEventListener("keydown",w)}},[a,v]),h.jsxs(UT,{ref:l,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&h.jsx(mp,{ref:u,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"forwards"});Td(x)}}),h.jsx(hg.Slot,{scope:n,children:h.jsx(Ee.ol,{tabIndex:-1,...i,ref:f})}),y&&h.jsx(mp,{ref:d,onFocusFromOutsideViewport:()=>{const x=v({tabbingDirection:"backwards"});Td(x)}})]})});ab.displayName=sb;var lb="ToastFocusProxy",mp=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=xc(lb,n);return h.jsx(ac,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});mp.displayName=lb;var Sc="Toast",YI="toast.swipeStart",XI="toast.swipeMove",JI="toast.swipeCancel",ZI="toast.swipeEnd",ub=p.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,l]=Ma({prop:r,defaultProp:o,onChange:i});return h.jsx(Cn,{present:n||a,children:h.jsx(nD,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:mt(e.onPause),onResume:mt(e.onResume),onSwipeStart:ie(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ie(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:ie(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ie(e.onSwipeEnd,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});ub.displayName=Sc;var[eD,tD]=ob(Sc,{onClose(){}}),nD=p.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:f,onSwipeEnd:g,...y}=e,v=xc(Sc,n),[x,w]=p.useState(null),m=qe(t,E=>w(E)),S=p.useRef(null),C=p.useRef(null),P=o||v.duration,b=p.useRef(0),A=p.useRef(P),k=p.useRef(0),{onToastAdd:$,onToastRemove:R}=v,N=mt(()=>{var M;(x==null?void 0:x.contains(document.activeElement))&&((M=v.viewport)==null||M.focus()),s()}),F=p.useCallback(E=>{!E||E===1/0||(window.clearTimeout(k.current),b.current=new Date().getTime(),k.current=window.setTimeout(N,E))},[N]);p.useEffect(()=>{const E=v.viewport;if(E){const M=()=>{F(A.current),u==null||u()},j=()=>{const V=new Date().getTime()-b.current;A.current=A.current-V,window.clearTimeout(k.current),l==null||l()};return E.addEventListener(hp,j),E.addEventListener(gp,M),()=>{E.removeEventListener(hp,j),E.removeEventListener(gp,M)}}},[v.viewport,P,l,u,F]),p.useEffect(()=>{i&&!v.isClosePausedRef.current&&F(P)},[i,P,v.isClosePausedRef,F]),p.useEffect(()=>($(),()=>R()),[$,R]);const L=p.useMemo(()=>x?mb(x):null,[x]);return v.viewport?h.jsxs(h.Fragment,{children:[L&&h.jsx(rD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),h.jsx(eD,{scope:n,onClose:N,children:Xi.createPortal(h.jsx(hg.ItemSlot,{scope:n,children:h.jsx($T,{asChild:!0,onEscapeKeyDown:ie(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||N(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(Ee.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ie(e.onKeyDown,E=>{E.key==="Escape"&&(a==null||a(E.nativeEvent),E.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:ie(e.onPointerDown,E=>{E.button===0&&(S.current={x:E.clientX,y:E.clientY})}),onPointerMove:ie(e.onPointerMove,E=>{if(!S.current)return;const M=E.clientX-S.current.x,j=E.clientY-S.current.y,V=!!C.current,D=["left","right"].includes(v.swipeDirection),O=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,B=D?O(0,M):0,q=D?0:O(0,j),te=E.pointerType==="touch"?10:2,fe={x:B,y:q},he={originalEvent:E,delta:fe};V?(C.current=fe,Sl(XI,c,he,{discrete:!1})):ey(fe,v.swipeDirection,te)?(C.current=fe,Sl(YI,d,he,{discrete:!1}),E.target.setPointerCapture(E.pointerId)):(Math.abs(M)>te||Math.abs(j)>te)&&(S.current=null)}),onPointerUp:ie(e.onPointerUp,E=>{const M=C.current,j=E.target;if(j.hasPointerCapture(E.pointerId)&&j.releasePointerCapture(E.pointerId),C.current=null,S.current=null,M){const V=E.currentTarget,D={originalEvent:E,delta:M};ey(M,v.swipeDirection,v.swipeThreshold)?Sl(ZI,g,D,{discrete:!0}):Sl(JI,f,D,{discrete:!0}),V.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),rD=e=>{const{__scopeToast:t,children:n,...r}=e,o=xc(Sc,t),[i,s]=p.useState(!1),[a,l]=p.useState(!1);return sD(()=>s(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:h.jsx(Aa,{asChild:!0,children:h.jsx(ac,{...r,children:i&&h.jsxs(h.Fragment,{children:[o.label," ",n]})})})},oD="ToastTitle",cb=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return h.jsx(Ee.div,{...r,ref:t})});cb.displayName=oD;var iD="ToastDescription",db=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return h.jsx(Ee.div,{...r,ref:t})});db.displayName=iD;var fb="ToastAction",pb=p.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?h.jsx(gb,{altText:n,asChild:!0,children:h.jsx(gg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${fb}\`. Expected non-empty \`string\`.`),null)});pb.displayName=fb;var hb="ToastClose",gg=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=tD(hb,n);return h.jsx(gb,{asChild:!0,children:h.jsx(Ee.button,{type:"button",...r,ref:t,onClick:ie(e.onClick,o.onClose)})})});gg.displayName=hb;var gb=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return h.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function mb(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),aD(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...mb(r))}}),t}function Sl(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Nh(o,i):o.dispatchEvent(i)}var ey=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function sD(e=()=>{}){const t=mt(e);Ln(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function aD(e){return e.nodeType===e.ELEMENT_NODE}function lD(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 Td(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var uD=ib,vb=ab,yb=ub,wb=cb,xb=db,Sb=pb,Cb=gg;const cD=uD,bb=p.forwardRef(({className:e,...t},n)=>h.jsx(vb,{ref:n,className:Q("fixed top-0 left-1/2 -translate-x-1/2 z-[100] gap-2 flex max-h-screen w-full flex-col-reverse p-4 md:max-w-[420px]",e),...t}));bb.displayName=vb.displayName;const dD=Xu("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-top-full data-[state=open]:slide-in-from-top-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),Rb=p.forwardRef(({className:e,variant:t,...n},r)=>h.jsx(yb,{ref:r,className:Q(dD({variant:t}),e),...n}));Rb.displayName=yb.displayName;const fD=p.forwardRef(({className:e,...t},n)=>h.jsx(Sb,{ref:n,className:Q("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));fD.displayName=Sb.displayName;const Eb=p.forwardRef(({className:e,...t},n)=>h.jsx(Cb,{ref:n,className:Q("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:h.jsx(Uh,{className:"h-4 w-4"})}));Eb.displayName=Cb.displayName;const Pb=p.forwardRef(({className:e,...t},n)=>h.jsx(wb,{ref:n,className:Q("text-sm font-semibold [&+div]:text-xs",e),...t}));Pb.displayName=wb.displayName;const _b=p.forwardRef(({className:e,...t},n)=>h.jsx(xb,{ref:n,className:Q("text-sm opacity-90",e),...t}));_b.displayName=xb.displayName;function pD(){const{toasts:e}=wc();return h.jsxs(cD,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return h.jsxs(Rb,{...i,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(Pb,{children:n}),r&&h.jsx(_b,{children:r})]}),o,h.jsx(Eb,{})]},t)}),h.jsx(bb,{})]})}const hD=()=>{const e=window.location.href;return h.jsxs(h.Fragment,{children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:"Welcome to Aidbox Forms Smart App"}),h.jsx("div",{className:"mb-4",children:"This is a demo smart app for launching Aidbox Forms."}),h.jsx("div",{className:"mb-4",children:"Looks like you came here without proper launch context. Please use one of the following links to launch the app:"}),h.jsxs("div",{className:"flex gap-4 mb-4",children:[h.jsx(ir,{variant:"outline",asChild:!0,children:h.jsxs("a",{href:bv({launchUrl:e,launchType:"provider-ehr"}),children:[h.jsx(yT,{className:"h-14 w-14 text-pink-400 my-4"}),"Provider EHR Launch",h.jsx(Pv,{className:"h-4 w-4"})]})}),h.jsx(ir,{variant:"outline",asChild:!0,children:h.jsxs("a",{href:bv({launchUrl:e,launchType:"patient-portal"}),children:[h.jsx(xT,{className:"h-14 w-14 text-pink-400 my-4"}),"Patient Portal Launch",h.jsx(Pv,{className:"h-4 w-4"})]})})]}),h.jsxs("div",{className:"mb-4",children:["If you want to run this app from within your own EHR system, you can register it as a SMART App with the following parameters:",h.jsxs("ul",{className:"list-disc ml-6 mt-2",children:[h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Launch URL:"})," ",h.jsx("code",{className:"bg-gray-50 px-1 py-0.5 rounded border text-sm",children:e})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Redirect URL:"})," ",h.jsx("code",{className:"bg-gray-50 px-1 py-0.5 rounded border text-sm",children:e})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Client ID:"})," ",h.jsx("code",{className:"bg-gray-50 px-1 py-0.5 rounded border text-sm",children:kx})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"PKCE:"})," ",h.jsx("code",{className:"bg-gray-50 px-1 py-0.5 rounded border text-sm",children:"true"})]})]})]}),h.jsxs("div",{className:"mb-4",children:["Most pages in this app can serve as entry points. For example, you can directly access a form filling page for a patient using a Launch/Redirect URL like this:"," ",h.jsx("code",{className:"bg-gray-50 px-1 py-0.5 rounded border text-sm",children:"/questionnaire-response/[your-id]"}),"."]})]})};function gD(){var t;let e=Gw();return h.jsx("div",{className:"p-10",children:(t=e==null?void 0:e.message)!=null&&t.includes("fhirServiceUrl")?h.jsx(hD,{}):h.jsxs(h.Fragment,{children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:e.status?`${e.status} - ${e.statusText}`:"Error"}),h.jsx("div",{className:"mb-2",children:"An error occurred while rendering this page."}),h.jsx("pre",{className:"text-xs bg-gray-50 px-1 py-0.5 rounded border overflow-auto empty:hidden",children:e.message})]})})}const mD=()=>{const e=p.useRef(),{id:t}=Bw(),n=ka(),{data:r}=Wr({queryKey:["questionnaire-response",t],queryFn:()=>n.request(`QuestionnaireResponse/${t}`)}),o=r.questionnaire,{data:i}=Wr({queryKey:["questionnaire",o],queryFn:()=>Lx(n,o)}),s=_x({mutationFn:Fx.bind(null,n,i)});return p.useEffect(()=>{const a=e.current,l=u=>s.mutate(u.detail);return a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[]),fg(e),h.jsx("aidbox-form-renderer",{ref:e,questionnaire:JSON.stringify(i),"questionnaire-response":JSON.stringify(r),style:{width:"100%",height:"100%",border:"none",flex:1}})},vD=()=>{var g;const[e]=qw(),{patient:t}=Bo(),n=ka(),r=_a(),o=Number(e.get("page"))||1,i=15,{data:s}=Wr({queryKey:["questionnaire-responses",o],queryFn:()=>n.request(`QuestionnaireResponse?_subject=${t.id}&_count=${i}&_page=${o}`)}),a=Math.ceil(s.total/i),l=((g=s.entry)==null?void 0:g.map(y=>y.resource))||[],u=Symbol("dummy"),d=wv({queries:l.filter(({author:y})=>y==null?void 0:y.id).map(({author:y})=>({queryKey:["author",y.id],queryFn:()=>n.request(`Practitioner/${y.id}`).catch(()=>u)})),combine:y=>y.reduce((v,{data:x})=>(x!==u&&(v[x.id]=x),v),{})}),c=wv({queries:l.filter(({questionnaire:y})=>y).map(({questionnaire:y})=>({queryKey:["questionnaire",y],queryFn:()=>Lx(n,y).then(v=>({key:y,result:v}),()=>u)})),combine:y=>y.reduce((v,{data:x})=>(x!==u&&(v[x.key]=x.result),v),{})}),f=[{header:"Author",accessorFn:y=>{var v,x,w;return(v=y.author)!=null&&v.id&&((x=d[y.author.id])!=null&&x.name)?ts((w=d[y.author.id])==null?void 0:w.name):"Unknown"}},{header:"Questionnaire",accessorFn:y=>{var v,x;return(v=c[y.questionnaire])!=null&&v.title?(x=c[y.questionnaire])==null?void 0:x.title:y.questionnaire}},{header:"Last Updated",accessorFn:y=>new Date(y.meta.lastUpdated).toLocaleString()},{header:"Status",accessorKey:"status"},{id:"actions",cell:({row:{original:y}})=>h.jsxs(gc,{modal:!0,children:[h.jsx(mc,{asChild:!0,children:h.jsxs(ir,{variant:"ghost",className:"h-8 w-8 p-0",children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Oh,{className:"h-4 w-4"})]})}),h.jsxs(Da,{align:"end",children:[h.jsx(sg,{children:"Actions"}),h.jsxs(gn,{onClick:()=>navigator.clipboard.writeText(y.id),children:[h.jsx(Ah,{}),"Copy ID"]}),h.jsx(vc,{}),h.jsxs(gn,{onClick:()=>r(`/questionnaire-responses/${y.id}`),children:[h.jsx(Bx,{}),"Edit response"]})]})]})}];return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsx(qC,{columns:f,data:l}),h.jsx(rb,{currentPage:o,totalPages:a})]})},yD=()=>{const{user:e}=Bo(),{toast:t}=wc(),n=e.resourceType==="Practitioner";return p.useEffect(()=>{n||t({variant:"destructive",title:"Unauthorized",description:"Only practitioners can access this page."})},[]),n?h.jsx(Ww,{}):h.jsx(C_,{to:"/"})},wD=new Jk({defaultOptions:{mutations:{throwOnError:!0},queries:{suspense:!0}}}),xD=A_([{path:"/",Component:zj,ErrorBoundary:gD,children:[{index:!0,Component:XM},{path:"/questionnaire-responses",Component:vD},{path:"/questionnaire-responses/:id",Component:mD},{Component:yD,children:[{path:"/questionnaires",Component:VI},{path:"/questionnaires/:id",Component:KI}]}]}],{basename:"/examples/aidbox-forms-smart-launch"});kw(document.getElementById("root")).render(h.jsx(p.StrictMode,{children:h.jsxs(oM,{client:wD,children:[h.jsx(p.Suspense,{fallback:h.jsx(lg,{}),children:h.jsx(U_,{router:xD})}),h.jsx(pD,{})]})}))});export default SD(); diff --git a/aidbox-forms-smart-launch/assets/index-jUC6lyQk.js b/aidbox-forms-smart-launch/assets/index-jUC6lyQk.js new file mode 100644 index 0000000..8fe54a9 --- /dev/null +++ b/aidbox-forms-smart-launch/assets/index-jUC6lyQk.js @@ -0,0 +1,283 @@ +var om=e=>{throw TypeError(e)};var TR=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Lc=(e,t,n)=>t.has(e)||om("Cannot "+n);var _=(e,t,n)=>(Lc(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?om("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(Lc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(Lc(e,t,"access private method"),n);var Ya=(e,t,n,r)=>({set _(o){W(e,t,o,n)},get _(){return _(e,t,r)}});var PF=TR((LF,Yl)=>{function Vy(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 i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Fs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function AR(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Ky={exports:{}},zu={},Gy={exports:{}},ve={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ta=Symbol.for("react.element"),NR=Symbol.for("react.portal"),jR=Symbol.for("react.fragment"),OR=Symbol.for("react.strict_mode"),IR=Symbol.for("react.profiler"),DR=Symbol.for("react.provider"),FR=Symbol.for("react.context"),LR=Symbol.for("react.forward_ref"),$R=Symbol.for("react.suspense"),UR=Symbol.for("react.memo"),zR=Symbol.for("react.lazy"),im=Symbol.iterator;function BR(e){return e===null||typeof e!="object"?null:(e=im&&e[im]||e["@@iterator"],typeof e=="function"?e:null)}var Wy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},qy=Object.assign,Qy={};function Zi(e,t,n){this.props=e,this.context=t,this.refs=Qy,this.updater=n||Wy}Zi.prototype.isReactComponent={};Zi.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")};Zi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Yy(){}Yy.prototype=Zi.prototype;function Fp(e,t,n){this.props=e,this.context=t,this.refs=Qy,this.updater=n||Wy}var Lp=Fp.prototype=new Yy;Lp.constructor=Fp;qy(Lp,Zi.prototype);Lp.isPureReactComponent=!0;var sm=Array.isArray,Xy=Object.prototype.hasOwnProperty,$p={current:null},Jy={key:!0,ref:!0,__self:!0,__source:!0};function Zy(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Xy.call(t,r)&&!Jy.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,te=L[Q];if(0>>1;Qo(z,B))Go(pe,z)?(L[Q]=pe,L[G]=B,Q=G):(L[Q]=z,L[ge]=B,Q=ge);else if(Go(pe,B))L[Q]=pe,L[G]=B,Q=G;else break e}}return j}function o(L,j){var B=L.sortIndex-j.sortIndex;return B!==0?B:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,f=3,g=!1,v=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(l,j);else break;j=n(u)}}function C(L){if(y=!1,S(L),!v)if(n(l)!==null)v=!0,D(P);else{var j=n(u);j!==null&&V(C,j.startTime-L)}}function P(L,j){v=!1,y&&(y=!1,w(M),M=-1),g=!0;var B=f;try{for(S(j),c=n(l);c!==null&&(!(c.expirationTime>j)||L&&!N());){var Q=c.callback;if(typeof Q=="function"){c.callback=null,f=c.priorityLevel;var te=Q(c.expirationTime<=j);j=e.unstable_now(),typeof te=="function"?c.callback=te:c===n(l)&&r(l),S(j)}else r(l);c=n(l)}if(c!==null)var fe=!0;else{var ge=n(u);ge!==null&&V(C,ge.startTime-j),fe=!1}return fe}finally{c=null,f=B,g=!1}}var b=!1,A=null,M=-1,O=5,R=-1;function N(){return!(e.unstable_now()-RL||125Q?(L.sortIndex=B,t(u,L),n(l)===null&&L===n(u)&&(y?(w(M),M=-1):y=!0,V(C,B-Q))):(L.sortIndex=te,t(l,L),v||g||(v=!0,D(P))),L},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(L){var j=f;return function(){var B=f;f=j;try{return L.apply(this,arguments)}finally{f=B}}}})(i0);o0.exports=i0;var ZR=o0.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 eE=p,Kt=ZR;function K(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"),Hd=Object.prototype.hasOwnProperty,tE=/^[: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]*$/,lm={},um={};function nE(e){return Hd.call(um,e)?!0:Hd.call(lm,e)?!1:tE.test(e)?um[e]=!0:(lm[e]=!0,!1)}function rE(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 oE(e,t,n,r){if(t===null||typeof t>"u"||rE(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 Ct(e,t,n,r,o,i,s){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=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Ct(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){ut[e]=new Ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Ct(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);ut[t]=new Ct(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);ut[t]=new Ct(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);ut[t]=new Ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vp(e,t,n,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{zc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ks(e):""}function iE(e){switch(e.tag){case 5:return ks(e.type);case 16:return ks("Lazy");case 13:return ks("Suspense");case 19:return ks("SuspenseList");case 0:case 2:case 15:return e=Bc(e.type,!1),e;case 11:return e=Bc(e.type.render,!1),e;case 1:return e=Bc(e.type,!0),e;default:return""}}function qd(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 ii:return"Fragment";case oi:return"Portal";case Kd:return"Profiler";case Hp:return"StrictMode";case Gd:return"Suspense";case Wd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l0:return(e.displayName||"Context")+".Consumer";case a0:return(e._context.displayName||"Context")+".Provider";case Kp: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:qd(e.type)||"Memo";case xr:t=e._payload,e=e._init;try{return qd(e(t))}catch{}}return null}function sE(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 qd(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 Wr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function c0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aE(e){var t=c0(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,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Za(e){e._valueTracker||(e._valueTracker=aE(e))}function d0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=c0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Xl(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 Qd(e,t){var n=t.checked;return ze({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function dm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Wr(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 f0(e,t){t=t.checked,t!=null&&Vp(e,"checked",t,!1)}function Yd(e,t){f0(e,t);var n=Wr(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")?Xd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xd(e,t.type,Wr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function fm(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 Xd(e,t,n){(t!=="number"||Xl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ts=Array.isArray;function mi(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=el.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ls={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},lE=["Webkit","ms","Moz","O"];Object.keys(Ls).forEach(function(e){lE.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ls[t]=Ls[e]})});function m0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ls.hasOwnProperty(e)&&Ls[e]?(""+t).trim():t+"px"}function v0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=m0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var uE=ze({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 ef(e,t){if(t){if(uE[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function tf(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 nf=null;function Wp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var rf=null,vi=null,yi=null;function gm(e){if(e=ja(e)){if(typeof rf!="function")throw Error(K(280));var t=e.stateNode;t&&(t=Gu(t),rf(e.stateNode,e.type,t))}}function y0(e){vi?yi?yi.push(e):yi=[e]:vi=e}function w0(){if(vi){var e=vi,t=yi;if(yi=vi=null,gm(e),t)for(e=0;e>>=0,e===0?32:31-(xE(e)/SE|0)|0}var tl=64,nl=4194304;function As(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 tu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=As(a):(i&=s,i!==0&&(r=As(i)))}else s=n&~o,s!==0?r=As(s):i!==0&&(r=As(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&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 Aa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yn(t),e[t]=n}function EE(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=Us),Rm=" ",Em=!1;function $0(e,t){switch(e){case"keyup":return ZE.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function U0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var si=!1;function tP(e,t){switch(e){case"compositionend":return U0(t);case"keypress":return t.which!==32?null:(Em=!0,Rm);case"textInput":return e=t.data,e===Rm&&Em?null:e;default:return null}}function nP(e,t){if(si)return e==="compositionend"||!th&&$0(e,t)?(e=F0(),Nl=Jp=Ir=null,si=!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=km(n)}}function H0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function K0(){for(var e=window,t=Xl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Xl(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 dP(e){var t=K0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&H0(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,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Tm(n,i);var s=Tm(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,ai=null,cf=null,Bs=null,df=!1;function Am(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;df||ai==null||ai!==Xl(r)||(r=ai,"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}),Bs&&ia(Bs,r)||(Bs=r,r=ou(cf,"onSelect"),0ci||(e.current=vf[ci],vf[ci]=null,ci--)}function Ne(e,t){ci++,vf[ci]=e.current,e.current=t}var qr={},gt=no(qr),Tt=no(!1),ko=qr;function Vi(e,t){var n=e.type.contextTypes;if(!n)return qr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function At(e){return e=e.childContextTypes,e!=null}function su(){Ie(Tt),Ie(gt)}function Lm(e,t,n){if(gt.current!==qr)throw Error(K(168));Ne(gt,t),Ne(Tt,n)}function ew(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(K(108,sE(e)||"Unknown",o));return ze({},n,r)}function au(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qr,ko=gt.current,Ne(gt,e),Ne(Tt,Tt.current),!0}function $m(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=ew(e,t,ko),r.__reactInternalMemoizedMergedChildContext=e,Ie(Tt),Ie(gt),Ne(gt,e)):Ie(Tt),Ne(Tt,n)}var Qn=null,Wu=!1,nd=!1;function tw(e){Qn===null?Qn=[e]:Qn.push(e)}function bP(e){Wu=!0,tw(e)}function ro(){if(!nd&&Qn!==null){nd=!0;var e=0,t=ke;try{var n=Qn;for(ke=1;e>=s,o-=s,Xn=1<<32-yn(t)+o|n<M?(O=A,A=null):O=A.sibling;var R=f(w,A,S[M],C);if(R===null){A===null&&(A=O);break}e&&A&&R.alternate===null&&t(w,A),m=i(R,m,M),b===null?P=R:b.sibling=R,b=R,A=O}if(M===S.length)return n(w,A),Fe&&uo(w,M),P;if(A===null){for(;MM?(O=A,A=null):O=A.sibling;var N=f(w,A,R.value,C);if(N===null){A===null&&(A=O);break}e&&A&&N.alternate===null&&t(w,A),m=i(N,m,M),b===null?P=N:b.sibling=N,b=N,A=O}if(R.done)return n(w,A),Fe&&uo(w,M),P;if(A===null){for(;!R.done;M++,R=S.next())R=c(w,R.value,C),R!==null&&(m=i(R,m,M),b===null?P=R:b.sibling=R,b=R);return Fe&&uo(w,M),P}for(A=r(w,A);!R.done;M++,R=S.next())R=g(A,w,M,R.value,C),R!==null&&(e&&R.alternate!==null&&A.delete(R.key===null?M:R.key),m=i(R,m,M),b===null?P=R:b.sibling=R,b=R);return e&&A.forEach(function(I){return t(w,I)}),Fe&&uo(w,M),P}function x(w,m,S,C){if(typeof S=="object"&&S!==null&&S.type===ii&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Ja:e:{for(var P=S.key,b=m;b!==null;){if(b.key===P){if(P=S.type,P===ii){if(b.tag===7){n(w,b.sibling),m=o(b,S.props.children),m.return=w,w=m;break e}}else if(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===xr&&Bm(P)===b.type){n(w,b.sibling),m=o(b,S.props),m.ref=xs(w,b,S),m.return=w,w=m;break e}n(w,b);break}else t(w,b);b=b.sibling}S.type===ii?(m=Mo(S.props.children,w.mode,C,S.key),m.return=w,w=m):(C=Ul(S.type,S.key,S.props,null,w.mode,C),C.ref=xs(w,m,S),C.return=w,w=C)}return s(w);case oi:e:{for(b=S.key;m!==null;){if(m.key===b)if(m.tag===4&&m.stateNode.containerInfo===S.containerInfo&&m.stateNode.implementation===S.implementation){n(w,m.sibling),m=o(m,S.children||[]),m.return=w,w=m;break e}else{n(w,m);break}else t(w,m);m=m.sibling}m=cd(S,w.mode,C),m.return=w,w=m}return s(w);case xr:return b=S._init,x(w,m,b(S._payload),C)}if(Ts(S))return v(w,m,S,C);if(gs(S))return y(w,m,S,C);ul(w,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,m!==null&&m.tag===6?(n(w,m.sibling),m=o(m,S),m.return=w,w=m):(n(w,m),m=ud(S,w.mode,C),m.return=w,w=m),s(w)):n(w,m)}return x}var Ki=iw(!0),sw=iw(!1),cu=no(null),du=null,pi=null,sh=null;function ah(){sh=pi=du=null}function lh(e){var t=cu.current;Ie(cu),e._currentValue=t}function xf(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 xi(e,t){du=e,sh=pi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(kt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(sh!==e)if(e={context:e,memoizedValue:t,next:null},pi===null){if(du===null)throw Error(K(308));pi=e,du.dependencies={lanes:0,firstContext:e}}else pi=pi.next=e;return t}var vo=null;function uh(e){vo===null?vo=[e]:vo.push(e)}function aw(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,sr(e,r)}function sr(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 Sr=!1;function ch(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lw(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 er(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Vr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Re&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,sr(e,n)}return o=r.interleaved,o===null?(t.next=t,uh(r)):(t.next=o.next,o.next=t),r.interleaved=t,sr(e,n)}function Ol(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 Vm(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,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 fu(e,t,n,r){var o=e.updateQueue;Sr=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var f=a.lane,g=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,y=a;switch(f=t,g=n,y.tag){case 1:if(v=y.payload,typeof v=="function"){c=v.call(g,c,f);break e}c=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=y.payload,f=typeof v=="function"?v.call(g,c,f):v,f==null)break e;c=ze({},c,f);break e;case 2:Sr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else g={eventTime:g,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=g,l=c):d=d.next=g,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);No|=s,e.lanes=s,e.memoizedState=c}}function Hm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=od.transition;od.transition={};try{e(!1),t()}finally{ke=n,od.transition=r}}function Ew(){return ln().memoizedState}function _P(e,t,n){var r=Kr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Pw(e))_w(t,n);else if(n=aw(e,t,n,r),n!==null){var o=xt();wn(n,e,r,o),Mw(n,t,r)}}function MP(e,t,n){var r=Kr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Pw(e))_w(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Sn(a,s)){var l=t.interleaved;l===null?(o.next=o,uh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=aw(e,t,o,r),n!==null&&(o=xt(),wn(n,e,r,o),Mw(n,t,r))}}function Pw(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function _w(e,t){Vs=hu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Mw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qp(e,n)}}var gu={readContext:an,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},kP={readContext:an,useCallback:function(e,t){return An().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:Gm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Dl(4194308,4,xw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Dl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dl(4,2,e,t)},useMemo:function(e,t){var n=An();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=An();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=_P.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=An();return e={current:e},t.memoizedState=e},useState:Km,useDebugValue:yh,useDeferredValue:function(e){return An().memoizedState=e},useTransition:function(){var e=Km(!1),t=e[0];return e=PP.bind(null,e[1]),An().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,o=An();if(Fe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ot===null)throw Error(K(349));Ao&30||fw(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Gm(hw.bind(null,r,i,e),[e]),r.flags|=2048,pa(9,pw.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=An(),t=ot.identifierPrefix;if(Fe){var n=Jn,r=Xn;n=(r&~(1<<32-yn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=da++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Dn]=t,e[la]=r,Lw(e,t,!1,!1),t.stateNode=e;e:{switch(s=tf(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),o=r;break;case"iframe":case"object":case"embed":Oe("load",e),o=r;break;case"video":case"audio":for(o=0;oqi&&(t.flags|=128,r=!0,Ss(i,!1),t.lanes=4194304)}else{if(!r)if(e=pu(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ss(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Fe)return dt(t),null}else 2*Qe()-i.renderingStartTime>qi&&n!==1073741824&&(t.flags|=128,r=!0,Ss(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qe(),t.sibling=null,n=$e.current,Ne($e,r?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return Rh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function FP(e,t){switch(oh(t),t.tag){case 1:return At(t.type)&&su(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(),Ie(Tt),Ie(gt),ph(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fh(t),null;case 13:if(Ie($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie($e),null;case 4:return Gi(),null;case 10:return lh(t.type._context),null;case 22:case 23:return Rh(),null;case 24:return null;default:return null}}var dl=!1,ht=!1,LP=typeof WeakSet=="function"?WeakSet:Set,Y=null;function hi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ge(e,t,r)}else n.current=null}function kf(e,t,n){try{n()}catch(r){Ge(e,t,r)}}var rv=!1;function $P(e,t){if(ff=nu,e=K0(),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,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var g;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(g=c.firstChild)!==null;)f=c,c=g;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++d===r&&(l=s),(g=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(pf={focusedElem:e,selectionRange:n},nu=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var y=v.memoizedProps,x=v.memoizedState,w=t.stateNode,m=w.getSnapshotBeforeUpdate(t.elementType===t.type?y:fn(t.type,y),x);w.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(C){Ge(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return v=rv,rv=!1,v}function Hs(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 i=o.destroy;o.destroy=void 0,i!==void 0&&kf(t,n,i)}o=o.next}while(o!==r)}}function Yu(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 Tf(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 zw(e){var t=e.alternate;t!==null&&(e.alternate=null,zw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Dn],delete t[la],delete t[mf],delete t[SP],delete t[CP])),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 Bw(e){return e.tag===5||e.tag===3||e.tag===4}function ov(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bw(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 Af(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=iu));else if(r!==4&&(e=e.child,e!==null))for(Af(e,t,n),e=e.sibling;e!==null;)Af(e,t,n),e=e.sibling}function Nf(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(Nf(e,t,n),e=e.sibling;e!==null;)Nf(e,t,n),e=e.sibling}var at=null,hn=!1;function pr(e,t,n){for(n=n.child;n!==null;)Vw(e,t,n),n=n.sibling}function Vw(e,t,n){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Bu,n)}catch{}switch(n.tag){case 5:ht||hi(n,t);case 6:var r=at,o=hn;at=null,pr(e,t,n),at=r,hn=o,at!==null&&(hn?(e=at,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):at.removeChild(n.stateNode));break;case 18:at!==null&&(hn?(e=at,n=n.stateNode,e.nodeType===8?td(e.parentNode,n):e.nodeType===1&&td(e,n),ra(e)):td(at,n.stateNode));break;case 4:r=at,o=hn,at=n.stateNode.containerInfo,hn=!0,pr(e,t,n),at=r,hn=o;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&kf(n,t,s),o=o.next}while(o!==r)}pr(e,t,n);break;case 1:if(!ht&&(hi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ge(n,t,a)}pr(e,t,n);break;case 21:pr(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,pr(e,t,n),ht=r):pr(e,t,n);break;default:pr(e,t,n)}}function iv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new LP),t.forEach(function(r){var o=qP.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zP(r/1960))-r,10e?16:e,Dr===null)var r=!1;else{if(e=Dr,Dr=null,yu=0,Re&6)throw Error(K(331));var o=Re;for(Re|=4,Y=e.current;Y!==null;){var i=Y,s=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lQe()-Ch?_o(e,0):Sh|=n),Nt(e,t)}function Xw(e,t){t===0&&(e.mode&1?(t=nl,nl<<=1,!(nl&130023424)&&(nl=4194304)):t=1);var n=xt();e=sr(e,t),e!==null&&(Aa(e,t,n),Nt(e,n))}function WP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xw(e,n)}function qP(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(K(314))}r!==null&&r.delete(t),Xw(e,n)}var Jw;Jw=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Tt.current)kt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return kt=!1,IP(e,t,n);kt=!!(e.flags&131072)}else kt=!1,Fe&&t.flags&1048576&&nw(t,uu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Fl(e,t),e=t.pendingProps;var o=Vi(t,gt.current);xi(t,n),o=gh(null,t,r,e,o,n);var i=mh();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,At(r)?(i=!0,au(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,ch(t),o.updater=Qu,t.stateNode=o,o._reactInternals=t,Cf(t,r,e,n),t=Ef(null,t,r,!0,i,n)):(t.tag=0,Fe&&i&&rh(t),wt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Fl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=YP(r),e=fn(r,e),o){case 0:t=Rf(null,t,r,e,n);break e;case 1:t=ev(null,t,r,e,n);break e;case 11:t=Jm(null,t,r,e,n);break e;case 14:t=Zm(null,t,r,fn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),Rf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),ev(e,t,r,o,n);case 3:e:{if(Iw(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,lw(e,t),fu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Wi(Error(K(423)),t),t=tv(e,t,r,n,o);break e}else if(r!==o){o=Wi(Error(K(424)),t),t=tv(e,t,r,n,o);break e}else for(Bt=Br(t.stateNode.containerInfo.firstChild),Vt=t,Fe=!0,mn=null,n=sw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Hi(),r===o){t=ar(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 5:return uw(t),e===null&&wf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,hf(r,o)?s=null:i!==null&&hf(r,i)&&(t.flags|=32),Ow(e,t),wt(e,t,s,n),t.child;case 6:return e===null&&wf(t),null;case 13:return Dw(e,t,n);case 4:return dh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ki(t,null,r,n):wt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),Jm(e,t,r,o,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ne(cu,r._currentValue),r._currentValue=s,i!==null)if(Sn(i.value,s)){if(i.children===o.children&&!Tt.current){t=ar(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=er(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),xf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),xf(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}wt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,xi(t,n),o=an(o),r=r(o),t.flags|=1,wt(e,t,r,n),t.child;case 14:return r=t.type,o=fn(r,t.pendingProps),o=fn(r.type,o),Zm(e,t,r,o,n);case 15:return Nw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),Fl(e,t),t.tag=1,At(r)?(e=!0,au(t)):e=!1,xi(t,n),kw(t,r,o),Cf(t,r,o,n),Ef(null,t,r,!0,e,n);case 19:return Fw(e,t,n);case 22:return jw(e,t,n)}throw Error(K(156,t.tag))};function Zw(e,t){return P0(e,t)}function QP(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 nn(e,t,n,r){return new QP(e,t,n,r)}function Ph(e){return e=e.prototype,!(!e||!e.isReactComponent)}function YP(e){if(typeof e=="function")return Ph(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Kp)return 11;if(e===Gp)return 14}return 2}function Gr(e,t){var n=e.alternate;return n===null?(n=nn(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 Ul(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Ph(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ii:return Mo(n.children,o,i,t);case Hp:s=8,o|=8;break;case Kd:return e=nn(12,n,t,o|2),e.elementType=Kd,e.lanes=i,e;case Gd:return e=nn(13,n,t,o),e.elementType=Gd,e.lanes=i,e;case Wd:return e=nn(19,n,t,o),e.elementType=Wd,e.lanes=i,e;case u0:return Ju(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case a0:s=10;break e;case l0:s=9;break e;case Kp:s=11;break e;case Gp:s=14;break e;case xr:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=nn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Mo(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function Ju(e,t,n,r){return e=nn(22,e,r,t),e.elementType=u0,e.lanes=n,e.stateNode={isHidden:!1},e}function ud(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function cd(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function XP(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=Hc(0),this.expirationTimes=Hc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function _h(e,t,n,r,o,i,s,a,l){return e=new XP(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ch(i),e}function JP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rx)}catch(e){console.error(e)}}rx(),r0.exports=Wt;var ns=r0.exports;const ox=Hy(ns),r_=Vy({__proto__:null,default:ox},[ns]);var ix,pv=ns;ix=pv.createRoot,pv.hydrateRoot;/** + * @remix-run/router v1.20.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Qi(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function i_(){return Math.random().toString(36).substr(2,8)}function gv(e,t){return{usr:e.state,key:e.key,idx:t}}function ga(e,t,n,r){return n===void 0&&(n=null),De({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?oo(t):t,{state:n,key:t&&t.key||r||i_()})}function Oo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function oo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function s_(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=Xe.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(De({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function c(){a=Xe.Pop;let x=d(),w=x==null?null:x-u;u=x,l&&l({action:a,location:y.location,delta:w})}function f(x,w){a=Xe.Push;let m=ga(y.location,x,w);u=d()+1;let S=gv(m,u),C=y.createHref(m);try{s.pushState(S,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&l&&l({action:a,location:y.location,delta:1})}function g(x,w){a=Xe.Replace;let m=ga(y.location,x,w);u=d();let S=gv(m,u),C=y.createHref(m);s.replaceState(S,"",C),i&&l&&l({action:a,location:y.location,delta:0})}function v(x){let w=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof x=="string"?x:Oo(x);return m=m.replace(/ $/,"%20"),me(w,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,w)}let y={get action(){return a},get location(){return e(o,s)},listen(x){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(hv,c),l=x,()=>{o.removeEventListener(hv,c),l=null}},createHref(x){return t(o,x)},createURL:v,encodeLocation(x){let w=v(x);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:f,replace:g,go(x){return s.go(x)}};return y}var Te;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Te||(Te={}));const a_=new Set(["lazy","caseSensitive","path","id","index","children"]);function l_(e){return e.index===!0}function Su(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,String(i)],a=typeof o.id=="string"?o.id:s.join("-");if(me(o.index!==!0||!o.children,"Cannot specify children on an index route"),me(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),l_(o)){let l=De({},o,t(o),{id:a});return r[a]=l,l}else{let l=De({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=Su(o.children,t,s,r)),l}})}function ho(e,t,n){return n===void 0&&(n="/"),zl(e,t,n,!1)}function zl(e,t,n,r){let o=typeof t=="string"?oo(t):t,i=rs(o.pathname||"/",n);if(i==null)return null;let s=sx(e);c_(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(me(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=tr([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(me(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),sx(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:v_(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of ax(i.path))o(i,s,l)}),t}function ax(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=ax(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function c_(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:y_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const d_=/^:[\w-]+$/,f_=3,p_=2,h_=1,g_=10,m_=-2,mv=e=>e==="*";function v_(e,t){let n=e.split("/"),r=n.length;return n.some(mv)&&(r+=m_),t&&(r+=p_),n.filter(o=>!mv(o)).reduce((o,i)=>o+(d_.test(i)?f_:i===""?h_:g_),r)}function y_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function w_(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a{let{paramName:f,isOptional:g}=d;if(f==="*"){let y=a[c]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const v=a[c];return g&&!v?u[f]=void 0:u[f]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function x_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Qi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function S_(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qi(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function rs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function C_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?oo(e):e;return{pathname:n?n.startsWith("/")?n:b_(n,t):t,search:E_(r),hash:P_(o)}}function b_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function dd(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function lx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function rc(e,t){let n=lx(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function oc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=oo(e):(o=De({},e),me(!o.pathname||!o.pathname.includes("?"),dd("?","pathname","search",o)),me(!o.pathname||!o.pathname.includes("#"),dd("#","pathname","hash",o)),me(!o.search||!o.search.includes("#"),dd("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let c=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),c-=1;o.pathname=f.join("/")}a=c>=0?t[c]:"/"}let l=C_(o,a),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const tr=e=>e.join("/").replace(/\/\/+/g,"/"),R_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),E_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,P_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Cu{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ic(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const ux=["post","put","patch","delete"],__=new Set(ux),M_=["get",...ux],k_=new Set(M_),T_=new Set([301,302,303,307,308]),A_=new Set([307,308]),fd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},N_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bs={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ah=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,j_=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),cx="remix-router-transitions";function O_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;me(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let T=e.detectErrorBoundary;o=F=>({hasErrorBoundary:T(F)})}else o=j_;let i={},s=Su(e.routes,o,void 0,i),a,l=e.basename||"/",u=e.dataStrategy||L_,d=e.patchRoutesOnNavigation,c=De({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,g=new Set,v=null,y=null,x=null,w=e.hydrationData!=null,m=ho(s,e.history.location,l),S=null;if(m==null&&!d){let T=Pt(404,{pathname:e.history.location.pathname}),{matches:F,route:U}=Mv(s);m=F,S={[U.id]:T}}m&&!e.hydrationData&&Ga(m,s,e.history.location.pathname).active&&(m=null);let C;if(m)if(m.some(T=>T.route.lazy))C=!1;else if(!m.some(T=>T.route.loader))C=!0;else if(c.v7_partialHydration){let T=e.hydrationData?e.hydrationData.loaderData:null,F=e.hydrationData?e.hydrationData.errors:null;if(F){let U=m.findIndex(H=>F[H.route.id]!==void 0);C=m.slice(0,U+1).every(H=>!Lf(H.route,T,F))}else C=m.every(U=>!Lf(U.route,T,F))}else C=e.hydrationData!=null;else if(C=!1,m=[],c.v7_partialHydration){let T=Ga(null,s,e.history.location.pathname);T.active&&T.matches&&(m=T.matches)}let P,b={historyAction:e.history.action,location:e.history.location,matches:m,initialized:C,navigation:fd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||S,fetchers:new Map,blockers:new Map},A=Xe.Pop,M=!1,O,R=!1,N=new Map,I=null,$=!1,E=!1,k=[],D=new Set,V=new Map,L=0,j=-1,B=new Map,Q=new Set,te=new Map,fe=new Map,ge=new Set,z=new Map,G=new Map,pe;function Me(){if(f=e.history.listen(T=>{let{action:F,location:U,delta:H}=T;if(pe){pe(),pe=void 0;return}Qi(G.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let X=em({currentLocation:b.location,nextLocation:U,historyAction:F});if(X&&H!=null){let oe=new Promise(ce=>{pe=ce});e.history.go(H*-1),Ka(X,{state:"blocked",location:U,proceed(){Ka(X,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),oe.then(()=>e.history.go(H))},reset(){let ce=new Map(b.blockers);ce.set(X,bs),Ce({blockers:ce})}});return}return nt(F,U)}),n){J_(t,N);let T=()=>Z_(t,N);t.addEventListener("pagehide",T),I=()=>t.removeEventListener("pagehide",T)}return b.initialized||nt(Xe.Pop,b.location,{initialHydration:!0}),P}function we(){f&&f(),I&&I(),g.clear(),O&&O.abort(),b.fetchers.forEach((T,F)=>Ha(F)),b.blockers.forEach((T,F)=>Zg(F))}function tt(T){return g.add(T),()=>g.delete(T)}function Ce(T,F){F===void 0&&(F={}),b=De({},b,T);let U=[],H=[];c.v7_fetcherPersist&&b.fetchers.forEach((X,oe)=>{X.state==="idle"&&(ge.has(oe)?H.push(oe):U.push(oe))}),[...g].forEach(X=>X(b,{deletedFetchers:H,viewTransitionOpts:F.viewTransitionOpts,flushSync:F.flushSync===!0})),c.v7_fetcherPersist&&(U.forEach(X=>b.fetchers.delete(X)),H.forEach(X=>Ha(X)))}function it(T,F,U){var H,X;let{flushSync:oe}=U===void 0?{}:U,ce=b.actionData!=null&&b.navigation.formMethod!=null&&gn(b.navigation.formMethod)&&b.navigation.state==="loading"&&((H=T.state)==null?void 0:H._isRedirect)!==!0,Z;F.actionData?Object.keys(F.actionData).length>0?Z=F.actionData:Z=null:ce?Z=b.actionData:Z=null;let ee=F.loaderData?Pv(b.loaderData,F.loaderData,F.matches||[],F.errors):b.loaderData,J=b.blockers;J.size>0&&(J=new Map(J),J.forEach((be,st)=>J.set(st,bs)));let ie=M===!0||b.navigation.formMethod!=null&&gn(b.navigation.formMethod)&&((X=T.state)==null?void 0:X._isRedirect)!==!0;a&&(s=a,a=void 0),$||A===Xe.Pop||(A===Xe.Push?e.history.push(T,T.state):A===Xe.Replace&&e.history.replace(T,T.state));let ye;if(A===Xe.Pop){let be=N.get(b.location.pathname);be&&be.has(T.pathname)?ye={currentLocation:b.location,nextLocation:T}:N.has(T.pathname)&&(ye={currentLocation:T,nextLocation:b.location})}else if(R){let be=N.get(b.location.pathname);be?be.add(T.pathname):(be=new Set([T.pathname]),N.set(b.location.pathname,be)),ye={currentLocation:b.location,nextLocation:T}}Ce(De({},F,{actionData:Z,loaderData:ee,historyAction:A,location:T,initialized:!0,navigation:fd,revalidation:"idle",restoreScrollPosition:nm(T,F.matches||b.matches),preventScrollReset:ie,blockers:J}),{viewTransitionOpts:ye,flushSync:oe===!0}),A=Xe.Pop,M=!1,R=!1,$=!1,E=!1,k=[]}async function Ot(T,F){if(typeof T=="number"){e.history.go(T);return}let U=Ff(b.location,b.matches,l,c.v7_prependBasename,T,c.v7_relativeSplatPath,F==null?void 0:F.fromRouteId,F==null?void 0:F.relative),{path:H,submission:X,error:oe}=yv(c.v7_normalizeFormMethod,!1,U,F),ce=b.location,Z=ga(b.location,H,F&&F.state);Z=De({},Z,e.history.encodeLocation(Z));let ee=F&&F.replace!=null?F.replace:void 0,J=Xe.Push;ee===!0?J=Xe.Replace:ee===!1||X!=null&&gn(X.formMethod)&&X.formAction===b.location.pathname+b.location.search&&(J=Xe.Replace);let ie=F&&"preventScrollReset"in F?F.preventScrollReset===!0:void 0,ye=(F&&F.flushSync)===!0,be=em({currentLocation:ce,nextLocation:Z,historyAction:J});if(be){Ka(be,{state:"blocked",location:Z,proceed(){Ka(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Ot(T,F)},reset(){let st=new Map(b.blockers);st.set(be,bs),Ce({blockers:st})}});return}return await nt(J,Z,{submission:X,pendingError:oe,preventScrollReset:ie,replace:F&&F.replace,enableViewTransition:F&&F.viewTransition,flushSync:ye})}function Le(){if(Oc(),Ce({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){nt(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}nt(A||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation,enableViewTransition:R===!0})}}async function nt(T,F,U){O&&O.abort(),O=null,A=T,$=(U&&U.startUninterruptedRevalidation)===!0,PR(b.location,b.matches),M=(U&&U.preventScrollReset)===!0,R=(U&&U.enableViewTransition)===!0;let H=a||s,X=U&&U.overrideNavigation,oe=ho(H,F,l),ce=(U&&U.flushSync)===!0,Z=Ga(oe,H,F.pathname);if(Z.active&&Z.matches&&(oe=Z.matches),!oe){let{error:Ae,notFoundMatches:Pe,route:Ve}=Ic(F.pathname);it(F,{matches:Pe,loaderData:{},errors:{[Ve.id]:Ae}},{flushSync:ce});return}if(b.initialized&&!E&&H_(b.location,F)&&!(U&&U.submission&&gn(U.submission.formMethod))){it(F,{matches:oe},{flushSync:ce});return}O=new AbortController;let ee=Zo(e.history,F,O.signal,U&&U.submission),J;if(U&&U.pendingError)J=[go(oe).route.id,{type:Te.error,error:U.pendingError}];else if(U&&U.submission&&gn(U.submission.formMethod)){let Ae=await cn(ee,F,U.submission,oe,Z.active,{replace:U.replace,flushSync:ce});if(Ae.shortCircuited)return;if(Ae.pendingActionResult){let[Pe,Ve]=Ae.pendingActionResult;if($t(Ve)&&ic(Ve.error)&&Ve.error.status===404){O=null,it(F,{matches:Ae.matches,loaderData:{},errors:{[Pe]:Ve.error}});return}}oe=Ae.matches||oe,J=Ae.pendingActionResult,X=pd(F,U.submission),ce=!1,Z.active=!1,ee=Zo(e.history,ee.url,ee.signal)}let{shortCircuited:ie,matches:ye,loaderData:be,errors:st}=await jc(ee,F,oe,Z.active,X,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,ce,J);ie||(O=null,it(F,De({matches:ye||oe},_v(J),{loaderData:be,errors:st})))}async function cn(T,F,U,H,X,oe){oe===void 0&&(oe={}),Oc();let ce=Y_(F,U);if(Ce({navigation:ce},{flushSync:oe.flushSync===!0}),X){let J=await Wa(H,F.pathname,T.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let ie=go(J.partialMatches).route.id;return{matches:J.partialMatches,pendingActionResult:[ie,{type:Te.error,error:J.error}]}}else if(J.matches)H=J.matches;else{let{notFoundMatches:ie,error:ye,route:be}=Ic(F.pathname);return{matches:ie,pendingActionResult:[be.id,{type:Te.error,error:ye}]}}}let Z,ee=js(H,F);if(!ee.route.action&&!ee.route.lazy)Z={type:Te.error,error:Pt(405,{method:T.method,pathname:F.pathname,routeId:ee.route.id})};else if(Z=(await ds("action",b,T,[ee],H,null))[ee.route.id],T.signal.aborted)return{shortCircuited:!0};if(wo(Z)){let J;return oe&&oe.replace!=null?J=oe.replace:J=bv(Z.response.headers.get("Location"),new URL(T.url),l)===b.location.pathname+b.location.search,await ao(T,Z,!0,{submission:U,replace:J}),{shortCircuited:!0}}if(Fr(Z))throw Pt(400,{type:"defer-action"});if($t(Z)){let J=go(H,ee.route.id);return(oe&&oe.replace)!==!0&&(A=Xe.Push),{matches:H,pendingActionResult:[J.route.id,Z]}}return{matches:H,pendingActionResult:[ee.route.id,Z]}}async function jc(T,F,U,H,X,oe,ce,Z,ee,J,ie){let ye=X||pd(F,oe),be=oe||ce||Tv(ye),st=!$&&(!c.v7_partialHydration||!ee);if(H){if(st){let He=Va(ie);Ce(De({navigation:ye},He!==void 0?{actionData:He}:{}),{flushSync:J})}let Ee=await Wa(U,F.pathname,T.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){let He=go(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,loaderData:{},errors:{[He]:Ee.error}}}else if(Ee.matches)U=Ee.matches;else{let{error:He,notFoundMatches:Yo,route:hs}=Ic(F.pathname);return{matches:Yo,loaderData:{},errors:{[hs.id]:He}}}}let Ae=a||s,[Pe,Ve]=xv(e.history,b,U,be,F,c.v7_partialHydration&&ee===!0,c.v7_skipActionErrorRevalidation,E,k,D,ge,te,Q,Ae,l,ie);if(Dc(Ee=>!(U&&U.some(He=>He.route.id===Ee))||Pe&&Pe.some(He=>He.route.id===Ee)),j=++L,Pe.length===0&&Ve.length===0){let Ee=Xg();return it(F,De({matches:U,loaderData:{},errors:ie&&$t(ie[1])?{[ie[0]]:ie[1].error}:null},_v(ie),Ee?{fetchers:new Map(b.fetchers)}:{}),{flushSync:J}),{shortCircuited:!0}}if(st){let Ee={};if(!H){Ee.navigation=ye;let He=Va(ie);He!==void 0&&(Ee.actionData=He)}Ve.length>0&&(Ee.fetchers=qo(Ve)),Ce(Ee,{flushSync:J})}Ve.forEach(Ee=>{fr(Ee.key),Ee.controller&&V.set(Ee.key,Ee.controller)});let Qo=()=>Ve.forEach(Ee=>fr(Ee.key));O&&O.signal.addEventListener("abort",Qo);let{loaderResults:fs,fetcherResults:Hn}=await qg(b,U,Pe,Ve,T);if(T.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Qo),Ve.forEach(Ee=>V.delete(Ee.key));let Pn=hl(fs);if(Pn)return await ao(T,Pn.result,!0,{replace:Z}),{shortCircuited:!0};if(Pn=hl(Hn),Pn)return Q.add(Pn.key),await ao(T,Pn.result,!0,{replace:Z}),{shortCircuited:!0};let{loaderData:Fc,errors:ps}=Ev(b,U,fs,ie,Ve,Hn,z);z.forEach((Ee,He)=>{Ee.subscribe(Yo=>{(Yo||Ee.done)&&z.delete(He)})}),c.v7_partialHydration&&ee&&b.errors&&(ps=De({},b.errors,ps));let lo=Xg(),qa=Jg(j),Qa=lo||qa||Ve.length>0;return De({matches:U,loaderData:Fc,errors:ps},Qa?{fetchers:new Map(b.fetchers)}:{})}function Va(T){if(T&&!$t(T[1]))return{[T[0]]:T[1].data};if(b.actionData)return Object.keys(b.actionData).length===0?null:b.actionData}function qo(T){return T.forEach(F=>{let U=b.fetchers.get(F.key),H=Rs(void 0,U?U.data:void 0);b.fetchers.set(F.key,H)}),new Map(b.fetchers)}function xR(T,F,U,H){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");fr(T);let X=(H&&H.flushSync)===!0,oe=a||s,ce=Ff(b.location,b.matches,l,c.v7_prependBasename,U,c.v7_relativeSplatPath,F,H==null?void 0:H.relative),Z=ho(oe,ce,l),ee=Ga(Z,oe,ce);if(ee.active&&ee.matches&&(Z=ee.matches),!Z){Vn(T,F,Pt(404,{pathname:ce}),{flushSync:X});return}let{path:J,submission:ie,error:ye}=yv(c.v7_normalizeFormMethod,!0,ce,H);if(ye){Vn(T,F,ye,{flushSync:X});return}let be=js(Z,J),st=(H&&H.preventScrollReset)===!0;if(ie&&gn(ie.formMethod)){SR(T,F,J,be,Z,ee.active,X,st,ie);return}te.set(T,{routeId:F,path:J}),CR(T,F,J,be,Z,ee.active,X,st,ie)}async function SR(T,F,U,H,X,oe,ce,Z,ee){Oc(),te.delete(T);function J(Ye){if(!Ye.route.action&&!Ye.route.lazy){let Xo=Pt(405,{method:ee.formMethod,pathname:U,routeId:F});return Vn(T,F,Xo,{flushSync:ce}),!0}return!1}if(!oe&&J(H))return;let ie=b.fetchers.get(T);dr(T,X_(ee,ie),{flushSync:ce});let ye=new AbortController,be=Zo(e.history,U,ye.signal,ee);if(oe){let Ye=await Wa(X,U,be.signal);if(Ye.type==="aborted")return;if(Ye.type==="error"){Vn(T,F,Ye.error,{flushSync:ce});return}else if(Ye.matches){if(X=Ye.matches,H=js(X,U),J(H))return}else{Vn(T,F,Pt(404,{pathname:U}),{flushSync:ce});return}}V.set(T,ye);let st=L,Pe=(await ds("action",b,be,[H],X,T))[H.route.id];if(be.signal.aborted){V.get(T)===ye&&V.delete(T);return}if(c.v7_fetcherPersist&&ge.has(T)){if(wo(Pe)||$t(Pe)){dr(T,vr(void 0));return}}else{if(wo(Pe))if(V.delete(T),j>st){dr(T,vr(void 0));return}else return Q.add(T),dr(T,Rs(ee)),ao(be,Pe,!1,{fetcherSubmission:ee,preventScrollReset:Z});if($t(Pe)){Vn(T,F,Pe.error);return}}if(Fr(Pe))throw Pt(400,{type:"defer-action"});let Ve=b.navigation.location||b.location,Qo=Zo(e.history,Ve,ye.signal),fs=a||s,Hn=b.navigation.state!=="idle"?ho(fs,b.navigation.location,l):b.matches;me(Hn,"Didn't find any matches after fetcher action");let Pn=++L;B.set(T,Pn);let Fc=Rs(ee,Pe.data);b.fetchers.set(T,Fc);let[ps,lo]=xv(e.history,b,Hn,ee,Ve,!1,c.v7_skipActionErrorRevalidation,E,k,D,ge,te,Q,fs,l,[H.route.id,Pe]);lo.filter(Ye=>Ye.key!==T).forEach(Ye=>{let Xo=Ye.key,rm=b.fetchers.get(Xo),kR=Rs(void 0,rm?rm.data:void 0);b.fetchers.set(Xo,kR),fr(Xo),Ye.controller&&V.set(Xo,Ye.controller)}),Ce({fetchers:new Map(b.fetchers)});let qa=()=>lo.forEach(Ye=>fr(Ye.key));ye.signal.addEventListener("abort",qa);let{loaderResults:Qa,fetcherResults:Ee}=await qg(b,Hn,ps,lo,Qo);if(ye.signal.aborted)return;ye.signal.removeEventListener("abort",qa),B.delete(T),V.delete(T),lo.forEach(Ye=>V.delete(Ye.key));let He=hl(Qa);if(He)return ao(Qo,He.result,!1,{preventScrollReset:Z});if(He=hl(Ee),He)return Q.add(He.key),ao(Qo,He.result,!1,{preventScrollReset:Z});let{loaderData:Yo,errors:hs}=Ev(b,Hn,Qa,void 0,lo,Ee,z);if(b.fetchers.has(T)){let Ye=vr(Pe.data);b.fetchers.set(T,Ye)}Jg(Pn),b.navigation.state==="loading"&&Pn>j?(me(A,"Expected pending action"),O&&O.abort(),it(b.navigation.location,{matches:Hn,loaderData:Yo,errors:hs,fetchers:new Map(b.fetchers)})):(Ce({errors:hs,loaderData:Pv(b.loaderData,Yo,Hn,hs),fetchers:new Map(b.fetchers)}),E=!1)}async function CR(T,F,U,H,X,oe,ce,Z,ee){let J=b.fetchers.get(T);dr(T,Rs(ee,J?J.data:void 0),{flushSync:ce});let ie=new AbortController,ye=Zo(e.history,U,ie.signal);if(oe){let Pe=await Wa(X,U,ye.signal);if(Pe.type==="aborted")return;if(Pe.type==="error"){Vn(T,F,Pe.error,{flushSync:ce});return}else if(Pe.matches)X=Pe.matches,H=js(X,U);else{Vn(T,F,Pt(404,{pathname:U}),{flushSync:ce});return}}V.set(T,ie);let be=L,Ae=(await ds("loader",b,ye,[H],X,T))[H.route.id];if(Fr(Ae)&&(Ae=await Nh(Ae,ye.signal,!0)||Ae),V.get(T)===ie&&V.delete(T),!ye.signal.aborted){if(ge.has(T)){dr(T,vr(void 0));return}if(wo(Ae))if(j>be){dr(T,vr(void 0));return}else{Q.add(T),await ao(ye,Ae,!1,{preventScrollReset:Z});return}if($t(Ae)){Vn(T,F,Ae.error);return}me(!Fr(Ae),"Unhandled fetcher deferred data"),dr(T,vr(Ae.data))}}async function ao(T,F,U,H){let{submission:X,fetcherSubmission:oe,preventScrollReset:ce,replace:Z}=H===void 0?{}:H;F.response.headers.has("X-Remix-Revalidate")&&(E=!0);let ee=F.response.headers.get("Location");me(ee,"Expected a Location header on the redirect Response"),ee=bv(ee,new URL(T.url),l);let J=ga(b.location,ee,{_isRedirect:!0});if(n){let Pe=!1;if(F.response.headers.has("X-Remix-Reload-Document"))Pe=!0;else if(Ah.test(ee)){const Ve=e.history.createURL(ee);Pe=Ve.origin!==t.location.origin||rs(Ve.pathname,l)==null}if(Pe){Z?t.location.replace(ee):t.location.assign(ee);return}}O=null;let ie=Z===!0||F.response.headers.has("X-Remix-Replace")?Xe.Replace:Xe.Push,{formMethod:ye,formAction:be,formEncType:st}=b.navigation;!X&&!oe&&ye&&be&&st&&(X=Tv(b.navigation));let Ae=X||oe;if(A_.has(F.response.status)&&Ae&&gn(Ae.formMethod))await nt(ie,J,{submission:De({},Ae,{formAction:ee}),preventScrollReset:ce||M,enableViewTransition:U?R:void 0});else{let Pe=pd(J,X);await nt(ie,J,{overrideNavigation:Pe,fetcherSubmission:oe,preventScrollReset:ce||M,enableViewTransition:U?R:void 0})}}async function ds(T,F,U,H,X,oe){let ce,Z={};try{ce=await $_(u,T,F,U,H,X,oe,i,o)}catch(ee){return H.forEach(J=>{Z[J.route.id]={type:Te.error,error:ee}}),Z}for(let[ee,J]of Object.entries(ce))if(K_(J)){let ie=J.result;Z[ee]={type:Te.redirect,response:B_(ie,U,ee,X,l,c.v7_relativeSplatPath)}}else Z[ee]=await z_(J);return Z}async function qg(T,F,U,H,X){let oe=T.matches,ce=ds("loader",T,X,U,F,null),Z=Promise.all(H.map(async ie=>{if(ie.matches&&ie.match&&ie.controller){let be=(await ds("loader",T,Zo(e.history,ie.path,ie.controller.signal),[ie.match],ie.matches,ie.key))[ie.match.route.id];return{[ie.key]:be}}else return Promise.resolve({[ie.key]:{type:Te.error,error:Pt(404,{pathname:ie.path})}})})),ee=await ce,J=(await Z).reduce((ie,ye)=>Object.assign(ie,ye),{});return await Promise.all([q_(F,ee,X.signal,oe,T.loaderData),Q_(F,J,H)]),{loaderResults:ee,fetcherResults:J}}function Oc(){E=!0,k.push(...Dc()),te.forEach((T,F)=>{V.has(F)&&D.add(F),fr(F)})}function dr(T,F,U){U===void 0&&(U={}),b.fetchers.set(T,F),Ce({fetchers:new Map(b.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Vn(T,F,U,H){H===void 0&&(H={});let X=go(b.matches,F);Ha(T),Ce({errors:{[X.route.id]:U},fetchers:new Map(b.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function Qg(T){return c.v7_fetcherPersist&&(fe.set(T,(fe.get(T)||0)+1),ge.has(T)&&ge.delete(T)),b.fetchers.get(T)||N_}function Ha(T){let F=b.fetchers.get(T);V.has(T)&&!(F&&F.state==="loading"&&B.has(T))&&fr(T),te.delete(T),B.delete(T),Q.delete(T),ge.delete(T),D.delete(T),b.fetchers.delete(T)}function bR(T){if(c.v7_fetcherPersist){let F=(fe.get(T)||0)-1;F<=0?(fe.delete(T),ge.add(T)):fe.set(T,F)}else Ha(T);Ce({fetchers:new Map(b.fetchers)})}function fr(T){let F=V.get(T);F&&(F.abort(),V.delete(T))}function Yg(T){for(let F of T){let U=Qg(F),H=vr(U.data);b.fetchers.set(F,H)}}function Xg(){let T=[],F=!1;for(let U of Q){let H=b.fetchers.get(U);me(H,"Expected fetcher: "+U),H.state==="loading"&&(Q.delete(U),T.push(U),F=!0)}return Yg(T),F}function Jg(T){let F=[];for(let[U,H]of B)if(H0}function RR(T,F){let U=b.blockers.get(T)||bs;return G.get(T)!==F&&G.set(T,F),U}function Zg(T){b.blockers.delete(T),G.delete(T)}function Ka(T,F){let U=b.blockers.get(T)||bs;me(U.state==="unblocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="proceeding"||U.state==="blocked"&&F.state==="unblocked"||U.state==="proceeding"&&F.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+F.state);let H=new Map(b.blockers);H.set(T,F),Ce({blockers:H})}function em(T){let{currentLocation:F,nextLocation:U,historyAction:H}=T;if(G.size===0)return;G.size>1&&Qi(!1,"A router only supports one blocker at a time");let X=Array.from(G.entries()),[oe,ce]=X[X.length-1],Z=b.blockers.get(oe);if(!(Z&&Z.state==="proceeding")&&ce({currentLocation:F,nextLocation:U,historyAction:H}))return oe}function Ic(T){let F=Pt(404,{pathname:T}),U=a||s,{matches:H,route:X}=Mv(U);return Dc(),{notFoundMatches:H,route:X,error:F}}function Dc(T){let F=[];return z.forEach((U,H)=>{(!T||T(H))&&(U.cancel(),F.push(H),z.delete(H))}),F}function ER(T,F,U){if(v=T,x=F,y=U||null,!w&&b.navigation===fd){w=!0;let H=nm(b.location,b.matches);H!=null&&Ce({restoreScrollPosition:H})}return()=>{v=null,x=null,y=null}}function tm(T,F){return y&&y(T,F.map(H=>u_(H,b.loaderData)))||T.key}function PR(T,F){if(v&&x){let U=tm(T,F);v[U]=x()}}function nm(T,F){if(v){let U=tm(T,F),H=v[U];if(typeof H=="number")return H}return null}function Ga(T,F,U){if(d)if(T){if(Object.keys(T[0].params).length>0)return{active:!0,matches:zl(F,U,l,!0)}}else return{active:!0,matches:zl(F,U,l,!0)||[]};return{active:!1,matches:null}}async function Wa(T,F,U){if(!d)return{type:"success",matches:T};let H=T;for(;;){let X=a==null,oe=a||s,ce=i;try{await d({path:F,matches:H,patch:(J,ie)=>{U.aborted||Cv(J,ie,oe,ce,o)}})}catch(J){return{type:"error",error:J,partialMatches:H}}finally{X&&!U.aborted&&(s=[...s])}if(U.aborted)return{type:"aborted"};let Z=ho(oe,F,l);if(Z)return{type:"success",matches:Z};let ee=zl(oe,F,l,!0);if(!ee||H.length===ee.length&&H.every((J,ie)=>J.route.id===ee[ie].route.id))return{type:"success",matches:null};H=ee}}function _R(T){i={},a=Su(T,o,void 0,i)}function MR(T,F){let U=a==null;Cv(T,F,a||s,i,o),U&&(s=[...s],Ce({}))}return P={get basename(){return l},get future(){return c},get state(){return b},get routes(){return s},get window(){return t},initialize:Me,subscribe:tt,enableScrollRestoration:ER,navigate:Ot,fetch:xR,revalidate:Le,createHref:T=>e.history.createHref(T),encodeLocation:T=>e.history.encodeLocation(T),getFetcher:Qg,deleteFetcher:bR,dispose:we,getBlocker:RR,deleteBlocker:Zg,patchRoutes:MR,_internalFetchControllers:V,_internalActiveDeferreds:z,_internalSetRoutes:_R},P}function I_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ff(e,t,n,r,o,i,s,a){let l,u;if(s){l=[];for(let c of t)if(l.push(c),c.route.id===s){u=c;break}}else l=t,u=t[t.length-1];let d=oc(o||".",rc(l,i),rs(e.pathname,n)||e.pathname,a==="path");if(o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u){let c=jh(d.search);if(u.route.index&&!c)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let f=new URLSearchParams(d.search),g=f.getAll("index");f.delete("index"),g.filter(y=>y).forEach(y=>f.append("index",y));let v=f.toString();d.search=v?"?"+v:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:tr([n,d.pathname])),Oo(d)}function yv(e,t,n,r){if(!r||!I_(r))return{path:n};if(r.formMethod&&!W_(r.formMethod))return{path:n,error:Pt(405,{method:r.formMethod})};let o=()=>({path:n,error:Pt(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=px(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!gn(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,v)=>{let[y,x]=v;return""+g+y+"="+x+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!gn(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}me(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=$f(r.formData),u=r.formData;else if(r.body instanceof FormData)l=$f(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Rv(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Rv(l)}catch{return o()}let d={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(gn(d.formMethod))return{path:n,submission:d};let c=oo(n);return t&&c.search&&jh(c.search)&&l.append("index",""),c.search="?"+l,{path:Oo(c),submission:d}}function wv(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function xv(e,t,n,r,o,i,s,a,l,u,d,c,f,g,v,y){let x=y?$t(y[1])?y[1].error:y[1].data:void 0,w=e.createURL(t.location),m=e.createURL(o),S=n;i&&t.errors?S=wv(n,Object.keys(t.errors)[0],!0):y&&$t(y[1])&&(S=wv(n,y[0]));let C=y?y[1].statusCode:void 0,P=s&&C&&C>=400,b=S.filter((M,O)=>{let{route:R}=M;if(R.lazy)return!0;if(R.loader==null)return!1;if(i)return Lf(R,t.loaderData,t.errors);if(D_(t.loaderData,t.matches[O],M)||l.some($=>$===M.route.id))return!0;let N=t.matches[O],I=M;return Sv(M,De({currentUrl:w,currentParams:N.params,nextUrl:m,nextParams:I.params},r,{actionResult:x,actionStatus:C,defaultShouldRevalidate:P?!1:a||w.pathname+w.search===m.pathname+m.search||w.search!==m.search||dx(N,I)}))}),A=[];return c.forEach((M,O)=>{if(i||!n.some(E=>E.route.id===M.routeId)||d.has(O))return;let R=ho(g,M.path,v);if(!R){A.push({key:O,routeId:M.routeId,path:M.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(O),I=js(R,M.path),$=!1;f.has(O)?$=!1:u.has(O)?(u.delete(O),$=!0):N&&N.state!=="idle"&&N.data===void 0?$=a:$=Sv(I,De({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:n[n.length-1].params},r,{actionResult:x,actionStatus:C,defaultShouldRevalidate:P?!1:a})),$&&A.push({key:O,routeId:M.routeId,path:M.path,matches:R,match:I,controller:new AbortController})}),[b,A]}function Lf(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function D_(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function dx(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Sv(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Cv(e,t,n,r,o){var i;let s;if(e){let u=r[e];me(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=n;let a=t.filter(u=>!s.some(d=>fx(u,d))),l=Su(a,o,[e||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],r);s.push(...l)}function fx(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(i=>fx(n,i))}):!1}async function F_(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];me(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";Qi(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!a_.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,De({},t(o),{lazy:void 0}))}async function L_(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,s)=>Object.assign(o,{[n[s].route.id]:i}),{})}async function $_(e,t,n,r,o,i,s,a,l,u){let d=i.map(g=>g.route.lazy?F_(g.route,l,a):void 0),c=i.map((g,v)=>{let y=d[v],x=o.some(m=>m.route.id===g.route.id);return De({},g,{shouldLoad:x,resolve:async m=>(m&&r.method==="GET"&&(g.route.lazy||g.route.loader)&&(x=!0),x?U_(t,r,g,y,m,u):Promise.resolve({type:Te.data,result:void 0}))})}),f=await e({matches:c,request:r,params:i[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return f}async function U_(e,t,n,r,o,i){let s,a,l=u=>{let d,c=new Promise((v,y)=>d=y);a=()=>d(),t.signal.addEventListener("abort",a);let f=v=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...v!==void 0?[v]:[]),g=(async()=>{try{return{type:"data",result:await(o?o(y=>f(y)):f())}}catch(v){return{type:"error",result:v}}})();return Promise.race([g,c])};try{let u=n.route[e];if(r)if(u){let d,[c]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;s=c}else if(await r,u=n.route[e],u)s=await l(u);else if(e==="action"){let d=new URL(t.url),c=d.pathname+d.search;throw Pt(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:Te.data,result:void 0};else if(u)s=await l(u);else{let d=new URL(t.url),c=d.pathname+d.search;throw Pt(404,{pathname:c})}me(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Te.error,result:u}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function z_(e){let{result:t,type:n}=e;if(hx(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:Te.error,error:d}}return n===Te.error?{type:Te.error,error:new Cu(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:Te.data,data:u,statusCode:t.status,headers:t.headers}}if(n===Te.error){if(kv(t)){var r;if(t.data instanceof Error){var o;return{type:Te.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Cu(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Te.error,error:t,statusCode:ic(t)?t.status:void 0}}if(G_(t)){var i,s;return{type:Te.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(kv(t)){var a,l;return{type:Te.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:Te.data,data:t}}function B_(e,t,n,r,o,i){let s=e.headers.get("Location");if(me(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ah.test(s)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=Ff(new URL(t.url),a,o,!0,s,i),e.headers.set("Location",s)}return e}function bv(e,t,n){if(Ah.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=rs(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function Zo(e,t,n,r){let o=e.createURL(px(t)).toString(),i={signal:n};if(r&&gn(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=$f(r.formData):i.body=r.formData}return new Request(o,i)}function $f(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Rv(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function V_(e,t,n,r,o){let i={},s=null,a,l=!1,u={},d=n&&$t(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let f=c.route.id,g=t[f];if(me(!wo(g),"Cannot handle redirect results in processLoaderData"),$t(g)){let v=g.error;d!==void 0&&(v=d,d=void 0),s=s||{};{let y=go(e,f);s[y.route.id]==null&&(s[y.route.id]=v)}i[f]=void 0,l||(l=!0,a=ic(g.error)?g.error.status:500),g.headers&&(u[f]=g.headers)}else Fr(g)?(r.set(f,g.deferredData),i[f]=g.deferredData.data,g.statusCode!=null&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(u[f]=g.headers)):(i[f]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(u[f]=g.headers))}),d!==void 0&&n&&(s={[n[0]]:d},i[n[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}function Ev(e,t,n,r,o,i,s){let{loaderData:a,errors:l}=V_(t,n,r,s);return o.forEach(u=>{let{key:d,match:c,controller:f}=u,g=i[d];if(me(g,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if($t(g)){let v=go(e.matches,c==null?void 0:c.route.id);l&&l[v.route.id]||(l=De({},l,{[v.route.id]:g.error})),e.fetchers.delete(d)}else if(wo(g))me(!1,"Unhandled fetcher revalidation redirect");else if(Fr(g))me(!1,"Unhandled fetcher deferred data");else{let v=vr(g.data);e.fetchers.set(d,v)}}),{loaderData:a,errors:l}}function Pv(e,t,n,r){let o=De({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function _v(e){return e?$t(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function go(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Mv(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Pt(e,t){let{pathname:n,routeId:r,method:o,type:i,message:s}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Cu(e||500,a,new Error(l),!0)}function hl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(wo(o))return{key:r,result:o}}}function px(e){let t=typeof e=="string"?oo(e):e;return Oo(De({},t,{hash:""}))}function H_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function K_(e){return hx(e.result)&&T_.has(e.result.status)}function Fr(e){return e.type===Te.deferred}function $t(e){return e.type===Te.error}function wo(e){return(e&&e.type)===Te.redirect}function kv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function G_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function hx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function W_(e){return k_.has(e.toLowerCase())}function gn(e){return __.has(e.toLowerCase())}async function q_(e,t,n,r,o){let i=Object.entries(t);for(let s=0;s(f==null?void 0:f.route.id)===a);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id),c=d!=null&&!dx(d,u)&&(o&&o[u.route.id])!==void 0;Fr(l)&&c&&await Nh(l,n,!1).then(f=>{f&&(t[a]=f)})}}async function Q_(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===i)&&Fr(a)&&(me(s,"Expected an AbortController for revalidating fetcher deferred result"),await Nh(a,s.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function Nh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Te.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Te.error,error:o}}return{type:Te.data,data:e.deferredData.data}}}function jh(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function js(e,t){let n=typeof t=="string"?oo(t).search:t.search;if(e[e.length-1].route.index&&jh(n||""))return e[e.length-1];let r=lx(e);return r[r.length-1]}function Tv(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function pd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Y_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Rs(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function X_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function vr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function J_(e,t){try{let n=e.sessionStorage.getItem(cx);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function Z_(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(cx,JSON.stringify(n))}catch(r){Qi(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let c=oc(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:tr([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,s,i,e])}const tM=p.createContext(null);function nM(e){let t=p.useContext(zn).outlet;return t&&p.createElement(tM.Provider,{value:e},t)}function wx(){let{matches:e}=p.useContext(zn),t=e[e.length-1];return t?t.params:{}}function xx(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(io),{matches:o}=p.useContext(zn),{pathname:i}=zo(),s=JSON.stringify(rc(o,r.v7_relativeSplatPath));return p.useMemo(()=>oc(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function rM(e,t,n,r){os()||me(!1);let{navigator:o}=p.useContext(io),{matches:i}=p.useContext(zn),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=zo(),d;d=u;let c=d.pathname||"/",f=c;if(l!=="/"){let y=l.replace(/^\//,"").split("/");f="/"+c.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=ho(e,{pathname:f});return lM(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:tr([l,o.encodeLocation?o.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:tr([l,o.encodeLocation?o.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r)}function oM(){let e=bx(),t=ic(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const iM=p.createElement(oM,null);class sM extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(zn.Provider,{value:this.props.routeContext},p.createElement(mx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function aM(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(sc);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(zn.Provider,{value:t},r)}function lM(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let d=s.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);d>=0||me(!1),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,c,f)=>{let g,v=!1,y=null,x=null;n&&(g=a&&c.route.id?a[c.route.id]:void 0,y=c.route.errorElement||iM,l&&(u<0&&f===0?(pM("route-fallback"),v=!0,x=null):u===f&&(v=!0,x=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,f+1)),m=()=>{let S;return g?S=y:v?S=x:c.route.Component?S=p.createElement(c.route.Component,null):c.route.element?S=c.route.element:S=d,p.createElement(aM,{match:c,routeContext:{outlet:d,matches:w,isDataRoute:n!=null},children:S})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?p.createElement(sM,{location:n.location,revalidation:n.revalidation,component:y,error:g,children:m(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):m()},null)}var Sx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Sx||{}),Ru=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Ru||{});function uM(e){let t=p.useContext(sc);return t||me(!1),t}function cM(e){let t=p.useContext(gx);return t||me(!1),t}function dM(e){let t=p.useContext(zn);return t||me(!1),t}function Cx(e){let t=dM(),n=t.matches[t.matches.length-1];return n.route.id||me(!1),n.route.id}function bx(){var e;let t=p.useContext(mx),n=cM(Ru.UseRouteError),r=Cx(Ru.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function fM(){let{router:e}=uM(Sx.UseNavigateStable),t=Cx(Ru.UseNavigateStable),n=p.useRef(!1);return yx(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,bu({fromRouteId:t},i)))},[e,t])}const Av={};function pM(e,t,n){Av[e]||(Av[e]=!0)}function hM(e){let{to:t,replace:n,state:r,relative:o}=e;os()||me(!1);let{future:i,static:s}=p.useContext(io),{matches:a}=p.useContext(zn),{pathname:l}=zo(),u=Ia(),d=oc(t,rc(a,i.v7_relativeSplatPath),l,o==="path"),c=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(c),{replace:n,state:r,relative:o}),[u,c,o,n,r]),null}function Rx(e){return nM(e.context)}function gM(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Xe.Pop,navigator:i,static:s=!1,future:a}=e;os()&&me(!1);let l=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:l,navigator:i,static:s,future:bu({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=oo(r));let{pathname:d="/",search:c="",hash:f="",state:g=null,key:v="default"}=r,y=p.useMemo(()=>{let x=rs(d,l);return x==null?null:{location:{pathname:x,search:c,hash:f,state:g,key:v},navigationType:o}},[l,d,c,f,g,v,o]);return y==null?null:p.createElement(io.Provider,{value:u},p.createElement(Oh.Provider,{children:n,value:y}))}new Promise(()=>{});function mM(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.27.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ma(){return ma=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function yM(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function wM(e,t){return e.button===0&&(!t||t==="_self")&&!yM(e)}function Uf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function xM(e,t){let n=Uf(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const SM=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],CM="6";try{window.__reactRouterVersion=CM}catch{}function bM(e,t){return O_({basename:t==null?void 0:t.basename,future:ma({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:o_({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||RM(),routes:e,mapRouteProperties:mM,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function RM(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ma({},t,{errors:EM(t.errors)})),t}function EM(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Cu(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const PM=p.createContext({isTransitioning:!1}),_M=p.createContext(new Map),MM="startTransition",Nv=t0[MM],kM="flushSync",jv=r_[kM];function TM(e){Nv?Nv(e):e()}function Es(e){jv?jv(e):e()}class AM{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function NM(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[s,a]=p.useState(),[l,u]=p.useState({isTransitioning:!1}),[d,c]=p.useState(),[f,g]=p.useState(),[v,y]=p.useState(),x=p.useRef(new Map),{v7_startTransition:w}=r||{},m=p.useCallback(M=>{w?TM(M):M()},[w]),S=p.useCallback((M,O)=>{let{deletedFetchers:R,flushSync:N,viewTransitionOpts:I}=O;R.forEach(E=>x.current.delete(E)),M.fetchers.forEach((E,k)=>{E.data!==void 0&&x.current.set(k,E.data)});let $=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!I||$){N?Es(()=>i(M)):m(()=>i(M));return}if(N){Es(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let E=n.window.document.startViewTransition(()=>{Es(()=>i(M))});E.finished.finally(()=>{Es(()=>{c(void 0),g(void 0),a(void 0),u({isTransitioning:!1})})}),Es(()=>g(E));return}f?(d&&d.resolve(),f.skipTransition(),y({state:M,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(a(M),u({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[n.window,f,d,x,m]);p.useLayoutEffect(()=>n.subscribe(S),[n,S]),p.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new AM)},[l]),p.useEffect(()=>{if(d&&s&&n.window){let M=s,O=d.promise,R=n.window.document.startViewTransition(async()=>{m(()=>i(M)),await O});R.finished.finally(()=>{c(void 0),g(void 0),a(void 0),u({isTransitioning:!1})}),g(R)}},[m,s,d,n.window]),p.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,f,o.location,s]),p.useEffect(()=>{!l.isTransitioning&&v&&(a(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),y(void 0))},[l.isTransitioning,v]),p.useEffect(()=>{},[]);let C=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:M=>n.navigate(M),push:(M,O,R)=>n.navigate(M,{state:O,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(M,O,R)=>n.navigate(M,{replace:!0,state:O,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),P=n.basename||"/",b=p.useMemo(()=>({router:n,navigator:C,static:!1,basename:P}),[n,C,P]),A=p.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return p.createElement(p.Fragment,null,p.createElement(sc.Provider,{value:b},p.createElement(gx.Provider,{value:o},p.createElement(_M.Provider,{value:x.current},p.createElement(PM.Provider,{value:l},p.createElement(gM,{basename:P,location:o.location,navigationType:o.historyAction,navigator:C,future:A},o.initialized||n.future.v7_partialHydration?p.createElement(jM,{routes:n.routes,future:n.future,state:o}):t))))),null)}const jM=p.memo(OM);function OM(e){let{routes:t,future:n,state:r}=e;return rM(t,void 0,r,n)}const IM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",DM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ws=p.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:d,viewTransition:c}=t,f=vM(t,SM),{basename:g}=p.useContext(io),v,y=!1;if(typeof u=="string"&&DM.test(u)&&(v=u,IM))try{let S=new URL(window.location.href),C=u.startsWith("//")?new URL(S.protocol+u):new URL(u),P=rs(C.pathname,g);C.origin===S.origin&&P!=null?u=P+C.search+C.hash:y=!0}catch{}let x=vx(u,{relative:o}),w=FM(u,{replace:s,state:a,target:l,preventScrollReset:d,relative:o,viewTransition:c});function m(S){r&&r(S),S.defaultPrevented||w(S)}return p.createElement("a",ma({},f,{href:v||x,onClick:y||i?r:m,ref:n,target:l}))});var Ov;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ov||(Ov={}));var Iv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Iv||(Iv={}));function FM(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=Ia(),u=zo(),d=xx(e,{relative:s});return p.useCallback(c=>{if(wM(c,n)){c.preventDefault();let f=r!==void 0?r:Oo(u)===Oo(d);l(e,{replace:f,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,d,r,o,n,e,i,s,a])}function ac(e){let t=p.useRef(Uf(e)),n=p.useRef(!1),r=zo(),o=p.useMemo(()=>xM(r.search,n.current?null:t.current),[r.search]),i=Ia(),s=p.useCallback((a,l)=>{const u=Uf(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}var Ih={},Ex={},ae={},Dh={};Object.defineProperty(Dh,"__esModule",{value:!0});class LM extends Error{constructor(t){super(`${t.status} ${t.statusText} +URL: ${t.url}`),this.name="HttpError",this.response=t,this.statusCode=t.status,this.status=t.status,this.statusText=t.statusText}async parse(){if(!this.response.bodyUsed)try{const t=this.response.headers.get("content-type")||"text/plain";if(t.match(/\bjson\b/i)){let n=await this.response.json();n.error?(this.message+=` +`+n.error,n.error_description&&(this.message+=": "+n.error_description)):this.message+=` + +`+JSON.stringify(n,null,4)}else if(t.match(/^text\//i)){let n=await this.response.text();n&&(this.message+=` + +`+n)}}catch{}return this}toJSON(){return{name:this.name,statusCode:this.statusCode,status:this.status,statusText:this.statusText,message:this.message}}}Dh.default=LM;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.SMART_KEY=rn.patientParams=rn.fhirVersions=rn.patientCompartment=void 0;rn.patientCompartment=["Account","AdverseEvent","AllergyIntolerance","Appointment","AppointmentResponse","AuditEvent","Basic","BodySite","BodyStructure","CarePlan","CareTeam","ChargeItem","Claim","ClaimResponse","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Consent","Coverage","CoverageEligibilityRequest","CoverageEligibilityResponse","DetectedIssue","DeviceRequest","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","EligibilityRequest","Encounter","EnrollmentRequest","EpisodeOfCare","ExplanationOfBenefit","FamilyMemberHistory","Flag","Goal","Group","ImagingManifest","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationEvaluation","ImmunizationRecommendation","Invoice","List","MeasureReport","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationRequest","MedicationStatement","MolecularSequence","NutritionOrder","Observation","Order","Patient","Person","Procedure","ProcedureRequest","Provenance","QuestionnaireResponse","ReferralRequest","RelatedPerson","RequestGroup","ResearchSubject","RiskAssessment","Schedule","ServiceRequest","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];rn.fhirVersions={"0.4.0":2,"0.5.0":2,"1.0.0":2,"1.0.1":2,"1.0.2":2,"1.1.0":3,"1.4.0":3,"1.6.0":3,"1.8.0":3,"3.0.0":3,"3.0.1":3,"3.3.0":4,"3.5.0":4,"4.0.0":4,"4.0.1":4};rn.patientParams=["patient","subject","requester","member","actor","beneficiary"];rn.SMART_KEY="SMART_KEY";var zf={exports:{}},hd,Dv;function $M(){if(Dv)return hd;Dv=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,i=r*365.25;hd=function(d,c){c=c||{};var f=typeof d;if(f==="string"&&d.length>0)return s(d);if(f==="number"&&isFinite(d))return c.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function s(d){if(d=String(d),!(d.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(c){var f=parseFloat(c[1]),g=(c[2]||"ms").toLowerCase();switch(g){case"years":case"year":case"yrs":case"yr":case"y":return f*i;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(d){var c=Math.abs(d);return c>=r?Math.round(d/r)+"d":c>=n?Math.round(d/n)+"h":c>=t?Math.round(d/t)+"m":c>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var c=Math.abs(d);return c>=r?u(d,c,r,"day"):c>=n?u(d,c,n,"hour"):c>=t?u(d,c,t,"minute"):c>=e?u(d,c,e,"second"):d+" ms"}function u(d,c,f,g){var v=c>=f*1.5;return Math.round(d/f)+" "+g+(v?"s":"")}return hd}function UM(e){n.debug=n,n.default=n,n.coerce=l,n.disable=i,n.enable=o,n.enabled=s,n.humanize=$M(),n.destroy=u,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let c=0;for(let f=0;f{if(b==="%%")return"%";C++;const M=n.formatters[A];if(typeof M=="function"){const O=x[C];b=M.call(w,O),x.splice(C,1),C--}return b}),n.formatArgs.call(w,x),(w.log||n.log).apply(w,x)}return y.namespace=d,y.useColors=n.useColors(),y.color=n.selectColor(d),y.extend=r,y.destroy=n.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(g!==n.namespaces&&(g=n.namespaces,v=n.enabled(d)),v),set:x=>{f=x}}),typeof n.init=="function"&&n.init(y),y}function r(d,c){const f=n(this.namespace+(typeof c>"u"?":":c)+d);return f.log=this.log,f}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let c;const f=(typeof d=="string"?d:"").split(/[\s,]+/),g=f.length;for(c=0;c"-"+c)].join(",");return n.enable(""),d}function s(d){if(d[d.length-1]==="*")return!0;let c,f;for(c=0,f=n.skips.length;c{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;u.splice(1,0,d,"color: inherit");let c=0,f=0;u[0].replace(/%[a-zA-Z%]/g,g=>{g!=="%%"&&(c++,g==="%c"&&(f=c))}),u.splice(f,0,d)}t.log=console.debug||console.log||(()=>{});function i(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function s(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=zM(t);const{formatters:l}=e.exports;l.j=function(u){try{return JSON.stringify(u)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(zf,zf.exports);var BM=zf.exports,gl={exports:{}},Fv;function Fh(){return Fv||(Fv=1,function(e,t){var n=typeof self<"u"?self:Fs,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(s){var a={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function c(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function f(E){return typeof E!="string"&&(E=String(E)),E}function g(E){var k={next:function(){var D=E.shift();return{done:D===void 0,value:D}}};return a.iterable&&(k[Symbol.iterator]=function(){return k}),k}function v(E){this.map={},E instanceof v?E.forEach(function(k,D){this.append(D,k)},this):Array.isArray(E)?E.forEach(function(k){this.append(k[0],k[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(k){this.append(k,E[k])},this)}v.prototype.append=function(E,k){E=c(E),k=f(k);var D=this.map[E];this.map[E]=D?D+", "+k:k},v.prototype.delete=function(E){delete this.map[c(E)]},v.prototype.get=function(E){return E=c(E),this.has(E)?this.map[E]:null},v.prototype.has=function(E){return this.map.hasOwnProperty(c(E))},v.prototype.set=function(E,k){this.map[c(E)]=f(k)},v.prototype.forEach=function(E,k){for(var D in this.map)this.map.hasOwnProperty(D)&&E.call(k,this.map[D],D,this)},v.prototype.keys=function(){var E=[];return this.forEach(function(k,D){E.push(D)}),g(E)},v.prototype.values=function(){var E=[];return this.forEach(function(k){E.push(k)}),g(E)},v.prototype.entries=function(){var E=[];return this.forEach(function(k,D){E.push([D,k])}),g(E)},a.iterable&&(v.prototype[Symbol.iterator]=v.prototype.entries);function y(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function x(E){return new Promise(function(k,D){E.onload=function(){k(E.result)},E.onerror=function(){D(E.error)}})}function w(E){var k=new FileReader,D=x(k);return k.readAsArrayBuffer(E),D}function m(E){var k=new FileReader,D=x(k);return k.readAsText(E),D}function S(E){for(var k=new Uint8Array(E),D=new Array(k.length),V=0;V-1?k:E}function M(E,k){k=k||{};var D=k.body;if(E instanceof M){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,k.headers||(this.headers=new v(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!D&&E._bodyInit!=null&&(D=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=k.credentials||this.credentials||"same-origin",(k.headers||!this.headers)&&(this.headers=new v(k.headers)),this.method=A(k.method||this.method||"GET"),this.mode=k.mode||this.mode||null,this.signal=k.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}M.prototype.clone=function(){return new M(this,{body:this._bodyInit})};function O(E){var k=new FormData;return E.trim().split("&").forEach(function(D){if(D){var V=D.split("="),L=V.shift().replace(/\+/g," "),j=V.join("=").replace(/\+/g," ");k.append(decodeURIComponent(L),decodeURIComponent(j))}}),k}function R(E){var k=new v,D=E.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(V){var L=V.split(":"),j=L.shift().trim();if(j){var B=L.join(":").trim();k.append(j,B)}}),k}P.call(M.prototype);function N(E,k){k||(k={}),this.type="default",this.status=k.status===void 0?200:k.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in k?k.statusText:"OK",this.headers=new v(k.headers),this.url=k.url||"",this._initBody(E)}P.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new v(this.headers),url:this.url})},N.error=function(){var E=new N(null,{status:0,statusText:""});return E.type="error",E};var I=[301,302,303,307,308];N.redirect=function(E,k){if(I.indexOf(k)===-1)throw new RangeError("Invalid status code");return new N(null,{status:k,headers:{location:E}})},s.DOMException=i.DOMException;try{new s.DOMException}catch{s.DOMException=function(k,D){this.message=k,this.name=D;var V=Error(k);this.stack=V.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function $(E,k){return new Promise(function(D,V){var L=new M(E,k);if(L.signal&&L.signal.aborted)return V(new s.DOMException("Aborted","AbortError"));var j=new XMLHttpRequest;function B(){j.abort()}j.onload=function(){var Q={status:j.status,statusText:j.statusText,headers:R(j.getAllResponseHeaders()||"")};Q.url="responseURL"in j?j.responseURL:Q.headers.get("X-Request-URL");var te="response"in j?j.response:j.responseText;D(new N(te,Q))},j.onerror=function(){V(new TypeError("Network request failed"))},j.ontimeout=function(){V(new TypeError("Network request failed"))},j.onabort=function(){V(new s.DOMException("Aborted","AbortError"))},j.open(L.method,L.url,!0),L.credentials==="include"?j.withCredentials=!0:L.credentials==="omit"&&(j.withCredentials=!1),"responseType"in j&&a.blob&&(j.responseType="blob"),L.headers.forEach(function(Q,te){j.setRequestHeader(te,Q)}),L.signal&&(L.signal.addEventListener("abort",B),j.onreadystatechange=function(){j.readyState===4&&L.signal.removeEventListener("abort",B)}),j.send(typeof L._bodyInit>"u"?null:L._bodyInit)})}return $.polyfill=!0,i.fetch||(i.fetch=$,i.Headers=v,i.Request=M,i.Response=N),s.Headers=v,s.Request=M,s.Response=N,s.fetch=$,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(gl,gl.exports)),gl.exports}var VM=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);ot.length?JSON.parse(t):"")}ae.responseToJSON=_x;function Eu(e){if(!e)return e;if(Array.isArray(e))return e.map(n=>n&&typeof n=="object"?Eu(n):n);let t={};return Object.keys(e).forEach(n=>{const r=n.toLowerCase(),o=e[n];t[r]=o&&typeof o=="object"?Eu(o):o}),t}ae.loweCaseKeys=Eu;function Lh(e,t={}){const{includeResponse:n}=t,r=VM(t,["includeResponse"]);return WM(e,Object.assign(Object.assign({mode:"cors"},r),{headers:Object.assign({accept:"application/json"},Eu(r.headers))})).then(Px).then(o=>{const i=o.headers.get("content-type")+"";return i.match(/\bjson\b/i)?_x(o).then(s=>({res:o,body:s})):i.match(/^text\//i)?o.text().then(s=>({res:o,body:s})):{res:o}}).then(({res:o,body:i})=>{if(!i&&o.status==201){const s=o.headers.get("location");if(s)return Lh(s,Object.assign(Object.assign({},r),{method:"GET",body:null,includeResponse:n}))}return n?{body:i,response:o}:i===void 0?o:i})}ae.request=Lh;function Mx(e,t,n=!1){return n||!ml[e]?(ml[e]=Lh(e,t),ml[e]):Promise.resolve(ml[e])}ae.getAndCache=Mx;function qM(e="/",t){const n=String(e).replace(/\/*$/,"/")+"metadata";return Mx(n,t).catch(r=>{throw new Error(`Failed to fetch the conformance statement from "${n}". ${r}`)})}ae.fetchConformanceStatement=qM;function $h(e,t=""){if(t=t.trim(),!t)return e;let n=t.split("."),r=e;for(;r&&n.length;){const o=n.shift();if(!o&&Array.isArray(r))return r.map(i=>$h(i,n.join(".")));r=r[o]}return r}ae.getPath=$h;function QM(e,t,n,r=!1){return t.trim().split(".").reduce((o,i,s,a)=>{if(o&&s===a.length-1)o[i]=n;else return o&&o[i]===void 0&&r&&(o[i]=a[s+1].match(/^[0-9]+$/)?[]:{}),o?o[i]:void 0},e),e}ae.setPath=QM;function kx(e){return Array.isArray(e)?e:[e]}ae.makeArray=kx;function YM(e,t){return e.match(/^http/)||e.match(/^urn/)?e:String(t||"").replace(/\/+$/,"")+"/"+e.replace(/^\/+/,"")}ae.absolute=YM;function XM(e=8,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){const n=[],r=t.length;for(;e--;)n.push(t.charAt(Math.floor(Math.random()*r)));return n.join("")}ae.randomString=XM;function Tx(e,t){const n=e.split(".")[1];return n?JSON.parse(t.atob(n)):null}ae.jwtDecode=Tx;function JM(e=120,t){return Math.floor(+(t||new Date)/1e3+e)}ae.getTimeInFuture=JM;function ZM(e,t){const n=Math.floor(Date.now()/1e3);if(e.expires_in)return n+e.expires_in;if(e.access_token){let r=Tx(e.access_token,t);if(r&&r.exp)return r.exp}return n+300}ae.getAccessTokenExpiration=ZM;function Ax(e,t){const n={};function r(o,i){o&&Array.isArray(o.coding)&&o.coding.forEach(({code:s})=>{s&&(n[s]=n[s]||[],n[s].push(i))})}return kx(e).forEach(o=>{o.resourceType==="Observation"&&o[t]&&(Array.isArray(o[t])?o[t].forEach(i=>r(i,o)):r(o[t],o))}),n}ae.byCode=Ax;function ek(e,t){const n=Ax(e,t);return(...r)=>r.filter(o=>o+""in n).reduce((o,i)=>o.concat(n[i+""]),[])}ae.byCodes=ek;function tk(e,t){const r=($h(e,"rest.0.resource")||[]).find(i=>i.type===t);if(!r)throw new Error(`Resource "${t}" is not supported by this FHIR server`);if(!Array.isArray(r.searchParam))throw new Error(`No search parameters supported for "${t}" on this FHIR server`);if(t=="Patient"&&r.searchParam.find(i=>i.name=="_id"))return"_id";const o=KM.patientParams.find(i=>r.searchParam.find(s=>s.name==i));if(!o)throw new Error("I don't know what param to use for "+t);return o}ae.getPatientParam=tk;async function nk(e,t=800,n=720){if(typeof e=="function"&&(e=await e()),e&&typeof e=="object")return e;if(typeof e!="string")return Os("Invalid target type '%s'. Failing back to '_self'.",typeof e),self;if(e=="_self")return self;if(e=="_parent")return parent;if(e=="_top")return top||self;if(e=="_blank"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup"),!i)throw new Error("Perhaps window.open was blocked")}catch(s){o=s}return i||(Os("Cannot open window. Failing back to '_self'. %s",o),self)}if(e=="popup"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup",["height="+n,"width="+t,"menubar=0","resizable=1","status=0","top="+(screen.height-n)/2,"left="+(screen.width-t)/2].join(",")),!i)throw new Error("Perhaps the popup window was blocked")}catch(s){o=s}return i||(Os("Cannot open window. Failing back to '_self'. %s",o),self)}const r=frames[e];return r||(Os("Unknown target '%s'. Failing back to '_self'.",e),self)}ae.getTargetWindow=nk;function kn(e,t){if(!e)throw new Error(t)}ae.assert=kn;function rk(e){kn(Array.isArray(e),"The JSON patch must be an array"),kn(e.length>0,"The JSON patch array should not be empty"),e.forEach(t=>{kn(["add","replace","test","move","copy","remove"].indexOf(t.op)>-1,'Each patch operation must have an "op" property which must be one of: "add", "replace", "test", "move", "copy", "remove"'),kn(t.path&&typeof t.path,`Invalid "${t.op}" operation. Missing "path" property`),t.op=="add"||t.op=="replace"||t.op=="test"?(kn("value"in t,`Invalid "${t.op}" operation. Missing "value" property`),kn(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):t.op=="move"||t.op=="copy"?(kn(typeof t.from=="string",`Invalid "${t.op}" operation. Requires a string "from" property`),kn(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):kn(Object.keys(t).length==2,`Invalid "${t.op}" operation. Contains unknown properties`)})}ae.assertJsonPatch=rk;var lc={},Uh={};Object.defineProperty(Uh,"__esModule",{value:!0});Uh.default={expired:"Session expired! Please re-launch the app",noScopeForId:"Trying to get the ID of the selected %s. Please add 'launch' or 'launch/%s' to the requested scopes and try again.",noIfNoAuth:"You are trying to get %s but the app is not authorized yet.",noFreeContext:"Please don't use open fhir servers if you need to access launch context items like the %S."};Object.defineProperty(lc,"__esModule",{value:!0});const Se=ae,Mn=Uh,Bl=rn,{Response:ok}=typeof FHIRCLIENT_PURE<"u"?window:Fh(),It=Se.debug.extend("client");async function ik(e,t){const n=(0,Se.absolute)("/",t.state.serverUrl);async function r(o){const i=o.pathname.split("/").pop();(0,Se.assert)(i,`Invalid url "${o}"`),(0,Se.assert)(Bl.patientCompartment.indexOf(i)>-1,`Cannot filter "${i}" resources by patient`);const s=await(0,Se.fetchConformanceStatement)(t.state.serverUrl),a=(0,Se.getPatientParam)(s,i);return o.searchParams.set(a,t.patient.id),o.href}return typeof e=="string"||e instanceof URL?{url:await r(new URL(e+"",n))}:(e.url=await r(new URL(e.url+"",n)),e)}function sk(e,t,n,r){if(!t[e]){const{signal:o,headers:i}=r;t[e]=n.request({url:e,headers:i,signal:o}).then(s=>(t[e]=s,s),s=>{throw delete t[e],s})}return Promise.resolve(t[e])}function ak(e,t,n,r,o,i){const s=(0,Se.getPath)(e,t);if(s){const a=Array.isArray(s);return Promise.all((0,Se.makeArray)(s).filter(Boolean).map((l,u)=>{const d=l.reference;if(d)return sk(d,r,o,i).then(c=>{n&&(a?t.indexOf("..")>-1?(0,Se.setPath)(e,`${t.replace("..",`.${u}.`)}`,c):(0,Se.setPath)(e,`${t}.${u}`,c):(0,Se.setPath)(e,t,c))}).catch(c=>{if(c.status!==404)throw c})}))}}function Lv(e,t,n,r,o){let i=(0,Se.makeArray)(t.resolveReferences).filter(Boolean).map(l=>String(l).trim()).filter(Boolean);if(i=i.filter((l,u)=>i.indexOf(l,u+1)>-1?(It('Duplicated reference path "%s"',l),!1):!0),!i.length)return Promise.resolve();const s={};i.forEach(l=>{const u=l.split(".").length;s[u]||(s[u]=[]),s[u].push(l)});let a=Promise.resolve();return Object.keys(s).sort().forEach(l=>{const u=s[l];a=a.then(()=>Promise.all(u.map(d=>ak(e,d,!!t.graph,n,r,o))))}),a}class lk{constructor(t,n){this.units=Se.units;const r=typeof n=="string"?{serverUrl:n}:n;(0,Se.assert)(r.serverUrl&&r.serverUrl.match(/https?:\/\/.+/),'A "serverUrl" option is required and must begin with "http(s)"'),this.state=r,this.environment=t,this._refreshTask=null;const o=this;this.patient={get id(){return o.getPatientId()},read:i=>{const s=this.patient.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Patient/${s}`})):Promise.reject(new Error("Patient is not available"))},request:(i,s={})=>this.patient.id?(async()=>{const a=await ik(i,this);return this.request(a,s)})():Promise.reject(new Error("Patient is not available"))},this.encounter={get id(){return o.getEncounterId()},read:i=>{const s=this.encounter.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Encounter/${s}`})):Promise.reject(new Error("Encounter is not available"))}},this.user={get fhirUser(){return o.getFhirUser()},get id(){return o.getUserId()},get resourceType(){return o.getUserType()},read:i=>{const s=this.user.fhirUser;return s?this.request(Object.assign(Object.assign({},i),{url:s})):Promise.reject(new Error("User is not available"))}},this.connect(t.fhir)}connect(t){if(typeof t=="function"){const n={baseUrl:this.state.serverUrl.replace(/\/$/,"")},r=this.getState("tokenResponse.access_token");if(r)n.auth={token:r};else{const{username:i,password:s}=this.state;i&&s&&(n.auth={user:i,pass:s})}this.api=t(n);const o=this.getState("tokenResponse.patient");o&&(this.patient.api=t(Object.assign(Object.assign({},n),{patient:o})))}return this}getPatientId(){const t=this.state.tokenResponse;return t?t.patient?t.patient:((this.state.scope||"").match(/\blaunch(\/patient)?\b/)?It("The ID of the selected patient is not available. Please check if your server supports that."):It(Mn.default.noScopeForId,"patient","patient"),null):(this.state.authorizeUri?It(Mn.default.noIfNoAuth,"the ID of the selected patient"):It(Mn.default.noFreeContext,"selected patient"),null)}getEncounterId(){const t=this.state.tokenResponse;return t?t.encounter?t.encounter:((this.state.scope||"").match(/\blaunch(\/encounter)?\b/)?It("The ID of the selected encounter is not available. Please check if your server supports that, and that the selected patient has any recorded encounters."):It(Mn.default.noScopeForId,"encounter","encounter"),null):(this.state.authorizeUri?It(Mn.default.noIfNoAuth,"the ID of the selected encounter"):It(Mn.default.noFreeContext,"selected encounter"),null)}getIdToken(){const t=this.state.tokenResponse;if(t){const n=t.id_token,r=this.state.scope||"";if(!n){const o=r.match(/\bopenid\b/),i=r.match(/\bprofile\b/),s=r.match(/\bfhirUser\b/);return It(!o||!(s||i)?"You are trying to get the id_token but you are not using the right scopes. Please add 'openid' and 'fhirUser' or 'profile' to the scopes you are requesting.":"The id_token is not available. Please check if your server supports that."),null}return(0,Se.jwtDecode)(n,this.environment)}return this.state.authorizeUri?It(Mn.default.noIfNoAuth,"the id_token"):It(Mn.default.noFreeContext,"id_token"),null}getFhirUser(){const t=this.getIdToken();return t?t.fhirUser?t.fhirUser.split("/").slice(-2).join("/"):t.profile:null}getUserId(){const t=this.getFhirUser();return t?t.split("/")[1]:null}getUserType(){const t=this.getFhirUser();return t?t.split("/")[0]:null}getAuthorizationHeader(){const t=this.getState("tokenResponse.access_token");if(t)return"Bearer "+t;const{username:n,password:r}=this.state;return n&&r?"Basic "+this.environment.btoa(n+":"+r):null}async _clearState(){const t=this.environment.getStorage(),n=await t.get(Bl.SMART_KEY);n&&await t.unset(n),await t.unset(Bl.SMART_KEY),this.state.tokenResponse={}}create(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}`,method:"POST",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}update(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}/${t.id}`,method:"PUT",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}delete(t,n={}){return this.request(Object.assign(Object.assign({},n),{url:t,method:"DELETE"}))}async patch(t,n,r={}){return(0,Se.assertJsonPatch)(n),this.request(Object.assign(Object.assign({},r),{url:t,method:"PATCH",body:JSON.stringify(n),headers:Object.assign({prefer:"return=presentation","content-type":"application/json-patch+json; charset=UTF-8"},r.headers)}))}async request(t,n={},r={}){var o;const i=Se.debug.extend("client:request");(0,Se.assert)(t,"request requires an url or request options as argument");let s;typeof t=="string"||t instanceof URL?(s=String(t),t={}):s=String(t.url),s=(0,Se.absolute)(s,this.state.serverUrl);const a={graph:n.graph!==!1,flat:!!n.flat,pageLimit:(o=n.pageLimit)!==null&&o!==void 0?o:1,resolveReferences:n.resolveReferences||[],useRefreshToken:n.useRefreshToken!==!1,onPage:typeof n.onPage=="function"?n.onPage:void 0},l=t.signal||void 0,u=a.useRefreshToken?this.refreshIfNeeded({signal:l}).then(()=>t):Promise.resolve(t);let d;return u.then(c=>{const f=this.getAuthorizationHeader();return f&&(c.headers=Object.assign(Object.assign({},c.headers),{authorization:f})),c}).then(c=>(i("%s, options: %O, fhirOptions: %O",s,c,a),(0,Se.request)(s,c).then(f=>c.includeResponse?(d=f.response,f.body):f))).catch(async c=>{throw c.status==401?this.getState("tokenResponse.access_token")?a.useRefreshToken?(i("Auto-refresh failed! Please re-launch the app."),await this._clearState(),c.message+=` +`+Mn.default.expired,c):(i("Your session has expired and the useRefreshToken option is set to false. Please re-launch the app."),await this._clearState(),c.message+=` +`+Mn.default.expired,c):(c.message+=` +This app cannot be accessed directly. Please launch it as SMART app!`,c):c}).catch(c=>{throw c.status==403&&i("Permission denied! Please make sure that you have requested the proper scopes."),c}).then(c=>!c||typeof c=="string"||c instanceof ok?t.includeResponse?{body:c,response:d}:c:(async f=>(f.resourceType=="Bundle"?await Promise.all((f.entry||[]).map(g=>Lv(g.resource,a,r,this,t))):await Lv(f,a,r,this,t),f))(c).then(async f=>{if(f&&f.resourceType=="Bundle"){const g=f.link||[];if(a.flat&&(f=(f.entry||[]).map(v=>v.resource)),a.onPage&&await a.onPage(f,Object.assign({},r)),--a.pageLimit){const v=g.find(y=>y.relation=="next");if(f=(0,Se.makeArray)(f),v&&v.url){const y=await this.request({url:v.url,signal:l},a,r);return a.onPage?null:a.resolveReferences.length?(Object.assign(r,y.references),f.concat((0,Se.makeArray)(y.data||y))):f.concat((0,Se.makeArray)(y))}}}return f}).then(f=>{if(a.graph)r={};else if(!a.onPage&&a.resolveReferences.length)return{data:f,references:r};return f}).then(f=>t.includeResponse?{body:f,response:d}:f))}refreshIfNeeded(t={}){const n=this.getState("tokenResponse.access_token"),r=this.getState("tokenResponse.refresh_token"),o=this.state.expiresAt||0;return n&&r&&o-10-1,u=a.search(/\bonline_access\b/)>-1;if((0,Se.assert)(l||u,"Unable to refresh. No offline_access or online_access scope found."),!this._refreshTask){const d=Object.assign(Object.assign({credentials:this.environment.options.refreshTokenWithCredentials||"same-origin"},t),{method:"POST",mode:"cors",headers:Object.assign(Object.assign({},t.headers||{}),{"content-type":"application/x-www-form-urlencoded"}),body:`grant_type=refresh_token&refresh_token=${encodeURIComponent(i)}`});if(!("authorization"in d.headers)){const{clientSecret:c,clientId:f}=this.state;c&&(d.headers.authorization="Basic "+this.environment.btoa(f+":"+c))}this._refreshTask=(0,Se.request)(s,d).then(c=>((0,Se.assert)(c.access_token,"No access token received"),o("Received new access token response %O",c),this.state.tokenResponse=Object.assign(Object.assign({},this.state.tokenResponse),c),this.state.expiresAt=(0,Se.getAccessTokenExpiration)(c,this.environment),this.state)).catch(c=>{var f,g;throw!((g=(f=this.state)===null||f===void 0?void 0:f.tokenResponse)===null||g===void 0)&&g.refresh_token&&(o("Deleting the expired or invalid refresh token."),delete this.state.tokenResponse.refresh_token),c}).finally(()=>{this._refreshTask=null;const c=this.state.key;c?this.environment.getStorage().set(c,this.state):o("No 'key' found in Clint.state. Cannot persist the instance.")})}return this._refreshTask}byCode(t,n){return(0,Se.byCode)(t,n)}byCodes(t,n){return(0,Se.byCodes)(t,n)}getPath(t,n=""){return(0,Se.getPath)(t,n)}getState(t=""){return(0,Se.getPath)(Object.assign({},this.state),t)}getFhirVersion(){return(0,Se.fetchConformanceStatement)(this.state.serverUrl).then(t=>t.fhirVersion)}getFhirRelease(){return this.getFhirVersion().then(t=>{var n;return(n=Bl.fhirVersions[t])!==null&&n!==void 0?n:0})}}lc.default=lk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.init=e.buildTokenRequest=e.ready=e.onMessage=e.isInPopUp=e.isInFrame=e.authorize=e.getSecurityExtensions=e.fetchWellKnownJson=e.KEY=void 0;const t=ae,n=lc,r=rn;Object.defineProperty(e,"KEY",{enumerable:!0,get:function(){return r.SMART_KEY}});const o=t.debug.extend("oauth2");function i(){return typeof window=="object"}function s(m="/",S){const C=String(m).replace(/\/*$/,"/")+".well-known/smart-configuration";return(0,t.getAndCache)(C,S).catch(P=>{throw new Error(`Failed to fetch the well-known json "${C}". ${P.message}`)})}e.fetchWellKnownJson=s;function a(m="/",S){return s(m,S).then(C=>{if(!C.authorization_endpoint||!C.token_endpoint)throw new Error("Invalid wellKnownJson");return{registrationUri:C.registration_endpoint||"",authorizeUri:C.authorization_endpoint,tokenUri:C.token_endpoint,codeChallengeMethods:C.code_challenge_methods_supported||[]}})}function l(m="/",S){return(0,t.fetchConformanceStatement)(m,S).then(C=>{const P="http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris",b=((0,t.getPath)(C||{},"rest.0.security.extension")||[]).filter(M=>M.url===P).map(M=>M.extension)[0],A={registrationUri:"",authorizeUri:"",tokenUri:"",codeChallengeMethods:[]};return b&&b.forEach(M=>{M.url==="register"&&(A.registrationUri=M.valueUri),M.url==="authorize"&&(A.authorizeUri=M.valueUri),M.url==="token"&&(A.tokenUri=M.valueUri)}),A})}function u(m="/"){return a(m).catch(()=>l(m))}e.getSecurityExtensions=u;async function d(m,S={}){const C=m.getUrl();if(Array.isArray(S)){const Le=C.searchParams.get("iss")||C.searchParams.get("fhirServiceUrl");if(!Le)throw new Error('Passing in an "iss" url parameter is required if authorize uses multiple configurations');const nt=S.find(cn=>{if(cn.issMatch){if(typeof cn.issMatch=="function")return!!cn.issMatch(Le);if(typeof cn.issMatch=="string")return cn.issMatch===Le;if(cn.issMatch instanceof RegExp)return cn.issMatch.test(Le)}return!1});return(0,t.assert)(nt,`No configuration found matching the current "iss" parameter "${Le}"`),await d(m,nt)}const{clientSecret:P,fakeTokenResponse:b,encounterId:A,target:M,width:O,height:R,pkceMode:N,clientPublicKeySetUrl:I,redirect_uri:$,client_id:E}=S;let{iss:k,launch:D,patientId:V,fhirServiceUrl:L,redirectUri:j,noRedirect:B,scope:Q="",clientId:te,completeInTarget:fe,clientPrivateJwk:ge}=S;const z=m.getStorage();k=C.searchParams.get("iss")||k,L=C.searchParams.get("fhirServiceUrl")||L,D=C.searchParams.get("launch")||D,V=C.searchParams.get("patientId")||V,te=C.searchParams.get("clientId")||te,te||(te=E),j||(j=$),j?j.match(/^https?\:\/\//)||(j=m.relative(j)):j=m.relative(".");const G=String(k||L||"");if(!G)throw new Error("No server url found. It must be specified as `iss` or as `fhirServiceUrl` parameter");if(k&&o("Making %s launch...",D?"EHR":"standalone"),D&&!Q.match(/launch/)&&(Q+=" launch"),i()){const Le=f(),nt=g();(Le||nt)&&fe!==!0&&fe!==!1&&(fe=Le,console.warn('Your app is being authorized from within an iframe or popup window. Please be explicit and provide a "completeInTarget" option. Use "true" to complete the authorization in the same window, or "false" to try to complete it in the parent or the opener window. See http://docs.smarthealthit.org/client-js/api.html'))}const pe=await z.get(r.SMART_KEY);await z.unset(pe);const Me=(0,t.randomString)(16),we={clientId:te,scope:Q,redirectUri:j,serverUrl:G,clientSecret:P,clientPrivateJwk:ge,tokenResponse:{},key:Me,completeInTarget:fe,clientPublicKeySetUrl:I};(i()?(0,t.getPath)(m,"options.fullSessionStorageSupport"):!0)&&await z.set(r.SMART_KEY,Me),b&&Object.assign(we.tokenResponse,b),V&&Object.assign(we.tokenResponse,{patient:V}),A&&Object.assign(we.tokenResponse,{encounter:A});let Ce=j+"?state="+encodeURIComponent(Me);if(L&&!k)return o("Making fake launch..."),await z.set(Me,we),B?Ce:await m.redirect(Ce);const it=await u(G);if(Object.assign(we,it),await z.set(Me,we),!we.authorizeUri)return B?Ce:await m.redirect(Ce);const Ot=["response_type=code","client_id="+encodeURIComponent(te||""),"scope="+encodeURIComponent(Q),"redirect_uri="+encodeURIComponent(j),"aud="+encodeURIComponent(G),"state="+encodeURIComponent(Me)];if(D&&Ot.push("launch="+encodeURIComponent(D)),c(it.codeChallengeMethods.includes("S256"),N)){let Le=await m.security.generatePKCEChallenge();Object.assign(we,Le),await z.set(Me,we),Ot.push("code_challenge="+we.codeChallenge),Ot.push("code_challenge_method=S256")}if(Ce=we.authorizeUri+"?"+Ot.join("&"),B)return Ce;if(M&&i()){let Le;if(Le=await(0,t.getTargetWindow)(M,O,R),Le!==self)try{Le.sessionStorage.removeItem(pe),Le.sessionStorage.setItem(Me,JSON.stringify(we))}catch(nt){(0,t.debug)('Failed to modify window.sessionStorage. Perhaps it is from different origin?. Failing back to "_self". %s',nt),Le=self}if(Le!==self)try{Le.location.href=Ce,self.addEventListener("message",v)}catch(nt){(0,t.debug)('Failed to modify window.location. Perhaps it is from different origin?. Failing back to "_self". %s',nt),self.location.href=Ce}else self.location.href=Ce;return}else return await m.redirect(Ce)}e.authorize=d;function c(m,S){if(S==="disabled")return!1;if(S==="unsafeV1")return!0;if(S==="required"){if(!m)throw new Error("Required PKCE code challenge method (`S256`) was not found in the server's codeChallengeMethods declaration.");return!0}return m}function f(){try{return self!==top&&parent!==self}catch{return!0}}e.isInFrame=f;function g(){try{return self===top&&!!opener&&opener!==self&&!!window.name}catch{return!1}}e.isInPopUp=g;function v(m){m.data.type=="completeAuth"&&m.origin===new URL(self.location.href).origin&&(window.removeEventListener("message",v),window.location.href=m.data.url)}e.onMessage=v;async function y(m,S={}){var C,P;const b=m.getUrl(),A=m.getStorage(),M=b.searchParams;let O=M.get("state");const R=M.get("code"),N=M.get("error"),I=M.get("error_description");if(O||(O=await A.get(r.SMART_KEY)),N||I)throw new Error([N,I].filter(Boolean).join(": "));o("key: %s, code: %s",O,R),(0,t.assert)(O,"No 'state' parameter found. Please (re)launch the app.");let $=await A.get(O);const E=i()?(0,t.getPath)(m,"options.fullSessionStorageSupport"):!0;if(i()&&$&&!$.completeInTarget){const L=f(),j=g();if((L||j)&&!b.searchParams.get("complete")){b.searchParams.set("complete","1");const{href:B,origin:Q}=b;return L&&parent.postMessage({type:"completeAuth",url:B},Q),j&&(opener.postMessage({type:"completeAuth",url:B},Q),window.close()),new Promise(()=>{})}}b.searchParams.delete("complete");const k=M.has("state");if(i()&&(0,t.getPath)(m,"options.replaceBrowserHistory")&&(R||k)&&(R&&(M.delete("code"),o("Removed code parameter from the url.")),k&&E&&(M.delete("state"),o("Removed state parameter from the url.")),window.history.replaceState&&window.history.replaceState({},"",b.href)),(0,t.assert)($,"No state found! Please (re)launch the app."),!(!R||((C=$.tokenResponse)===null||C===void 0?void 0:C.access_token))&&$.tokenUri){(0,t.assert)(R,"'code' url parameter is required"),o("Preparing to exchange the code for access token...");const L=await x(m,{code:R,state:$,clientPublicKeySetUrl:S.clientPublicKeySetUrl,privateKey:S.privateKey||$.clientPrivateJwk});o("Token request options: %O",L);const j=await(0,t.request)($.tokenUri,L);o("Token response: %O",j),(0,t.assert)(j.access_token,"Failed to obtain access token."),$.expiresAt=(0,t.getAccessTokenExpiration)(j,m),$=Object.assign(Object.assign({},$),{tokenResponse:j}),await A.set(O,$),o("Authorization successful!")}else o(!((P=$.tokenResponse)===null||P===void 0)&&P.access_token?"Already authorized":"No authorization needed");E&&await A.set(r.SMART_KEY,O);const V=new n.default(m,$);return o("Created client instance: %O",V),V}e.ready=y;async function x(m,{code:S,state:C,clientPublicKeySetUrl:P,privateKey:b}){const{redirectUri:A,clientSecret:M,tokenUri:O,clientId:R,codeVerifier:N}=C;(0,t.assert)(A,"Missing state.redirectUri"),(0,t.assert)(O,"Missing state.tokenUri"),(0,t.assert)(R,"Missing state.clientId");const I={method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:`code=${S}&grant_type=authorization_code&redirect_uri=${encodeURIComponent(A)}`};if(M)I.headers.authorization="Basic "+m.btoa(R+":"+M),o("Using state.clientSecret to construct the authorization header: %s",I.headers.authorization);else if(b){const $="key"in b?b.key:await m.security.importJWK(b),E={typ:"JWT",kid:b.kid,jku:P||C.clientPublicKeySetUrl},k={iss:R,sub:R,aud:O,jti:m.base64urlencode(m.security.randomBytes(32)),exp:(0,t.getTimeInFuture)(120)},D=await m.security.signCompactJws(b.alg,$,E,k);I.body+=`&client_assertion_type=${encodeURIComponent("urn:ietf:params:oauth:client-assertion-type:jwt-bearer")}`,I.body+=`&client_assertion=${encodeURIComponent(D)}`,o("Using state.clientPrivateJwk to add a client_assertion to the POST body")}else o("Public client detected; adding state.clientId to the POST body"),I.body+=`&client_id=${encodeURIComponent(R)}`;return N&&(o("Found state.codeVerifier, adding to the POST body"),I.body+="&code_verifier="+N),I}e.buildTokenRequest=x;async function w(m,S,C){const P=m.getUrl(),b=P.searchParams.get("code"),A=P.searchParams.get("state");if(b&&A)return y(m,C);const M=m.getStorage(),O=A||await M.get(r.SMART_KEY),R=await M.get(O);return R?new n.default(m,R):d(m,S).then(()=>new Promise(()=>{}))}e.init=w})(Ex);var zh={};Object.defineProperty(zh,"__esModule",{value:!0});class uk{async get(t){const n=sessionStorage[t];return n?JSON.parse(n):null}async set(t,n){return sessionStorage[t]=JSON.stringify(n),n}async unset(t){return t in sessionStorage?(delete sessionStorage[t],!0):!1}}zh.default=uk;var tn={},Nx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:typeof window<"u"?window:Fs,function(){var n="3.7.7",r=n,o=typeof Buffer=="function",i=typeof TextDecoder=="function"?new TextDecoder:void 0,s=typeof TextEncoder=="function"?new TextEncoder:void 0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=Array.prototype.slice.call(a),u=function(z){var G={};return z.forEach(function(pe,Me){return G[pe]=Me}),G}(l),d=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(z){return new Uint8Array(Array.prototype.slice.call(z,0))},g=function(z){return z.replace(/=/g,"").replace(/[+\/]/g,function(G){return G=="+"?"-":"_"})},v=function(z){return z.replace(/[^A-Za-z0-9\+\/]/g,"")},y=function(z){for(var G,pe,Me,we,tt="",Ce=z.length%3,it=0;it255||(Me=z.charCodeAt(it++))>255||(we=z.charCodeAt(it++))>255)throw new TypeError("invalid character found");G=pe<<16|Me<<8|we,tt+=l[G>>18&63]+l[G>>12&63]+l[G>>6&63]+l[G&63]}return Ce?tt.slice(0,Ce-3)+"===".substring(Ce):tt},x=typeof btoa=="function"?function(z){return btoa(z)}:o?function(z){return Buffer.from(z,"binary").toString("base64")}:y,w=o?function(z){return Buffer.from(z).toString("base64")}:function(z){for(var G=4096,pe=[],Me=0,we=z.length;Me>>6)+c(128|G&63):c(224|G>>>12&15)+c(128|G>>>6&63)+c(128|G&63)}else{var G=65536+(z.charCodeAt(0)-55296)*1024+(z.charCodeAt(1)-56320);return c(240|G>>>18&7)+c(128|G>>>12&63)+c(128|G>>>6&63)+c(128|G&63)}},C=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,P=function(z){return z.replace(C,S)},b=o?function(z){return Buffer.from(z,"utf8").toString("base64")}:s?function(z){return w(s.encode(z))}:function(z){return x(P(z))},A=function(z,G){return G===void 0&&(G=!1),G?g(b(z)):b(z)},M=function(z){return A(z,!0)},O=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,R=function(z){switch(z.length){case 4:var G=(7&z.charCodeAt(0))<<18|(63&z.charCodeAt(1))<<12|(63&z.charCodeAt(2))<<6|63&z.charCodeAt(3),pe=G-65536;return c((pe>>>10)+55296)+c((pe&1023)+56320);case 3:return c((15&z.charCodeAt(0))<<12|(63&z.charCodeAt(1))<<6|63&z.charCodeAt(2));default:return c((31&z.charCodeAt(0))<<6|63&z.charCodeAt(1))}},N=function(z){return z.replace(O,R)},I=function(z){if(z=z.replace(/\s+/g,""),!d.test(z))throw new TypeError("malformed base64.");z+="==".slice(2-(z.length&3));for(var G,pe="",Me,we,tt=0;tt>16&255):we===64?c(G>>16&255,G>>8&255):c(G>>16&255,G>>8&255,G&255);return pe},$=typeof atob=="function"?function(z){return atob(v(z))}:o?function(z){return Buffer.from(z,"base64").toString("binary")}:I,E=o?function(z){return f(Buffer.from(z,"base64"))}:function(z){return f($(z).split("").map(function(G){return G.charCodeAt(0)}))},k=function(z){return E(V(z))},D=o?function(z){return Buffer.from(z,"base64").toString("utf8")}:i?function(z){return i.decode(E(z))}:function(z){return N($(z))},V=function(z){return v(z.replace(/[-_]/g,function(G){return G=="-"?"+":"/"}))},L=function(z){return D(V(z))},j=function(z){if(typeof z!="string")return!1;var G=z.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(G)||!/[^\s0-9a-zA-Z\-_]/.test(G)},B=function(z){return{value:z,enumerable:!1,writable:!0,configurable:!0}},Q=function(){var z=function(G,pe){return Object.defineProperty(String.prototype,G,B(pe))};z("fromBase64",function(){return L(this)}),z("toBase64",function(G){return A(this,G)}),z("toBase64URI",function(){return A(this,!0)}),z("toBase64URL",function(){return A(this,!0)}),z("toUint8Array",function(){return k(this)})},te=function(){var z=function(G,pe){return Object.defineProperty(Uint8Array.prototype,G,B(pe))};z("toBase64",function(G){return m(this,G)}),z("toBase64URI",function(){return m(this,!0)}),z("toBase64URL",function(){return m(this,!0)})},fe=function(){Q(),te()},ge={version:n,VERSION:r,atob:$,atobPolyfill:I,btoa:x,btoaPolyfill:y,fromBase64:L,toBase64:A,encode:A,encodeURI:M,encodeURL:M,utob:P,btou:N,decode:L,isValid:j,fromUint8Array:m,toUint8Array:k,extendString:Q,extendUint8Array:te,extendBuiltins:fe};return ge.Base64={},Object.keys(ge).forEach(function(z){return ge.Base64[z]=ge[z]}),ge})})(Nx);var jx=Nx.exports;/** + * @file Web Cryptography API shim + * @author Artem S Vybornov + * @license MIT + */(function(e,t){typeof define=="function"&&define.amd?define([],function(){return t(e)}):typeof Yl=="object"&&Yl.exports?Yl.exports=t(e):t(e)})(typeof self<"u"?self:void 0,function(e){if(typeof Promise!="function")throw"Promise support required";var t=e.crypto||e.msCrypto;if(!t)return;var n=t.subtle||t.webkitSubtle;if(!n)return;var r=e.Crypto||t.constructor||Object,o=e.SubtleCrypto||n.constructor||Object;e.CryptoKey||e.Key;var i=e.navigator.userAgent.indexOf("Edge/")>-1,s=!!e.msCrypto&&!i,a=!t.subtle&&!!t.webkitSubtle;if(!s&&!a)return;function l(R){return btoa(R).replace(/\=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(R){return R+="===",R=R.slice(0,-R.length%4),atob(R.replace(/-/g,"+").replace(/_/g,"/"))}function d(R){for(var N=new Uint8Array(R.length),I=0;I2&&(I=!0,N.shift());var $={ext:!0};switch(N[0][0]){case"1.2.840.113549.1.1.1":var E=["n","e","d","p","q","dp","dq","qi"],k=C(N[1]);I&&k.shift();for(var D=0;D2&&($=!0,k.unshift(new Uint8Array([0]))),I[0][0]="1.2.840.113549.1.1.1",N=k;break;default:throw new TypeError("Unsupported key type")}return I.push(new Uint8Array(P(N)).buffer),$?I.unshift(new Uint8Array([0])):I[1]={tag:3,value:I[1]},new Uint8Array(P(I)).buffer}var m={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},S={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};function C(R,N){if(R instanceof ArrayBuffer&&(R=new Uint8Array(R)),N||(N={pos:0,end:R.length}),N.end-N.pos<2||N.end>R.length)throw new RangeError("Malformed DER");var I=R[N.pos++],$=R[N.pos++];if($>=128){if($&=127,N.end-N.pos<$)throw new RangeError("Malformed DER");for(var E=0;$--;)E<<=8,E|=R[N.pos++];$=E}if(N.end-N.pos<$)throw new RangeError("Malformed DER");var k;switch(I){case 2:k=R.subarray(N.pos,N.pos+=$);break;case 3:if(R[N.pos++])throw new Error("Unsupported bit string");$--;case 4:k=new Uint8Array(R.subarray(N.pos,N.pos+=$)).buffer;break;case 5:k=null;break;case 6:var D=btoa(c(R.subarray(N.pos,N.pos+=$)));if(!(D in m))throw new Error("Unsupported OBJECT ID "+D);k=m[D];break;case 48:k=[];for(var V=N.pos+$;N.pos=128){var V=$,$=4;for(N.splice(E,0,V>>24&255,V>>16&255,V>>8&255,V&255);$>1&&!(V>>24);)V<<=8,$--;$<4&&N.splice(E,4-$),$|=128}return N.splice(E-2,2,I,$),N}function b(R,N,I,$){Object.defineProperties(this,{_key:{value:R},type:{value:R.type,enumerable:!0},extractable:{value:I===void 0?R.extractable:I,enumerable:!0},algorithm:{value:N===void 0?R.algorithm:N,enumerable:!0},usages:{value:$===void 0?R.usages:$,enumerable:!0}})}function A(R){return R==="verify"||R==="encrypt"||R==="wrapKey"}function M(R){return R==="sign"||R==="decrypt"||R==="unwrapKey"}if(["generateKey","importKey","unwrapKey"].forEach(function(R){var N=n[R];n[R]=function(I,$,E){var k=[].slice.call(arguments),D,V,L;switch(R){case"generateKey":D=f(I),V=$,L=E;break;case"importKey":D=f(E),V=k[3],L=k[4],I==="jwk"&&($=v($),$.alg||($.alg=g(D)),$.key_ops||($.key_ops=$.kty!=="oct"?"d"in $?L.filter(M):L.filter(A):L.slice()),k[1]=y($));break;case"unwrapKey":D=k[4],V=k[5],L=k[6],k[2]=E._key;break}if(R==="generateKey"&&D.name==="HMAC"&&D.hash)return D.length=D.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[D.hash.name],n.importKey("raw",t.getRandomValues(new Uint8Array(D.length+7>>3)),D,V,L);if(a&&R==="generateKey"&&D.name==="RSASSA-PKCS1-v1_5"&&(!D.modulusLength||D.modulusLength>=2048))return I=f(I),I.name="RSAES-PKCS1-v1_5",delete I.hash,n.generateKey(I,!0,["encrypt","decrypt"]).then(function(B){return Promise.all([n.exportKey("jwk",B.publicKey),n.exportKey("jwk",B.privateKey)])}).then(function(B){return B[0].alg=B[1].alg=g(D),B[0].key_ops=L.filter(A),B[1].key_ops=L.filter(M),Promise.all([n.importKey("jwk",B[0],D,!0,B[0].key_ops),n.importKey("jwk",B[1],D,V,B[1].key_ops)])}).then(function(B){return{publicKey:B[0],privateKey:B[1]}});if((a||s&&(D.hash||{}).name==="SHA-1")&&R==="importKey"&&I==="jwk"&&D.name==="HMAC"&&$.kty==="oct")return n.importKey("raw",d(u($.k)),E,k[3],k[4]);if(a&&R==="importKey"&&(I==="spki"||I==="pkcs8"))return n.importKey("jwk",x($),E,k[3],k[4]);if(s&&R==="unwrapKey")return n.decrypt(k[3],E,$).then(function(B){return n.importKey(I,B,k[4],k[5],k[6])});var j;try{j=N.apply(n,k)}catch(B){return Promise.reject(B)}return s&&(j=new Promise(function(B,Q){j.onabort=j.onerror=function(te){Q(te)},j.oncomplete=function(te){B(te.target.result)}})),j=j.then(function(B){return D.name==="HMAC"&&(D.length||(D.length=8*B.algorithm.length)),D.name.search("RSA")==0&&(D.modulusLength||(D.modulusLength=(B.publicKey||B).algorithm.modulusLength),D.publicExponent||(D.publicExponent=(B.publicKey||B).algorithm.publicExponent)),B.publicKey&&B.privateKey?B={publicKey:new b(B.publicKey,D,V,L.filter(A)),privateKey:new b(B.privateKey,D,V,L.filter(M))}:B=new b(B,D,V,L),B}),j}}),["exportKey","wrapKey"].forEach(function(R){var N=n[R];n[R]=function(I,$,E){var k=[].slice.call(arguments);switch(R){case"exportKey":k[1]=$._key;break;case"wrapKey":k[1]=$._key,k[2]=E._key;break}if((a||s&&($.algorithm.hash||{}).name==="SHA-1")&&R==="exportKey"&&I==="jwk"&&$.algorithm.name==="HMAC"&&(k[0]="raw"),a&&R==="exportKey"&&(I==="spki"||I==="pkcs8")&&(k[0]="jwk"),s&&R==="wrapKey")return n.exportKey(I,$).then(function(V){return I==="jwk"&&(V=d(unescape(encodeURIComponent(JSON.stringify(v(V)))))),n.encrypt(k[3],E,V)});var D;try{D=N.apply(n,k)}catch(V){return Promise.reject(V)}return s&&(D=new Promise(function(V,L){D.onabort=D.onerror=function(j){L(j)},D.oncomplete=function(j){V(j.target.result)}})),R==="exportKey"&&I==="jwk"&&(D=D.then(function(V){return(a||s&&($.algorithm.hash||{}).name==="SHA-1")&&$.algorithm.name==="HMAC"?{kty:"oct",alg:g($.algorithm),key_ops:$.usages.slice(),ext:!0,k:l(c(V))}:(V=v(V),V.alg||(V.alg=g($.algorithm)),V.key_ops||(V.key_ops=$.type==="public"?$.usages.filter(A):$.type==="private"?$.usages.filter(M):$.usages.slice()),V)})),a&&R==="exportKey"&&(I==="spki"||I==="pkcs8")&&(D=D.then(function(V){return V=w(v(V)),V})),D}}),["encrypt","decrypt","sign","verify"].forEach(function(R){var N=n[R];n[R]=function(I,$,E,k){if(s&&(!E.byteLength||k&&!k.byteLength))throw new Error("Empy input is not allowed");var D=[].slice.call(arguments),V=f(I);if(s&&R==="decrypt"&&V.name==="AES-GCM"){var L=I.tagLength>>3;D[2]=(E.buffer||E).slice(0,E.byteLength-L),I.tag=(E.buffer||E).slice(E.byteLength-L)}D[1]=$._key;var j;try{j=N.apply(n,D)}catch(B){return Promise.reject(B)}return s&&(j=new Promise(function(B,Q){j.onabort=j.onerror=function(te){Q(te)},j.oncomplete=function(fe){var fe=fe.target.result;if(R==="encrypt"&&fe instanceof AesGcmEncryptResult){var ge=fe.ciphertext,z=fe.tag;fe=new Uint8Array(ge.byteLength+z.byteLength),fe.set(new Uint8Array(ge),0),fe.set(new Uint8Array(z),ge.byteLength),fe=fe.buffer}B(fe)}})),j}}),s){var O=n.digest;n.digest=function(R,N){if(!N.byteLength)throw new Error("Empy input is not allowed");var I;try{I=O.call(n,R,N)}catch($){return Promise.reject($)}return I=new Promise(function($,E){I.onabort=I.onerror=function(k){E(k)},I.oncomplete=function(k){$(k.target.result)}}),I},e.crypto=Object.create(t,{getRandomValues:{value:function(R){return t.getRandomValues(R)}},subtle:{value:n}}),e.CryptoKey=b}a&&(t.subtle=n,e.Crypto=r,e.SubtleCrypto=o,e.CryptoKey=b)});const ck=window.crypto,dk=Object.freeze(Object.defineProperty({__proto__:null,default:ck},Symbol.toStringTag,{value:"Module"})),fk=AR(dk);Object.defineProperty(tn,"__esModule",{value:!0});tn.signCompactJws=tn.importJWK=tn.generatePKCEChallenge=tn.digestSha256=tn.randomBytes=void 0;const qs=jx,Bf=typeof globalThis=="object"&&globalThis.crypto?globalThis.crypto:fk.default,Bh=()=>{if(!Bf.subtle)throw globalThis.isSecureContext?new Error("Some of the required subtle crypto functionality is not available in the current environment (no crypto.subtle)"):new Error("Some of the required subtle crypto functionality is not available unless you run this app in secure context (using HTTPS or running locally). See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts");return Bf.subtle},pk={ES384:{name:"ECDSA",namedCurve:"P-384"},RS384:{name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-384"}}};function Ox(e){return Bf.getRandomValues(new Uint8Array(e))}tn.randomBytes=Ox;async function Ix(e){const t=new TextEncoder().encode(e),n=await Bh().digest("SHA-256",t);return new Uint8Array(n)}tn.digestSha256=Ix;const hk=async(e=96)=>{const t=Ox(e),n=(0,qs.fromUint8Array)(t,!0);return{codeChallenge:(0,qs.fromUint8Array)(await Ix(n),!0),codeVerifier:n}};tn.generatePKCEChallenge=hk;async function gk(e){if(!e.alg)throw new Error('The "alg" property of the JWK must be set to "ES384" or "RS384"');if(Array.isArray(e.key_ops)||(e.key_ops=["sign"]),!e.key_ops.includes("sign"))throw new Error('The "key_ops" property of the JWK does not contain "sign"');try{return await Bh().importKey("jwk",e,pk[e.alg],e.ext===!0,e.key_ops)}catch(t){throw new Error(`The ${e.alg} is not supported by this browser: ${t}`)}}tn.importJWK=gk;async function mk(e,t,n,r){const o=JSON.stringify(Object.assign(Object.assign({},n),{alg:e})),i=JSON.stringify(r),s=`${(0,qs.encodeURL)(o)}.${(0,qs.encodeURL)(i)}`,a=await Bh().sign(Object.assign(Object.assign({},t.algorithm),{hash:"SHA-384"}),t,new TextEncoder().encode(s));return`${s}.${(0,qs.fromUint8Array)(new Uint8Array(a),!0)}`}tn.signCompactJws=mk;Object.defineProperty(Ih,"__esModule",{value:!0});const md=Ex,vk=lc,yk=zh,$v=tn,vd=jx;class wk{constructor(t={}){this._url=null,this._storage=null,this.security=$v,this.options=Object.assign({replaceBrowserHistory:!0,fullSessionStorageSupport:!0,refreshTokenWithCredentials:"same-origin"},t)}relative(t){return new URL(t,this.getUrl().href).href}get fhir(){return typeof fhir=="function"?fhir:null}getUrl(){return this._url||(this._url=new URL(location+"")),this._url}redirect(t){location.href=t}getStorage(){return this._storage||(this._storage=new yk.default),this._storage}getAbortController(){return AbortController}atob(t){return window.atob(t)}btoa(t){return window.btoa(t)}base64urlencode(t){return typeof t=="string"?(0,vd.encodeURL)(t):(0,vd.fromUint8Array)(t,!0)}base64urldecode(t){return(0,vd.decode)(t)}getSmartApi(){return{ready:(...t)=>(0,md.ready)(this,...t),authorize:t=>(0,md.authorize)(this,t),init:t=>(0,md.init)(this,t),client:t=>new vk.default(this,t),options:this.options,utils:{security:$v}}}}Ih.default=wk;var Uv={},zv;function xk(){return zv||(zv=1,function(e){e()}(function(){function e(x,w){if(!(x instanceof w))throw new TypeError("Cannot call a class as a function")}function t(x,w){for(var m=0;m"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(x){if(x===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return x}function l(x,w){if(w&&(typeof w=="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a(x)}function u(x){var w=s();return function(){var S=o(x),C;if(w){var P=o(this).constructor;C=Reflect.construct(S,arguments,P)}else C=S.apply(this,arguments);return l(this,C)}}function d(x,w){for(;!Object.prototype.hasOwnProperty.call(x,w)&&(x=o(x),x!==null););return x}function c(){return typeof Reflect<"u"&&Reflect.get?c=Reflect.get.bind():c=function(w,m,S){var C=d(w,m);if(C){var P=Object.getOwnPropertyDescriptor(C,m);return P.get?P.get.call(arguments.length<3?w:S):P.value}},c.apply(this,arguments)}var f=function(){function x(){e(this,x),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(x,[{key:"addEventListener",value:function(m,S,C){m in this.listeners||(this.listeners[m]=[]),this.listeners[m].push({callback:S,options:C})}},{key:"removeEventListener",value:function(m,S){if(m in this.listeners){for(var C=this.listeners[m],P=0,b=C.length;P"u")C=new Error("This operation was aborted"),C.name="AbortError";else try{C=new DOMException("signal is aborted without reason")}catch{C=new Error("This operation was aborted"),C.name="AbortError"}this.signal.reason=C,this.signal.dispatchEvent(S)}},{key:"toString",value:function(){return"[object AbortController]"}}]),x}();typeof Symbol<"u"&&Symbol.toStringTag&&(v.prototype[Symbol.toStringTag]="AbortController",g.prototype[Symbol.toStringTag]="AbortSignal");function y(x){return x.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof x.Request=="function"&&!x.Request.prototype.hasOwnProperty("signal")||!x.AbortController}(function(x){y(x)&&(x.AbortController=v,x.AbortSignal=g)})(typeof self<"u"?self:Fs)})),Uv}const Sk=Ih,Ck=new Sk.default,{ready:bk,authorize:Rk,init:Ek,client:Pk,options:_k,utils:Mk}=Ck.getSmartApi();if(typeof FHIRCLIENT_PURE>"u"){const e=Fh();xk(),window.fetch||(window.fetch=e.default,window.Headers=e.Headers,window.Request=e.Request,window.Response=e.Response)}const kk={AbortController:window.AbortController,client:Pk,utils:Mk,oauth2:{settings:_k,ready:bk,authorize:Rk,init:Ek}};var Pu=kk,Bo=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(){}},Io=typeof window>"u"||"Deno"in globalThis;function Jt(){}function Tk(e,t){return typeof e=="function"?e(t):e}function Vf(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dx(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function vn(e,t){return typeof e=="function"?e(t):e}function Bv(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Vh(s,t.options))return!1}else if(!va(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function Vv(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Do(t.options.mutationKey)!==Do(i))return!1}else if(!va(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Vh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Do)(e)}function Do(e){return JSON.stringify(e,(t,n)=>Hf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function va(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!va(e[n],t[n])):!1}function Hh(e,t){if(e===t)return e;const n=Hv(e)&&Hv(t);if(n||Hf(e)&&Hf(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=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?Hh(e,t):t}function Nk(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function jk(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kh=Symbol();function Fx(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kh?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var xo,Er,Pi,Ny,Ok=(Ny=class extends Bo{constructor(){super();ne(this,xo);ne(this,Er);ne(this,Pi);W(this,Pi,t=>{if(!Io&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Er)||this.setEventListener(_(this,Pi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Er))==null||t.call(this),W(this,Er,void 0))}setEventListener(t){var n;W(this,Pi,t),(n=_(this,Er))==null||n.call(this),W(this,Er,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,xo)!==t&&(W(this,xo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,xo)=="boolean"?_(this,xo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xo=new WeakMap,Er=new WeakMap,Pi=new WeakMap,Ny),Gh=new Ok,_i,Pr,Mi,jy,Ik=(jy=class extends Bo{constructor(){super();ne(this,_i,!0);ne(this,Pr);ne(this,Mi);W(this,Mi,t=>{if(!Io&&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(){_(this,Pr)||this.setEventListener(_(this,Mi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Pr))==null||t.call(this),W(this,Pr,void 0))}setEventListener(t){var n;W(this,Mi,t),(n=_(this,Pr))==null||n.call(this),W(this,Pr,t(this.setOnline.bind(this)))}setOnline(t){_(this,_i)!==t&&(W(this,_i,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,_i)}},_i=new WeakMap,Pr=new WeakMap,Mi=new WeakMap,jy),Mu=new Ik;function Gf(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function Dk(e){return Math.min(1e3*2**e,3e4)}function Lx(e){return(e??"online")==="online"?Mu.isOnline():!0}var $x=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yd(e){return e instanceof $x}function Ux(e){let t=!1,n=0,r=!1,o;const i=Gf(),s=y=>{var x;r||(f(new $x(y)),(x=e.abort)==null||x.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>Gh.isFocused()&&(e.networkMode==="always"||Mu.isOnline())&&e.canRun(),d=()=>Lx(e.networkMode)&&e.canRun(),c=y=>{var x;r||(r=!0,(x=e.onSuccess)==null||x.call(e,y),o==null||o(),i.resolve(y))},f=y=>{var x;r||(r=!0,(x=e.onError)==null||x.call(e,y),o==null||o(),i.reject(y))},g=()=>new Promise(y=>{var x;o=w=>{(r||u())&&y(w)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;o=void 0,r||(y=e.onContinue)==null||y.call(e)}),v=()=>{if(r)return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(c).catch(w=>{var b;if(r)return;const m=e.retry??(Io?0:3),S=e.retryDelay??Dk,C=typeof S=="function"?S(n,w):S,P=m===!0||typeof m=="number"&&nu()?void 0:g()).then(()=>{t?f(w):v()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?v():g().then(v),i)}}function Fk(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var We=Fk(),So,Oy,zx=(Oy=class{constructor(){ne(this,So)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Vf(this.gcTime)&&W(this,So,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Io?1/0:5*60*1e3))}clearGcTimeout(){_(this,So)&&(clearTimeout(_(this,So)),W(this,So,void 0))}},So=new WeakMap,Oy),ki,Ti,Yt,pt,Ra,Co,pn,Gn,Iy,Lk=(Iy=class extends zx{constructor(t){super();ne(this,pn);ne(this,ki);ne(this,Ti);ne(this,Yt);ne(this,pt);ne(this,Ra);ne(this,Co);W(this,Co,!1),W(this,Ra,t.defaultOptions),this.setOptions(t.options),this.observers=[],W(this,Yt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,W(this,ki,$k(this.options)),this.state=t.state??_(this,ki),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,pt))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Ra),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Yt).remove(this)}setData(t,n){const r=Kf(this.state.data,t,this.options);return se(this,pn,Gn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,pn,Gn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,pt))==null?void 0:r.promise;return(o=_(this,pt))==null||o.cancel(t),n?n.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,ki))}isActive(){return this.observers.some(t=>vn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}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||!Dx(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Yt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,pt)&&(_(this,Co)?_(this,pt).cancel({revert:!0}):_(this,pt).cancelRetry()),this.scheduleGc()),_(this,Yt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,pn,Gn).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,pt))return _(this,pt).continueRetry(),_(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,o=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(W(this,Co,!0),r.signal)})},i=()=>{const c=Fx(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return o(f),W(this,Co,!1),this.options.persister?this.options.persister(c,f,this):c(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),W(this,Ti,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&se(this,pn,Gn).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,g,v,y;yd(c)&&c.silent||se(this,pn,Gn).call(this,{type:"error",error:c}),yd(c)||((g=(f=_(this,Yt).config).onError)==null||g.call(f,c,this),(y=(v=_(this,Yt).config).onSettled)==null||y.call(v,this.state.data,c,this)),this.scheduleGc()};return W(this,pt,Ux({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,g,v,y;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(x){a(x);return}(g=(f=_(this,Yt).config).onSuccess)==null||g.call(f,c,this),(y=(v=_(this,Yt).config).onSettled)==null||y.call(v,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{se(this,pn,Gn).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,pn,Gn).call(this,{type:"pause"})},onContinue:()=>{se(this,pn,Gn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),_(this,pt).start()}},ki=new WeakMap,Ti=new WeakMap,Yt=new WeakMap,pt=new WeakMap,Ra=new WeakMap,Co=new WeakMap,pn=new WeakSet,Gn=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,...Bx(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 yd(o)&&o.revert&&_(this,Ti)?{..._(this,Ti),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),We.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Yt).notify({query:this,type:"updated",action:t})})},Iy);function Bx(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $k(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 Nn,Dy,Uk=(Dy=class extends Bo{constructor(t={}){super();ne(this,Nn);this.config=t,W(this,Nn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Vh(o,n);let s=this.get(i);return s||(s=new Lk({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){_(this,Nn).has(t.queryHash)||(_(this,Nn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Nn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Nn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){We.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Nn).get(t)}getAll(){return[..._(this,Nn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Bv(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Bv(t,r)):n}notify(t){We.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){We.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){We.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nn=new WeakMap,Dy),jn,vt,bo,On,yr,Fy,zk=(Fy=class extends zx{constructor(t){super();ne(this,On);ne(this,jn);ne(this,vt);ne(this,bo);this.mutationId=t.mutationId,W(this,vt,t.mutationCache),W(this,jn,[]),this.state=t.state||Vx(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,jn).includes(t)||(_(this,jn).push(t),this.clearGcTimeout(),_(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){W(this,jn,_(this,jn).filter(n=>n!==t)),this.scheduleGc(),_(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,jn).length||(this.state.status==="pending"?this.scheduleGc():_(this,vt).remove(this))}continue(){var t;return((t=_(this,bo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,c,f,g,v,y,x,w,m,S,C,P,b,A;W(this,bo,Ux({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,O)=>{se(this,On,yr).call(this,{type:"failed",failureCount:M,error:O})},onPause:()=>{se(this,On,yr).call(this,{type:"pause"})},onContinue:()=>{se(this,On,yr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,vt).canRun(this)}));const n=this.state.status==="pending",r=!_(this,bo).canStart();try{if(!n){se(this,On,yr).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=_(this,vt).config).onMutate)==null?void 0:i.call(o,t,this));const O=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));O!==this.state.context&&se(this,On,yr).call(this,{type:"pending",context:O,variables:t,isPaused:r})}const M=await _(this,bo).start();return await((u=(l=_(this,vt).config).onSuccess)==null?void 0:u.call(l,M,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,M,t,this.state.context)),await((g=(f=_(this,vt).config).onSettled)==null?void 0:g.call(f,M,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,M,null,t,this.state.context)),se(this,On,yr).call(this,{type:"success",data:M}),M}catch(M){try{throw await((w=(x=_(this,vt).config).onError)==null?void 0:w.call(x,M,t,this.state.context,this)),await((S=(m=this.options).onError)==null?void 0:S.call(m,M,t,this.state.context)),await((P=(C=_(this,vt).config).onSettled)==null?void 0:P.call(C,void 0,M,this.state.variables,this.state.context,this)),await((A=(b=this.options).onSettled)==null?void 0:A.call(b,void 0,M,t,this.state.context)),M}finally{se(this,On,yr).call(this,{type:"error",error:M})}}finally{_(this,vt).runNext(this)}}},jn=new WeakMap,vt=new WeakMap,bo=new WeakMap,On=new WeakSet,yr=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),We.batch(()=>{_(this,jn).forEach(r=>{r.onMutationUpdate(t)}),_(this,vt).notify({mutation:this,type:"updated",action:t})})},Fy);function Vx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Dt,Ea,Ly,Bk=(Ly=class extends Bo{constructor(t={}){super();ne(this,Dt);ne(this,Ea);this.config=t,W(this,Dt,new Map),W(this,Ea,Date.now())}build(t,n,r){const o=new zk({mutationCache:this,mutationId:++Ya(this,Ea)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=vl(t),r=_(this,Dt).get(n)??[];r.push(t),_(this,Dt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=vl(t);if(_(this,Dt).has(n)){const o=(r=_(this,Dt).get(n))==null?void 0:r.filter(i=>i!==t);o&&(o.length===0?_(this,Dt).delete(n):_(this,Dt).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=_(this,Dt).get(vl(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=_(this,Dt).get(vl(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){We.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,Dt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Vv(n,r))}findAll(t={}){return this.getAll().filter(n=>Vv(t,n))}notify(t){We.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return We.batch(()=>Promise.all(t.map(n=>n.continue().catch(Jt))))}},Dt=new WeakMap,Ea=new WeakMap,Ly);function vl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Gv(e){return{onFetch:(t,n)=>{var d,c,f,g,v;const r=t.options,o=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((g=t.state.data)==null?void 0:g.pages)||[],s=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const x=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?y=!0:t.signal.addEventListener("abort",()=>{y=!0}),t.signal)})},w=Fx(t.options,t.fetchOptions),m=async(S,C,P)=>{if(y)return Promise.reject();if(C==null&&S.pages.length)return Promise.resolve(S);const b={queryKey:t.queryKey,pageParam:C,direction:P?"backward":"forward",meta:t.options.meta};x(b);const A=await w(b),{maxPages:M}=t.options,O=P?jk:Nk;return{pages:O(S.pages,A,M),pageParams:O(S.pageParams,C,M)}};if(o&&i.length){const S=o==="backward",C=S?Vk:Wv,P={pages:i,pageParams:s},b=C(r,P);a=await m(P,b,S)}else{const S=e??i.length;do{const C=l===0?s[0]??r.initialPageParam:Wv(r,a);if(l>0&&C==null)break;a=await m(a,C),l++}while(l{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function Wv(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 Vk(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 Ke,_r,Mr,Ai,Ni,kr,ji,Oi,$y,Hk=($y=class{constructor(e={}){ne(this,Ke);ne(this,_r);ne(this,Mr);ne(this,Ai);ne(this,Ni);ne(this,kr);ne(this,ji);ne(this,Oi);W(this,Ke,e.queryCache||new Uk),W(this,_r,e.mutationCache||new Bk),W(this,Mr,e.defaultOptions||{}),W(this,Ai,new Map),W(this,Ni,new Map),W(this,kr,0)}mount(){Ya(this,kr)._++,_(this,kr)===1&&(W(this,ji,Gh.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onFocus())})),W(this,Oi,Mu.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ke).onOnline())})))}unmount(){var e,t;Ya(this,kr)._--,_(this,kr)===0&&((e=_(this,ji))==null||e.call(this),W(this,ji,void 0),(t=_(this,Oi))==null||t.call(this),W(this,Oi,void 0))}isFetching(e){return _(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,_r).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).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=_(this,Ke).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ci(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return _(this,Ke).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=_(this,Ke).get(r.queryHash),i=o==null?void 0:o.state.data,s=Tk(t,i);if(s!==void 0)return _(this,Ke).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return We.batch(()=>_(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,Ke);We.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,Ke),r={type:"active",...e};return We.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=We.batch(()=>_(this,Ke).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e={},t={}){return We.batch(()=>{if(_(this,Ke).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=We.batch(()=>_(this,Ke).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,Ke).build(this,t);return n.isStaleByTime(Ci(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=Gv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=Gv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mu.isOnline()?_(this,_r).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ke)}getMutationCache(){return _(this,_r)}getDefaultOptions(){return _(this,Mr)}setDefaultOptions(e){W(this,Mr,e)}setQueryDefaults(e,t){_(this,Ai).set(Do(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Ai).values()];let n={};return t.forEach(r=>{va(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){_(this,Ni).set(Do(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Ni).values()];let n={};return t.forEach(r=>{va(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Mr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Vh(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===Kh&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Mr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ke).clear(),_(this,_r).clear()}},Ke=new WeakMap,_r=new WeakMap,Mr=new WeakMap,Ai=new WeakMap,Ni=new WeakMap,kr=new WeakMap,ji=new WeakMap,Oi=new WeakMap,$y),Rt,xe,Pa,yt,Ro,Ii,Tr,In,_a,Di,Fi,Eo,Po,Ar,Li,_e,Is,Wf,qf,Qf,Yf,Xf,Jf,Zf,Hx,Uy,Wh=(Uy=class extends Bo{constructor(t,n){super();ne(this,_e);ne(this,Rt);ne(this,xe);ne(this,Pa);ne(this,yt);ne(this,Ro);ne(this,Ii);ne(this,Tr);ne(this,In);ne(this,_a);ne(this,Di);ne(this,Fi);ne(this,Eo);ne(this,Po);ne(this,Ar);ne(this,Li,new Set);this.options=n,W(this,Rt,t),W(this,In,null),W(this,Tr,Gf()),this.options.experimental_prefetchInRender||_(this,Tr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,xe).addObserver(this),qv(_(this,xe),this.options)?se(this,_e,Is).call(this):this.updateResult(),se(this,_e,Yf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ep(_(this,xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ep(_(this,xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,_e,Xf).call(this),se(this,_e,Jf).call(this),_(this,xe).removeObserver(this)}setOptions(t,n){const r=this.options,o=_(this,xe);if(this.options=_(this,Rt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vn(this.options.enabled,_(this,xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,_e,Zf).call(this),_(this,xe).setOptions(this.options),r._defaulted&&!_u(this.options,r)&&_(this,Rt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,xe),observer:this});const i=this.hasListeners();i&&Qv(_(this,xe),o,this.options,r)&&se(this,_e,Is).call(this),this.updateResult(n),i&&(_(this,xe)!==o||vn(this.options.enabled,_(this,xe))!==vn(r.enabled,_(this,xe))||Ci(this.options.staleTime,_(this,xe))!==Ci(r.staleTime,_(this,xe)))&&se(this,_e,Wf).call(this);const s=se(this,_e,qf).call(this);i&&(_(this,xe)!==o||vn(this.options.enabled,_(this,xe))!==vn(r.enabled,_(this,xe))||s!==_(this,Ar))&&se(this,_e,Qf).call(this,s)}getOptimisticResult(t){const n=_(this,Rt).getQueryCache().build(_(this,Rt),t),r=this.createResult(n,t);return Gk(this,r)&&(W(this,yt,r),W(this,Ii,this.options),W(this,Ro,_(this,xe).state)),r}getCurrentResult(){return _(this,yt)}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){_(this,Li).add(t)}getCurrentQuery(){return _(this,xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Rt).defaultQueryOptions(t),r=_(this,Rt).getQueryCache().build(_(this,Rt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,_e,Is).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,yt)))}createResult(t,n){var M;const r=_(this,xe),o=this.options,i=_(this,yt),s=_(this,Ro),a=_(this,Ii),u=t!==r?t.state:_(this,Pa),{state:d}=t;let c={...d},f=!1,g;if(n._optimisticResults){const O=this.hasListeners(),R=!O&&qv(t,n),N=O&&Qv(t,r,n,o);(R||N)&&(c={...c,...Bx(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:x}=c;if(n.select&&c.data!==void 0)if(i&&c.data===(s==null?void 0:s.data)&&n.select===_(this,_a))g=_(this,Di);else try{W(this,_a,n.select),g=n.select(c.data),g=Kf(i==null?void 0:i.data,g,n),W(this,Di,g),W(this,In,null)}catch(O){W(this,In,O)}else g=c.data;if(n.placeholderData!==void 0&&g===void 0&&x==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData((M=_(this,Fi))==null?void 0:M.state.data,_(this,Fi)):n.placeholderData,n.select&&O!==void 0)try{O=n.select(O),W(this,In,null)}catch(R){W(this,In,R)}O!==void 0&&(x="success",g=Kf(i==null?void 0:i.data,O,n),f=!0)}_(this,In)&&(v=_(this,In),g=_(this,Di),y=Date.now(),x="error");const w=c.fetchStatus==="fetching",m=x==="pending",S=x==="error",C=m&&w,P=g!==void 0,A={status:x,fetchStatus:c.fetchStatus,isPending:m,isSuccess:x==="success",isError:S,isInitialLoading:C,isLoading:C,data:g,dataUpdatedAt:c.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:S&&!P,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&P,isStale:qh(t,n),refetch:this.refetch,promise:_(this,Tr)};if(this.options.experimental_prefetchInRender){const O=I=>{A.status==="error"?I.reject(A.error):A.data!==void 0&&I.resolve(A.data)},R=()=>{const I=W(this,Tr,A.promise=Gf());O(I)},N=_(this,Tr);switch(N.status){case"pending":t.queryHash===r.queryHash&&O(N);break;case"fulfilled":(A.status==="error"||A.data!==N.value)&&R();break;case"rejected":(A.status!=="error"||A.error!==N.reason)&&R();break}}return A}updateResult(t){const n=_(this,yt),r=this.createResult(_(this,xe),this.options);if(W(this,Ro,_(this,xe).state),W(this,Ii,this.options),_(this,Ro).data!==void 0&&W(this,Fi,_(this,xe)),_u(r,n))return;W(this,yt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!_(this,Li).size)return!0;const l=new Set(a??_(this,Li));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,yt)).some(u=>{const d=u;return _(this,yt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),se(this,_e,Hx).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,_e,Yf).call(this)}},Rt=new WeakMap,xe=new WeakMap,Pa=new WeakMap,yt=new WeakMap,Ro=new WeakMap,Ii=new WeakMap,Tr=new WeakMap,In=new WeakMap,_a=new WeakMap,Di=new WeakMap,Fi=new WeakMap,Eo=new WeakMap,Po=new WeakMap,Ar=new WeakMap,Li=new WeakMap,_e=new WeakSet,Is=function(t){se(this,_e,Zf).call(this);let n=_(this,xe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Jt)),n},Wf=function(){se(this,_e,Xf).call(this);const t=Ci(this.options.staleTime,_(this,xe));if(Io||_(this,yt).isStale||!Vf(t))return;const r=Dx(_(this,yt).dataUpdatedAt,t)+1;W(this,Eo,setTimeout(()=>{_(this,yt).isStale||this.updateResult()},r))},qf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,xe)):this.options.refetchInterval)??!1},Qf=function(t){se(this,_e,Jf).call(this),W(this,Ar,t),!(Io||vn(this.options.enabled,_(this,xe))===!1||!Vf(_(this,Ar))||_(this,Ar)===0)&&W(this,Po,setInterval(()=>{(this.options.refetchIntervalInBackground||Gh.isFocused())&&se(this,_e,Is).call(this)},_(this,Ar)))},Yf=function(){se(this,_e,Wf).call(this),se(this,_e,Qf).call(this,se(this,_e,qf).call(this))},Xf=function(){_(this,Eo)&&(clearTimeout(_(this,Eo)),W(this,Eo,void 0))},Jf=function(){_(this,Po)&&(clearInterval(_(this,Po)),W(this,Po,void 0))},Zf=function(){const t=_(this,Rt).getQueryCache().build(_(this,Rt),this.options);if(t===_(this,xe))return;const n=_(this,xe);W(this,xe,t),W(this,Pa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Hx=function(t){We.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,yt))}),_(this,Rt).getQueryCache().notify({query:_(this,xe),type:"observerResultsUpdated"})})},Uy);function Kk(e,t){return vn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qv(e,t){return Kk(e,t)||e.state.data!==void 0&&ep(e,t,t.refetchOnMount)}function ep(e,t,n){if(vn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&qh(e,t)}return!1}function Qv(e,t,n,r){return(e!==t||vn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&qh(e,n)}function qh(e,t){return vn(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function Gk(e,t){return!_u(e.getCurrentResult(),t)}function Yv(e,t){return e.filter(n=>!t.includes(n))}function Wk(e,t,n){const r=e.slice(0);return r[t]=n,r}var $i,Xt,Ui,zi,Ft,Nr,Ma,ka,jt,tp,np,rp,op,zy,qk=(zy=class extends Bo{constructor(t,n,r){super();ne(this,jt);ne(this,$i);ne(this,Xt);ne(this,Ui);ne(this,zi);ne(this,Ft);ne(this,Nr);ne(this,Ma);ne(this,ka);W(this,$i,t),W(this,zi,r),W(this,Ui,[]),W(this,Ft,[]),W(this,Xt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&_(this,Ft).forEach(t=>{t.subscribe(n=>{se(this,jt,rp).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,_(this,Ft).forEach(t=>{t.destroy()})}setQueries(t,n,r){W(this,Ui,t),W(this,zi,n),We.batch(()=>{const o=_(this,Ft),i=se(this,jt,np).call(this,_(this,Ui));i.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions,r));const s=i.map(u=>u.observer),a=s.map(u=>u.getCurrentResult()),l=s.some((u,d)=>u!==o[d]);o.length===s.length&&!l||(W(this,Ft,s),W(this,Xt,a),this.hasListeners()&&(Yv(o,s).forEach(u=>{u.destroy()}),Yv(s,o).forEach(u=>{u.subscribe(d=>{se(this,jt,rp).call(this,u,d)})}),se(this,jt,op).call(this)))})}getCurrentResult(){return _(this,Xt)}getQueries(){return _(this,Ft).map(t=>t.getCurrentQuery())}getObservers(){return _(this,Ft)}getOptimisticResult(t,n){const r=se(this,jt,np).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>se(this,jt,tp).call(this,i??o,n),()=>r.map((i,s)=>{const a=o[s];return i.defaultedQueryOptions.notifyOnChangeProps?a:i.observer.trackResult(a,l=>{r.forEach(u=>{u.observer.trackProp(l)})})})]}},$i=new WeakMap,Xt=new WeakMap,Ui=new WeakMap,zi=new WeakMap,Ft=new WeakMap,Nr=new WeakMap,Ma=new WeakMap,ka=new WeakMap,jt=new WeakSet,tp=function(t,n){return n?((!_(this,Nr)||_(this,Xt)!==_(this,ka)||n!==_(this,Ma))&&(W(this,Ma,n),W(this,ka,_(this,Xt)),W(this,Nr,Hh(_(this,Nr),n(t)))),_(this,Nr)):t},np=function(t){const n=new Map(_(this,Ft).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=_(this,$i).defaultQueryOptions(o),s=n.get(i.queryHash);if(s)r.push({defaultedQueryOptions:i,observer:s});else{const a=_(this,Ft).find(l=>l.options.queryHash===i.queryHash);r.push({defaultedQueryOptions:i,observer:a??new Wh(_(this,$i),i)})}}),r.sort((o,i)=>t.findIndex(s=>s.queryHash===o.defaultedQueryOptions.queryHash)-t.findIndex(s=>s.queryHash===i.defaultedQueryOptions.queryHash))},rp=function(t,n){const r=_(this,Ft).indexOf(t);r!==-1&&(W(this,Xt,Wk(_(this,Xt),r,n)),se(this,jt,op).call(this))},op=function(){var t;if(this.hasListeners()){const n=_(this,Nr),r=se(this,jt,tp).call(this,_(this,Xt),(t=_(this,zi))==null?void 0:t.combine);n!==r&&We.batch(()=>{this.listeners.forEach(o=>{o(_(this,Xt))})})}},zy),jr,Or,Et,Yn,rr,Vl,ip,By,Qk=(By=class extends Bo{constructor(n,r){super();ne(this,rr);ne(this,jr);ne(this,Or);ne(this,Et);ne(this,Yn);W(this,jr,n),this.setOptions(r),this.bindMethods(),se(this,rr,Vl).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=_(this,jr).defaultMutationOptions(n),_u(this.options,r)||_(this,jr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Et),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Do(r.mutationKey)!==Do(this.options.mutationKey)?this.reset():((o=_(this,Et))==null?void 0:o.state.status)==="pending"&&_(this,Et).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Et))==null||n.removeObserver(this)}onMutationUpdate(n){se(this,rr,Vl).call(this),se(this,rr,ip).call(this,n)}getCurrentResult(){return _(this,Or)}reset(){var n;(n=_(this,Et))==null||n.removeObserver(this),W(this,Et,void 0),se(this,rr,Vl).call(this),se(this,rr,ip).call(this)}mutate(n,r){var o;return W(this,Yn,r),(o=_(this,Et))==null||o.removeObserver(this),W(this,Et,_(this,jr).getMutationCache().build(_(this,jr),this.options)),_(this,Et).addObserver(this),_(this,Et).execute(n)}},jr=new WeakMap,Or=new WeakMap,Et=new WeakMap,Yn=new WeakMap,rr=new WeakSet,Vl=function(){var r;const n=((r=_(this,Et))==null?void 0:r.state)??Vx();W(this,Or,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},ip=function(n){We.batch(()=>{var r,o,i,s,a,l,u,d;if(_(this,Yn)&&this.hasListeners()){const c=_(this,Or).variables,f=_(this,Or).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,Yn)).onSuccess)==null||o.call(r,n.data,c,f),(s=(i=_(this,Yn)).onSettled)==null||s.call(i,n.data,null,c,f)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,Yn)).onError)==null||l.call(a,n.error,c,f),(d=(u=_(this,Yn)).onSettled)==null||d.call(u,void 0,n.error,c,f))}this.listeners.forEach(c=>{c(_(this,Or))})})},By),Kx=p.createContext(void 0),uc=e=>{const t=p.useContext(Kx);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Yk=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(Kx.Provider,{value:e,children:t})),Gx=p.createContext(!1),Wx=()=>p.useContext(Gx);Gx.Provider;function Xk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jk=p.createContext(Xk()),qx=()=>p.useContext(Jk);function Qx(e,t){return typeof e=="function"?e(...t):!!e}function Yx(){}var Xx=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Jx=e=>{p.useEffect(()=>{e.clearReset()},[e])},Zx=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Qx(n,[e.error,r]),e1=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},t1=(e,t)=>e.isLoading&&e.isFetching&&!t,sp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ku=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Xv({queries:e,...t},n){const r=uc(),o=Wx(),i=qx(),s=p.useMemo(()=>e.map(v=>{const y=r.defaultQueryOptions(v);return y._optimisticResults=o?"isRestoring":"optimistic",y}),[e,r,o]);s.forEach(v=>{e1(v),Xx(v,i)}),Jx(i);const[a]=p.useState(()=>new qk(r,s,t)),[l,u,d]=a.getOptimisticResult(s,t.combine);p.useSyncExternalStore(p.useCallback(v=>o?()=>{}:a.subscribe(We.batchCalls(v)),[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const f=l.some((v,y)=>sp(s[y],v))?l.flatMap((v,y)=>{const x=s[y];if(x){const w=new Wh(r,x);if(sp(x,v))return ku(x,w,i);t1(v,o)&&ku(x,w,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const g=l.find((v,y)=>{const x=s[y];return x&&Zx({result:v,errorResetBoundary:i,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash)})});if(g!=null&&g.error)throw g.error;return u(d())}function Zk(e,t,n){var d,c,f,g,v;const r=uc(),o=Wx(),i=qx(),s=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,s),s._optimisticResults=o?"isRestoring":"optimistic",e1(s),Xx(s,i),Jx(i);const a=!r.getQueryCache().get(s.queryHash),[l]=p.useState(()=>new t(r,s)),u=l.getOptimisticResult(s);if(p.useSyncExternalStore(p.useCallback(y=>{const x=o?()=>{}:l.subscribe(We.batchCalls(y));return l.updateResult(),x},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),p.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),sp(s,u))throw ku(s,l,i);if(Zx({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw u.error;if((g=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||g.call(f,s,u),s.experimental_prefetchInRender&&!Io&&t1(u,o)){const y=a?ku(s,l,i):(v=r.getQueryCache().get(s.queryHash))==null?void 0:v.promise;y==null||y.catch(Yx).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function Qr(e,t){return Zk(e,Wh)}function Qs(e,t){const n=uc(),[r]=p.useState(()=>new Qk(n,e));p.useEffect(()=>{r.setOptions(e)},[r,e]);const o=p.useSyncExternalStore(p.useCallback(s=>r.subscribe(We.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=p.useCallback((s,a)=>{r.mutate(s,a).catch(Yx)},[r]);if(o.error&&Qx(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const Tu="aidbox-forms",n1=["openid fhirUser","profile","online_access","launch/patient","launch/questionnaire","launch/questionnaireresponse","user/Questionnaire.crus","patient/Patient.r","patient/QuestionnaireResponse.crus"],Zn=Pu.client("https://form-builder.aidbox.app"),r1=p.createContext(null),eT=e=>Pu.oauth2.authorize({clientId:Tu,redirectUri:window.location.pathname,...e}),Vo=()=>{const e=p.useContext(r1);if(!e)throw new Error("No client found in the context");return e},tT=({children:e})=>{const[t]=ac(),{data:n}=Qr({queryKey:["client"],queryFn:()=>t.has("error")||t.has("error_description")?Pu.oauth2.ready({clientId:Tu,redirectUri:window.location.pathname}).catch(r=>{throw sessionStorage.clear(),r}):Pu.oauth2.init({clientId:Tu,scope:n1.join(" "),redirectUri:window.location.pathname}),retry:!1});return h.jsx(r1.Provider,{value:n,children:e})},Jv=async(e,t)=>{var o;const{fhirContext:n}=(o=e==null?void 0:e.state)==null?void 0:o.tokenResponse,[r]=n==null?void 0:n.filter(({reference:i})=>{if(i.startsWith(`${t}/`))return i.split("/")[1]});if(r)return(t==="Questionnaire"?Zn:e).request(`${t}/${r}`);throw new Error(`No ${t} in the launch context`)},nT=async e=>{const[t,n,r,o,i]=await Promise.allSettled([e.patient.read(),e.encounter.read(),e.user.read(),Jv(e,"Questionnaire"),Jv(e,"QuestionnaireResponse")]);return{patient:t.status==="fulfilled"?t.value:null,encounter:n.status==="fulfilled"?n.value:null,user:r.status==="fulfilled"?r.value:null,questionnaire:o.status==="fulfilled"?o.value:null,questionnaireResponse:i.status==="fulfilled"?i.value:null}},o1=p.createContext(null),Ho=()=>{const e=p.useContext(o1);if(!e)throw new Error("No launch context found in the context");return e},rT=({children:e})=>{const t=Vo(),{data:n}=Qr({queryKey:["launch-context"],queryFn:()=>nT(t)});return h.jsx(o1.Provider,{value:n,children:e})};function i1(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;t{const t=aT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(Qh);return a[0]===""&&a.length!==1&&a.shift(),s1(a,t)||sT(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},s1=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?s1(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Qh);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},Zv=/^\[(.+)\]$/,sT=e=>{if(Zv.test(e)){const t=Zv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},aT=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return uT(Object.entries(e.classGroups),n).forEach(([i,s])=>{ap(s,r,i,t)}),r},ap=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:ey(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(lT(o)){ap(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{ap(s,ey(t,i),n,r)})})},ey=(e,t)=>{let n=e;return t.split(Qh).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},lT=e=>e.isThemeGetter,uT=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,cT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},a1="!",dT=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,d=0,c;for(let x=0;xd?c-d:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:v,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},fT=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},pT=e=>({cache:cT(e.cacheSize),parseClassName:dT(e),...iT(e)}),hT=/\s+/,gT=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(hT);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:g}=n(u);let v=!!g,y=r(v?f.substring(0,g):f);if(!y){if(!v){a=u+(a.length>0?" "+a:a);continue}if(y=r(f),!y){a=u+(a.length>0?" "+a:a);continue}v=!1}const x=fT(d).join(":"),w=c?x+a1:x,m=w+y;if(i.includes(m))continue;i.push(m);const S=o(y,v);for(let C=0;C0?" "+a:a)}return a};function mT(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rc(d),e());return n=pT(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=gT(l,n);return o(l,d),d}return function(){return i(mT.apply(null,arguments))}}const je=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},u1=/^\[(?:([a-z-]+):)?(.+)\]$/i,yT=/^\d+\/\d+$/,wT=new Set(["px","full","screen"]),xT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ST=/\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$/,CT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,RT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kn=e=>bi(e)||wT.has(e)||yT.test(e),hr=e=>is(e,"length",NT),bi=e=>!!e&&!Number.isNaN(Number(e)),wd=e=>is(e,"number",bi),Ps=e=>!!e&&Number.isInteger(Number(e)),ET=e=>e.endsWith("%")&&bi(e.slice(0,-1)),de=e=>u1.test(e),gr=e=>xT.test(e),PT=new Set(["length","size","percentage"]),_T=e=>is(e,PT,c1),MT=e=>is(e,"position",c1),kT=new Set(["image","url"]),TT=e=>is(e,kT,OT),AT=e=>is(e,"",jT),_s=()=>!0,is=(e,t,n)=>{const r=u1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},NT=e=>ST.test(e)&&!CT.test(e),c1=()=>!1,jT=e=>bT.test(e),OT=e=>RT.test(e),IT=()=>{const e=je("colors"),t=je("spacing"),n=je("blur"),r=je("brightness"),o=je("borderColor"),i=je("borderRadius"),s=je("borderSpacing"),a=je("borderWidth"),l=je("contrast"),u=je("grayscale"),d=je("hueRotate"),c=je("invert"),f=je("gap"),g=je("gradientColorStops"),v=je("gradientColorStopPositions"),y=je("inset"),x=je("margin"),w=je("opacity"),m=je("padding"),S=je("saturate"),C=je("scale"),P=je("sepia"),b=je("skew"),A=je("space"),M=je("translate"),O=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",de,t],I=()=>[de,t],$=()=>["",Kn,hr],E=()=>["auto",bi,de],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],D=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],j=()=>["","0",de],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[bi,de];return{cacheSize:500,separator:":",theme:{colors:[_s],spacing:[Kn,hr],blur:["none","",gr,de],brightness:Q(),borderColor:[e],borderRadius:["none","","full",gr,de],borderSpacing:I(),borderWidth:$(),contrast:Q(),grayscale:j(),hueRotate:Q(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[ET,hr],inset:N(),margin:N(),opacity:Q(),padding:I(),saturate:Q(),scale:Q(),sepia:j(),skew:Q(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[gr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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:[...k(),de]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ps,de]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",Ps,de]}],"grid-cols":[{"grid-cols":[_s]}],"col-start-end":[{col:["auto",{span:["full",Ps,de]},de]}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":[_s]}],"row-start-end":[{row:["auto",{span:[Ps,de]},de]}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[gr]},gr]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",gr,hr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wd]}],"font-family":[{font:[_s]}],"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",de]}],"line-clamp":[{"line-clamp":["none",bi,wd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kn,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kn,hr]}],"underline-offset":[{"underline-offset":["auto",Kn,de]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],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",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),MT]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",_T]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},TT]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...D(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:D()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...D()]}],"outline-offset":[{"outline-offset":[Kn,de]}],"outline-w":[{outline:[Kn,hr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:$()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Kn,hr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",gr,AT]}],"shadow-color":[{shadow:[_s]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",gr,de]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[S]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",de]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Ps,de]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],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",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kn,hr,wd]}],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-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"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"]}}},DT=vT(IT);function q(...e){return DT(oT(e))}function ss(e){var t,n;if(e!=null&&e[0].text)return`${e==null?void 0:e[0].text}`;{const r=((t=e==null?void 0:e[0].prefix)==null?void 0:t[0])??"",o=((n=e==null?void 0:e[0].given)==null?void 0:n[0])??"",i=(e==null?void 0:e[0].family)??"";return`${r} ${o} ${i}`.replace(/\s+/g," ").trim()}}const FT=e=>{var s;const t=((s=e[0].line)==null?void 0:s[0])??"",n=e[0].city??"",r=e[0].state??"",o=e[0].postalCode??"",i=e[0].country??"";return`${t}, ${n}, ${r} ${o}, ${i}`};function LT(e){return e.charAt(0).toUpperCase()+e.slice(1)}function $T(e){const[t,n]=ss(e).split(" ");return n?`${t.charAt(0)}${n.charAt(0)}`.toUpperCase():t.substring(0,2).toUpperCase()}function UT(e,t){e=Math.max(1,Math.min(e,t));const i=e>1,s=e1||l1&&a--,l1,c=l2,g=lvv>e),showLastEllipsis:g,showLastPageButton:c,nextButtonEnabled:s}}async function zT({questionnaire:e,subject:t,encounter:n,author:r}){const{parameter:[{resource:o}]}=await Zn.request({url:"Questionnaire/$populate",method:"POST",headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({resourceType:"Parameters",parameter:[{name:"questionnaire",resource:e},{name:"subject",resource:t},{name:"context",part:[...n?[{name:"name",valueString:"encounter"},{name:"content",resource:n}]:[],...r?[{name:"name",valueString:"author"},{name:"content",resource:r}]:[]]}]})});return o}function d1(e,t,n){let r="QuestionnaireResponse",o="POST";return n.id&&(r+=`/${n.id}`,o="PUT"),e.request({url:r,method:o,headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({...n,questionnaire:t.url?t.url:`Questionnaire/${t.id}`,meta:{...n.meta,source:"https://aidbox.github.io/examples/aidbox-forms-smart-launch"}})})}function f1(e,t){console.log({client:e});let n="Questionnaire",r="POST";return t.id&&(n+=`/${t.id}`,r="PUT"),e.request({url:n,method:r,headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify(t)})}function BT(e,t){return e.request({url:`Questionnaire/${t.id}`,method:"DELETE"})}async function VT({client:e,questionnaire:t,subject:n,encounter:r,author:o}){const i=await zT({questionnaire:t,subject:n,encounter:r,author:o});return d1(e,t,i)}function ty({launchUrl:e,launchType:t,fhirVersion:n}){const r=["provider-ehr","patient-portal","provider-standalone","patient-standalone","backend-service"],o=new URL(e);o.search="",o.hash="";const i=new URLSearchParams;return i.set("fhir_version",n||"r4"),i.set("launch_url",o.toString()),i.set("launch",btoa(JSON.stringify([r.indexOf(t)]))),`https://launch.smarthealthit.org/?${i.toString()}`}function xd(e){var n,r;const t=e.resourceType==="Bundle"?(r=(n=e.entry)==null?void 0:n[0])==null?void 0:r.resource:e;if(!t)throw new Error("Resource not found");return t}async function p1(e,t){const n=t.startsWith("http")?`Questionnaire?url=${t.replace(/\|.*$/,"")}`:`Questionnaire/${t.replace(/^Questionnaire\//,"")}`;return Promise.any([Zn.request(n).then(r=>[Zn,xd(r)]),e.request(n).then(r=>[e,xd(r)]),Zn.request(t).then(r=>[Zn,xd(r)])])}async function Yh(e,t){return p1(e,t).then(([,n])=>n)}function HT(){const{user:e}=Ho();return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsxs("h1",{className:"mb-4 text-2xl font-bold",children:["Welcome, ",ss(e.name)]}),h.jsx("p",{className:"text-muted-foreground",children:e.resourceType==="Patient"?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{children:"This is a demo patient portal dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),h.jsx("p",{children:"In a fully functional version, you could:"}),h.jsxs("ul",{className:"list-disc ml-6",children:[h.jsx("li",{children:"View and manage your upcoming appointments."}),h.jsx("li",{children:"Access your medical records, including lab results, diagnoses, and treatment history."}),h.jsx("li",{children:"Communicate securely with your healthcare providers."}),h.jsx("li",{children:"Maintain and update your personal health information."}),h.jsx("li",{children:"Explore educational resources related to your health conditions and treatments."})]}),h.jsx("p",{children:"For now, you can explore and submit/amend your responses."})]}):h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{children:"This is a demo practitioner EHR dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),h.jsx("p",{children:"In a fully functional version, you could:"}),h.jsxs("ul",{className:"list-disc ml-6",children:[h.jsx("li",{children:"Access and manage patient records."}),h.jsx("li",{children:"Schedule and manage patient appointments."}),h.jsx("li",{children:"Review lab results and other diagnostic information."}),h.jsx("li",{children:"Prescribe medications and generate referrals."}),h.jsx("li",{children:"Communicate with patients and other healthcare professionals."}),h.jsx("li",{children:"Generate reports and analyze data."})]}),h.jsx("p",{children:"For now, you can create and manage questionnaires, and review patient responses."})]})})]})}function KT(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cc(...e){return t=>e.forEach(n=>KT(n,t))}function qe(...e){return p.useCallback(cc(...e),e)}var un=p.forwardRef((e,t)=>{const{children:n,...r}=e,o=p.Children.toArray(n),i=o.find(GT);if(i){const s=i.props.children,a=o.map(l=>l===i?p.Children.count(s)>1?p.Children.only(null):p.isValidElement(s)?s.props.children:null:l);return h.jsx(lp,{...r,ref:t,children:p.isValidElement(s)?p.cloneElement(s,void 0,a):null})}return h.jsx(lp,{...r,ref:t,children:n})});un.displayName="Slot";var lp=p.forwardRef((e,t)=>{const{children:n,...r}=e;if(p.isValidElement(n)){const o=qT(n);return p.cloneElement(n,{...WT(r,n.props),ref:t?cc(t,o):o})}return p.Children.count(n)>1?p.Children.only(null):null});lp.displayName="SlotClone";var h1=({children:e})=>h.jsx(h.Fragment,{children:e});function GT(e){return p.isValidElement(e)&&e.type===h1}function WT(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function qT(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 g1(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,ry=QT,Da=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ry(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const f=ny(d)||ny(c);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...g}=d;return Object.entries(g).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,c,f]:u},[]);return ry(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const YT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),m1=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var XT={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.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const JT=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>p.createElement("svg",{ref:l,...XT,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m1("lucide",o),...a},[...s.map(([u,d])=>p.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Be=(e,t)=>{const n=p.forwardRef(({className:r,...o},i)=>p.createElement(JT,{ref:i,iconNode:t,className:m1(`lucide-${YT(e)}`,r),...o}));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ZT=Be("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const v1=Be("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const e2=Be("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t2=Be("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xh=Be("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jh=Be("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"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const n2=Be("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r2=Be("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const o2=Be("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i2=Be("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s2=Be("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a2=Be("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l2=Be("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u2=Be("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const c2=Be("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d2=Be("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const f2=Be("SquareMenu",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y1=Be("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const p2=Be("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h2=Be("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const g2=Be("UserPen",[["path",{d:"M11.5 15H7a4 4 0 0 0-4 4v2",key:"15lzij"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m2=Be("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const v2=Be("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Sd=768;function y2(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Sd-1}px)`),r=()=>{t(window.innerWidthn.removeEventListener("change",r)},[]),!!e}const w1=Da("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Mt=p.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?un:"button";return h.jsx(s,{className:q(w1({variant:t,size:n,className:e})),ref:i,...o})});Mt.displayName="Button";const Zh=p.forwardRef(({className:e,type:t,...n},r)=>h.jsx("input",{type:t,className:q("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Zh.displayName="Input";var w2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],he=w2.reduce((e,t)=>{const n=p.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?un:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function eg(e,t){e&&ns.flushSync(()=>e.dispatchEvent(t))}var x2="Separator",oy="horizontal",S2=["horizontal","vertical"],x1=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=oy,...o}=e,i=C2(r)?r:oy,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return h.jsx(he.div,{"data-orientation":i,...a,...o,ref:t})});x1.displayName=x2;function C2(e){return S2.includes(e)}var S1=x1;const C1=p.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>h.jsx(S1,{ref:o,decorative:n,orientation:t,className:q("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));C1.displayName=S1.displayName;function re(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 b2(e,t){const n=p.createContext(t),r=i=>{const{children:s,...a}=i,l=p.useMemo(()=>a,Object.values(a));return h.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=p.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function so(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];const u=c=>{var w;const{scope:f,children:g,...v}=c,y=((w=f==null?void 0:f[e])==null?void 0:w[l])||a,x=p.useMemo(()=>v,Object.values(v));return h.jsx(y.Provider,{value:x,children:g})};u.displayName=i+"Provider";function d(c,f){var y;const g=((y=f==null?void 0:f[e])==null?void 0:y[l])||a,v=p.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,R2(o,...t)]}function R2(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Cn=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},E2=t0.useId||(()=>{}),P2=0;function nr(e){const[t,n]=p.useState(E2());return Cn(()=>{e||n(r=>r??String(P2++))},[e]),e||(t?`radix-${t}`:"")}function mt(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ko({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_2({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=mt(n),l=p.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[i,e,o,a]);return[s,l]}function _2({defaultProp:e,onChange:t}){const n=p.useState(e),[r]=n,o=p.useRef(r),i=mt(t);return p.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function M2(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e);p.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 k2="DismissableLayer",up="dismissableLayer.update",T2="dismissableLayer.pointerDownOutside",A2="dismissableLayer.focusOutside",iy,b1=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fa=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=p.useContext(b1),[d,c]=p.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=p.useState({}),v=qe(t,A=>c(A)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(x),m=d?y.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=m>=w,P=j2(A=>{const M=A.target,O=[...u.branches].some(R=>R.contains(M));!C||O||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),b=O2(A=>{const M=A.target;[...u.branches].some(R=>R.contains(M))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return M2(A=>{m===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),p.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(iy=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),sy(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=iy)}},[d,f,n,u]),p.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),sy())},[d,u]),p.useEffect(()=>{const A=()=>g({});return document.addEventListener(up,A),()=>document.removeEventListener(up,A)},[]),h.jsx(he.div,{...l,ref:v,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,b.onFocusCapture),onBlurCapture:re(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,P.onPointerDownCapture)})});Fa.displayName=k2;var N2="DismissableLayerBranch",R1=p.forwardRef((e,t)=>{const n=p.useContext(b1),r=p.useRef(null),o=qe(t,r);return p.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),h.jsx(he.div,{...e,ref:o})});R1.displayName=N2;function j2(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){E1(T2,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function O2(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=p.useRef(!1);return p.useEffect(()=>{const o=i=>{i.target&&!r.current&&E1(A2,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function sy(){const e=new CustomEvent(up);document.dispatchEvent(e)}function E1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?eg(o,i):o.dispatchEvent(i)}var I2=Fa,D2=R1,Cd="focusScope.autoFocusOnMount",bd="focusScope.autoFocusOnUnmount",ay={bubbles:!1,cancelable:!0},F2="FocusScope",tg=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=p.useState(null),u=mt(o),d=mt(i),c=p.useRef(null),f=qe(t,y=>l(y)),g=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let y=function(S){if(g.paused||!a)return;const C=S.target;a.contains(C)?c.current=C:wr(c.current,{select:!0})},x=function(S){if(g.paused||!a)return;const C=S.relatedTarget;C!==null&&(a.contains(C)||wr(c.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const P of S)P.removedNodes.length>0&&wr(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const m=new MutationObserver(w);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),m.disconnect()}}},[r,a,g.paused]),p.useEffect(()=>{if(a){uy.add(g);const y=document.activeElement;if(!a.contains(y)){const w=new CustomEvent(Cd,ay);a.addEventListener(Cd,u),a.dispatchEvent(w),w.defaultPrevented||(L2(V2(P1(a)),{select:!0}),document.activeElement===y&&wr(a))}return()=>{a.removeEventListener(Cd,u),setTimeout(()=>{const w=new CustomEvent(bd,ay);a.addEventListener(bd,d),a.dispatchEvent(w),w.defaultPrevented||wr(y??document.body,{select:!0}),a.removeEventListener(bd,d),uy.remove(g)},0)}}},[a,u,d,g]);const v=p.useCallback(y=>{if(!n&&!r||g.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(x&&w){const m=y.currentTarget,[S,C]=$2(m);S&&C?!y.shiftKey&&w===C?(y.preventDefault(),n&&wr(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&wr(C,{select:!0})):w===m&&y.preventDefault()}},[n,r,g.paused]);return h.jsx(he.div,{tabIndex:-1,...s,ref:f,onKeyDown:v})});tg.displayName=F2;function L2(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wr(r,{select:t}),document.activeElement!==n)return}function $2(e){const t=P1(e),n=ly(t,e),r=ly(t.reverse(),e);return[n,r]}function P1(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 ly(e,t){for(const n of e)if(!U2(n,{upTo:t}))return n}function U2(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 z2(e){return e instanceof HTMLInputElement&&"select"in e}function wr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&z2(e)&&t&&e.select()}}var uy=B2();function B2(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cy(e,t),e.unshift(t)},remove(t){var n;e=cy(e,t),(n=e[0])==null||n.resume()}}}function cy(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function V2(e){return e.filter(t=>t.tagName!=="A")}var H2="Portal",La=p.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=p.useState(!1);Cn(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?ox.createPortal(h.jsx(he.div,{...r,ref:t}),s):null});La.displayName=H2;function K2(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Qt=e=>{const{present:t,children:n}=e,r=G2(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),i=qe(r.ref,W2(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:i}):null};Qt.displayName="Presence";function G2(e){const[t,n]=p.useState(),r=p.useRef({}),o=p.useRef(e),i=p.useRef("none"),s=e?"mounted":"unmounted",[a,l]=K2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const u=yl(r.current);i.current=a==="mounted"?u:"none"},[a]),Cn(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,g=yl(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Cn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=g=>{const y=yl(r.current).includes(g.animationName);if(g.target===t&&y&&(l("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},f=g=>{g.target===t&&(i.current=yl(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function yl(e){return(e==null?void 0:e.animationName)||"none"}function W2(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)}var Rd=0;function _1(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??dy()),document.body.insertAdjacentElement("beforeend",e[1]??dy()),Rd++,()=>{Rd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Rd--}},[])}function dy(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fn=function(){return Fn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return cA;var t=dA(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])}},pA=A1(),Ri="data-scroll-locked",hA=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Q2,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(a,"px ").concat(r,`; + } + body[`).concat(Ri,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(a,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Hl,` { + right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Kl,` { + margin-right: `).concat(a,"px ").concat(r,`; + } + + .`).concat(Hl," .").concat(Hl,` { + right: 0 `).concat(r,`; + } + + .`).concat(Kl," .").concat(Kl,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(Ri,`] { + `).concat(Y2,": ").concat(a,`px; + } +`)},py=function(){var e=parseInt(document.body.getAttribute(Ri)||"0",10);return isFinite(e)?e:0},gA=function(){p.useEffect(function(){return document.body.setAttribute(Ri,(py()+1).toString()),function(){var e=py()-1;e<=0?document.body.removeAttribute(Ri):document.body.setAttribute(Ri,e.toString())}},[])},mA=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;gA();var i=p.useMemo(function(){return fA(o)},[o]);return p.createElement(pA,{styles:hA(i,!t,o,n?"":"!important")})},cp=!1;if(typeof window<"u")try{var wl=Object.defineProperty({},"passive",{get:function(){return cp=!0,!0}});window.addEventListener("test",wl,wl),window.removeEventListener("test",wl,wl)}catch{cp=!1}var ei=cp?{passive:!1}:!1,vA=function(e){return e.tagName==="TEXTAREA"},N1=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vA(e)&&n[t]==="visible")},yA=function(e){return N1(e,"overflowY")},wA=function(e){return N1(e,"overflowX")},hy=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=j1(e,r);if(o){var i=O1(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xA=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},SA=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},j1=function(e,t){return e==="v"?yA(t):wA(t)},O1=function(e,t){return e==="v"?xA(t):SA(t)},CA=function(e,t){return e==="h"&&t==="rtl"?-1:1},bA=function(e,t,n,r,o){var i=CA(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,c=0,f=0;do{var g=O1(e,a),v=g[0],y=g[1],x=g[2],w=y-x-i*v;(v||w)&&j1(e,a)&&(c+=w,f+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(c)<1||!o)||!d&&(Math.abs(f)<1||!o))&&(u=!0),u},xl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},gy=function(e){return[e.deltaX,e.deltaY]},my=function(e){return e&&"current"in e?e.current:e},RA=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EA=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},PA=0,ti=[];function _A(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(PA++)[0],i=p.useState(A1)[0],s=p.useRef(e);p.useEffect(function(){s.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=q2([e.lockRef.current],(e.shards||[]).map(my),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var w=xl(y),m=n.current,S="deltaX"in y?y.deltaX:m[0]-w[0],C="deltaY"in y?y.deltaY:m[1]-w[1],P,b=y.target,A=Math.abs(S)>Math.abs(C)?"h":"v";if("touches"in y&&A==="h"&&b.type==="range")return!1;var M=hy(A,b);if(!M)return!0;if(M?P=A:(P=A==="v"?"h":"v",M=hy(A,b)),!M)return!1;if(!r.current&&"changedTouches"in y&&(S||C)&&(r.current=P),!P)return!0;var O=r.current||P;return bA(O,x,y,O==="h"?S:C,!0)},[]),l=p.useCallback(function(y){var x=y;if(!(!ti.length||ti[ti.length-1]!==i)){var w="deltaY"in x?gy(x):xl(x),m=t.current.filter(function(P){return P.name===x.type&&(P.target===x.target||x.target===P.shadowParent)&&RA(P.delta,w)})[0];if(m&&m.should){x.cancelable&&x.preventDefault();return}if(!m){var S=(s.current.shards||[]).map(my).filter(Boolean).filter(function(P){return P.contains(x.target)}),C=S.length>0?a(x,S[0]):!s.current.noIsolation;C&&x.cancelable&&x.preventDefault()}}},[]),u=p.useCallback(function(y,x,w,m){var S={name:y,delta:x,target:w,should:m,shadowParent:MA(w)};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(C){return C!==S})},1)},[]),d=p.useCallback(function(y){n.current=xl(y),r.current=void 0},[]),c=p.useCallback(function(y){u(y.type,gy(y),y.target,a(y,e.lockRef.current))},[]),f=p.useCallback(function(y){u(y.type,xl(y),y.target,a(y,e.lockRef.current))},[]);p.useEffect(function(){return ti.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ei),document.addEventListener("touchmove",l,ei),document.addEventListener("touchstart",d,ei),function(){ti=ti.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,ei),document.removeEventListener("touchmove",l,ei),document.removeEventListener("touchstart",d,ei)}},[]);var g=e.removeScrollBar,v=e.inert;return p.createElement(p.Fragment,null,v?p.createElement(i,{styles:EA(o)}):null,g?p.createElement(mA,{gapMode:e.gapMode}):null)}function MA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const kA=rA(T1,_A);var ng=p.forwardRef(function(e,t){return p.createElement(dc,Fn({},e,{ref:t,sideCar:kA}))});ng.classNames=dc.classNames;var TA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ni=new WeakMap,Sl=new WeakMap,Cl={},Md=0,I1=function(e){return e&&(e.host||I1(e.parentNode))},AA=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=I1(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})},NA=function(e,t,n,r){var o=AA(t,Array.isArray(e)?e:[e]);Cl[n]||(Cl[n]=new WeakMap);var i=Cl[n],s=[],a=new Set,l=new Set(o),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(f){if(a.has(f))d(f);else try{var g=f.getAttribute(r),v=g!==null&&g!=="false",y=(ni.get(f)||0)+1,x=(i.get(f)||0)+1;ni.set(f,y),i.set(f,x),s.push(f),y===1&&v&&Sl.set(f,!0),x===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return d(t),a.clear(),Md++,function(){s.forEach(function(c){var f=ni.get(c)-1,g=i.get(c)-1;ni.set(c,f),i.set(c,g),f||(Sl.has(c)||c.removeAttribute(r),Sl.delete(c)),g||c.removeAttribute(n)}),Md--,Md||(ni=new WeakMap,ni=new WeakMap,Sl=new WeakMap,Cl={})}},D1=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=TA(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),NA(r,o,n,"aria-hidden")):function(){return null}},rg="Dialog",[F1,kF]=so(rg),[jA,En]=F1(rg),L1=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=p.useRef(null),l=p.useRef(null),[u=!1,d]=Ko({prop:r,defaultProp:o,onChange:i});return h.jsx(jA,{scope:t,triggerRef:a,contentRef:l,contentId:nr(),titleId:nr(),descriptionId:nr(),open:u,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(c=>!c),[d]),modal:s,children:n})};L1.displayName=rg;var $1="DialogTrigger",OA=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En($1,n),i=qe(t,o.triggerRef);return h.jsx(he.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":sg(o.open),...r,ref:i,onClick:re(e.onClick,o.onOpenToggle)})});OA.displayName=$1;var og="DialogPortal",[IA,U1]=F1(og,{forceMount:void 0}),z1=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=En(og,t);return h.jsx(IA,{scope:t,forceMount:n,children:p.Children.map(r,s=>h.jsx(Qt,{present:n||i.open,children:h.jsx(La,{asChild:!0,container:o,children:s})}))})};z1.displayName=og;var Au="DialogOverlay",B1=p.forwardRef((e,t)=>{const n=U1(Au,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=En(Au,e.__scopeDialog);return i.modal?h.jsx(Qt,{present:r||i.open,children:h.jsx(DA,{...o,ref:t})}):null});B1.displayName=Au;var DA=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(Au,n);return h.jsx(ng,{as:un,allowPinchZoom:!0,shards:[o.contentRef],children:h.jsx(he.div,{"data-state":sg(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Fo="DialogContent",V1=p.forwardRef((e,t)=>{const n=U1(Fo,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=En(Fo,e.__scopeDialog);return h.jsx(Qt,{present:r||i.open,children:i.modal?h.jsx(FA,{...o,ref:t}):h.jsx(LA,{...o,ref:t})})});V1.displayName=Fo;var FA=p.forwardRef((e,t)=>{const n=En(Fo,e.__scopeDialog),r=p.useRef(null),o=qe(t,n.contentRef,r);return p.useEffect(()=>{const i=r.current;if(i)return D1(i)},[]),h.jsx(H1,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault())})}),LA=p.forwardRef((e,t)=>{const n=En(Fo,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return h.jsx(H1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),H1=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=En(Fo,n),l=p.useRef(null),u=qe(t,l);return _1(),h.jsxs(h.Fragment,{children:[h.jsx(tg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:h.jsx(Fa,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":sg(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx($A,{titleId:a.titleId}),h.jsx(zA,{contentRef:l,descriptionId:a.descriptionId})]})]})}),ig="DialogTitle",K1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(ig,n);return h.jsx(he.h2,{id:o.titleId,...r,ref:t})});K1.displayName=ig;var G1="DialogDescription",W1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(G1,n);return h.jsx(he.p,{id:o.descriptionId,...r,ref:t})});W1.displayName=G1;var q1="DialogClose",Q1=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(q1,n);return h.jsx(he.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});Q1.displayName=q1;function sg(e){return e?"open":"closed"}var Y1="DialogTitleWarning",[TF,X1]=b2(Y1,{contentName:Fo,titleName:ig,docsSlug:"dialog"}),$A=({titleId:e})=>{const t=X1(Y1),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},UA="DialogDescriptionWarning",zA=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${X1(UA).contentName}}.`;return p.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},J1=L1,Z1=z1,fc=B1,pc=V1,hc=K1,gc=W1,eS=Q1;function as(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var BA=["color"],VA=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,BA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),HA=["color"],KA=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,HA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),GA=["color"],tS=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,GA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),WA=["color"],ag=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,WA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),qA=["color"],QA=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,qA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),YA=["color"],XA=p.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=as(e,YA);return p.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),p.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const JA=J1,ZA=Z1,nS=p.forwardRef(({className:e,...t},n)=>h.jsx(fc,{className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));nS.displayName=fc.displayName;const eN=Da("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),rS=p.forwardRef(({side:e="right",className:t,children:n,...r},o)=>h.jsxs(ZA,{children:[h.jsx(nS,{}),h.jsxs(pc,{ref:o,className:q(eN({side:e}),t),...r,children:[h.jsxs(eS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[h.jsx(ag,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]}),n]})]}));rS.displayName=pc.displayName;const tN=p.forwardRef(({className:e,...t},n)=>h.jsx(hc,{ref:n,className:q("text-lg font-semibold text-foreground",e),...t}));tN.displayName=hc.displayName;const nN=p.forwardRef(({className:e,...t},n)=>h.jsx(gc,{ref:n,className:q("text-sm text-muted-foreground",e),...t}));nN.displayName=gc.displayName;function vy({className:e,...t}){return h.jsx("div",{className:q("animate-pulse rounded-md bg-primary/10",e),...t})}const rN=["top","right","bottom","left"],Yr=Math.min,Ut=Math.max,Nu=Math.round,bl=Math.floor,Xr=e=>({x:e,y:e}),oN={left:"right",right:"left",bottom:"top",top:"bottom"},iN={start:"end",end:"start"};function dp(e,t,n){return Ut(e,Yr(t,n))}function lr(e,t){return typeof e=="function"?e(t):e}function ur(e){return e.split("-")[0]}function ls(e){return e.split("-")[1]}function lg(e){return e==="x"?"y":"x"}function ug(e){return e==="y"?"height":"width"}function Jr(e){return["top","bottom"].includes(ur(e))?"y":"x"}function cg(e){return lg(Jr(e))}function sN(e,t,n){n===void 0&&(n=!1);const r=ls(e),o=cg(e),i=ug(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ju(s)),[s,ju(s)]}function aN(e){const t=ju(e);return[fp(e),t,fp(t)]}function fp(e){return e.replace(/start|end/g,t=>iN[t])}function lN(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function uN(e,t,n,r){const o=ls(e);let i=lN(ur(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(fp)))),i}function ju(e){return e.replace(/left|right|bottom|top/g,t=>oN[t])}function cN(e){return{top:0,right:0,bottom:0,left:0,...e}}function oS(e){return typeof e!="number"?cN(e):{top:e,right:e,bottom:e,left:e}}function Ou(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 yy(e,t,n){let{reference:r,floating:o}=e;const i=Jr(t),s=cg(t),a=ug(s),l=ur(t),u=i==="y",d=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:c};break;case"left":g={x:r.x-o.width,y:c};break;default:g={x:r.x,y:r.y}}switch(ls(t)){case"start":g[s]-=f*(n&&u?-1:1);break;case"end":g[s]+=f*(n&&u?-1:1);break}return g}const dN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:c}=yy(u,r,l),f=r,g={},v=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=lr(e,t)||{};if(u==null)return{};const c=oS(d),f={x:n,y:r},g=cg(o),v=ug(g),y=await s.getDimensions(u),x=g==="y",w=x?"top":"left",m=x?"bottom":"right",S=x?"clientHeight":"clientWidth",C=i.reference[v]+i.reference[g]-f[g]-i.floating[v],P=f[g]-i.reference[g],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let A=b?b[S]:0;(!A||!await(s.isElement==null?void 0:s.isElement(b)))&&(A=a.floating[S]||i.floating[v]);const M=C/2-P/2,O=A/2-y[v]/2-1,R=Yr(c[w],O),N=Yr(c[m],O),I=R,$=A-y[v]-N,E=A/2-y[v]/2+M,k=dp(I,E,$),D=!l.arrow&&ls(o)!=null&&E!==k&&i.reference[v]/2-(EE<=0)){var N,I;const E=(((N=i.flip)==null?void 0:N.index)||0)+1,k=A[E];if(k)return{data:{index:E,overflows:R},reset:{placement:k}};let D=(I=R.filter(V=>V.overflows[0]<=0).sort((V,L)=>V.overflows[1]-L.overflows[1])[0])==null?void 0:I.placement;if(!D)switch(g){case"bestFit":{var $;const V=($=R.filter(L=>{if(b){const j=Jr(L.placement);return j===m||j==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(j=>j>0).reduce((j,B)=>j+B,0)]).sort((L,j)=>L[1]-j[1])[0])==null?void 0:$[0];V&&(D=V);break}case"initialPlacement":D=a;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function wy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xy(e){return rN.some(t=>e[t]>=0)}const hN=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=lr(e,t);switch(r){case"referenceHidden":{const i=await ya(t,{...o,elementContext:"reference"}),s=wy(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:xy(s)}}}case"escaped":{const i=await ya(t,{...o,altBoundary:!0}),s=wy(i,n.floating);return{data:{escapedOffsets:s,escaped:xy(s)}}}default:return{}}}}};async function gN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ur(n),a=ls(n),l=Jr(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,c=lr(t,e);let{mainAxis:f,crossAxis:g,alignmentAxis:v}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*d,y:f*u}:{x:f*u,y:g*d}}const mN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await gN(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},vN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:m}=x;return{x:w,y:m}}},...l}=lr(e,t),u={x:n,y:r},d=await ya(t,l),c=Jr(ur(o)),f=lg(c);let g=u[f],v=u[c];if(i){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",m=g+d[x],S=g-d[w];g=dp(m,g,S)}if(s){const x=c==="y"?"top":"left",w=c==="y"?"bottom":"right",m=v+d[x],S=v-d[w];v=dp(m,v,S)}const y=a.fn({...t,[f]:g,[c]:v});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[f]:i,[c]:s}}}}}},yN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=lr(e,t),d={x:n,y:r},c=Jr(o),f=lg(c);let g=d[f],v=d[c];const y=lr(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const S=f==="y"?"height":"width",C=i.reference[f]-i.floating[S]+x.mainAxis,P=i.reference[f]+i.reference[S]-x.mainAxis;gP&&(g=P)}if(u){var w,m;const S=f==="y"?"width":"height",C=["top","left"].includes(ur(o)),P=i.reference[c]-i.floating[S]+(C&&((w=s.offset)==null?void 0:w[c])||0)+(C?0:x.crossAxis),b=i.reference[c]+i.reference[S]+(C?0:((m=s.offset)==null?void 0:m[c])||0)-(C?x.crossAxis:0);vb&&(v=b)}return{[f]:g,[c]:v}}}},wN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=lr(e,t),d=await ya(t,u),c=ur(o),f=ls(o),g=Jr(o)==="y",{width:v,height:y}=i.floating;let x,w;c==="top"||c==="bottom"?(x=c,w=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=c,x=f==="end"?"top":"bottom");const m=y-d.top-d.bottom,S=v-d.left-d.right,C=Yr(y-d[x],m),P=Yr(v-d[w],S),b=!t.middlewareData.shift;let A=C,M=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=m),b&&!f){const R=Ut(d.left,0),N=Ut(d.right,0),I=Ut(d.top,0),$=Ut(d.bottom,0);g?M=v-2*(R!==0||N!==0?R+N:Ut(d.left,d.right)):A=y-2*(I!==0||$!==0?I+$:Ut(d.top,d.bottom))}await l({...t,availableWidth:M,availableHeight:A});const O=await s.getDimensions(a.floating);return v!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}};function mc(){return typeof window<"u"}function us(e){return iS(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bn(e){var t;return(t=(iS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function iS(e){return mc()?e instanceof Node||e instanceof Ht(e).Node:!1}function bn(e){return mc()?e instanceof Element||e instanceof Ht(e).Element:!1}function Un(e){return mc()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:!1}function Sy(e){return!mc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}function $a(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function xN(e){return["table","td","th"].includes(us(e))}function vc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function dg(e){const t=fg(),n=bn(e)?Rn(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 SN(e){let t=Zr(e);for(;Un(t)&&!Yi(t);){if(dg(t))return t;if(vc(t))return null;t=Zr(t)}return null}function fg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Yi(e){return["html","body","#document"].includes(us(e))}function Rn(e){return Ht(e).getComputedStyle(e)}function yc(e){return bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zr(e){if(us(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Sy(e)&&e.host||Bn(e);return Sy(t)?t.host:t}function sS(e){const t=Zr(e);return Yi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&$a(t)?t:sS(t)}function wa(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sS(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ht(o);if(i){const a=pp(s);return t.concat(s,s.visualViewport||[],$a(o)?o:[],a&&n?wa(a):[])}return t.concat(o,wa(o,[],n))}function pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function aS(e){const t=Rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Un(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Nu(n)!==i||Nu(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function pg(e){return bn(e)?e:e.contextElement}function Ei(e){const t=pg(e);if(!Un(t))return Xr(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=aS(t);let s=(i?Nu(n.width):n.width)/r,a=(i?Nu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const CN=Xr(0);function lS(e){const t=Ht(e);return!fg()||!t.visualViewport?CN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ht(e)?!1:t}function Lo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=pg(e);let s=Xr(1);t&&(r?bn(r)&&(s=Ei(r)):s=Ei(e));const a=bN(i,n,r)?lS(i):Xr(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,c=o.height/s.y;if(i){const f=Ht(i),g=r&&bn(r)?Ht(r):r;let v=f,y=pp(v);for(;y&&r&&g!==v;){const x=Ei(y),w=y.getBoundingClientRect(),m=Rn(y),S=w.left+(y.clientLeft+parseFloat(m.paddingLeft))*x.x,C=w.top+(y.clientTop+parseFloat(m.paddingTop))*x.y;l*=x.x,u*=x.y,d*=x.x,c*=x.y,l+=S,u+=C,v=Ht(y),y=pp(v)}}return Ou({width:d,height:c,x:l,y:u})}function RN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Bn(r),a=t?vc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=Xr(1);const d=Xr(0),c=Un(r);if((c||!c&&!i)&&((us(r)!=="body"||$a(s))&&(l=yc(r)),Un(r))){const f=Lo(r);u=Ei(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function EN(e){return Array.from(e.getClientRects())}function hp(e,t){const n=yc(e).scrollLeft;return t?t.left+n:Lo(Bn(e)).left+n}function PN(e){const t=Bn(e),n=yc(e),r=e.ownerDocument.body,o=Ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+hp(e);const a=-n.scrollTop;return Rn(r).direction==="rtl"&&(s+=Ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function _N(e,t){const n=Ht(e),r=Bn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=fg();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function MN(e,t){const n=Lo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Un(e)?Ei(e):Xr(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Cy(e,t,n){let r;if(t==="viewport")r=_N(e,n);else if(t==="document")r=PN(Bn(e));else if(bn(t))r=MN(t,n);else{const o=lS(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Ou(r)}function uS(e,t){const n=Zr(e);return n===t||!bn(n)||Yi(n)?!1:Rn(n).position==="fixed"||uS(n,t)}function kN(e,t){const n=t.get(e);if(n)return n;let r=wa(e,[],!1).filter(a=>bn(a)&&us(a)!=="body"),o=null;const i=Rn(e).position==="fixed";let s=i?Zr(e):e;for(;bn(s)&&!Yi(s);){const a=Rn(s),l=dg(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||$a(s)&&!l&&uS(e,s))?r=r.filter(d=>d!==s):o=a,s=Zr(s)}return t.set(e,r),r}function TN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vc(t)?[]:kN(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const c=Cy(t,d,o);return u.top=Ut(c.top,u.top),u.right=Yr(c.right,u.right),u.bottom=Yr(c.bottom,u.bottom),u.left=Ut(c.left,u.left),u},Cy(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function AN(e){const{width:t,height:n}=aS(e);return{width:t,height:n}}function NN(e,t,n){const r=Un(t),o=Bn(t),i=n==="fixed",s=Lo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Xr(0);if(r||!r&&!i)if((us(t)!=="body"||$a(o))&&(a=yc(t)),r){const g=Lo(t,!0,i,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else o&&(l.x=hp(o));let u=0,d=0;if(o&&!r&&!i){const g=o.getBoundingClientRect();d=g.top+a.scrollTop,u=g.left+a.scrollLeft-hp(o,g)}const c=s.left+a.scrollLeft-l.x-u,f=s.top+a.scrollTop-l.y-d;return{x:c,y:f,width:s.width,height:s.height}}function kd(e){return Rn(e).position==="static"}function by(e,t){if(!Un(e)||Rn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bn(e)===n&&(n=n.ownerDocument.body),n}function cS(e,t){const n=Ht(e);if(vc(e))return n;if(!Un(e)){let o=Zr(e);for(;o&&!Yi(o);){if(bn(o)&&!kd(o))return o;o=Zr(o)}return n}let r=by(e,t);for(;r&&xN(r)&&kd(r);)r=by(r,t);return r&&Yi(r)&&kd(r)&&!dg(r)?n:r||SN(e)||n}const jN=async function(e){const t=this.getOffsetParent||cS,n=this.getDimensions,r=await n(e.floating);return{reference:NN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ON(e){return Rn(e).direction==="rtl"}const IN={convertOffsetParentRelativeRectToViewportRelativeRect:RN,getDocumentElement:Bn,getClippingRect:TN,getOffsetParent:cS,getElementRects:jN,getClientRects:EN,getDimensions:AN,getScale:Ei,isElement:bn,isRTL:ON};function DN(e,t){let n=null,r;const o=Bn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:c,height:f}=e.getBoundingClientRect();if(a||t(),!c||!f)return;const g=bl(d),v=bl(o.clientWidth-(u+c)),y=bl(o.clientHeight-(d+f)),x=bl(u),m={rootMargin:-g+"px "+-v+"px "+-y+"px "+-x+"px",threshold:Ut(0,Yr(1,l))||1};let S=!0;function C(P){const b=P[0].intersectionRatio;if(b!==l){if(!S)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(C,{...m,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,m)}n.observe(e)}return s(!0),i}function FN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=pg(e),d=o||i?[...u?wa(u):[],...wa(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const c=u&&a?DN(u,n):null;let f=-1,g=null;s&&(g=new ResizeObserver(w=>{let[m]=w;m&&m.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let v,y=l?Lo(e):null;l&&x();function x(){const w=Lo(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,v=requestAnimationFrame(x)}return n(),()=>{var w;d.forEach(m=>{o&&m.removeEventListener("scroll",n),i&&m.removeEventListener("resize",n)}),c==null||c(),(w=g)==null||w.disconnect(),g=null,l&&cancelAnimationFrame(v)}}const LN=mN,$N=vN,UN=pN,zN=wN,BN=hN,Ry=fN,VN=yN,HN=(e,t,n)=>{const r=new Map,o={platform:IN,...n},i={...o.platform,_c:r};return dN(e,t,{...o,platform:i})};var Gl=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Iu(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(!Iu(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Iu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function dS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ey(e,t){const n=dS(e);return Math.round(t*n)/n}function Td(e){const t=p.useRef(e);return Gl(()=>{t.current=e}),t}function KN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,c]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,g]=p.useState(r);Iu(f,r)||g(r);const[v,y]=p.useState(null),[x,w]=p.useState(null),m=p.useCallback(L=>{L!==b.current&&(b.current=L,y(L))},[]),S=p.useCallback(L=>{L!==A.current&&(A.current=L,w(L))},[]),C=i||v,P=s||x,b=p.useRef(null),A=p.useRef(null),M=p.useRef(d),O=l!=null,R=Td(l),N=Td(o),I=Td(u),$=p.useCallback(()=>{if(!b.current||!A.current)return;const L={placement:t,strategy:n,middleware:f};N.current&&(L.platform=N.current),HN(b.current,A.current,L).then(j=>{const B={...j,isPositioned:I.current!==!1};E.current&&!Iu(M.current,B)&&(M.current=B,ns.flushSync(()=>{c(B)}))})},[f,t,n,N,I]);Gl(()=>{u===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,c(L=>({...L,isPositioned:!1})))},[u]);const E=p.useRef(!1);Gl(()=>(E.current=!0,()=>{E.current=!1}),[]),Gl(()=>{if(C&&(b.current=C),P&&(A.current=P),C&&P){if(R.current)return R.current(C,P,$);$()}},[C,P,$,R,O]);const k=p.useMemo(()=>({reference:b,floating:A,setReference:m,setFloating:S}),[m,S]),D=p.useMemo(()=>({reference:C,floating:P}),[C,P]),V=p.useMemo(()=>{const L={position:n,left:0,top:0};if(!D.floating)return L;const j=Ey(D.floating,d.x),B=Ey(D.floating,d.y);return a?{...L,transform:"translate("+j+"px, "+B+"px)",...dS(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:j,top:B}},[n,a,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:$,refs:k,elements:D,floatingStyles:V}),[d,$,k,D,V])}const GN=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?Ry({element:r.current,padding:o}).fn(n):{}:r?Ry({element:r,padding:o}).fn(n):{}}}},WN=(e,t)=>({...LN(e),options:[e,t]}),qN=(e,t)=>({...$N(e),options:[e,t]}),QN=(e,t)=>({...VN(e),options:[e,t]}),YN=(e,t)=>({...UN(e),options:[e,t]}),XN=(e,t)=>({...zN(e),options:[e,t]}),JN=(e,t)=>({...BN(e),options:[e,t]}),ZN=(e,t)=>({...GN(e),options:[e,t]});var ej="Arrow",fS=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return h.jsx(he.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});fS.displayName=ej;var tj=fS;function nj(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...v}=c,y=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>v,Object.values(v));return h.jsx(y.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,v=p.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,rj(o,...t)]}function rj(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function oj(e){const[t,n]=p.useState(void 0);return Cn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var hg="Popper",[pS,wc]=nj(hg),[ij,hS]=pS(hg),gS=e=>{const{__scopePopper:t,children:n}=e,[r,o]=p.useState(null);return h.jsx(ij,{scope:t,anchor:r,onAnchorChange:o,children:n})};gS.displayName=hg;var mS="PopperAnchor",vS=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=hS(mS,n),s=p.useRef(null),a=qe(t,s);return p.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:h.jsx(he.div,{...o,ref:a})});vS.displayName=mS;var gg="PopperContent",[sj,aj]=pS(gg),yS=p.forwardRef((e,t)=>{var pe,Me,we,tt,Ce,it;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:v,...y}=e,x=hS(gg,n),[w,m]=p.useState(null),S=qe(t,Ot=>m(Ot)),[C,P]=p.useState(null),b=oj(C),A=(b==null?void 0:b.width)??0,M=(b==null?void 0:b.height)??0,O=r+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],I=N.length>0,$={padding:R,boundary:N.filter(uj),altBoundary:I},{refs:E,floatingStyles:k,placement:D,isPositioned:V,middlewareData:L}=KN({strategy:"fixed",placement:O,whileElementsMounted:(...Ot)=>FN(...Ot,{animationFrame:g==="always"}),elements:{reference:x.anchor},middleware:[WN({mainAxis:o+M,alignmentAxis:s}),l&&qN({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?QN():void 0,...$}),l&&YN({...$}),XN({...$,apply:({elements:Ot,rects:Le,availableWidth:nt,availableHeight:cn})=>{const{width:jc,height:Va}=Le.reference,qo=Ot.floating.style;qo.setProperty("--radix-popper-available-width",`${nt}px`),qo.setProperty("--radix-popper-available-height",`${cn}px`),qo.setProperty("--radix-popper-anchor-width",`${jc}px`),qo.setProperty("--radix-popper-anchor-height",`${Va}px`)}}),C&&ZN({element:C,padding:a}),cj({arrowWidth:A,arrowHeight:M}),f&&JN({strategy:"referenceHidden",...$})]}),[j,B]=SS(D),Q=mt(v);Cn(()=>{V&&(Q==null||Q())},[V,Q]);const te=(pe=L.arrow)==null?void 0:pe.x,fe=(Me=L.arrow)==null?void 0:Me.y,ge=((we=L.arrow)==null?void 0:we.centerOffset)!==0,[z,G]=p.useState();return Cn(()=>{w&&G(window.getComputedStyle(w).zIndex)},[w]),h.jsx("div",{ref:E.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:V?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[(tt=L.transformOrigin)==null?void 0:tt.x,(Ce=L.transformOrigin)==null?void 0:Ce.y].join(" "),...((it=L.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(sj,{scope:n,placedSide:j,onArrowChange:P,arrowX:te,arrowY:fe,shouldHideArrow:ge,children:h.jsx(he.div,{"data-side":j,"data-align":B,...y,ref:S,style:{...y.style,animation:V?void 0:"none"}})})})});yS.displayName=gg;var wS="PopperArrow",lj={top:"bottom",right:"left",bottom:"top",left:"right"},xS=p.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=aj(wS,r),s=lj[i.placedSide];return h.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:h.jsx(tj,{...o,ref:n,style:{...o.style,display:"block"}})})});xS.displayName=wS;function uj(e){return e!==null}var cj=e=>({name:"transformOrigin",options:e,fn(t){var x,w,m;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=SS(n),c={start:"0%",center:"50%",end:"100%"}[d],f=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,g=(((m=o.arrow)==null?void 0:m.y)??0)+l/2;let v="",y="";return u==="bottom"?(v=s?c:`${f}px`,y=`${-l}px`):u==="top"?(v=s?c:`${f}px`,y=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,y=s?c:`${g}px`):u==="left"&&(v=`${r.floating.width+l}px`,y=s?c:`${g}px`),{data:{x:v,y}}}});function SS(e){const[t,n="center"]=e.split("-");return[t,n]}var CS=gS,bS=vS,RS=yS,ES=xS,dj="VisuallyHidden",xc=p.forwardRef((e,t)=>h.jsx(he.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}}));xc.displayName=dj;var fj=xc,[Sc,AF]=so("Tooltip",[wc]),Cc=wc(),PS="TooltipProvider",pj=700,gp="tooltip.open",[hj,mg]=Sc(PS),_S=e=>{const{__scopeTooltip:t,delayDuration:n=pj,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=p.useState(!0),l=p.useRef(!1),u=p.useRef(0);return p.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),h.jsx(hj,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:p.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};_S.displayName=PS;var bc="Tooltip",[gj,Ua]=Sc(bc),MS=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=mg(bc,e.__scopeTooltip),u=Cc(t),[d,c]=p.useState(null),f=nr(),g=p.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=p.useRef(!1),[w=!1,m]=Ko({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(gp))):l.onClose(),i==null||i(A)}}),S=p.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),C=p.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,m(!0)},[m]),P=p.useCallback(()=>{window.clearTimeout(g.current),m(!1)},[m]),b=p.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,m(!0)},y)},[y,m]);return p.useEffect(()=>()=>window.clearTimeout(g.current),[]),h.jsx(CS,{...u,children:h.jsx(gj,{scope:t,contentId:f,open:w,stateAttribute:S,trigger:d,onTriggerChange:c,onTriggerEnter:p.useCallback(()=>{l.isOpenDelayed?b():C()},[l.isOpenDelayed,b,C]),onTriggerLeave:p.useCallback(()=>{v?P():window.clearTimeout(g.current)},[P,v]),onOpen:C,onClose:P,disableHoverableContent:v,children:n})})};MS.displayName=bc;var mp="TooltipTrigger",kS=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Ua(mp,n),i=mg(mp,n),s=Cc(n),a=p.useRef(null),l=qe(t,a,o.onTriggerChange),u=p.useRef(!1),d=p.useRef(!1),c=p.useCallback(()=>u.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),h.jsx(bS,{asChild:!0,...s,children:h.jsx(he.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:re(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:re(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:re(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:re(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:re(e.onBlur,o.onClose),onClick:re(e.onClick,o.onClose)})})});kS.displayName=mp;var vg="TooltipPortal",[mj,vj]=Sc(vg,{forceMount:void 0}),TS=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=Ua(vg,t);return h.jsx(mj,{scope:t,forceMount:n,children:h.jsx(Qt,{present:n||i.open,children:h.jsx(La,{asChild:!0,container:o,children:r})})})};TS.displayName=vg;var Xi="TooltipContent",AS=p.forwardRef((e,t)=>{const n=vj(Xi,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Ua(Xi,e.__scopeTooltip);return h.jsx(Qt,{present:r||s.open,children:s.disableHoverableContent?h.jsx(NS,{side:o,...i,ref:t}):h.jsx(yj,{side:o,...i,ref:t})})}),yj=p.forwardRef((e,t)=>{const n=Ua(Xi,e.__scopeTooltip),r=mg(Xi,e.__scopeTooltip),o=p.useRef(null),i=qe(t,o),[s,a]=p.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,f=p.useCallback(()=>{a(null),c(!1)},[c]),g=p.useCallback((v,y)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},m=Cj(w,x.getBoundingClientRect()),S=bj(w,m),C=Rj(y.getBoundingClientRect()),P=Pj([...S,...C]);a(P),c(!0)},[c]);return p.useEffect(()=>()=>f(),[f]),p.useEffect(()=>{if(l&&d){const v=x=>g(x,d),y=x=>g(x,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",y)}}},[l,d,g,f]),p.useEffect(()=>{if(s){const v=y=>{const x=y.target,w={x:y.clientX,y:y.clientY},m=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),S=!Ej(w,s);m?f():S&&(f(),u())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,s,u,f]),h.jsx(NS,{...e,ref:i})}),[wj,xj]=Sc(bc,{isInside:!1}),NS=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Ua(Xi,n),u=Cc(n),{onClose:d}=l;return p.useEffect(()=>(document.addEventListener(gp,d),()=>document.removeEventListener(gp,d)),[d]),p.useEffect(()=>{if(l.trigger){const c=f=>{const g=f.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),h.jsx(Fa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:h.jsxs(RS,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(h1,{children:r}),h.jsx(wj,{scope:n,isInside:!0,children:h.jsx(fj,{id:l.contentId,role:"tooltip",children:o||r})})]})})});AS.displayName=Xi;var jS="TooltipArrow",Sj=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Cc(n);return xj(jS,n).isInside?null:h.jsx(ES,{...o,...r,ref:t})});Sj.displayName=jS;function Cj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function bj(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Rj(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Ej(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function Pj(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),_j(t)}function _j(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Mj=_S,kj=MS,Tj=kS,Aj=TS,OS=AS;const Nj=Mj,jj=kj,Oj=Tj,IS=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(Aj,{children:h.jsx(OS,{ref:r,sideOffset:t,className:q("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));IS.displayName=OS.displayName;const Ij="sidebar:state",Dj=60*60*24*7,Fj="16rem",Lj="18rem",$j="3rem",Uj="b",DS=p.createContext(null);function Rc(){const e=p.useContext(DS);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const FS=p.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:i,...s},a)=>{const l=y2(),[u,d]=p.useState(!1),[c,f]=p.useState(e),g=t??c,v=p.useCallback(m=>{if(n)return n==null?void 0:n(typeof m=="function"?m(g):m);f(m),document.cookie=`${Ij}=${g}; path=/; max-age=${Dj}`},[n,g]),y=p.useCallback(()=>l?d(m=>!m):v(m=>!m),[l,v,d]);p.useEffect(()=>{const m=S=>{S.key===Uj&&(S.metaKey||S.ctrlKey)&&(S.preventDefault(),y())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[y]);const x=g?"expanded":"collapsed",w=p.useMemo(()=>({state:x,open:g,setOpen:v,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:y}),[x,g,v,l,u,d,y]);return h.jsx(DS.Provider,{value:w,children:h.jsx(Nj,{delayDuration:0,children:h.jsx("div",{style:{"--sidebar-width":Fj,"--sidebar-width-icon":$j,...o},className:q("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...s,children:i})})})});FS.displayName="SidebarProvider";const LS=p.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...i},s)=>{const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=Rc();return n==="none"?h.jsx("div",{className:q("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:s,...i,children:o}):a?h.jsx(JA,{open:u,onOpenChange:d,...i,children:h.jsx(rS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":Lj},side:e,children:h.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):h.jsxs("div",{ref:s,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[h.jsx("div",{className:q("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),h.jsx("div",{className:q("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:h.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});LS.displayName="Sidebar";const $S=p.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:o}=Rc();return h.jsxs(Mt,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:q("h-7 w-7",e),onClick:i=>{t==null||t(i),o()},...n,children:[h.jsx(a2,{}),h.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});$S.displayName="SidebarTrigger";const US=p.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=Rc();return h.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:q("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});US.displayName="SidebarRail";const zS=p.forwardRef(({className:e,...t},n)=>h.jsx("main",{ref:n,className:q("relative flex min-h-[calc(100svh_-_4rem)] flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));zS.displayName="SidebarInset";const zj=p.forwardRef(({className:e,...t},n)=>h.jsx(Zh,{ref:n,"data-sidebar":"input",className:q("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));zj.displayName="SidebarInput";const BS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"header",className:q("flex flex-col gap-2 p-2",e),...t}));BS.displayName="SidebarHeader";const VS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"footer",className:q("flex flex-col gap-2 p-2",e),...t}));VS.displayName="SidebarFooter";const vp=p.forwardRef(({className:e,...t},n)=>h.jsx(C1,{ref:n,"data-sidebar":"separator",className:q("mx-2 w-auto bg-sidebar-border",e),...t}));vp.displayName="SidebarSeparator";const HS=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"content",className:q("flex min-h-0 flex-1 flex-col gap-2 p-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));HS.displayName="SidebarContent";const Bj=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"group",className:q("relative flex w-full min-w-0 flex-col p-2",e),...t}));Bj.displayName="SidebarGroup";const Vj=p.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?un:"div";return h.jsx(o,{ref:r,"data-sidebar":"group-label",className:q("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});Vj.displayName="SidebarGroupLabel";const Hj=p.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?un:"button";return h.jsx(o,{ref:r,"data-sidebar":"group-action",className:q("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});Hj.displayName="SidebarGroupAction";const Kj=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"group-content",className:q("w-full text-sm",e),...t}));Kj.displayName="SidebarGroupContent";const KS=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,"data-sidebar":"menu",className:q("flex w-full min-w-0 flex-col gap-1",e),...t}));KS.displayName="SidebarMenu";const fo=p.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,"data-sidebar":"menu-item",className:q("group/menu-item relative",e),...t}));fo.displayName="SidebarMenuItem";const Gj=Da("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),po=p.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:i,...s},a)=>{const l=e?un:"button",{isMobile:u,state:d}=Rc(),c=h.jsx(l,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:q(Gj({variant:n,size:r}),i),...s});return o?(typeof o=="string"&&(o={children:o}),h.jsxs(jj,{children:[h.jsx(Oj,{asChild:!0,children:c}),h.jsx(IS,{side:"right",align:"center",hidden:d!=="collapsed"||u,...o})]})):c});po.displayName="SidebarMenuButton";const Wj=p.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},o)=>{const i=t?un:"button";return h.jsx(i,{ref:o,"data-sidebar":"menu-action",className:q("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});Wj.displayName="SidebarMenuAction";const qj=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:q("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));qj.displayName="SidebarMenuBadge";const Qj=p.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const o=p.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return h.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:q("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&h.jsx(vy,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),h.jsx(vy,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});Qj.displayName="SidebarMenuSkeleton";const Yj=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:q("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));Yj.displayName="SidebarMenuSub";const Xj=p.forwardRef(({...e},t)=>h.jsx("li",{ref:t,...e}));Xj.displayName="SidebarMenuSubItem";const Jj=p.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...o},i)=>{const s=e?un:"a";return h.jsx(s,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:q("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})});Jj.displayName="SidebarMenuSubButton";function Zj(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...v}=c,y=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>v,Object.values(v));return h.jsx(y.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,v=p.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,eO(o,...t)]}function eO(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function yg(e){const t=e+"CollectionProvider",[n,r]=Zj(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:v,children:y}=g,x=mr.useRef(null),w=mr.useRef(new Map).current;return h.jsx(o,{scope:v,itemMap:w,collectionRef:x,children:y})};s.displayName=t;const a=e+"CollectionSlot",l=mr.forwardRef((g,v)=>{const{scope:y,children:x}=g,w=i(a,y),m=qe(v,w.collectionRef);return h.jsx(un,{ref:m,children:x})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",c=mr.forwardRef((g,v)=>{const{scope:y,children:x,...w}=g,m=mr.useRef(null),S=qe(v,m),C=i(u,y);return mr.useEffect(()=>(C.itemMap.set(m,{ref:m,...w}),()=>void C.itemMap.delete(m))),h.jsx(un,{[d]:"",ref:S,children:x})});c.displayName=u;function f(g){const v=i(e+"CollectionConsumer",g);return mr.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((C,P)=>w.indexOf(C.ref.current)-w.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:c},f,r]}var tO=p.createContext(void 0);function wg(e){const t=p.useContext(tO);return e||t||"ltr"}function nO(e,t=[]){let n=[];function r(i,s){const a=p.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:g,...v}=c,y=(f==null?void 0:f[e][l])||a,x=p.useMemo(()=>v,Object.values(v));return h.jsx(y.Provider,{value:x,children:g})}function d(c,f){const g=(f==null?void 0:f[e][l])||a,v=p.useContext(g);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>p.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,rO(o,...t)]}function rO(...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(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ad="rovingFocusGroup.onEntryFocus",oO={bubbles:!1,cancelable:!0},Ec="RovingFocusGroup",[yp,GS,iO]=yg(Ec),[sO,Pc]=nO(Ec,[iO]),[aO,lO]=sO(Ec),WS=p.forwardRef((e,t)=>h.jsx(yp.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(yp.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(uO,{...e,ref:t})})}));WS.displayName=Ec;var uO=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=p.useRef(null),g=qe(t,f),v=wg(i),[y=null,x]=Ko({prop:s,defaultProp:a,onChange:l}),[w,m]=p.useState(!1),S=mt(u),C=GS(n),P=p.useRef(!1),[b,A]=p.useState(0);return p.useEffect(()=>{const M=f.current;if(M)return M.addEventListener(Ad,S),()=>M.removeEventListener(Ad,S)},[S]),h.jsx(aO,{scope:n,orientation:r,dir:v,loop:o,currentTabStopId:y,onItemFocus:p.useCallback(M=>x(M),[x]),onItemShiftTab:p.useCallback(()=>m(!0),[]),onFocusableItemAdd:p.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>A(M=>M-1),[]),children:h.jsx(he.div,{tabIndex:w||b===0?-1:0,"data-orientation":r,...c,ref:g,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{P.current=!0}),onFocus:re(e.onFocus,M=>{const O=!P.current;if(M.target===M.currentTarget&&O&&!w){const R=new CustomEvent(Ad,oO);if(M.currentTarget.dispatchEvent(R),!R.defaultPrevented){const N=C().filter(D=>D.focusable),I=N.find(D=>D.active),$=N.find(D=>D.id===y),k=[I,$,...N].filter(Boolean).map(D=>D.ref.current);YS(k,d)}}P.current=!1}),onBlur:re(e.onBlur,()=>m(!1))})})}),qS="RovingFocusGroupItem",QS=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=nr(),l=i||a,u=lO(qS,n),d=u.currentTabStopId===l,c=GS(n),{onFocusableItemAdd:f,onFocusableItemRemove:g}=u;return p.useEffect(()=>{if(r)return f(),()=>g()},[r,f,g]),h.jsx(yp.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:h.jsx(he.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:re(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:re(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=fO(v,u.orientation,u.dir);if(y!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=c().filter(m=>m.focusable).map(m=>m.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const m=w.indexOf(v.currentTarget);w=u.loop?pO(w,m+1):w.slice(m+1)}setTimeout(()=>YS(w))}})})})});QS.displayName=qS;var cO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function dO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fO(e,t,n){const r=dO(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return cO[r]}function YS(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function pO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var XS=WS,JS=QS,wp=["Enter"," "],hO=["ArrowDown","PageUp","Home"],ZS=["ArrowUp","PageDown","End"],gO=[...hO,...ZS],mO={ltr:[...wp,"ArrowRight"],rtl:[...wp,"ArrowLeft"]},vO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},za="Menu",[xa,yO,wO]=yg(za),[Go,eC]=so(za,[wO,wc,Pc]),_c=wc(),tC=Pc(),[xO,Wo]=Go(za),[SO,Ba]=Go(za),nC=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=_c(t),[l,u]=p.useState(null),d=p.useRef(!1),c=mt(i),f=wg(o);return p.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.jsx(CS,{...a,children:h.jsx(xO,{scope:t,open:n,onOpenChange:c,content:l,onContentChange:u,children:h.jsx(SO,{scope:t,onClose:p.useCallback(()=>c(!1),[c]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};nC.displayName=za;var CO="MenuAnchor",xg=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=_c(n);return h.jsx(bS,{...o,...r,ref:t})});xg.displayName=CO;var Sg="MenuPortal",[bO,rC]=Go(Sg,{forceMount:void 0}),oC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Wo(Sg,t);return h.jsx(bO,{scope:t,forceMount:n,children:h.jsx(Qt,{present:n||i.open,children:h.jsx(La,{asChild:!0,container:o,children:r})})})};oC.displayName=Sg;var sn="MenuContent",[RO,Cg]=Go(sn),iC=p.forwardRef((e,t)=>{const n=rC(sn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Wo(sn,e.__scopeMenu),s=Ba(sn,e.__scopeMenu);return h.jsx(xa.Provider,{scope:e.__scopeMenu,children:h.jsx(Qt,{present:r||i.open,children:h.jsx(xa.Slot,{scope:e.__scopeMenu,children:s.modal?h.jsx(EO,{...o,ref:t}):h.jsx(PO,{...o,ref:t})})})})}),EO=p.forwardRef((e,t)=>{const n=Wo(sn,e.__scopeMenu),r=p.useRef(null),o=qe(t,r);return p.useEffect(()=>{const i=r.current;if(i)return D1(i)},[]),h.jsx(bg,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),PO=p.forwardRef((e,t)=>{const n=Wo(sn,e.__scopeMenu);return h.jsx(bg,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),bg=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:g,disableOutsideScroll:v,...y}=e,x=Wo(sn,n),w=Ba(sn,n),m=_c(n),S=tC(n),C=yO(n),[P,b]=p.useState(null),A=p.useRef(null),M=qe(t,A,x.onContentChange),O=p.useRef(0),R=p.useRef(""),N=p.useRef(0),I=p.useRef(null),$=p.useRef("right"),E=p.useRef(0),k=v?ng:p.Fragment,D=v?{as:un,allowPinchZoom:!0}:void 0,V=j=>{var pe,Me;const B=R.current+j,Q=C().filter(we=>!we.disabled),te=document.activeElement,fe=(pe=Q.find(we=>we.ref.current===te))==null?void 0:pe.textValue,ge=Q.map(we=>we.textValue),z=LO(ge,B,fe),G=(Me=Q.find(we=>we.textValue===z))==null?void 0:Me.ref.current;(function we(tt){R.current=tt,window.clearTimeout(O.current),tt!==""&&(O.current=window.setTimeout(()=>we(""),1e3))})(B),G&&setTimeout(()=>G.focus())};p.useEffect(()=>()=>window.clearTimeout(O.current),[]),_1();const L=p.useCallback(j=>{var Q,te;return $.current===((Q=I.current)==null?void 0:Q.side)&&UO(j,(te=I.current)==null?void 0:te.area)},[]);return h.jsx(RO,{scope:n,searchRef:R,onItemEnter:p.useCallback(j=>{L(j)&&j.preventDefault()},[L]),onItemLeave:p.useCallback(j=>{var B;L(j)||((B=A.current)==null||B.focus(),b(null))},[L]),onTriggerLeave:p.useCallback(j=>{L(j)&&j.preventDefault()},[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:p.useCallback(j=>{I.current=j},[]),children:h.jsx(k,{...D,children:h.jsx(tg,{asChild:!0,trapped:o,onMountAutoFocus:re(i,j=>{var B;j.preventDefault(),(B=A.current)==null||B.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:h.jsx(Fa,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:g,children:h.jsx(XS,{asChild:!0,...S,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:b,onEntryFocus:re(l,j=>{w.isUsingKeyboardRef.current||j.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(RS,{role:"menu","aria-orientation":"vertical","data-state":SC(x.open),"data-radix-menu-content":"",dir:w.dir,...m,...y,ref:M,style:{outline:"none",...y.style},onKeyDown:re(y.onKeyDown,j=>{const Q=j.target.closest("[data-radix-menu-content]")===j.currentTarget,te=j.ctrlKey||j.altKey||j.metaKey,fe=j.key.length===1;Q&&(j.key==="Tab"&&j.preventDefault(),!te&&fe&&V(j.key));const ge=A.current;if(j.target!==ge||!gO.includes(j.key))return;j.preventDefault();const G=C().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);ZS.includes(j.key)&&G.reverse(),DO(G)}),onBlur:re(e.onBlur,j=>{j.currentTarget.contains(j.target)||(window.clearTimeout(O.current),R.current="")}),onPointerMove:re(e.onPointerMove,Sa(j=>{const B=j.target,Q=E.current!==j.clientX;if(j.currentTarget.contains(B)&&Q){const te=j.clientX>E.current?"right":"left";$.current=te,E.current=j.clientX}}))})})})})})})});iC.displayName=sn;var _O="MenuGroup",Rg=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(he.div,{role:"group",...r,ref:t})});Rg.displayName=_O;var MO="MenuLabel",sC=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(he.div,{...r,ref:t})});sC.displayName=MO;var Du="MenuItem",Py="menu.itemSelect",Mc=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=p.useRef(null),s=Ba(Du,e.__scopeMenu),a=Cg(Du,e.__scopeMenu),l=qe(t,i),u=p.useRef(!1),d=()=>{const c=i.current;if(!n&&c){const f=new CustomEvent(Py,{bubbles:!0,cancelable:!0});c.addEventListener(Py,g=>r==null?void 0:r(g),{once:!0}),eg(c,f),f.defaultPrevented?u.current=!1:s.onClose()}};return h.jsx(aC,{...o,ref:l,disabled:n,onClick:re(e.onClick,d),onPointerDown:c=>{var f;(f=e.onPointerDown)==null||f.call(e,c),u.current=!0},onPointerUp:re(e.onPointerUp,c=>{var f;u.current||(f=c.currentTarget)==null||f.click()}),onKeyDown:re(e.onKeyDown,c=>{const f=a.searchRef.current!=="";n||f&&c.key===" "||wp.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});Mc.displayName=Du;var aC=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Cg(Du,n),a=tC(n),l=p.useRef(null),u=qe(t,l),[d,c]=p.useState(!1),[f,g]=p.useState("");return p.useEffect(()=>{const v=l.current;v&&g((v.textContent??"").trim())},[i.children]),h.jsx(xa.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:h.jsx(JS,{asChild:!0,...a,focusable:!r,children:h.jsx(he.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:re(e.onPointerMove,Sa(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,Sa(v=>s.onItemLeave(v))),onFocus:re(e.onFocus,()=>c(!0)),onBlur:re(e.onBlur,()=>c(!1))})})})}),kO="MenuCheckboxItem",lC=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return h.jsx(pC,{scope:e.__scopeMenu,checked:n,children:h.jsx(Mc,{role:"menuitemcheckbox","aria-checked":Fu(n)?"mixed":n,...o,ref:t,"data-state":Pg(n),onSelect:re(o.onSelect,()=>r==null?void 0:r(Fu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});lC.displayName=kO;var uC="MenuRadioGroup",[TO,AO]=Go(uC,{value:void 0,onValueChange:()=>{}}),cC=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=mt(r);return h.jsx(TO,{scope:e.__scopeMenu,value:n,onValueChange:i,children:h.jsx(Rg,{...o,ref:t})})});cC.displayName=uC;var dC="MenuRadioItem",fC=p.forwardRef((e,t)=>{const{value:n,...r}=e,o=AO(dC,e.__scopeMenu),i=n===o.value;return h.jsx(pC,{scope:e.__scopeMenu,checked:i,children:h.jsx(Mc,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Pg(i),onSelect:re(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});fC.displayName=dC;var Eg="MenuItemIndicator",[pC,NO]=Go(Eg,{checked:!1}),hC=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=NO(Eg,n);return h.jsx(Qt,{present:r||Fu(i.checked)||i.checked===!0,children:h.jsx(he.span,{...o,ref:t,"data-state":Pg(i.checked)})})});hC.displayName=Eg;var jO="MenuSeparator",gC=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(he.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});gC.displayName=jO;var OO="MenuArrow",mC=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=_c(n);return h.jsx(ES,{...o,...r,ref:t})});mC.displayName=OO;var IO="MenuSub",[NF,vC]=Go(IO),Ds="MenuSubTrigger",yC=p.forwardRef((e,t)=>{const n=Wo(Ds,e.__scopeMenu),r=Ba(Ds,e.__scopeMenu),o=vC(Ds,e.__scopeMenu),i=Cg(Ds,e.__scopeMenu),s=p.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=p.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return p.useEffect(()=>d,[d]),p.useEffect(()=>{const c=a.current;return()=>{window.clearTimeout(c),l(null)}},[a,l]),h.jsx(xg,{asChild:!0,...u,children:h.jsx(aC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":SC(n.open),...e,ref:cc(t,o.onTriggerChange),onClick:c=>{var f;(f=e.onClick)==null||f.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,Sa(c=>{i.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:re(e.onPointerLeave,Sa(c=>{var g,v;d();const f=(g=n.content)==null?void 0:g.getBoundingClientRect();if(f){const y=(v=n.content)==null?void 0:v.dataset.side,x=y==="right",w=x?-5:5,m=f[x?"left":"right"],S=f[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:c.clientX+w,y:c.clientY},{x:m,y:f.top},{x:S,y:f.top},{x:S,y:f.bottom},{x:m,y:f.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(c),c.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,c=>{var g;const f=i.searchRef.current!=="";e.disabled||f&&c.key===" "||mO[r.dir].includes(c.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),c.preventDefault())})})})});yC.displayName=Ds;var wC="MenuSubContent",xC=p.forwardRef((e,t)=>{const n=rC(sn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Wo(sn,e.__scopeMenu),s=Ba(sn,e.__scopeMenu),a=vC(wC,e.__scopeMenu),l=p.useRef(null),u=qe(t,l);return h.jsx(xa.Provider,{scope:e.__scopeMenu,children:h.jsx(Qt,{present:r||i.open,children:h.jsx(xa.Slot,{scope:e.__scopeMenu,children:h.jsx(bg,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var c;s.isUsingKeyboardRef.current&&((c=l.current)==null||c.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:re(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:re(e.onKeyDown,d=>{var g;const c=d.currentTarget.contains(d.target),f=vO[s.dir].includes(d.key);c&&f&&(i.onOpenChange(!1),(g=a.trigger)==null||g.focus(),d.preventDefault())})})})})})});xC.displayName=wC;function SC(e){return e?"open":"closed"}function Fu(e){return e==="indeterminate"}function Pg(e){return Fu(e)?"indeterminate":e?"checked":"unchecked"}function DO(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function FO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function LO(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=FO(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function $O(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function UO(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $O(n,t)}function Sa(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zO=nC,BO=xg,VO=oC,HO=iC,KO=Rg,GO=sC,WO=Mc,qO=lC,QO=cC,YO=fC,XO=hC,JO=gC,ZO=mC,eI=yC,tI=xC,_g="DropdownMenu",[nI,jF]=so(_g,[eC]),bt=eC(),[rI,CC]=nI(_g),bC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=bt(t),u=p.useRef(null),[d=!1,c]=Ko({prop:o,defaultProp:i,onChange:s});return h.jsx(rI,{scope:t,triggerId:nr(),triggerRef:u,contentId:nr(),open:d,onOpenChange:c,onOpenToggle:p.useCallback(()=>c(f=>!f),[c]),modal:a,children:h.jsx(zO,{...l,open:d,onOpenChange:c,dir:r,modal:a,children:n})})};bC.displayName=_g;var RC="DropdownMenuTrigger",EC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=CC(RC,n),s=bt(n);return h.jsx(BO,{asChild:!0,...s,children:h.jsx(he.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:cc(t,i.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});EC.displayName=RC;var oI="DropdownMenuPortal",PC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=bt(t);return h.jsx(VO,{...r,...n})};PC.displayName=oI;var _C="DropdownMenuContent",MC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=CC(_C,n),i=bt(n),s=p.useRef(!1);return h.jsx(HO,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(s.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)"}})});MC.displayName=_C;var iI="DropdownMenuGroup",sI=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(KO,{...o,...r,ref:t})});sI.displayName=iI;var aI="DropdownMenuLabel",kC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(GO,{...o,...r,ref:t})});kC.displayName=aI;var lI="DropdownMenuItem",TC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(WO,{...o,...r,ref:t})});TC.displayName=lI;var uI="DropdownMenuCheckboxItem",AC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(qO,{...o,...r,ref:t})});AC.displayName=uI;var cI="DropdownMenuRadioGroup",NC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(QO,{...o,...r,ref:t})});NC.displayName=cI;var dI="DropdownMenuRadioItem",jC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(YO,{...o,...r,ref:t})});jC.displayName=dI;var fI="DropdownMenuItemIndicator",OC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(XO,{...o,...r,ref:t})});OC.displayName=fI;var pI="DropdownMenuSeparator",IC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(JO,{...o,...r,ref:t})});IC.displayName=pI;var hI="DropdownMenuArrow",gI=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(ZO,{...o,...r,ref:t})});gI.displayName=hI;var mI="DropdownMenuSubTrigger",DC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(eI,{...o,...r,ref:t})});DC.displayName=mI;var vI="DropdownMenuSubContent",FC=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return h.jsx(tI,{...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)"}})});FC.displayName=vI;var yI=bC,wI=EC,xI=PC,LC=MC,$C=kC,UC=TC,zC=AC,SI=NC,BC=jC,VC=OC,HC=IC,KC=DC,GC=FC;const Ca=yI,ba=wI,CI=SI,bI=p.forwardRef(({className:e,inset:t,children:n,...r},o)=>h.jsxs(KC,{ref:o,className:q("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,h.jsx(tS,{className:"ml-auto h-4 w-4"})]}));bI.displayName=KC.displayName;const RI=p.forwardRef(({className:e,...t},n)=>h.jsx(GC,{ref:n,className:q("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}));RI.displayName=GC.displayName;const Ji=p.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(xI,{children:h.jsx(LC,{ref:r,sideOffset:t,className:q("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})}));Ji.displayName=LC.displayName;const zt=p.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(UC,{ref:r,className:q("relative flex cursor-default select-none items-center gap-2 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 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));zt.displayName=UC.displayName;const EI=p.forwardRef(({className:e,children:t,checked:n,...r},o)=>h.jsxs(zC,{ref:o,className:q("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(VC,{children:h.jsx(VA,{className:"h-4 w-4"})})}),t]}));EI.displayName=zC.displayName;const xp=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(BC,{ref:r,className:q("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:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(VC,{children:h.jsx(QA,{className:"h-4 w-4 fill-current"})})}),t]}));xp.displayName=BC.displayName;const Mg=p.forwardRef(({className:e,inset:t,...n},r)=>h.jsx($C,{ref:r,className:q("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Mg.displayName=$C.displayName;const kc=p.forwardRef(({className:e,...t},n)=>h.jsx(HC,{ref:n,className:q("-mx-1 my-1 h-px bg-muted",e),...t}));kc.displayName=HC.displayName;var kg="Avatar",[PI,OF]=so(kg),[_I,WC]=PI(kg),qC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=p.useState("idle");return h.jsx(_I,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:h.jsx(he.span,{...r,ref:t})})});qC.displayName=kg;var QC="AvatarImage",YC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=WC(QC,n),a=MI(r,i.referrerPolicy),l=mt(u=>{o(u),s.onImageLoadingStatusChange(u)});return Cn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?h.jsx(he.img,{...i,ref:t,src:r}):null});YC.displayName=QC;var XC="AvatarFallback",JC=p.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=WC(XC,n),[s,a]=p.useState(r===void 0);return p.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?h.jsx(he.span,{...o,ref:t}):null});JC.displayName=XC;function MI(e,t){const[n,r]=p.useState("idle");return Cn(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,s=a=>()=>{o&&r(a)};return r("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var ZC=qC,eb=YC,tb=JC;const nb=p.forwardRef(({className:e,...t},n)=>h.jsx(ZC,{ref:n,className:q("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));nb.displayName=ZC.displayName;const rb=p.forwardRef(({className:e,...t},n)=>h.jsx(eb,{ref:n,className:q("aspect-square h-full w-full",e),...t}));rb.displayName=eb.displayName;const ob=p.forwardRef(({className:e,...t},n)=>h.jsx(tb,{ref:n,className:q("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));ob.displayName=tb.displayName;const ib=({user:e})=>{var n,r,o,i,s,a,l,u;const t=$T(e.name);return h.jsx(nb,{className:"h-8 w-8",children:(r=(n=e.photo)==null?void 0:n[0])!=null&&r.url||(i=(o=e.photo)==null?void 0:o[0])!=null&&i.data?h.jsx(rb,{src:((a=(s=e.photo)==null?void 0:s[0])==null?void 0:a.url)||((u=(l=e.photo)==null?void 0:l[0])==null?void 0:u.data),alt:name}):h.jsx(ob,{className:e.resourceType==="Patient"?"bg-pink-400 text-pink-50":"bg-teal-400 text-teal-50",children:t})})},kI=()=>{const{user:e}=Ho(),t=vx("/"),n=Vo(),r=()=>{var o;(o=n._clearState)==null||o.call(n),location.href=t};return h.jsxs(Ca,{children:[h.jsx(ba,{asChild:!0,children:h.jsxs(Mt,{variant:"ghost",className:"flex items-center h-11",children:[h.jsx(ib,{user:e}),h.jsx("span",{className:"hidden md:block",children:ss(e.name)}),h.jsx(v1,{className:"h-4 w-4 opacity-50"})]})}),h.jsxs(Ji,{align:"end",className:"w-56",children:[h.jsxs(zt,{children:[h.jsx(g2,{}),e.resourceType," profile"]}),h.jsxs(zt,{children:[h.jsx(c2,{}),"Settings"]}),h.jsx(kc,{}),h.jsxs(zt,{onClick:r,children:[h.jsx(s2,{className:"h-4 w-4"}),h.jsx("span",{children:"Log out"})]})]})]})};function TI({title:e}){return h.jsxs("header",{className:"flex h-16 items-center border-b px-4 flex-shrink-0 gap-4",children:[h.jsx($S,{}),e,h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs(Mt,{variant:"ghost",size:"icon",children:[h.jsx(ZT,{className:"h-5 w-5"}),h.jsx("span",{className:"sr-only",children:"Notifications"})]}),h.jsx(kI,{})]})]})}const Lu=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:q("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Lu.displayName="Card";const $u=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:q("flex flex-col space-y-1.5 p-6",e),...t}));$u.displayName="CardHeader";const Uu=p.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:q("font-semibold leading-none tracking-tight",e),...t}));Uu.displayName="CardTitle";const Sp=p.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:q("text-sm text-muted-foreground",e),...t}));Sp.displayName="CardDescription";const Tg=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:q("p-6 pt-0",e),...t}));Tg.displayName="CardContent";const Cp=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:q("flex items-center p-6 pt-0",e),...t}));Cp.displayName="CardFooter";const AI=()=>{const{patient:e,user:t}=Ho();if(!e||t.resourceType==="Patient")return;const n=ss(e.name),r=e.birthDate?new Date().getFullYear()-new Date(e.birthDate).getFullYear():"unknown",o=e.address?FT(e.address):"unknown",i=LT(e.gender);return h.jsxs(Lu,{className:"mx-4 mb-4 shadow-none",children:[h.jsxs($u,{className:"px-4 space-y-0 py-2 border-b flex-row items-center",children:[h.jsx(Uu,{children:"Current Patient"}),h.jsxs(Ca,{children:[h.jsx(ba,{asChild:!0,children:h.jsxs(Mt,{variant:"ghost",className:"h-8 w-8 ml-auto",children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Jh,{className:"h-4 w-4"})]})}),h.jsx(Ji,{align:"start",children:h.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(e.id),children:[h.jsx(Xh,{}),"Copy ID"]})})]})]}),h.jsxs(Tg,{className:"px-4 py-3",children:[h.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[h.jsx(ib,{user:e}),h.jsxs("div",{className:"flex flex-col text-sm",children:[h.jsx("div",{className:" font-medium",children:n}),h.jsxs("div",{className:"text-xs text-muted-foreground",children:[i,", ",r," years old"]})]})]}),h.jsx("div",{className:"text-xs text-muted-foreground",children:o})]})]})},NI=()=>{const{user:e}=Ho(),t=zo();return h.jsxs(LS,{className:"border-r",children:[h.jsx(BS,{className:"h-16 items-center flex-row px-4",children:h.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e.resourceType==="Patient"?"Patient Portal":"Provider EHR"})}),h.jsx(HS,{children:h.jsxs(KS,{children:[h.jsx(fo,{children:h.jsx(po,{asChild:!0,isActive:t.pathname==="/",children:h.jsxs(Ws,{to:"/",children:[h.jsx(o2,{className:"mr-2 h-5 w-5"}),"Dashboard"]})})}),e.resourceType==="Practitioner"&&h.jsxs(h.Fragment,{children:[h.jsx(fo,{children:h.jsxs(po,{children:[h.jsx(v2,{className:"mr-2 h-5 w-5"}),"Patients"]})}),h.jsx(fo,{children:h.jsxs(po,{children:[h.jsx(t2,{className:"mr-2 h-5 w-5"}),"Appointments"]})}),h.jsx(vp,{}),h.jsx(fo,{children:h.jsx(po,{asChild:!0,isActive:t.pathname==="/questionnaires",children:h.jsxs(Ws,{to:"/questionnaires",children:[h.jsx(r2,{className:"mr-2 h-5 w-5"}),"Questionnaires"]})})})]}),h.jsx(fo,{children:h.jsx(po,{asChild:!0,isActive:t.pathname==="/questionnaire-responses",children:h.jsxs(Ws,{to:"/questionnaire-responses",children:[h.jsx(f2,{className:"mr-2 h-5 w-5"}),"Questionnaire Responses"]})})}),h.jsx(vp,{}),h.jsx(fo,{children:h.jsxs(po,{children:[h.jsx(d2,{className:"mr-2 h-5 w-5"}),"Settings"]})})]})}),h.jsx(VS,{children:h.jsx(AI,{})}),h.jsx(US,{})]})},sb=e=>h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 150",...e,children:h.jsx("path",{fill:"none",stroke:"#EA4A35",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"300 385",strokeDashoffset:"0",d:"M275 75c0 31-27 50-50 50-58 0-92-100-150-100-28 0-50 22-50 50s23 50 50 50c58 0 92-100 150-100 24 0 50 19 50 50Z",children:h.jsx("animate",{attributeName:"stroke-dashoffset",calcMode:"spline",dur:"2",values:"685;-685",keySplines:"0 0 1 1",repeatCount:"indefinite"})})}),Ag=()=>h.jsx("div",{className:"flex-1 grid place-items-center",children:h.jsx(sb,{width:"80"})}),jI=()=>h.jsx(tT,{children:h.jsx(rT,{children:h.jsx(FS,{style:{"--sidebar-width":"18rem"},children:h.jsx("div",{className:"flex h-screen flex-col w-full",children:h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsx(NI,{}),h.jsxs(zS,{className:"flex-1",children:[h.jsx(TI,{}),h.jsx(p.Suspense,{fallback:h.jsx(Ag,{}),children:h.jsx(Rx,{})})]})]})})})})});/** + * 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 Lr(e,t){return typeof e=="function"?e(t):e}function Gt(e,t){return n=>{t.setState(r=>({...r,[e]:Lr(n,r[e])}))}}function Tc(e){return e instanceof Function}function OI(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function II(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function le(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((d,c)=>r[c]!==d)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-s)*100)/100,c=Math.round((Date.now()-u)*100)/100,f=c/16,g=(v,y)=>{for(v=String(v);v.length{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function DI(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:le(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ue(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function FI(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=f=>{let g=f;for(const y of l.split(".")){var v;g=(v=g)==null?void 0:v[y]}return g}:d=f=>f[a.accessorKey]),!u)throw new Error;let c={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:le(()=>[!0],()=>{var f;return[c,...(f=c.columns)==null?void 0:f.flatMap(g=>g.getFlatColumns())]},ue(e.options,"debugColumns")),getLeafColumns:le(()=>[e._getOrderColumnsFn()],f=>{var g;if((g=c.columns)!=null&&g.length){let v=c.columns.flatMap(y=>y.getLeafColumns());return f(v)}return[c]},ue(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(c,e);return c}const ft="debugHeaders";function _y(e,t,n){var r;let i={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 s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const LI={createTable:e=>{e.getHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?s:[],u=n.filter(c=>!(r!=null&&r.includes(c.id))&&!(o!=null&&o.includes(c.id)));return Rl(t,[...a,...u,...l],e)},ue(e.options,ft)),e.getCenterHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),Rl(t,n,e,"center")),ue(e.options,ft)),e.getLeftHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Rl(t,i,e,"left")},ue(e.options,ft)),e.getRightHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return Rl(t,i,e,"right")},ue(e.options,ft)),e.getFooterGroups=le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getLeftFooterGroups=le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getCenterFooterGroups=le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getRightFooterGroups=le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getFlatHeaders=le(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getLeftFlatHeaders=le(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterFlatHeaders=le(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getRightFlatHeaders=le(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterLeafHeaders=le(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeftLeafHeaders=le(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getRightLeafHeaders=le(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeafHeaders=le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},ue(e.options,ft))}};function Rl(e,t,n,r){var o,i;let s=0;const a=function(f,g){g===void 0&&(g=1),s=Math.max(s,g),f.filter(v=>v.getIsVisible()).forEach(v=>{var y;(y=v.columns)!=null&&y.length&&a(v.columns,g+1)},0)};a(e);let l=[];const u=(f,g)=>{const v={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},y=[];f.forEach(x=>{const w=[...y].reverse()[0],m=x.column.depth===v.depth;let S,C=!1;if(m&&x.column.parent?S=x.column.parent:(S=x.column,C=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(x);else{const P=_y(n,S,{id:[r,g,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${y.filter(b=>b.column===S).length}`:void 0,depth:g,index:y.length});P.subHeaders.push(x),y.push(P)}v.headers.push(x),x.headerGroup=v}),l.push(v),g>0&&u(y,g-1)},d=t.map((f,g)=>_y(n,f,{depth:s,index:g}));u(d,s-1),l.reverse();const c=f=>f.filter(v=>v.column.getIsVisible()).map(v=>{let y=0,x=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],c(v.subHeaders).forEach(S=>{let{colSpan:C,rowSpan:P}=S;y+=C,w.push(P)})):y=1;const m=Math.min(...w);return x=x+m,v.colSpan=y,v.rowSpan=x,{colSpan:y,rowSpan:x}});return c((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const $I=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>II(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:le(()=>[e.getAllLeafColumns()],l=>l.map(u=>DI(e,a,u,u.id)),ue(e.options,"debugRows")),_getAllCellsByColumnId:le(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),ue(e.options,"debugRows"))};for(let l=0;l{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()}}},ab=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};ab.autoRemove=e=>xn(e);const lb=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};lb.autoRemove=e=>xn(e);const ub=(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())};ub.autoRemove=e=>xn(e);const cb=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};cb.autoRemove=e=>xn(e)||!(e!=null&&e.length);const db=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});db.autoRemove=e=>xn(e)||!(e!=null&&e.length);const fb=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});fb.autoRemove=e=>xn(e)||!(e!=null&&e.length);const pb=(e,t,n)=>e.getValue(t)===n;pb.autoRemove=e=>xn(e);const hb=(e,t,n)=>e.getValue(t)==n;hb.autoRemove=e=>xn(e);const Ng=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Ng.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Ng.autoRemove=e=>xn(e)||xn(e[0])&&xn(e[1]);const qn={includesString:ab,includesStringSensitive:lb,equalsString:ub,arrIncludes:cb,arrIncludesAll:db,arrIncludesSome:fb,equals:pb,weakEquals:hb,inNumberRange:Ng};function xn(e){return e==null||e===""}const zI={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Gt("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"?qn.includesString:typeof r=="number"?qn.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?qn.equals:Array.isArray(r)?qn.arrIncludes:qn.weakEquals},e.getFilterFn=()=>{var n,r;return Tc(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:qn[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(),i=r==null?void 0:r.find(d=>d.id===e.id),s=Lr(n,i?i.value:void 0);if(My(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Lr(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(My(l,s.value,a))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 My(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const BI=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),VI=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},HI=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r=i)&&(r=i)}),r},KI=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},WI=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!OI(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},qI=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),QI=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,YI=(e,t)=>t.length,Nd={sum:BI,min:VI,max:HI,extent:KI,mean:GI,median:WI,unique:qI,uniqueCount:QI,count:YI},XI={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:Gt("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 Nd.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Nd.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Tc(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:Nd[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 JI(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const ZI={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Gt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=le(n=>[Ys(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Ys(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Ys(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 i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return JI(i,n,r)},ue(e.options,"debugTable"))}},jd=()=>({left:[],right:[]}),eD={getInitialState:e=>({columnPinning:jd(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Gt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(c=>!(r!=null&&r.includes(c))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(c=>!(r!=null&&r.includes(c))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(c=>!(r!=null&&r.includes(c))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(c=>!(r!=null&&r.includes(c)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(c=>!(r!=null&&r.includes(c))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(c=>!(r!=null&&r.includes(c)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"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 i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows")),e.getLeftVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows")),e.getRightVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(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?jd():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:jd())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.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),ue(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),ue(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(i=>!o.includes(i.id))},ue(e.options,"debugColumns"))}},El={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Od=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),tD={getDefaultColumnDef:()=>El,getInitialState:e=>({columnSizing:{},columnSizingInfo:Od(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Gt("columnSizing",e),onColumnSizingInfoChange:Gt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:El.minSize,(r=i??e.columnDef.size)!=null?r:El.size),(o=e.columnDef.maxSize)!=null?o:El.maxSize)},e.getStart=le(n=>[n,Ys(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns")),e.getAfter=le(n=>[n,Ys(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(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 i;n+=(i=o.column.getSize())!=null?i: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 i=>{if(!r||!o||(i.persist==null||i.persist(),Id(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Id(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(w,m)=>{typeof m=="number"&&(t.setColumnSizingInfo(S=>{var C,P;const b=t.options.columnResizeDirection==="rtl"?-1:1,A=(m-((C=S==null?void 0:S.startOffset)!=null?C:0))*b,M=Math.max(A/((P=S==null?void 0:S.startSize)!=null?P:0),-.999999);return S.columnSizingStart.forEach(O=>{let[R,N]=O;u[R]=Math.round(Math.max(N+N*M,0)*100)/100}),{...S,deltaOffset:A,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...u})))},c=w=>d("move",w),f=w=>{d("end",w),t.setColumnSizingInfo(m=>({...m,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,v={moveHandler:w=>c(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",v.moveHandler),g==null||g.removeEventListener("mouseup",v.upHandler),f(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),c(w.touches[0].clientX),!1),upHandler:w=>{var m;g==null||g.removeEventListener("touchmove",y.moveHandler),g==null||g.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((m=w.touches[0])==null?void 0:m.clientX)}},x=nD()?{passive:!1}:!1;Id(i)?(g==null||g.addEventListener("touchmove",y.moveHandler,x),g==null||g.addEventListener("touchend",y.upHandler,x)):(g==null||g.addEventListener("mousemove",v.moveHandler,x),g==null||g.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,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?Od():(n=e.initialState.columnSizingInfo)!=null?n:Od())},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 Pl=null;function nD(){if(typeof Pl=="boolean")return Pl;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 Pl=e,Pl}function Id(e){return e.type==="touchstart"}const rD={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Gt("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(i=>i.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()),ue(t.options,"debugRows")),e.getVisibleCells=le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>le(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(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,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.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 Ys(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const oD={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()}}},iD={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Gt("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,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Tc(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:qn[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},sD={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Gt("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,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.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(i=>{const s=i.split(".");r=Math.max(r,s.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 i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}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()}}}},bp=0,Rp=10,Dd=()=>({pageIndex:bp,pageSize:Rp}),aD={getInitialState:e=>({...e,pagination:{...Dd(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Gt("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=i=>Lr(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Dd():(o=e.initialState.pagination)!=null?o:Dd())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Lr(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?bp:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:bp)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Rp:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Rp)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Lr(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Lr(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=le(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(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}}},Fd=()=>({top:[],bottom:[]}),lD={getInitialState:e=>({rowPinning:Fd(),...e}),getDefaultOptions:e=>({onRowPinningChange:Gt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,d;if(n==="bottom"){var c,f;return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var g,v;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(y=>!(a!=null&&a.has(y)))}})},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,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.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?Fd():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Fd())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows")),e.getBottomRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(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(i=>!o.has(i.id))},ue(e.options,"debugRows"))}},uD={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Gt("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(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Ep(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ld(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getFilteredSelectedRowModel=le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ld(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getGroupedSelectedRowModel=le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ld(e,n):{rows:[],flatRows:[],rowsById:{}},ue(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(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Ep(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return jg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Pp(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Pp(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)}}}},Ep=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Ep(e,a.id,n,r,o))};function Ld(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=jg(l,n);if(d&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function jg(e,t){var n;return(n=t[e.id])!=null?n:!1}function Pp(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(jg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Pp(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const _p=/([0-9]+)/gm,cD=(e,t,n)=>gb(eo(e.getValue(n)).toLowerCase(),eo(t.getValue(n)).toLowerCase()),dD=(e,t,n)=>gb(eo(e.getValue(n)),eo(t.getValue(n))),fD=(e,t,n)=>Og(eo(e.getValue(n)).toLowerCase(),eo(t.getValue(n)).toLowerCase()),pD=(e,t,n)=>Og(eo(e.getValue(n)),eo(t.getValue(n))),hD=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:rOg(e.getValue(n),t.getValue(n));function Og(e,t){return e===t?0:e>t?1:-1}function eo(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function gb(e,t){const n=e.split(_p).filter(Boolean),r=t.split(_p).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ms={alphanumeric:cD,alphanumericCaseSensitive:dD,text:fD,textCaseSensitive:pD,datetime:hD,basic:gD},mD={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Gt("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 i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ms.datetime;if(typeof i=="string"&&(r=!0,i.split(_p).length>1))return Ms.alphanumeric}return r?Ms.text:Ms.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 Tc(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:Ms[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let u=[],d,c=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var f;u=[...s,{id:e.id,desc:c}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=s.map(g=>g.id===e.id?{...g,desc:c}:g):d==="remove"?u=s.filter(g=>g.id!==e.id):u=[{id:e.id,desc:c}];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 i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},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())}},vD=[LI,rD,ZI,eD,UI,zI,oD,iD,mD,XI,sD,aD,lD,uD,tD];function yD(e){var t,n;const r=[...vD,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,g)=>Object.assign(f,g.getDefaultOptions==null?void 0:g.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var g;l=(g=f.getInitialState==null?void 0:f.getInitialState(l))!=null?g:l});const u=[];let d=!1;const c={_features:r,options:{...i,...e},initialState:l,_queue:f=>{u.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const g=Lr(f,o.options);o.options=s(g)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,g,v)=>{var y;return(y=o.options.getRowId==null?void 0:o.options.getRowId(f,g,v))!=null?y:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,g)=>{let v=(g?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!v&&(v=o.getCoreRowModel().rowsById[f],!v))throw new Error;return v},_getDefaultColumnDef:le(()=>[o.options.defaultColumn],f=>{var g;return f=(g=f)!=null?g:{},{header:v=>{const y=v.header.column.columnDef;return y.accessorKey?y.accessorKey:y.accessorFn?y.id:null},cell:v=>{var y,x;return(y=(x=v.renderValue())==null||x.toString==null?void 0:x.toString())!=null?y:null},...o._features.reduce((v,y)=>Object.assign(v,y.getDefaultColumnDef==null?void 0:y.getDefaultColumnDef()),{}),...f}},ue(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:le(()=>[o._getColumnDefs()],f=>{const g=function(v,y,x){return x===void 0&&(x=0),v.map(w=>{const m=FI(o,w,x,y),S=w;return m.columns=S.columns?g(S.columns,m,x+1):[],m})};return g(f)},ue(e,"debugColumns")),getAllFlatColumns:le(()=>[o.getAllColumns()],f=>f.flatMap(g=>g.getFlatColumns()),ue(e,"debugColumns")),_getAllFlatColumnsById:le(()=>[o.getAllFlatColumns()],f=>f.reduce((g,v)=>(g[v.id]=v,g),{}),ue(e,"debugColumns")),getAllLeafColumns:le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,g)=>{let v=f.flatMap(y=>y.getLeafColumns());return g(v)},ue(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,c);for(let f=0;fle(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;ue._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 ky(e,t){return e?xD(e)?p.createElement(e,t):e:null}function xD(e){return SD(e)||typeof e=="function"||CD(e)}function SD(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function CD(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function bD(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:yD(t)})),[r,o]=p.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const mb=p.forwardRef(({className:e,...t},n)=>h.jsx("div",{className:"relative w-full overflow-auto",children:h.jsx("table",{ref:n,className:q("w-full caption-bottom text-sm",e),...t})}));mb.displayName="Table";const vb=p.forwardRef(({className:e,...t},n)=>h.jsx("thead",{ref:n,className:q("[&_tr]:border-b",e),...t}));vb.displayName="TableHeader";const yb=p.forwardRef(({className:e,...t},n)=>h.jsx("tbody",{ref:n,className:q("[&_tr:last-child]:border-0",e),...t}));yb.displayName="TableBody";const RD=p.forwardRef(({className:e,...t},n)=>h.jsx("tfoot",{ref:n,className:q("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));RD.displayName="TableFooter";const Wl=p.forwardRef(({className:e,...t},n)=>h.jsx("tr",{ref:n,className:q("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Wl.displayName="TableRow";const wb=p.forwardRef(({className:e,...t},n)=>h.jsx("th",{ref:n,className:q("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));wb.displayName="TableHead";const Mp=p.forwardRef(({className:e,...t},n)=>h.jsx("td",{ref:n,className:q("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));Mp.displayName="TableCell";const ED=p.forwardRef(({className:e,...t},n)=>h.jsx("caption",{ref:n,className:q("mt-4 text-sm text-muted-foreground",e),...t}));ED.displayName="TableCaption";const xb=({columns:e,data:t})=>{var r;const n=bD({data:t,columns:e,getCoreRowModel:wD()});return h.jsx("div",{className:"rounded-md border",children:h.jsxs(mb,{children:[h.jsx(vb,{children:n.getHeaderGroups().map(o=>h.jsx(Wl,{children:o.headers.map(i=>h.jsx(wb,{children:i.isPlaceholder?null:ky(i.column.columnDef.header,i.getContext())},i.id))},o.id))}),h.jsx(yb,{children:(r=n.getRowModel().rows)!=null&&r.length?n.getRowModel().rows.map(o=>h.jsx(Wl,{"data-state":o.getIsSelected()&&"selected",children:o.getVisibleCells().map(i=>h.jsx(Mp,{children:ky(i.column.columnDef.cell,i.getContext())},i.id))},o.id)):h.jsx(Wl,{children:h.jsx(Mp,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})},Sb=J1,PD=Z1,Cb=p.forwardRef(({className:e,...t},n)=>h.jsx(fc,{ref:n,className:q("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Cb.displayName=fc.displayName;const Ig=p.forwardRef(({className:e,children:t,...n},r)=>h.jsxs(PD,{children:[h.jsx(Cb,{}),h.jsxs(pc,{ref:r,className:q("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,h.jsxs(eS,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[h.jsx(ag,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Ig.displayName=pc.displayName;const Dg=({className:e,...t})=>h.jsx("div",{className:q("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Dg.displayName="DialogHeader";const Fg=p.forwardRef(({className:e,...t},n)=>h.jsx(hc,{ref:n,className:q("text-lg font-semibold leading-none tracking-tight",e),...t}));Fg.displayName=hc.displayName;const _D=p.forwardRef(({className:e,...t},n)=>h.jsx(gc,{ref:n,className:q("text-sm text-muted-foreground",e),...t}));_D.displayName=gc.displayName;const MD=3,kD=1e6;let $d=0;function TD(){return $d=($d+1)%Number.MAX_SAFE_INTEGER,$d.toString()}const Ud=new Map,Ty=e=>{if(Ud.has(e))return;const t=setTimeout(()=>{Ud.delete(e),Xs({type:"REMOVE_TOAST",toastId:e})},kD);Ud.set(e,t)},AD=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,MD)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Ty(n):e.toasts.forEach(r=>{Ty(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ql=[];let Ql={toasts:[]};function Xs(e){Ql=AD(Ql,e),ql.forEach(t=>{t(Ql)})}function ND({...e}){const t=TD(),n=o=>Xs({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>Xs({type:"DISMISS_TOAST",toastId:t});return Xs({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function cs(){const[e,t]=p.useState(Ql);return p.useEffect(()=>(ql.push(t),()=>{const n=ql.indexOf(t);n>-1&&ql.splice(n,1)}),[e]),{...e,toast:ND,dismiss:n=>Xs({type:"DISMISS_TOAST",toastId:n})}}const Lg=e=>{var r;const[,t]=p.useState(!1),n=p.useRef(null);if((r=n.current)!=null&&r.promise)throw n.current.promise;p.useLayoutEffect(()=>{n.current===null&&(n.current={},n.current.promise=new Promise(o=>{n.current.resolve=o}),t(!0))},[]),p.useEffect(()=>{const o=e.current;if(o){const i=()=>{setTimeout(()=>{var s;(s=n.current)==null||s.resolve(),n.current.promise=null},300)};return o.addEventListener("ready",i),()=>{o.removeEventListener("ready",i)}}},[])},jD=({id:e})=>{const t=p.useRef(),n=Vo(),{data:r}=Qr({queryKey:["questionnaire",e],queryFn:()=>Yh(n,e)}),{toast:o}=cs();return p.useEffect(()=>{const i=t.current,s=a=>{(a.detail.status==="completed"||a.detail.status==="amended")&&o({title:"Not saved",description:"This is a preview, changes will not be saved"})};return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),Lg(t),h.jsx("aidbox-form-renderer",{ref:t,questionnaire:JSON.stringify(r),style:{width:"100%",height:"100%",border:"none",flex:1}})},bb=({className:e,...t})=>h.jsx("nav",{role:"navigation","aria-label":"pagination",className:q("mx-auto flex w-full justify-center",e),...t});bb.displayName="Pagination";const Rb=p.forwardRef(({className:e,...t},n)=>h.jsx("ul",{ref:n,className:q("flex flex-row items-center gap-1",e),...t}));Rb.displayName="PaginationContent";const Tn=p.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,className:q("",e),...t}));Tn.displayName="PaginationItem";const Rr=({className:e,isActive:t,size:n="icon",...r})=>h.jsx(Ws,{"aria-current":t?"page":void 0,className:q(w1({variant:t?"outline":"ghost",size:n}),e),...r});Rr.displayName="PaginationLink";const Eb=({className:e,...t})=>h.jsxs(Rr,{"aria-label":"Go to previous page",size:"default",className:q("gap-1 pl-2.5",e),...t,children:[h.jsx(KA,{className:"h-4 w-4"}),h.jsx("span",{children:"Previous"})]});Eb.displayName="PaginationPrevious";const Pb=({className:e,...t})=>h.jsxs(Rr,{"aria-label":"Go to next page",size:"default",className:q("gap-1 pr-2.5",e),...t,children:[h.jsx("span",{children:"Next"}),h.jsx(tS,{className:"h-4 w-4"})]});Pb.displayName="PaginationNext";const kp=({className:e,...t})=>h.jsxs("span",{"aria-hidden":!0,className:q("flex h-9 w-9 items-center justify-center",e),...t,children:[h.jsx(XA,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"More pages"})]});kp.displayName="PaginationEllipsis";const _b=({currentPage:e,totalPages:t})=>{const[n]=ac(),r=i=>(n.set("page",i),`?${n}`);if(t<=1)return null;const o=UT(e,t);return h.jsx(bb,{className:"mt-4",children:h.jsxs(Rb,{children:[o.prevButtonEnabled&&h.jsx(Tn,{children:h.jsx(Eb,{to:r(e-1)})}),o.showFirstPageButton&&h.jsx(Tn,{children:h.jsx(Rr,{to:r(1),children:1})}),o.showFirstEllipsis&&h.jsx(Tn,{children:h.jsx(kp,{})}),o.pagesBeforeCurrent.map(i=>h.jsx(Tn,{children:h.jsx(Rr,{to:r(i),children:i})},i)),h.jsx(Tn,{children:h.jsx(Rr,{isActive:!0,children:e})}),o.pagesAfterCurrent.map(i=>h.jsx(Tn,{children:h.jsx(Rr,{to:r(i),children:i})},i)),o.showLastEllipsis&&h.jsx(Tn,{children:h.jsx(kp,{})}),o.showLastPageButton&&h.jsx(Tn,{children:h.jsx(Rr,{to:r(t),children:t})}),o.nextButtonEnabled&&h.jsx(Tn,{children:h.jsx(Pb,{to:r(e+1)})})]})})};var $g="ToastProvider",[Ug,OD,ID]=yg("Toast"),[Mb,IF]=so("Toast",[ID]),[DD,Ac]=Mb($g),kb=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=p.useState(null),[u,d]=p.useState(0),c=p.useRef(!1),f=p.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${$g}\`. Expected non-empty \`string\`.`),h.jsx(Ug.Provider,{scope:t,children:h.jsx(DD,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:p.useCallback(()=>d(g=>g+1),[]),onToastRemove:p.useCallback(()=>d(g=>g-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:f,children:s})})};kb.displayName=$g;var Tb="ToastViewport",FD=["F8"],Tp="toast.viewportPause",Ap="toast.viewportResume",Ab=p.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=FD,label:o="Notifications ({hotkey})",...i}=e,s=Ac(Tb,n),a=OD(n),l=p.useRef(null),u=p.useRef(null),d=p.useRef(null),c=p.useRef(null),f=qe(t,c,s.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=s.toastCount>0;p.useEffect(()=>{const x=w=>{var S;r.length!==0&&r.every(C=>w[C]||w.code===C)&&((S=c.current)==null||S.focus())};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),p.useEffect(()=>{const x=l.current,w=c.current;if(v&&x&&w){const m=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(Tp);w.dispatchEvent(b),s.isClosePausedRef.current=!0}},S=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(Ap);w.dispatchEvent(b),s.isClosePausedRef.current=!1}},C=b=>{!x.contains(b.relatedTarget)&&S()},P=()=>{x.contains(document.activeElement)||S()};return x.addEventListener("focusin",m),x.addEventListener("focusout",C),x.addEventListener("pointermove",m),x.addEventListener("pointerleave",P),window.addEventListener("blur",m),window.addEventListener("focus",S),()=>{x.removeEventListener("focusin",m),x.removeEventListener("focusout",C),x.removeEventListener("pointermove",m),x.removeEventListener("pointerleave",P),window.removeEventListener("blur",m),window.removeEventListener("focus",S)}}},[v,s.isClosePausedRef]);const y=p.useCallback(({tabbingDirection:x})=>{const m=a().map(S=>{const C=S.ref.current,P=[C,...YD(C)];return x==="forwards"?P:P.reverse()});return(x==="forwards"?m.reverse():m).flat()},[a]);return p.useEffect(()=>{const x=c.current;if(x){const w=m=>{var P,b,A;const S=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!S){const M=document.activeElement,O=m.shiftKey;if(m.target===x&&O){(P=u.current)==null||P.focus();return}const I=y({tabbingDirection:O?"backwards":"forwards"}),$=I.findIndex(E=>E===M);zd(I.slice($+1))?m.preventDefault():O?(b=u.current)==null||b.focus():(A=d.current)==null||A.focus()}};return x.addEventListener("keydown",w),()=>x.removeEventListener("keydown",w)}},[a,y]),h.jsxs(D2,{ref:l,role:"region","aria-label":o.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&h.jsx(Np,{ref:u,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"forwards"});zd(x)}}),h.jsx(Ug.Slot,{scope:n,children:h.jsx(he.ol,{tabIndex:-1,...i,ref:f})}),v&&h.jsx(Np,{ref:d,onFocusFromOutsideViewport:()=>{const x=y({tabbingDirection:"backwards"});zd(x)}})]})});Ab.displayName=Tb;var Nb="ToastFocusProxy",Np=p.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=Ac(Nb,n);return h.jsx(xc,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});Np.displayName=Nb;var Nc="Toast",LD="toast.swipeStart",$D="toast.swipeMove",UD="toast.swipeCancel",zD="toast.swipeEnd",jb=p.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,l]=Ko({prop:r,defaultProp:o,onChange:i});return h.jsx(Qt,{present:n||a,children:h.jsx(HD,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:mt(e.onPause),onResume:mt(e.onResume),onSwipeStart:re(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:re(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:re(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:re(e.onSwipeEnd,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});jb.displayName=Nc;var[BD,VD]=Mb(Nc,{onClose(){}}),HD=p.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:f,onSwipeEnd:g,...v}=e,y=Ac(Nc,n),[x,w]=p.useState(null),m=qe(t,E=>w(E)),S=p.useRef(null),C=p.useRef(null),P=o||y.duration,b=p.useRef(0),A=p.useRef(P),M=p.useRef(0),{onToastAdd:O,onToastRemove:R}=y,N=mt(()=>{var k;(x==null?void 0:x.contains(document.activeElement))&&((k=y.viewport)==null||k.focus()),s()}),I=p.useCallback(E=>{!E||E===1/0||(window.clearTimeout(M.current),b.current=new Date().getTime(),M.current=window.setTimeout(N,E))},[N]);p.useEffect(()=>{const E=y.viewport;if(E){const k=()=>{I(A.current),u==null||u()},D=()=>{const V=new Date().getTime()-b.current;A.current=A.current-V,window.clearTimeout(M.current),l==null||l()};return E.addEventListener(Tp,D),E.addEventListener(Ap,k),()=>{E.removeEventListener(Tp,D),E.removeEventListener(Ap,k)}}},[y.viewport,P,l,u,I]),p.useEffect(()=>{i&&!y.isClosePausedRef.current&&I(P)},[i,P,y.isClosePausedRef,I]),p.useEffect(()=>(O(),()=>R()),[O,R]);const $=p.useMemo(()=>x?Ub(x):null,[x]);return y.viewport?h.jsxs(h.Fragment,{children:[$&&h.jsx(KD,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:$}),h.jsx(BD,{scope:n,onClose:N,children:ns.createPortal(h.jsx(Ug.ItemSlot,{scope:n,children:h.jsx(I2,{asChild:!0,onEscapeKeyDown:re(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||N(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:h.jsx(he.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...v,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:re(e.onKeyDown,E=>{E.key==="Escape"&&(a==null||a(E.nativeEvent),E.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:re(e.onPointerDown,E=>{E.button===0&&(S.current={x:E.clientX,y:E.clientY})}),onPointerMove:re(e.onPointerMove,E=>{if(!S.current)return;const k=E.clientX-S.current.x,D=E.clientY-S.current.y,V=!!C.current,L=["left","right"].includes(y.swipeDirection),j=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,B=L?j(0,k):0,Q=L?0:j(0,D),te=E.pointerType==="touch"?10:2,fe={x:B,y:Q},ge={originalEvent:E,delta:fe};V?(C.current=fe,_l($D,c,ge,{discrete:!1})):Ay(fe,y.swipeDirection,te)?(C.current=fe,_l(LD,d,ge,{discrete:!1}),E.target.setPointerCapture(E.pointerId)):(Math.abs(k)>te||Math.abs(D)>te)&&(S.current=null)}),onPointerUp:re(e.onPointerUp,E=>{const k=C.current,D=E.target;if(D.hasPointerCapture(E.pointerId)&&D.releasePointerCapture(E.pointerId),C.current=null,S.current=null,k){const V=E.currentTarget,L={originalEvent:E,delta:k};Ay(k,y.swipeDirection,y.swipeThreshold)?_l(zD,g,L,{discrete:!0}):_l(UD,f,L,{discrete:!0}),V.addEventListener("click",j=>j.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),KD=e=>{const{__scopeToast:t,children:n,...r}=e,o=Ac(Nc,t),[i,s]=p.useState(!1),[a,l]=p.useState(!1);return qD(()=>s(!0)),p.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:h.jsx(La,{asChild:!0,children:h.jsx(xc,{...r,children:i&&h.jsxs(h.Fragment,{children:[o.label," ",n]})})})},GD="ToastTitle",Ob=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return h.jsx(he.div,{...r,ref:t})});Ob.displayName=GD;var WD="ToastDescription",Ib=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return h.jsx(he.div,{...r,ref:t})});Ib.displayName=WD;var Db="ToastAction",Fb=p.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?h.jsx($b,{altText:n,asChild:!0,children:h.jsx(zg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Db}\`. Expected non-empty \`string\`.`),null)});Fb.displayName=Db;var Lb="ToastClose",zg=p.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=VD(Lb,n);return h.jsx($b,{asChild:!0,children:h.jsx(he.button,{type:"button",...r,ref:t,onClick:re(e.onClick,o.onClose)})})});zg.displayName=Lb;var $b=p.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return h.jsx(he.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Ub(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),QD(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Ub(r))}}),t}function _l(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?eg(o,i):o.dispatchEvent(i)}var Ay=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function qD(e=()=>{}){const t=mt(e);Cn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function QD(e){return e.nodeType===e.ELEMENT_NODE}function YD(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 zd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var XD=kb,zb=Ab,Bb=jb,Vb=Ob,Hb=Ib,Kb=Fb,Gb=zg;const JD=XD,Wb=p.forwardRef(({className:e,...t},n)=>h.jsx(zb,{ref:n,className:q("fixed top-0 left-1/2 -translate-x-1/2 z-[100] gap-2 flex max-h-screen w-full flex-col-reverse p-4 md:max-w-[420px]",e),...t}));Wb.displayName=zb.displayName;const ZD=Da("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-top-full data-[state=open]:slide-in-from-top-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),qb=p.forwardRef(({className:e,variant:t,...n},r)=>h.jsx(Bb,{ref:r,className:q(ZD({variant:t}),e),...n}));qb.displayName=Bb.displayName;const Qb=p.forwardRef(({className:e,...t},n)=>h.jsx(Kb,{ref:n,className:q("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));Qb.displayName=Kb.displayName;const Yb=p.forwardRef(({className:e,...t},n)=>h.jsx(Gb,{ref:n,className:q("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:h.jsx(ag,{className:"h-4 w-4"})}));Yb.displayName=Gb.displayName;const Xb=p.forwardRef(({className:e,...t},n)=>h.jsx(Vb,{ref:n,className:q("text-sm font-semibold [&+div]:text-xs",e),...t}));Xb.displayName=Vb.displayName;const Jb=p.forwardRef(({className:e,...t},n)=>h.jsx(Hb,{ref:n,className:q("text-sm opacity-90",e),...t}));Jb.displayName=Hb.displayName;const eF=()=>{var M;const e=uc(),[t,n]=ac();console.log(t.toString());const{user:r,patient:o,encounter:i}=Ho(),s=Vo(),{toast:a}=cs(),l=Ia(),u=Number(t.get("page"))||1,d=15,c=t.get("source")||"library",f=O=>{t.set("source",O),n(t)},g=["questionnaires",c,u],v=["questionnaires","ehr",1],{data:y}=Qr({queryKey:g,queryFn:()=>c==="library"?Zn.request(`Questionnaire?_count=${d}&page=${u}`):s.request(`Questionnaire?_count=${d}&_getpagesoffset=${d*(u-1)}`)}),x=Qs({mutationFn:VT,onSuccess:O=>{a({title:"Response created",description:`New response created for ${ss(o.name)}`}),l(`/questionnaire-responses/${O.id}`)}}),w=Qs({mutationFn:O=>f1(s,O),onMutate:async O=>{await e.cancelQueries({queryKey:v});const R=e.getQueryData(v);return e.setQueryData(v,N=>({...N,entry:[{resource:O},...(N==null?void 0:N.entry)||[]]})),l("?source=ehr&page=1"),{previousData:R}},onSuccess:async(O,R,N)=>{var I;await e.cancelQueries({queryKey:v}),e.setQueryData(v,{...N.previousData,entry:[{resource:O},...((I=N.previousData)==null?void 0:I.entry)||[]]}),a({title:"Questionnaire imported",description:"Questionnaire imported successfully",action:h.jsx(Qb,{altText:"Edit",onClick:()=>{l(`/questionnaires/${O.id}`)},children:"Edit"})})},onError:(O,R,N)=>{e.setQueryData(v,N.previousData),a({variant:"destructive",title:"Import questionnaire",description:`Unable to import questionnaire: ${O.message}`})},onSettled:()=>{e.invalidateQueries({queryKey:v})}}),m=Qs({mutationFn:O=>BT(s,O),onMutate:async O=>{await e.cancelQueries({queryKey:g});const R=e.getQueryData(g);return e.setQueryData(g,N=>{var I;return{...N,entry:(I=N.entry)==null?void 0:I.filter($=>$.resource.id!==O.id)}}),{previousData:R}},onSuccess:()=>{a({title:"Questionnaire deleted",description:"Questionnaire deleted successfully"})},onError:(O,R,N)=>{e.setQueryData(g,N.previousData),a({variant:"destructive",title:"Delete questionnaire",description:`Unable to delete questionnaire: ${O.message}`})},onSettled:()=>{e.invalidateQueries({queryKey:g})}}),S=Math.ceil(y.total/d),C=((M=y.entry)==null?void 0:M.map(O=>({publisher:c==="library"?"Health Samurai":void 0,...O.resource})))||[],[P,b]=p.useState(null),A=[{accessorKey:"title",header:"Title"},{accessorKey:"status",header:"Status"},{accessorKey:"version",header:"Version"},{accessorKey:"publisher",header:"Publisher"},{id:"actions",cell:({row:{original:O}})=>{const R=x.isPending&&x.variables.questionnaire.id===O.id||O.id===void 0;return R?h.jsx(sb,{className:"h-4 my-2"}):h.jsxs(Ca,{children:[h.jsx(ba,{asChild:!0,children:h.jsxs(Mt,{variant:"ghost",className:"h-8 w-8 p-0",disabled:R,children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Jh,{className:"h-4 w-4"})]})}),h.jsxs(Ji,{align:"end",children:[h.jsx(Mg,{children:"Actions"}),h.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(O.id),children:[h.jsx(Xh,{}),"Copy ID"]}),h.jsx(kc,{}),h.jsxs(zt,{onClick:()=>b(O.id),children:[h.jsx(n2,{}),"View questionnaire"]}),h.jsx(zt,{asChild:!0,children:h.jsxs(Ws,{to:`/questionnaires/${O.id}`,children:[h.jsx(y1,{}),"Edit questionnaire"]})}),c==="library"&&h.jsxs(zt,{onClick:()=>{w.mutate({...O,id:void 0})},children:[h.jsx(i2,{}),"Import questionnaire"]}),c!=="library"&&h.jsxs(zt,{className:"text-destructive focus:text-destructive",onClick:()=>{m.mutate(O)},children:[h.jsx(h2,{}),"Delete questionnaire"]}),h.jsxs(zt,{onClick:()=>{x.mutate({client:s,questionnaire:{...O,url:c==="library"?`${Zn.state.serverUrl}/Questionnaire/${O.id}`:void 0},subject:o,encounter:i,author:r})},children:[h.jsx(u2,{}),"Create response"]})]})]})}}];return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsx("div",{className:"mb-4 flex justify-end",children:h.jsxs(Ca,{children:[h.jsx(ba,{asChild:!0,children:h.jsxs(Mt,{variant:"outline",className:"ml-auto",children:["Source: ",c==="library"?"Forms Public Library":"EHR",h.jsx(v1,{className:"ml-2 h-4 w-4"})]})}),h.jsx(Ji,{align:"end",children:h.jsxs(CI,{value:c,onValueChange:f,children:[h.jsx(xp,{value:"library",children:"Forms Library"}),h.jsx(xp,{value:"ehr",children:"EHR"})]})})]})}),h.jsx(xb,{columns:A,data:C}),h.jsx(_b,{currentPage:u,totalPages:S}),h.jsx(Sb,{onOpenChange:O=>{O||b(null)},open:!!P,children:h.jsxs(Ig,{className:"flex flex-col max-w-[calc(100vw_-_4rem)] h-[calc(100vh_-_4rem)]",children:[h.jsx(Dg,{children:h.jsx(Fg,{children:"Preview"})}),P&&h.jsx(p.Suspense,{fallback:h.jsx(Ag,{}),children:h.jsx(jD,{id:P})})]})})]})},tF=({id:e})=>{const t=p.useRef(),n=Vo(),{toast:r}=cs(),o=p.useRef(!1),{data:[i,s]}=Qr({queryKey:["questionnaire",e],queryFn:()=>p1(n,e)}),a=Qs({mutationFn:l=>f1(i,l),onSuccess:()=>{o.current||(o.current=!0,r({title:"Questionnaire is autosaved",description:"All changes are saved automatically"}))}});return Lg(t),p.useEffect(()=>{if(i!==Zn){const l=t.current,u=d=>a.mutate(d.detail);return l.addEventListener("change",u),()=>{l.removeEventListener("change",u)}}else r({title:"This questionnaire is read-only",description:"You can't save changes to questionnaires from the library. Please import it first to your EHR to make changes."})},[]),h.jsx("aidbox-form-builder",{"hide-back":!0,"show-share":!1,"hide-population":!0,"hide-extraction":!0,"hide-publish":!0,"hide-add-theme":!0,"hide-edit-theme":!0,"hide-save-theme":!0,"hide-convert":!0,"hide-save":!0,"disable-save":!0,ref:t,value:JSON.stringify(s),style:{width:"100%",height:"100%",border:"none",flex:1}})},nF=()=>{const{id:e}=wx();return h.jsx(tF,{id:e})};function rF(){const{toasts:e}=cs();return h.jsxs(JD,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return h.jsxs(qb,{...i,children:[h.jsxs("div",{className:"grid gap-1",children:[n&&h.jsx(Xb,{children:n}),r&&h.jsx(Jb,{children:r})]}),o,h.jsx(Yb,{})]},t)}),h.jsx(Wb,{})]})}var Bg="Tabs",[oF,DF]=so(Bg,[Pc]),Zb=Pc(),[iF,Vg]=oF(Bg),eR=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=wg(a),[c,f]=Ko({prop:r,onChange:o,defaultProp:i});return h.jsx(iF,{scope:n,baseId:nr(),value:c,onValueChange:f,orientation:s,dir:d,activationMode:l,children:h.jsx(he.div,{dir:d,"data-orientation":s,...u,ref:t})})});eR.displayName=Bg;var tR="TabsList",nR=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Vg(tR,n),s=Zb(n);return h.jsx(XS,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:h.jsx(he.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});nR.displayName=tR;var rR="TabsTrigger",oR=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Vg(rR,n),a=Zb(n),l=aR(s.baseId,r),u=lR(s.baseId,r),d=r===s.value;return h.jsx(JS,{asChild:!0,...a,focusable:!o,active:d,children:h.jsx(he.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:re(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?s.onValueChange(r):c.preventDefault()}),onKeyDown:re(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(r)}),onFocus:re(e.onFocus,()=>{const c=s.activationMode!=="manual";!d&&!o&&c&&s.onValueChange(r)})})})});oR.displayName=rR;var iR="TabsContent",sR=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Vg(iR,n),l=aR(a.baseId,r),u=lR(a.baseId,r),d=r===a.value,c=p.useRef(d);return p.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),h.jsx(Qt,{present:o||d,children:({present:f})=>h.jsx(he.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:f&&i})})});sR.displayName=iR;function aR(e,t){return`${e}-trigger-${t}`}function lR(e,t){return`${e}-content-${t}`}var sF=eR,uR=nR,cR=oR,dR=sR;const aF=sF,fR=p.forwardRef(({className:e,...t},n)=>h.jsx(uR,{ref:n,className:q("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));fR.displayName=uR.displayName;const jp=p.forwardRef(({className:e,...t},n)=>h.jsx(cR,{ref:n,className:q("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));jp.displayName=cR.displayName;const Op=p.forwardRef(({className:e,...t},n)=>h.jsx(dR,{ref:n,className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Op.displayName=dR.displayName;var lF="Label",pR=p.forwardRef((e,t)=>h.jsx(he.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())}}));pR.displayName=lF;var hR=pR;const uF=Da("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ip=p.forwardRef(({className:e,...t},n)=>h.jsx(hR,{ref:n,className:q(uF(),e),...t}));Ip.displayName=hR.displayName;var Hg="Collapsible",[cF,FF]=so(Hg),[dF,Kg]=cF(Hg),gR=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,u]=Ko({prop:r,defaultProp:o,onChange:s});return h.jsx(dF,{scope:n,disabled:i,contentId:nr(),open:l,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),children:h.jsx(he.div,{"data-state":Wg(l),"data-disabled":i?"":void 0,...a,ref:t})})});gR.displayName=Hg;var mR="CollapsibleTrigger",vR=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Kg(mR,n);return h.jsx(he.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Wg(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:re(e.onClick,o.onOpenToggle)})});vR.displayName=mR;var Gg="CollapsibleContent",yR=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Kg(Gg,e.__scopeCollapsible);return h.jsx(Qt,{present:n||o.open,children:({present:i})=>h.jsx(fF,{...r,ref:t,present:i})})});yR.displayName=Gg;var fF=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=Kg(Gg,n),[a,l]=p.useState(r),u=p.useRef(null),d=qe(t,u),c=p.useRef(0),f=c.current,g=p.useRef(0),v=g.current,y=s.open||a,x=p.useRef(y),w=p.useRef();return p.useEffect(()=>{const m=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(m)},[]),Cn(()=>{const m=u.current;if(m){w.current=w.current||{transitionDuration:m.style.transitionDuration,animationName:m.style.animationName},m.style.transitionDuration="0s",m.style.animationName="none";const S=m.getBoundingClientRect();c.current=S.height,g.current=S.width,x.current||(m.style.transitionDuration=w.current.transitionDuration,m.style.animationName=w.current.animationName),l(r)}},[s.open,r]),h.jsx(he.div,{"data-state":Wg(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y,...i,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:y&&o})});function Wg(e){return e?"open":"closed"}var pF=gR;const hF=pF,gF=vR,mF=yR,wR=p.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{className:q("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));wR.displayName="Textarea";const ri=new Map;function Bd(e,t){const n=t==null?void 0:t.serializer,[r]=p.useState(t==null?void 0:t.defaultValue);return vF(e,r,t==null?void 0:t.storageSync,n==null?void 0:n.parse,n==null?void 0:n.stringify)}function vF(e,t,n=!0,r=yF,o=JSON.stringify){const i=p.useRef({string:null,parsed:void 0}),s=p.useSyncExternalStore(p.useCallback(u=>{const d=c=>{e===c&&u()};return Dp.add(d),()=>{Dp.delete(d)}},[e]),()=>{const u=Ml(()=>localStorage.getItem(e))??null;if(ri.has(e))i.current.parsed=ri.get(e);else if(u!==i.current.string){let d;try{d=u===null?t:r(u)}catch{d=t}i.current.parsed=d}return i.current.string=u,t!==void 0&&u===null&&Ml(()=>{const d=o(t);localStorage.setItem(e,d),i.current={string:d,parsed:t}}),i.current.parsed},()=>t),a=p.useCallback(u=>{const d=u instanceof Function?u(i.current.parsed):u;try{localStorage.setItem(e,o(d)),ri.delete(e)}catch{ri.set(e,d)}Vd(e)},[e,o]),l=p.useCallback(()=>{Ml(()=>localStorage.removeItem(e)),ri.delete(e),Vd(e)},[e]);return p.useEffect(()=>{if(!n)return;const u=d=>{d.key===e&&d.storageArea===Ml(()=>localStorage)&&Vd(e)};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e,n]),p.useMemo(()=>[s,a,{isPersistent:s===t||!ri.has(e),removeItem:l}],[e,a,s,t,l])}const Dp=new Set;function Vd(e){for(const t of[...Dp])t(e)}function yF(e){return e==="undefined"?void 0:JSON.parse(e)}function Ml(e){try{return e()}catch{}}const wF=()=>{const{toast:e}=cs(),[t,n]=p.useState(!1),[r,o]=Bd("welcome-tab",{defaultValue:"ehr"}),[i,s,{removeItem:a}]=Bd("issuer",{defaultValue:"https://launch.smarthealthit.org/v/r4/fhir"}),[l,u,{removeItem:d}]=Bd("scope",{defaultValue:n1.join(` +`)}),c=window.location.href;return h.jsxs(h.Fragment,{children:[h.jsx(Sb,{open:t,onOpenChange:n,children:h.jsxs(Ig,{children:[h.jsx(Dg,{children:h.jsx(Fg,{children:"Instructions"})}),h.jsxs("div",{className:"mb-4 text-sm",children:["To run this app from within your own EHR system, you can register it as a SMART App with the following parameters:",h.jsxs("ul",{className:"list-disc ml-6 mt-2",children:[h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Launch URL:"})," ",h.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:c})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Redirect URL:"})," ",h.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:c})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"Client ID:"})," ",h.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:Tu})]}),h.jsxs("li",{children:[h.jsx("span",{className:"font-semibold",children:"PKCE:"})," ",h.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:"true"})]})]})]}),h.jsxs("div",{className:"mb-4",children:["All pages in this app can serve as entry points. For example, you can directly access a form filling page for a patient using a Launch/Redirect URL like this:",h.jsx("br",{}),h.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:"/questionnaire-response/[your-id]"})]})]})}),h.jsx("div",{className:"mb-4"}),h.jsxs("div",{className:"flex flex-col items-center gap-8 max-w-[24rem] mx-auto",children:[h.jsx("img",{alt:"Health Samurai",src:"/health-samurai.svg",width:"64"}),h.jsx("h1",{className:"text-2xl font-bold text-center text-pretty",children:"Welcome to Aidbox Forms Smart App"}),h.jsx("div",{className:"text-sm",children:"This is a demo smart app for launching Aidbox Forms"}),h.jsxs(aF,{defaultValue:"account",className:"w-full",value:r,onValueChange:o,children:[h.jsxs(fR,{className:"grid w-full grid-cols-2",children:[h.jsx(jp,{value:"ehr",children:"EHR Launch"}),h.jsx(jp,{value:"standalone",children:"Standalone Launch"})]}),h.jsx(Op,{value:"ehr",children:h.jsxs(Lu,{children:[h.jsxs($u,{children:[h.jsx(Uu,{children:"Heads up!"}),h.jsxs(Sp,{className:"space-y-2",children:[h.jsx("p",{children:"If you’re seeing this page, it means the app wasn’t launched with the correct context."}),h.jsxs("p",{children:["Please refer to the"," ",h.jsx(Mt,{variant:"link",className:"underline p-0 h-auto",onClick:()=>n(!0),children:"instructions"})," ","for registering the app in your EHR."]}),h.jsx("p",{children:"Alternatively, use one of the following links to simulate launching the app from:"})]})]}),h.jsxs(Cp,{className:"gap-2",children:[h.jsx(Mt,{variant:"outline",className:"flex-1",asChild:!0,children:h.jsxs("a",{href:ty({launchUrl:c,launchType:"provider-ehr"}),children:[h.jsx(p2,{className:"text-orange-500 my-4"}),"Provider EHR"]})}),h.jsx(Mt,{variant:"outline",className:"flex-1",asChild:!0,children:h.jsxs("a",{href:ty({launchUrl:c,launchType:"patient-portal"}),children:[h.jsx(m2,{className:"text-orange-500 my-4"}),"Patient Portal"]})})]})]})}),h.jsx(Op,{value:"standalone",children:h.jsx(hF,{children:h.jsxs(Lu,{children:[h.jsxs($u,{children:[h.jsxs(Uu,{className:"flex items-center justify-between",children:["Launch Parameters",h.jsx(gF,{asChild:!0,children:h.jsxs(Mt,{variant:"ghost",size:"sm",className:"w-9 p-0",children:[h.jsx(e2,{className:"h-4 w-4"}),h.jsx("span",{className:"sr-only",children:"Toggle"})]})})]}),h.jsx(Sp,{children:"Use the following parameters to launch the app standalone:"})]}),h.jsxs(Tg,{className:"space-y-2",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ip,{htmlFor:"name",children:"Issuer"}),h.jsx(Zh,{value:i,onChange:f=>s(f.target.value)})]}),h.jsx(mF,{className:"space-y-2",children:h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ip,{htmlFor:"name",children:"Scope"}),h.jsx(wR,{value:l,onChange:f=>u(f.target.value),rows:10})]})})]}),h.jsxs(Cp,{className:"justify-between",children:[h.jsx(Mt,{variant:"ghost",onClick:()=>{a(),d()},children:"Reset"}),h.jsxs(Mt,{disabled:!i||!l,variant:"outline",onClick:()=>{var g,v,y;const f=(y=(v=(g=l==null?void 0:l.split(` +`))==null?void 0:g.map(x=>x.trim()))==null?void 0:v.filter(Boolean))==null?void 0:y.join(" ");!i||!f?e({variant:"destructive",title:"Error",description:"Issuer and Scope are required"}):eT({iss:i,scope:f})},children:[h.jsx(l2,{className:"text-orange-500 my-4"}),"Launch"]})]})]})})})]})]})]})};function xF(){var t;let e=bx();return h.jsx("div",{className:"p-10",children:(t=e==null?void 0:e.message)!=null&&t.includes("fhirServiceUrl")?h.jsx(wF,{}):h.jsxs(h.Fragment,{children:[h.jsx("h1",{className:"text-4xl font-bold mb-4",children:e.status?`${e.status} - ${e.statusText}`:"Error"}),h.jsx("div",{className:"mb-2",children:"An error occurred while rendering this page."}),h.jsx("pre",{className:"text-xs bg-gray-50 px-1 py-0.5 rounded border overflow-auto empty:hidden",children:e.message})]})})}const SF=()=>{const e=p.useRef(),{id:t}=wx(),n=Vo(),{data:r}=Qr({queryKey:["questionnaire-response",t],queryFn:()=>n.request(`QuestionnaireResponse/${t}`)}),o=r.questionnaire,{data:i}=Qr({queryKey:["questionnaire",o],queryFn:()=>Yh(n,o)}),s=Qs({mutationFn:d1.bind(null,n,i)});return p.useEffect(()=>{const a=e.current,l=u=>s.mutate(u.detail);return a.addEventListener("change",l),()=>{a.removeEventListener("change",l)}},[]),Lg(e),h.jsx("aidbox-form-renderer",{ref:e,questionnaire:JSON.stringify(i),"questionnaire-response":JSON.stringify(r),style:{width:"100%",height:"100%",border:"none",flex:1}})},CF=()=>{var g;const[e]=ac(),{patient:t}=Ho(),n=Vo(),r=Ia(),o=Number(e.get("page"))||1,i=15,{data:s}=Qr({queryKey:["questionnaire-responses",o],queryFn:()=>n.request(`QuestionnaireResponse?_subject=${t.id}&_count=${i}&_page=${o}`)}),a=Math.ceil(s.total/i),l=((g=s.entry)==null?void 0:g.map(v=>v.resource))||[],u=Symbol("dummy"),d=Xv({queries:l.filter(({author:v})=>v==null?void 0:v.id).map(({author:v})=>({queryKey:["author",v.id],queryFn:()=>n.request(`Practitioner/${v.id}`).catch(()=>u)})),combine:v=>v.reduce((y,{data:x})=>(x!==u&&(y[x.id]=x),y),{})}),c=Xv({queries:l.filter(({questionnaire:v})=>v).map(({questionnaire:v})=>({queryKey:["questionnaire",v],queryFn:()=>Yh(n,v).then(y=>({key:v,result:y}),()=>u)})),combine:v=>v.reduce((y,{data:x})=>(x!==u&&(y[x.key]=x.result),y),{})}),f=[{header:"Author",accessorFn:v=>{var y,x,w;return(y=v.author)!=null&&y.id&&((x=d[v.author.id])!=null&&x.name)?ss((w=d[v.author.id])==null?void 0:w.name):"Unknown"}},{header:"Questionnaire",accessorFn:v=>{var y,x;return(y=c[v.questionnaire])!=null&&y.title?(x=c[v.questionnaire])==null?void 0:x.title:v.questionnaire}},{header:"Last Updated",accessorFn:v=>new Date(v.meta.lastUpdated).toLocaleString()},{header:"Status",accessorKey:"status"},{id:"actions",cell:({row:{original:v}})=>h.jsxs(Ca,{modal:!0,children:[h.jsx(ba,{asChild:!0,children:h.jsxs(Mt,{variant:"ghost",className:"h-8 w-8 p-0",children:[h.jsx("span",{className:"sr-only",children:"Open menu"}),h.jsx(Jh,{className:"h-4 w-4"})]})}),h.jsxs(Ji,{align:"end",children:[h.jsx(Mg,{children:"Actions"}),h.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(v.id),children:[h.jsx(Xh,{}),"Copy ID"]}),h.jsx(kc,{}),h.jsxs(zt,{onClick:()=>r(`/questionnaire-responses/${v.id}`),children:[h.jsx(y1,{}),"Edit response"]})]})]})}];return h.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[h.jsx(xb,{columns:f,data:l}),h.jsx(_b,{currentPage:o,totalPages:a})]})},bF=()=>{const{user:e}=Ho(),{toast:t}=cs(),n=e.resourceType==="Practitioner";return p.useEffect(()=>{n||t({variant:"destructive",title:"Unauthorized",description:"Only practitioners can access this page."})},[]),n?h.jsx(Rx,{}):h.jsx(hM,{to:"/"})},RF=new Hk({defaultOptions:{mutations:{throwOnError:!0},queries:{suspense:!0}}}),EF=bM([{path:"/",Component:jI,ErrorBoundary:xF,children:[{index:!0,Component:HT},{path:"/questionnaire-responses",Component:CF},{path:"/questionnaire-responses/:id",Component:SF},{Component:bF,children:[{path:"/questionnaires",Component:eF},{path:"/questionnaires/:id",Component:nF}]}]}],{basename:"/examples/aidbox-forms-smart-launch"});ix(document.getElementById("root")).render(h.jsx(p.StrictMode,{children:h.jsxs(Yk,{client:RF,children:[h.jsx(p.Suspense,{fallback:h.jsx(Ag,{}),children:h.jsx(NM,{router:EF})}),h.jsx(rF,{})]})}))});export default PF(); diff --git a/aidbox-forms-smart-launch/index.html b/aidbox-forms-smart-launch/index.html index a37194b..ebf1edb 100644 --- a/aidbox-forms-smart-launch/index.html +++ b/aidbox-forms-smart-launch/index.html @@ -8,8 +8,8 @@ Aidbox Forms Smart App Launch - - + +