@gup-fe/js-sdk 2.1.3 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1,27 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`._Viewport_ai81v_1{position:fixed;width:100%;max-width:300px;margin:0 auto;top:1rem;right:0;left:0;bottom:auto;z-index:999}._Toast_ai81v_14{--gap: .75rem;--peek: .75rem;--scale: max(0, 1 - (var(--toast-index) * .1)) ;--shrink: calc(1 - var(--scale));--height: var(--toast-frontmost-height, var(--toast-height));--offset-y: calc( var(--toast-offset-y) + (var(--toast-index) * var(--gap)) + var(--toast-swipe-movement-y) );position:absolute;box-sizing:border-box;background:var(--color-gray-50);color:var(--color-gray-900);border:1px solid var(--color-gray-200);padding:1rem;width:100%;box-shadow:0 2px 10px #0000001a;background-clip:padding-box;border-radius:.5rem;transform-origin:top center;top:0;left:0;right:0;margin:0 auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s,height .15s;cursor:default;z-index:calc(1000 - var(--toast-index));height:var(--height);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--peek)) + (var(--shrink) * var(--height)))) scale(var(--scale))}._Toast_ai81v_14[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y));height:var(--toast-height)}._Toast_ai81v_14[data-starting-style],._Toast_ai81v_14[data-ending-style]{transform:translateY(-150%)}._Toast_ai81v_14[data-limited],._Toast_ai81v_14[data-ending-style]{opacity:0}._Toast_ai81v_14[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}._Toast_ai81v_14:after{content:"";position:absolute;width:100%;bottom:100%;left:0;height:calc(var(--gap) + 1px)}._Content_ai81v_99{overflow:hidden;transition:opacity .25s}._Content_ai81v_99[data-behind]{opacity:0}._Content_ai81v_99[data-expanded]{opacity:1}._Title_ai81v_112{font-weight:500;font-size:.975rem;line-height:1.25rem;margin:0}._Description_ai81v_119{font-size:.925rem;line-height:1.25rem;margin:0}._Close_ai81v_125{position:absolute;top:.5rem;right:.5rem;padding:0;border:none;background:transparent;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center;border-radius:.25rem}._Close_ai81v_125:hover{background-color:var(--color-gray-100)}._Icon_ai81v_144{width:1rem;height:1rem}._item_1ddxp_1{margin-right:1rem;margin-left:.625rem;display:grid;cursor:pointer;grid-template-columns:.75rem 1fr;align-items:center;gap:.5rem;border-bottom-width:1px;padding-top:.5rem;padding-bottom:.5rem;font-size:.875rem;line-height:1.25rem}._item_1ddxp_1:hover,._item_1ddxp_1[data-selected]{color:var(--jssdk-primary-color)}._uidGet_os9yc_1{width:80vw;max-width:400px;background-size:cover;background-position:center}._mailCodeGet_os9yc_5{width:100%;background-size:cover;background-position:center}.game-5174 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626145347721513.png);aspect-ratio:553 / 428}.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:680/1096}.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626151631191610.png)}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626144535531913.png)}}.game-5273 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626142807783110.png);aspect-ratio:553 / 428}.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1096;background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-mobile.png)}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:1220/654}}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-pc.png)}}.game-5242 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624152217734019.png);aspect-ratio:596 / 266}.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624132201121910.png)}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624143628881023.png)}}.game-5234 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811141956691626.png);aspect-ratio:740 / 290}.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142113377920.png)}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142146601319.png)}}.game-5199 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319163303381734.png);aspect-ratio:541 / 431;border-radius:10px}.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:353 / 561;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319160000001714.png)}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:677/323}}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319153435571035.png)}}.game-5199 input{color:#dfd9c6}.game-5199 input::-moz-placeholder{color:#70625e}.game-5199 input::placeholder{color:#70625e}.game-5199 button{color:#dfd9c6}.game-5199 ._uidGetPopup_os9yc_79{background-color:#5d5655;padding:10px}.game-5199 ._uidGetArrow_os9yc_83{color:#5d5655}.game-5199 ._inputControl_os9yc_86{height:40px}.game-5199 ._form_os9yc_89>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.game-5199 ._modal_1pbx2_2{background:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319165656615516.png) no-repeat center center;background-size:100% 100%;padding:60px 35px 30px}.game-5199 ._close_1pbx2_8{top:10px;right:0;background:url(https://ipay.ztgame.com/png/button_close.hzBHa9.png) no-repeat center center;background-size:100% 100%;width:57px;height:60px}.game-5199 ._close_1pbx2_8 svg{opacity:0}.game-5199 ._close_1pbx2_8:hover{background-color:transparent}*,: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}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input::-webkit-input-placeholder{color:#a9a9a9}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-1\\/2{top:50%}.top-4{top:1rem}.z-\\[1\\]{z-index:1}.z-\\[990\\]{z-index:990}.z-\\[991\\]{z-index:991}.z-\\[992\\]{z-index:992}.z-\\[999\\]{z-index:999}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.-mt-1\\.5{margin-top:-.375rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.ml-2\\.5{margin-left:.625rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\\[240\\/85\\]{aspect-ratio:240/85}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-4{height:1rem}.h-4\\/6{height:66.666667%}.h-7{height:1.75rem}.h-\\[70vh\\]{height:70vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-\\[60vh\\]{max-height:60vh}.max-h-\\[var\\(--available-height\\)\\]{max-height:var(--available-height)}.w-0{width:0px}.w-12{width:3rem}.w-16{width:4rem}.w-32{width:8rem}.w-80{width:20rem}.w-96{width:24rem}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[var\\(--anchor-width\\)\\]{min-width:var(--anchor-width)}.max-w-64{max-width:16rem}.max-w-\\[80vw\\]{max-width:80vw}.max-w-\\[calc\\(100vw-3rem\\)\\]{max-width:calc(100vw - 3rem)}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-\\[var\\(--transform-origin\\)\\]{transform-origin:var(--transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-\\[0\\.75rem_1fr\\]{grid-template-columns:.75rem 1fr}.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-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-\\[var\\(--jssdk-input-border-color\\)\\]{border-color:var(--jssdk-input-border-color)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.bg-\\[canvas\\]{background-color:canvas}.bg-\\[var\\(--jssdk-icon-color\\)\\]{background-color:var(--jssdk-icon-color)}.bg-\\[var\\(--jssdk-input-bg-color\\)\\]{background-color:var(--jssdk-input-bg-color)}.bg-black\\/20{background-color:#0003}.bg-black\\/70{background-color:#000000b3}.bg-black\\/80{background-color:#000c}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#497efe\\]{--tw-gradient-from: #497efe var(--tw-gradient-from-position);--tw-gradient-to: rgb(73 126 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#947afa\\]{--tw-gradient-to: #947afa var(--tw-gradient-to-position)}.fill-\\[canvas\\]{fill:canvas}.fill-current{fill:currentColor}.fill-gray-200{fill:#e5e7eb}.fill-gray-400{fill:#9ca3af}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-\\[11px\\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.text-\\[\\#f59e9e\\]{--tw-text-opacity: 1;color:rgb(245 158 158 / var(--tw-text-opacity, 1))}.text-\\[var\\(--jssdk-primary-color\\)\\]{color:var(--jssdk-primary-color)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.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-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}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[transform\\,scale\\,opacity\\]{transition-property:transform,scale,opacity;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}.duration-150{transition-duration:.15s}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:top-\\[-100\\%\\]:before{content:var(--tw-content);top:-100%}.before\\:h-full:before{content:var(--tw-content);height:100%}.before\\:w-full:before{content:var(--tw-content);width:100%}.before\\:content-\\[\\'\\'\\]:before{--tw-content: "";content:var(--tw-content)}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[var\\(--jssdk-primary-color\\)\\]:hover{color:var(--jssdk-primary-color)}.hover\\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:brightness-90:active{--tw-brightness: brightness(.9);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)}.enabled\\:text-\\[var\\(--jssdk-primary-color\\)\\]:enabled{color:var(--jssdk-primary-color)}.enabled\\:hover\\:bg-\\[var\\(--jssdk-primary-color\\)\\]:hover:enabled{background-color:var(--jssdk-primary-color)}.enabled\\:hover\\:text-\\[var\\(--jssdk-primary-foregroud-color\\)\\]:hover:enabled{color:var(--jssdk-primary-foregroud-color)}.enabled\\:hover\\:text-white:hover:enabled{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\\:grayscale:disabled{--tw-grayscale: grayscale(100%);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)}.data-\\[direction\\=down\\]\\:bottom-0[data-direction=down]{bottom:0}.data-\\[side\\=bottom\\]\\:top-\\[-8px\\][data-side=bottom]{top:-8px}.data-\\[side\\=left\\]\\:right-\\[-13px\\][data-side=left]{right:-13px}.data-\\[side\\=right\\]\\:left-\\[-13px\\][data-side=right]{left:-13px}.data-\\[side\\=top\\]\\:bottom-\\[-8px\\][data-side=top]{bottom:-8px}.data-\\[side\\=left\\]\\:rotate-90[data-side=left]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:-rotate-90[data-side=right]{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:rotate-180[data-side=top]{--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))}.data-\\[ending-style\\]\\:scale-90[data-ending-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:scale-100[data-starting-style][data-side=none]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[starting-style\\]\\:scale-90[data-starting-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[checked\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-checked],.data-\\[focused\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-focused]{border-color:var(--jssdk-primary-color)}.data-\\[unchecked\\]\\:border-\\[var\\(--jssdk-input-border-color\\)\\][data-unchecked]{border-color:var(--jssdk-input-border-color)}.data-\\[unchecked\\]\\:border-gray-300[data-unchecked]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.data-\\[highlighted\\]\\:text-\\[\\#789bf5\\][data-highlighted]{--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}.data-\\[ending-style\\]\\:opacity-0[data-ending-style]{opacity:0}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:opacity-100[data-starting-style][data-side=none]{opacity:1}.data-\\[starting-style\\]\\:opacity-0[data-starting-style]{opacity:0}.data-\\[ending-style\\]\\:transition-none[data-ending-style],.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:transition-none[data-starting-style][data-side=none]{transition-property:none}.data-\\[direction\\=down\\]\\:before\\:bottom-\\[-100\\%\\][data-direction=down]:before{content:var(--tw-content);bottom:-100%}.dark\\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\\:fill-none:is(.dark *){fill:none}.dark\\:opacity-70:is(.dark *){opacity:.7}.dark\\:shadow-none:is(.dark *){--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)}.dark\\:-outline-offset-1:is(.dark *){outline-offset:-1px}.dark\\:outline-gray-300:is(.dark *){outline-color:#d1d5db}@media(min-width:768px){.md\\:size-5{width:1.25rem;height:1.25rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:1024px){.lg\\:size-6{width:1.5rem;height:1.5rem}.lg\\:w-4\\/5{width:80%}.lg\\:w-\\[60vw\\]{width:60vw}.lg\\:max-w-5xl{max-width:64rem}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- (function(pt,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-dom/client","react","react-dom"],O):(pt=typeof globalThis<"u"?globalThis:pt||self,O(pt.SDK={},pt.jsxRuntime,pt.ReactDOM$1,pt.React,pt.ReactDOM))})(this,(function(pt,O,Mv,W,Yl){"use strict";function Zl(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const f=Zl(W),lt=Zl(Yl);var so=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(){}},rs=typeof window>"u"||"Deno"in globalThis;function Mt(){}function Lv(e,t){return typeof e=="function"?e(t):e}function $v(e){return typeof e=="number"&&e>=0&&e!==1/0}function Fv(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zi(e,t){return typeof e=="function"?e(t):e}function Vv(e,t){return typeof e=="function"?e(t):e}function ql(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==qi(i,t.options))return!1}else if(!io(t.queryKey,i))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||s&&!s(t))}function Xl(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Qn(t.options.mutationKey)!==Qn(s))return!1}else if(!io(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function qi(e,t){return(t?.queryKeyHashFn||Qn)(e)}function Qn(e){return JSON.stringify(e,(t,n)=>Ki(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function io(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>io(e[n],t[n])):!1}function Xi(e,t){if(e===t)return e;const n=Kl(e)&&Kl(t);if(n||Ki(e)&&Ki(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},l=new Set(r);let c=0;for(let u=0;u<i;u++){const d=n?u:s[u];(!n&&l.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,c++):(a[d]=Xi(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return o===i&&c===o?e:a}return t}function Bv(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Kl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ki(e){if(!Jl(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Jl(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Jl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wv(e){return new Promise(t=>{setTimeout(t,e)})}function jv(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Xi(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Xi(e,t)}return t}function Hv(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Uv(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var os=Symbol();function Ql(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===os&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===os?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Gv(e,t){return typeof e=="function"?e(...t):!!e}var zv=class extends so{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!rs&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},eu=new zv,Yv=class extends so{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!rs&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ss=new Yv;function Zv(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});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 qv(e){return Math.min(1e3*2**e,3e4)}function tu(e){return(e??"online")==="online"?ss.isOnline():!0}var nu=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ji(e){return e instanceof nu}function ru(e){let t=!1,n=0,r=!1,o;const s=Zv(),i=m=>{r||(h(new nu(m)),e.abort?.())},a=()=>{t=!0},l=()=>{t=!1},c=()=>eu.isFocused()&&(e.networkMode==="always"||ss.isOnline())&&e.canRun(),u=()=>tu(e.networkMode)&&e.canRun(),d=m=>{r||(r=!0,e.onSuccess?.(m),o?.(),s.resolve(m))},h=m=>{r||(r=!0,e.onError?.(m),o?.(),s.reject(m))},p=()=>new Promise(m=>{o=v=>{(r||c())&&m(v)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),g=()=>{if(r)return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(y){m=Promise.reject(y)}Promise.resolve(m).then(d).catch(y=>{if(r)return;const b=e.retry??(rs?0:3),E=e.retryDelay??qv,x=typeof E=="function"?E(n,y):E,w=b===!0||typeof b=="number"&&n<b||typeof b=="function"&&b(n,y);if(t||!w){h(y);return}n++,e.onFail?.(n,y),Wv(x).then(()=>c()?void 0:p()).then(()=>{t?h(y):g()})})};return{promise:s,cancel:i,continue:()=>(o?.(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?g():p().then(g),s)}}var Xv=e=>setTimeout(e,0);function Kv(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=Xv;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{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||i()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var ut=Kv(),ou=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),$v(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(rs?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},Jv=class extends ou{#e;#t;#n;#r;#o;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=ey(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=jv(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Vv(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===os||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Zi(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Fv(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#a?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const l=this.observers.find(c=>c.options.queryFn);l&&this.setOptions(l.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=l=>{Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const l=Ql(this.options,t),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(l,u,this):l(u)},i=(()=>{const l={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return r(l),l})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta});const a=l=>{Ji(l)&&l.silent||this.#s({type:"error",error:l}),Ji(l)||(this.#n.config.onError?.(l,this),this.#n.config.onSettled?.(this.state.data,l,this)),this.scheduleGc()};return this.#o=ru({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:l=>{if(l===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(l)}catch(c){a(c);return}this.#n.config.onSuccess?.(l,this),this.#n.config.onSettled?.(l,this.state.error,this),this.scheduleGc()},onError:a,onFail:(l,c)=>{this.#s({type:"failed",failureCount:l,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#o.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Qv(n.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Ji(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ut.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Qv(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:tu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ey(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 ty=class extends so{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??qi(r,t);let s=this.get(o);return s||(s=new Jv({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ql(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ql(e,n)):t}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ny=class extends ou{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||su(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=ru({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#r({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:r})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#r({type:"error",error:o})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ut.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function su(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ry=class extends so{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new ny({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=is(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=is(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=is(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=is(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ut.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Xl(t,n))}findAll(e={}){return this.getAll().filter(t=>Xl(e,t))}notify(e){ut.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ut.batch(()=>Promise.all(e.map(t=>t.continue().catch(Mt))))}};function is(e){return e.options.scope?.id}function iu(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const d=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},h=Ql(t.options,t.fetchOptions),p=async(g,m,v)=>{if(u)return Promise.reject();if(m==null&&g.pages.length)return Promise.resolve(g);const b=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:m,direction:v?"backward":"forward",meta:t.options.meta};return d(T),T})(),E=await h(b),{maxPages:x}=t.options,w=v?Uv:Hv;return{pages:w(g.pages,E,x),pageParams:w(g.pageParams,m,x)}};if(o&&s.length){const g=o==="backward",m=g?oy:au,v={pages:s,pageParams:i},y=m(r,v);a=await p(v,y,g)}else{const g=e??s.length;do{const m=l===0?i[0]??r.initialPageParam:au(r,a);if(l>0&&m==null)break;a=await p(a,m),l++}while(l<g)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function au(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 oy(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var sy=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new ty,this.#t=e.mutationCache||new ry,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=eu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=ss.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zi(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Lv(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return ut.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ut.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ut.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ut.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Mt).catch(Mt)}invalidateQueries(e,t={}){return ut.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ut.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Mt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Mt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Zi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mt).catch(Mt)}fetchInfiniteQuery(e){return e.behavior=iu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mt).catch(Mt)}ensureInfiniteQueryData(e){return e.behavior=iu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ss.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Qn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{io(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Qn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{io(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qi(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.queryFn===os&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},iy=class extends so{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Bv(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Qn(n.mutationKey)!==Qn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??su();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){ut.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},cu=f.createContext(void 0),ay=e=>{const t=f.useContext(cu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},cy=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),O.jsx(cu.Provider,{value:e,children:t}));function ao(e,t){const n=ay(),[r]=f.useState(()=>new iy(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);const o=f.useSyncExternalStore(f.useCallback(i=>r.subscribe(ut.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=f.useCallback((i,a)=>{r.mutate(i,a).catch(Mt)},[r]);if(o.error&&Gv(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Ht=function(){return Ht=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ht.apply(this,arguments)};function lu(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);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Jt(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function l(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){u.done?s(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function Qt(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(s=c[0]&2?o.return:c[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,c[1])).done)return s;switch(o=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function ly(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Qi(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var uu="4.6.2";function as(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function uy(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function dy(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):as(Math.min(e,t))}function du(e){return!!e&&typeof e.then=="function"}function fu(e,t){try{var n=e();du(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function pu(e,t,n){return n===void 0&&(n=16),Jt(this,void 0,void 0,function(){var r,o,s,i;return Qt(this,function(a){switch(a.label){case 0:r=Array(e.length),o=Date.now(),s=0,a.label=1;case 1:return s<e.length?(r[s]=t(e[s],s),i=Date.now(),i>=o+n?(o=i,[4,uy()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,r]}})})}function co(e){return e.then(void 0,function(){}),e}function fy(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function py(e,t){return!fy(e,t)}function ea(e){return parseInt(e)}function Ut(e){return parseFloat(e)}function fn(e,t){return typeof e=="number"&&isNaN(e)?t:e}function yt(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function hu(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function hy(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),s=o[1]||void 0,i={},a=/([.:#][\w-]+|\[.+?\])/gi,l=function(h,p){i[h]=i[h]||[],i[h].push(p)};;){var c=a.exec(o[2]);if(!c)break;var u=c[0];switch(u[0]){case".":l("class",u.slice(1));break;case"#":l("id",u.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)l(d[1],(n=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[s,i]}function my(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function Rn(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=s+c,h+=p>>>16,p&=65535,h+=o+l,d+=h>>>16,h&=65535,d+=r+a,u+=d>>>16,d&=65535,u+=n+i,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function Lt(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,l=t[1]>>>16,c=t[1]&65535,u=0,d=0,h=0,p=0;p+=s*c,h+=p>>>16,p&=65535,h+=o*c,d+=h>>>16,h&=65535,h+=s*l,d+=h>>>16,h&=65535,d+=r*c,u+=d>>>16,d&=65535,d+=o*l,u+=d>>>16,d&=65535,d+=s*a,u+=d>>>16,d&=65535,u+=n*c+r*l+o*a+s*i,u&=65535,e[0]=u<<16|d,e[1]=h<<16|p}function xr(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function kt(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Ge(e,t){e[0]^=t[0],e[1]^=t[1]}var gy=[4283543511,3981806797],vy=[3301882366,444984403];function mu(e){var t=[0,e[0]>>>1];Ge(e,t),Lt(e,gy),t[1]=e[0]>>>1,Ge(e,t),Lt(e,vy),t[1]=e[0]>>>1,Ge(e,t)}var cs=[2277735313,289559509],ls=[1291169091,658871167],gu=[0,5],yy=[0,1390208809],by=[0,944331445];function wy(e,t){var n=my(e);t=t||0;var r=[0,n.length],o=r[1]%16,s=r[1]-o,i=[0,t],a=[0,t],l=[0,0],c=[0,0],u;for(u=0;u<s;u=u+16)l[0]=n[u+4]|n[u+5]<<8|n[u+6]<<16|n[u+7]<<24,l[1]=n[u]|n[u+1]<<8|n[u+2]<<16|n[u+3]<<24,c[0]=n[u+12]|n[u+13]<<8|n[u+14]<<16|n[u+15]<<24,c[1]=n[u+8]|n[u+9]<<8|n[u+10]<<16|n[u+11]<<24,Lt(l,cs),xr(l,31),Lt(l,ls),Ge(i,l),xr(i,27),Rn(i,a),Lt(i,gu),Rn(i,yy),Lt(c,ls),xr(c,33),Lt(c,cs),Ge(a,c),xr(a,31),Rn(a,i),Lt(a,gu),Rn(a,by);l[0]=0,l[1]=0,c[0]=0,c[1]=0;var d=[0,0];switch(o){case 15:d[1]=n[u+14],kt(d,48),Ge(c,d);case 14:d[1]=n[u+13],kt(d,40),Ge(c,d);case 13:d[1]=n[u+12],kt(d,32),Ge(c,d);case 12:d[1]=n[u+11],kt(d,24),Ge(c,d);case 11:d[1]=n[u+10],kt(d,16),Ge(c,d);case 10:d[1]=n[u+9],kt(d,8),Ge(c,d);case 9:d[1]=n[u+8],Ge(c,d),Lt(c,ls),xr(c,33),Lt(c,cs),Ge(a,c);case 8:d[1]=n[u+7],kt(d,56),Ge(l,d);case 7:d[1]=n[u+6],kt(d,48),Ge(l,d);case 6:d[1]=n[u+5],kt(d,40),Ge(l,d);case 5:d[1]=n[u+4],kt(d,32),Ge(l,d);case 4:d[1]=n[u+3],kt(d,24),Ge(l,d);case 3:d[1]=n[u+2],kt(d,16),Ge(l,d);case 2:d[1]=n[u+1],kt(d,8),Ge(l,d);case 1:d[1]=n[u],Ge(l,d),Lt(l,cs),xr(l,31),Lt(l,ls),Ge(i,l)}return Ge(i,r),Ge(a,r),Rn(i,a),Rn(a,i),mu(i),mu(a),Rn(i,a),Rn(a,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Ey(e){var t;return Ht({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
3
- `)},e)}function xy(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Sy(e){return typeof e!="function"}function Cy(e,t){var n=co(new Promise(function(r){var o=Date.now();fu(e.bind(null,t),function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];var a=Date.now()-o;if(!s[0])return r(function(){return{error:s[1],duration:a}});var l=s[1];if(Sy(l))return r(function(){return{value:l,duration:a}});r(function(){return new Promise(function(c){var u=Date.now();fu(l,function(){for(var d=[],h=0;h<arguments.length;h++)d[h]=arguments[h];var p=a+Date.now()-u;if(!d[0])return c({error:d[1],duration:p});c({value:d[1],duration:p})})})})})}));return function(){return n.then(function(o){return o()})}}function Ty(e,t,n,r){var o=Object.keys(e).filter(function(i){return py(n,i)}),s=co(pu(o,function(i){return Cy(e[i],t)},r));return function(){return Jt(this,void 0,void 0,function(){var a,l,c,u,d;return Qt(this,function(h){switch(h.label){case 0:return[4,s];case 1:return a=h.sent(),[4,pu(a,function(p){return co(p())},r)];case 2:return l=h.sent(),[4,Promise.all(l)];case 3:for(c=h.sent(),u={},d=0;d<o.length;++d)u[o[d]]=c[d];return[2,u]}})})}}function vu(){var e=window,t=navigator;return yt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Oy(){var e=window,t=navigator;return yt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!vu()}function lo(){var e=window,t=navigator;return yt(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Gt(){var e=window,t=navigator;return yt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function ta(){var e=window,t=e.HTMLElement,n=e.Document;return yt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function uo(){var e=window;return xy(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function yu(){var e,t,n=window;return yt(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function ky(){var e=window;return yt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Ry(){var e=window,t=e.URLPattern;return yt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Py(){var e=window;return yt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function fo(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return yt([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function Iy(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return yt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function _y(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Ny(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function na(){var e=lo(),t=yu(),n=window,r=navigator,o="connection";return e?yt([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?yt(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Ay(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return yt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Dy(){return $y()?-4:My()}function My(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Ly())return-1;var n=4500,r=5e3,o=new t(1,r,44100),s=o.createOscillator();s.type="triangle",s.frequency.value=1e4;var i=o.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,s.connect(i),i.connect(o.destination),s.start(0);var a=Fy(o),l=a[0],c=a[1],u=co(l.then(function(d){return Vy(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return c(),u}}function Ly(){return Gt()&&!ta()&&!Py()}function $y(){return Gt()&&fo()&&uo()||lo()&&Ay()&&Ry()}function Fy(e){var t=3,n=500,r=500,o=5e3,s=function(){},i=new Promise(function(a,l){var c=!1,u=0,d=0;e.oncomplete=function(g){return a(g.renderedBuffer)};var h=function(){setTimeout(function(){return l(bu("timeout"))},Math.min(r,d+o-Date.now()))},p=function(){try{var g=e.startRendering();switch(du(g)&&co(g),e.state){case"running":d=Date.now(),c&&h();break;case"suspended":document.hidden||u++,c&&u>=t?l(bu("suspended")):setTimeout(p,n);break}}catch(m){l(m)}};p(),s=function(){c||(c=!0,d>0&&h())}});return[i,s]}function Vy(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function bu(e){var t=new Error(e);return t.name=e,t}function wu(e,t,n){var r,o,s;return n===void 0&&(n=50),Jt(this,void 0,void 0,function(){var i,a;return Qt(this,function(l){switch(l.label){case 0:i=document,l.label=1;case 1:return i.body?[3,3]:[4,as(n)];case 2:return l.sent(),[3,1];case 3:a=i.createElement("iframe"),l.label=4;case 4:return l.trys.push([4,,10,11]),[4,new Promise(function(c,u){var d=!1,h=function(){d=!0,c()},p=function(v){d=!0,u(v)};a.onload=h,a.onerror=p;var g=a.style;g.setProperty("display","block","important"),g.position="absolute",g.top="0",g.left="0",g.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",i.body.appendChild(a);var m=function(){var v,y;d||(((y=(v=a.contentWindow)===null||v===void 0?void 0:v.document)===null||y===void 0?void 0:y.readyState)==="complete"?h():setTimeout(m,10))};m()})];case 5:l.sent(),l.label=6;case 6:return!((o=(r=a.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body?[3,8]:[4,as(n)];case 7:return l.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,l.sent()];case 10:return(s=a.parentNode)===null||s===void 0||s.removeChild(a),[7];case 11:return[2]}})})}function By(e){for(var t=hy(e),n=t[0],r=t[1],o=document.createElement(n??"div"),s=0,i=Object.keys(r);s<i.length;s++){var a=i[s],l=r[a].join(" ");a==="style"?Wy(o.style,l):o.setAttribute(a,l)}return o}function Wy(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(s){var i=s[1],a=s[2],l=s[4];e.setProperty(i,a,l||"")}}}function jy(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var Hy="mmMwWLliI0O&1",Uy="48px",Sr=["monospace","sans-serif","serif"],Eu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Gy(){var e=this;return wu(function(t,n){var r=n.document;return Jt(e,void 0,void 0,function(){var o,s,i,a,l,c,u,d,h,p,g,m;return Qt(this,function(v){for(o=r.body,o.style.fontSize=Uy,s=r.createElement("div"),s.style.setProperty("visibility","hidden","important"),i={},a={},l=function(y){var b=r.createElement("span"),E=b.style;return E.position="absolute",E.top="0",E.left="0",E.fontFamily=y,b.textContent=Hy,s.appendChild(b),b},c=function(y,b){return l("'".concat(y,"',").concat(b))},u=function(){return Sr.map(l)},d=function(){for(var y={},b=function(T){y[T]=Sr.map(function(S){return c(T,S)})},E=0,x=Eu;E<x.length;E++){var w=x[E];b(w)}return y},h=function(y){return Sr.some(function(b,E){return y[E].offsetWidth!==i[b]||y[E].offsetHeight!==a[b]})},p=u(),g=d(),o.appendChild(s),m=0;m<Sr.length;m++)i[Sr[m]]=p[m].offsetWidth,a[Sr[m]]=p[m].offsetHeight;return[2,Eu.filter(function(y){return h(g[y])})]})})})}function zy(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var o=[],s=0;s<r.length;++s){var i=r[s];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}}return t}}function Yy(){return Zy(tb())}function Zy(e){var t,n=!1,r,o,s=qy(),i=s[0],a=s[1];return Xy(i,a)?(n=Ky(a),e?r=o="skipped":(t=Jy(i,a),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function qy(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function Xy(e,t){return!!(t&&e.toDataURL)}function Ky(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function Jy(e,t){Qy(e,t);var n=ra(e),r=ra(e);if(n!==r)return["unstable","unstable"];eb(e,t);var o=ra(e);return[o,n]}function Qy(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function eb(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var o=r[n],s=o[0],i=o[1],a=o[2];t.fillStyle=s,t.beginPath(),t.arc(i,a,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function ra(e){return e.toDataURL()}function tb(){return Gt()&&fo()&&uo()}function nb(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=ea(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function rb(){return navigator.oscpu}function ob(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))lo()&&ky()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function sb(){return window.screen.colorDepth}function ib(){return fn(Ut(navigator.deviceMemory),void 0)}function ab(){if(!(Gt()&&fo()&&uo()))return cb()}function cb(){var e=screen,t=function(r){return fn(ea(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var lb=2500,ub=10,us,oa;function db(){if(oa===void 0){var e=function(){var t=sa();ia(t)?oa=setTimeout(e,lb):(us=t,oa=void 0)};e()}}function fb(){var e=this;return db(),function(){return Jt(e,void 0,void 0,function(){var t;return Qt(this,function(n){switch(n.label){case 0:return t=sa(),ia(t)?us?[2,Qi([],us,!0)]:_y()?[4,Ny()]:[3,2]:[3,2];case 1:n.sent(),t=sa(),n.label=2;case 2:return ia(t)||(us=t),[2,t]}})})}}function pb(){var e=this;if(Gt()&&fo()&&uo())return function(){return Promise.resolve(void 0)};var t=fb();return function(){return Jt(e,void 0,void 0,function(){var n,r;return Qt(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(s){return s===null?null:hu(s,ub)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function sa(){var e=screen;return[fn(Ut(e.availTop),null),fn(Ut(e.width)-Ut(e.availWidth)-fn(Ut(e.availLeft),0),null),fn(Ut(e.height)-Ut(e.availHeight)-fn(Ut(e.availTop),0),null),fn(Ut(e.availLeft),null)]}function ia(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function hb(){return fn(ea(navigator.hardwareConcurrency),void 0)}function mb(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-gb();return"UTC".concat(r>=0?"+":"").concat(r)}function gb(){var e=new Date().getFullYear();return Math.max(Ut(new Date(e,0,1).getTimezoneOffset()),Ut(new Date(e,6,1).getTimezoneOffset()))}function vb(){try{return!!window.sessionStorage}catch{return!0}}function yb(){try{return!!window.localStorage}catch{return!0}}function bb(){if(!(vu()||Oy()))try{return!!window.indexedDB}catch{return!0}}function wb(){return!!window.openDatabase}function Eb(){return navigator.cpuClass}function xb(){var e=navigator.platform;return e==="MacIntel"&&Gt()&&!ta()?Iy()?"iPad":"iPhone":e}function Sb(){return navigator.vendor||""}function Cb(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],o=window[r];o&&typeof o=="object"&&e.push(r)}return e.sort()}function Tb(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Ob(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function kb(e){var t=e===void 0?{}:e,n=t.debug;return Jt(this,void 0,void 0,function(){var r,o,s,i,a,l;return Qt(this,function(c){switch(c.label){case 0:return Rb()?(r=Ob(),o=Object.keys(r),s=(l=[]).concat.apply(l,o.map(function(u){return r[u]})),[4,Pb(s)]):[2,void 0];case 1:return i=c.sent(),n&&Ib(r,i),a=o.filter(function(u){var d=r[u],h=yt(d.map(function(p){return i[p]}));return h>d.length*.6}),a.sort(),[2,a]}})})}function Rb(){return Gt()||na()}function Pb(e){var t;return Jt(this,void 0,void 0,function(){var n,r,o,s,l,i,a,l;return Qt(this,function(c){switch(c.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),s={},xu(r),l=0;l<e.length;++l)i=By(e[l]),i.tagName==="DIALOG"&&i.show(),a=n.createElement("div"),xu(a),a.appendChild(i),r.appendChild(a),o[l]=i;c.label=1;case 1:return n.body?[3,3]:[4,as(50)];case 2:return c.sent(),[3,1];case 3:n.body.appendChild(r);try{for(l=0;l<e.length;++l)o[l].offsetParent||(s[e[l]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,s]}})})}function xu(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Ib(e,t){for(var n="DOM blockers debug:\n```",r=0,o=Object.keys(e);r<o.length;r++){var s=o[r];n+=`
4
- `.concat(s,":");for(var i=0,a=e[s];i<a.length;i++){var l=a[i];n+=`
5
- `.concat(t[l]?"🚫":"➡️"," ").concat(l)}}console.log("".concat(n,"\n```"))}function _b(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Nb(){if(Su("inverted"))return!0;if(Su("none"))return!1}function Su(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Ab(){if(Cu("active"))return!0;if(Cu("none"))return!1}function Cu(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var Db=100;function Mb(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=Db;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function Lb(){if(Cr("no-preference"))return 0;if(Cr("high")||Cr("more"))return 1;if(Cr("low")||Cr("less"))return-1;if(Cr("forced"))return 10}function Cr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function $b(){if(Tu("reduce"))return!0;if(Tu("no-preference"))return!1}function Tu(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Fb(){if(Ou("reduce"))return!0;if(Ou("no-preference"))return!1}function Ou(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function Vb(){if(ku("high"))return!0;if(ku("standard"))return!1}function ku(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var Le=Math,bt=function(){return 0};function Bb(){var e=Le.acos||bt,t=Le.acosh||bt,n=Le.asin||bt,r=Le.asinh||bt,o=Le.atanh||bt,s=Le.atan||bt,i=Le.sin||bt,a=Le.sinh||bt,l=Le.cos||bt,c=Le.cosh||bt,u=Le.tan||bt,d=Le.tanh||bt,h=Le.exp||bt,p=Le.expm1||bt,g=Le.log1p||bt,m=function(I){return Le.pow(Le.PI,I)},v=function(I){return Le.log(I+Le.sqrt(I*I-1))},y=function(I){return Le.log(I+Le.sqrt(I*I+1))},b=function(I){return Le.log((1+I)/(1-I))/2},E=function(I){return Le.exp(I)-1/Le.exp(I)/2},x=function(I){return(Le.exp(I)+1/Le.exp(I))/2},w=function(I){return Le.exp(I)-1},T=function(I){return(Le.exp(2*I)-1)/(Le.exp(2*I)+1)},S=function(I){return Le.log(1+I)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:v(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:y(1),atanh:o(.5),atanhPf:b(.5),atan:s(.5),sin:i(-1e300),sinh:a(1),sinhPf:E(1),cos:l(10.000000000123),cosh:c(1),coshPf:x(1),tan:u(-1e300),tanh:d(1),tanhPf:T(1),exp:h(1),expm1:p(1),expm1Pf:w(1),log1p:g(10),log1pPf:S(10),powPI:m(-100)}}var Wb="mmMwWLliI0fiflO&1",aa={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function jb(){return Hb(function(e,t){for(var n={},r={},o=0,s=Object.keys(aa);o<s.length;o++){var i=s[o],a=aa[i],l=a[0],c=l===void 0?{}:l,u=a[1],d=u===void 0?Wb:u,h=e.createElement("span");h.textContent=d,h.style.whiteSpace="nowrap";for(var p=0,g=Object.keys(c);p<g.length;p++){var m=g[p],v=c[m];v!==void 0&&(h.style[m]=v)}n[i]=h,t.append(e.createElement("br"),h)}for(var y=0,b=Object.keys(aa);y<b.length;y++){var i=b[y];r[i]=n[i].getBoundingClientRect().width}return r})}function Hb(e,t){return t===void 0&&(t=4e3),wu(function(n,r){var o=r.document,s=o.body,i=s.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",lo()?s.style.zoom="".concat(1/r.devicePixelRatio):Gt()&&(s.style.zoom="reset");var a=o.createElement("div");return a.textContent=Qi([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),s.appendChild(a),e(o,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Ub(){return navigator.pdfViewerEnabled}function Gb(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function zb(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(Yb())return-3;try{return e.canMakePayments()?1:0}catch(t){return Zb(t)}}var Yb=jy;function Zb(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function qb(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var Ru=-1,Pu=-2,Xb=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Kb=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Jb=["FRAGMENT_SHADER","VERTEX_SHADER"],Qb=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Iu="WEBGL_debug_renderer_info",e0="WEBGL_polygon_mode";function t0(e){var t,n,r,o,s,i,a=e.cache,l=_u(a);if(!l)return Ru;if(!Du(l))return Pu;var c=Au()?null:l.getExtension(Iu);return{version:((t=l.getParameter(l.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=l.getParameter(l.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:c?(r=l.getParameter(c.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=l.getParameter(l.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:c?(s=l.getParameter(c.UNMASKED_RENDERER_WEBGL))===null||s===void 0?void 0:s.toString():"",shadingLanguageVersion:((i=l.getParameter(l.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function n0(e){var t=e.cache,n=_u(t);if(!n)return Ru;if(!Du(n))return Pu;var r=n.getSupportedExtensions(),o=n.getContextAttributes(),s=[],i=[],a=[],l=[],c=[];if(o)for(var u=0,d=Object.keys(o);u<d.length;u++){var h=d[u];i.push("".concat(h,"=").concat(o[h]))}for(var p=Nu(n),g=0,m=p;g<m.length;g++){var v=m[g],y=n[v];a.push("".concat(v,"=").concat(y).concat(Xb.has(y)?"=".concat(n.getParameter(y)):""))}if(r)for(var b=0,E=r;b<E.length;b++){var x=E[b];if(!(x===Iu&&Au()||x===e0&&s0())){var w=n.getExtension(x);if(!w){s.push(x);continue}for(var T=0,S=Nu(w);T<S.length;T++){var v=S[T],y=w[v];l.push("".concat(v,"=").concat(y).concat(Kb.has(y)?"=".concat(n.getParameter(y)):""))}}}for(var I=0,A=Jb;I<A.length;I++)for(var L=A[I],M=0,N=Qb;M<N.length;M++){var R=N[M],P=r0(n,L,R);c.push("".concat(L,".").concat(R,"=").concat(P.join(",")))}return l.sort(),a.sort(),{contextAttributes:i,parameters:a,shaderPrecisions:c,extensions:r,extensionParameters:l,unsupportedExtensions:s}}function _u(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,o=["webgl","experimental-webgl"];r<o.length;r++){var s=o[r];try{n=t.getContext(s)}catch{}if(n)break}return e.webgl={context:n},n}function r0(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Nu(e){var t=Object.keys(e.__proto__);return t.filter(o0)}function o0(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function Au(){return yu()}function s0(){return lo()||Gt()}function Du(e){return typeof e.getParameter=="function"}function i0(){var e=na()||Gt();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function a0(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var c0={fonts:Gy,domBlockers:kb,fontPreferences:jb,audio:Dy,screenFrame:pb,canvas:Yy,osCpu:rb,languages:ob,colorDepth:sb,deviceMemory:ib,screenResolution:ab,hardwareConcurrency:hb,timezone:mb,sessionStorage:vb,localStorage:yb,indexedDB:bb,openDatabase:wb,cpuClass:Eb,platform:xb,plugins:zy,touchSupport:nb,vendor:Sb,vendorFlavors:Cb,cookiesEnabled:Tb,colorGamut:_b,invertedColors:Nb,forcedColors:Ab,monochrome:Mb,contrast:Lb,reducedMotion:$b,reducedTransparency:Fb,hdr:Vb,math:Bb,pdfViewerEnabled:Ub,architecture:Gb,applePay:zb,privateClickMeasurement:qb,audioBaseLatency:i0,dateTimeLocale:a0,webGlBasics:t0,webGlExtensions:n0};function l0(e){return Ty(c0,e,[])}var u0="$ if upgrade to Pro: https://fpjs.dev/pro";function d0(e){var t=f0(e),n=p0(t);return{score:t,comment:u0.replace(/\$/g,"".concat(n))}}function f0(e){if(na())return .4;if(Gt())return ta()&&!(fo()&&uo())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function p0(e){return hu(.99+.01*e,1e-4)}function h0(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var o=r[n],s=e[o],i="error"in s?"error":JSON.stringify(s.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}function Mu(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Ey(n):n},2)}function Lu(e){return wy(h0(e))}function m0(e){var t,n=d0(e);return{get visitorId(){return t===void 0&&(t=Lu(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:uu}}function g0(e){return e===void 0&&(e=50),dy(e,e*2)}function v0(e,t){var n=Date.now();return{get:function(r){return Jt(this,void 0,void 0,function(){var o,s,i;return Qt(this,function(a){switch(a.label){case 0:return o=Date.now(),[4,e()];case 1:return s=a.sent(),i=m0(s),(t||r?.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,`
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(`._Viewport_ai81v_1{position:fixed;width:100%;max-width:300px;margin:0 auto;top:1rem;right:0;left:0;bottom:auto;z-index:999}._Toast_ai81v_14{--gap: .75rem;--peek: .75rem;--scale: max(0, 1 - (var(--toast-index) * .1)) ;--shrink: calc(1 - var(--scale));--height: var(--toast-frontmost-height, var(--toast-height));--offset-y: calc( var(--toast-offset-y) + (var(--toast-index) * var(--gap)) + var(--toast-swipe-movement-y) );position:absolute;box-sizing:border-box;background:var(--color-gray-50);color:var(--color-gray-900);border:1px solid var(--color-gray-200);padding:1rem;width:100%;box-shadow:0 2px 10px #0000001a;background-clip:padding-box;border-radius:.5rem;transform-origin:top center;top:0;left:0;right:0;margin:0 auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s,height .15s;cursor:default;z-index:calc(1000 - var(--toast-index));height:var(--height);transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--peek)) + (var(--shrink) * var(--height)))) scale(var(--scale))}._Toast_ai81v_14[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y));height:var(--toast-height)}._Toast_ai81v_14[data-starting-style],._Toast_ai81v_14[data-ending-style]{transform:translateY(-150%)}._Toast_ai81v_14[data-limited],._Toast_ai81v_14[data-ending-style]{opacity:0}._Toast_ai81v_14[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}._Toast_ai81v_14[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}._Toast_ai81v_14:after{content:"";position:absolute;width:100%;bottom:100%;left:0;height:calc(var(--gap) + 1px)}._Content_ai81v_99{overflow:hidden;transition:opacity .25s}._Content_ai81v_99[data-behind]{opacity:0}._Content_ai81v_99[data-expanded]{opacity:1}._Title_ai81v_112{font-weight:500;font-size:.975rem;line-height:1.25rem;margin:0}._Description_ai81v_119{font-size:.925rem;line-height:1.25rem;margin:0}._Close_ai81v_125{position:absolute;top:.5rem;right:.5rem;padding:0;border:none;background:transparent;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center;border-radius:.25rem}._Close_ai81v_125:hover{background-color:var(--color-gray-100)}._Icon_ai81v_144{width:1rem;height:1rem}._trigger_ltbvo_1{display:flex;height:100%;width:4rem;align-items:center;justify-content:center;gap:.25rem;border-right-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}._popup_ltbvo_5{width:20rem;overflow-y:auto;border-radius:1rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);max-height:var(--available-height);transform-origin:var(--transform-origin);transition:transform .2s ease,opacity .2s ease}._popup_ltbvo_5[data-starting-style],._popup_ltbvo_5[data-ending-style]{opacity:0;transform:scale(.95)}._popup_ltbvo_5[data-side=none][data-starting-style]{transform:scale(1);opacity:1}._item_ltbvo_24{display:grid;min-width:var(--anchor-width);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;grid-template-columns:.75rem 1fr;align-items:center;gap:.5rem;border-bottom-width:1px;padding:.75rem 1rem;font-size:.875rem;line-height:1.25rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}._item_ltbvo_24:last-child{border-bottom-width:0px}._item_ltbvo_24:first-of-type{border-top-left-radius:1rem;border-top-right-radius:1rem}._item_ltbvo_24:last-of-type{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}._item_ltbvo_24[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}._indicator_ltbvo_40{grid-column-start:1}._itemText_ltbvo_44{grid-column-start:2;display:flex;justify-content:space-between}._itemCode_ltbvo_48{font-weight:500}._itemLabel_ltbvo_52{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}._uidGet_os9yc_1{width:80vw;max-width:400px;background-size:cover;background-position:center}._mailCodeGet_os9yc_5{width:100%;background-size:cover;background-position:center}.game-5174 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626145347721513.png);aspect-ratio:553 / 428}.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:680/1096}.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626151631191610.png)}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5174 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626144535531913.png)}}.game-5273 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250626142807783110.png);aspect-ratio:553 / 428}.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1096;background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-mobile.png)}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{aspect-ratio:1220/654}}@media(min-width:1024px){.game-5273 ._mailCodeGet_os9yc_5{background-image:url(https://h5.sdk.mobileztgame.com/dist/role-tip-pc.png)}}.game-5242 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624152217734019.png);aspect-ratio:596 / 266}.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624132201121910.png)}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5242 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250624143628881023.png)}}.game-5234 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811141956691626.png);aspect-ratio:740 / 290}.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:680 / 1094;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142113377920.png)}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{aspect-ratio:1300/654}}@media(min-width:1024px){.game-5234 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/ipayact/250811142146601319.png)}}.game-5199 ._uidGet_os9yc_1{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319163303381734.png);aspect-ratio:541 / 431;border-radius:10px}.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:353 / 561;background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319160000001714.png)}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{aspect-ratio:677/323}}@media(min-width:1024px){.game-5199 ._mailCodeGet_os9yc_5{background-image:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319153435571035.png)}}.game-5199 input{color:#dfd9c6}.game-5199 input::-moz-placeholder{color:#70625e}.game-5199 input::placeholder{color:#70625e}.game-5199 button{color:#dfd9c6}.game-5199 ._uidGetPopup_os9yc_79{background-color:#5d5655;padding:10px}.game-5199 ._uidGetArrow_os9yc_83{color:#5d5655}.game-5199 ._inputControl_os9yc_86{height:40px}.game-5199 ._form_os9yc_89>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}._quickLogin_1ibz1_1{width:100%}._quickAccounts_1ibz1_5{position:relative}._selectedAccount_1ibz1_9{display:flex;align-items:center;justify-content:space-between;border:1px solid #ddd;border-radius:9999px;height:44px;padding:0 20px;background:#fff;cursor:pointer}._accountInfo_1ibz1_21{display:flex;flex-direction:column}._accountName_1ibz1_26{font-size:15px;color:#333}._arrow_1ibz1_31{size:16px;color:#999;transition:transform .2s}._arrowRotate_1ibz1_37{transform:rotate(180deg)}._accountList_1ibz1_41{position:absolute;top:50px;left:0;right:0;z-index:10}._listScroll_1ibz1_49{max-height:200px;border:1px solid #ddd;border-radius:12px;overflow-y:auto;background:#fff;box-shadow:0 4px 12px #0000001a}._accountItem_1ibz1_58{display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:44px;gap:12px;border-bottom:1px solid #f5f5f5;cursor:pointer}._accountItem_1ibz1_58:last-child{border-bottom:none}._accountItem_1ibz1_58:hover{background-color:#f9f9f9}._accountItem_1ibz1_58._active_1ibz1_77{background-color:#f0f4ff}._accountItem_1ibz1_58._active_1ibz1_77 ._itemName_1ibz1_81{color:#497efe;font-weight:500}._itemInfo_1ibz1_86{display:flex;flex-direction:column;flex:1}._itemName_1ibz1_81{font-size:14px;color:#333}._deleteBtn_1ibz1_97{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:background-color .2s}._deleteBtn_1ibz1_97:hover{background-color:#fee2e2}.game-5199 ._modal_1pbx2_2{background:url(https://cdn-imgs.sdk.mobileztgame.com/paycenter/260319165656615516.png) no-repeat center center;background-size:100% 100%;padding:60px 35px 30px}.game-5199 ._close_1pbx2_8{top:10px;right:0;background:url(https://ipay.ztgame.com/png/button_close.hzBHa9.png) no-repeat center center;background-size:100% 100%;width:57px;height:60px}.game-5199 ._close_1pbx2_8 svg{opacity:0}.game-5199 ._close_1pbx2_8:hover{background-color:transparent}._autoLoginHint_h58ls_1{position:fixed;top:16px;left:50%;transform:translate(-50%);width:80%;max-width:400px;height:48px;background-color:#000c;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 20px;z-index:9999;font-size:14px;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-radius:24px;box-shadow:0 8px 20px #0000004d}._left_h58ls_22{display:flex;align-items:center;gap:8px}._loading_h58ls_28{width:18px;height:18px;border:2px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:_spin_h58ls_1 .8s cubic-bezier(.5,.1,.4,.9) infinite}._switchBtn_h58ls_37{color:#a5a7ff;cursor:pointer;padding:6px 12px;background:#787bf426;border:none;font-size:13px;font-weight:600;border-radius:12px;transition:all .2s ease}._switchBtn_h58ls_37:hover{background:#787bf44d;color:#fff}@keyframes _spin_h58ls_1{to{transform:rotate(360deg)}}*,: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}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input::-webkit-input-placeholder{color:#a9a9a9}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.inset-0{inset:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\\/2{left:50%}.right-0{right:0}.right-4{right:1rem}.top-0{top:0}.top-1\\/2{top:50%}.top-4{top:1rem}.z-\\[1\\]{z-index:1}.z-\\[990\\]{z-index:990}.z-\\[991\\]{z-index:991}.z-\\[992\\]{z-index:992}.z-\\[999\\]{z-index:999}.col-start-1{grid-column-start:1}.col-start-2{grid-column-start:2}.mx-auto{margin-left:auto;margin-right:auto}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.-mt-1\\.5{margin-top:-.375rem}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.mr-0\\.5{margin-right:.125rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-\\[240\\/85\\]{aspect-ratio:240/85}.size-3{width:.75rem;height:.75rem}.size-4{width:1rem;height:1rem}.size-5{width:1.25rem;height:1.25rem}.size-6{width:1.5rem;height:1.5rem}.h-1\\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-4{height:1rem}.h-4\\/6{height:66.666667%}.h-7{height:1.75rem}.h-9{height:2.25rem}.h-\\[70vh\\]{height:70vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.max-h-\\[var\\(--available-height\\)\\]{max-height:var(--available-height)}.w-0{width:0px}.w-12{width:3rem}.w-16{width:4rem}.w-32{width:8rem}.w-80{width:20rem}.w-96{width:24rem}.w-\\[300px\\]{width:300px}.w-\\[400px\\]{width:400px}.w-\\[90vw\\]{width:90vw}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[var\\(--anchor-width\\)\\]{min-width:var(--anchor-width)}.max-w-64{max-width:16rem}.max-w-\\[80vw\\]{max-width:80vw}.max-w-\\[calc\\(100vw-3rem\\)\\]{max-width:calc(100vw - 3rem)}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.origin-\\[var\\(--transform-origin\\)\\]{transform-origin:var(--transform-origin)}.-translate-x-1\\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.grid-cols-\\[0\\.75rem_1fr\\]{grid-template-columns:.75rem 1fr}.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-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}.border-\\[var\\(--jssdk-input-border-color\\)\\]{border-color:var(--jssdk-input-border-color)}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.bg-\\[canvas\\]{background-color:canvas}.bg-\\[var\\(--jssdk-icon-color\\)\\]{background-color:var(--jssdk-icon-color)}.bg-\\[var\\(--jssdk-input-bg-color\\)\\]{background-color:var(--jssdk-input-bg-color)}.bg-black\\/20{background-color:#0003}.bg-black\\/70{background-color:#000000b3}.bg-black\\/80{background-color:#000c}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-inherit{background-color:inherit}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-gradient-to-r{background-image:linear-gradient(to right,var(--tw-gradient-stops))}.from-\\[\\#497efe\\]{--tw-gradient-from: #497efe var(--tw-gradient-from-position);--tw-gradient-to: rgb(73 126 254 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.to-\\[\\#947afa\\]{--tw-gradient-to: #947afa var(--tw-gradient-to-position)}.fill-\\[canvas\\]{fill:canvas}.fill-current{fill:currentColor}.fill-gray-200{fill:#e5e7eb}.fill-gray-400{fill:#9ca3af}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-1{padding:.25rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-\\[11px\\]{font-size:11px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.text-\\[\\#f59e9e\\]{--tw-text-opacity: 1;color:rgb(245 158 158 / var(--tw-text-opacity, 1))}.text-\\[var\\(--jssdk-primary-color\\)\\]{color:var(--jssdk-primary-color)}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\\/80{color:#fffc}.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-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px 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}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-\\[transform\\,scale\\,opacity\\]{transition-property:transform,scale,opacity;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}.duration-150{transition-duration:.15s}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:0}.before\\:top-\\[-100\\%\\]:before{content:var(--tw-content);top:-100%}.before\\:h-full:before{content:var(--tw-content);height:100%}.before\\:w-full:before{content:var(--tw-content);width:100%}.before\\:content-\\[\\'\\'\\]:before{--tw-content: "";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-width:0px}.focus-within\\:border-\\[\\#787bf4\\]:focus-within{--tw-border-opacity: 1;border-color:rgb(120 123 244 / var(--tw-border-opacity, 1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[var\\(--jssdk-primary-color\\)\\]:hover{color:var(--jssdk-primary-color)}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\\:brightness-110:hover{--tw-brightness: brightness(1.1);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)}.focus\\:outline:focus{outline-style:solid}.focus\\:outline-2:focus{outline-width:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.active\\:scale-90:active{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:brightness-90:active{--tw-brightness: brightness(.9);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)}.enabled\\:text-\\[var\\(--jssdk-primary-color\\)\\]:enabled{color:var(--jssdk-primary-color)}.enabled\\:hover\\:bg-\\[var\\(--jssdk-primary-color\\)\\]:hover:enabled{background-color:var(--jssdk-primary-color)}.enabled\\:hover\\:text-\\[var\\(--jssdk-primary-foregroud-color\\)\\]:hover:enabled{color:var(--jssdk-primary-foregroud-color)}.enabled\\:hover\\:text-white:hover:enabled{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:text-gray-500:disabled{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:grayscale:disabled{--tw-grayscale: grayscale(100%);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)}.data-\\[direction\\=down\\]\\:bottom-0[data-direction=down]{bottom:0}.data-\\[side\\=bottom\\]\\:top-\\[-8px\\][data-side=bottom]{top:-8px}.data-\\[side\\=left\\]\\:right-\\[-13px\\][data-side=left]{right:-13px}.data-\\[side\\=right\\]\\:left-\\[-13px\\][data-side=right]{left:-13px}.data-\\[side\\=top\\]\\:bottom-\\[-8px\\][data-side=top]{bottom:-8px}.data-\\[side\\=left\\]\\:rotate-90[data-side=left]{--tw-rotate: 90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=right\\]\\:-rotate-90[data-side=right]{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:rotate-180[data-side=top]{--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))}.data-\\[ending-style\\]\\:scale-90[data-ending-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:scale-100[data-starting-style][data-side=none]{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[starting-style\\]\\:scale-90[data-starting-style]{--tw-scale-x: .9;--tw-scale-y: .9;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[checked\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-checked],.data-\\[focused\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\][data-focused]{border-color:var(--jssdk-primary-color)}.data-\\[unchecked\\]\\:border-\\[var\\(--jssdk-input-border-color\\)\\][data-unchecked]{border-color:var(--jssdk-input-border-color)}.data-\\[unchecked\\]\\:border-gray-300[data-unchecked]{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.data-\\[highlighted\\]\\:bg-gray-50[data-highlighted]{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.data-\\[highlighted\\]\\:text-\\[\\#789bf5\\][data-highlighted]{--tw-text-opacity: 1;color:rgb(120 155 245 / var(--tw-text-opacity, 1))}.data-\\[ending-style\\]\\:opacity-0[data-ending-style]{opacity:0}.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:opacity-100[data-starting-style][data-side=none]{opacity:1}.data-\\[starting-style\\]\\:opacity-0[data-starting-style]{opacity:0}.data-\\[ending-style\\]\\:transition-none[data-ending-style],.data-\\[side\\=none\\]\\:data-\\[starting-style\\]\\:transition-none[data-starting-style][data-side=none]{transition-property:none}.data-\\[direction\\=down\\]\\:before\\:bottom-\\[-100\\%\\][data-direction=down]:before{content:var(--tw-content);bottom:-100%}.dark\\:fill-gray-300:is(.dark *){fill:#d1d5db}.dark\\:fill-none:is(.dark *){fill:none}.dark\\:opacity-70:is(.dark *){opacity:.7}.dark\\:shadow-none:is(.dark *){--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)}.dark\\:-outline-offset-1:is(.dark *){outline-offset:-1px}.dark\\:outline-gray-300:is(.dark *){outline-color:#d1d5db}@media(min-width:768px){.md\\:size-5{width:1.25rem;height:1.25rem}.md\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media(min-width:1024px){.lg\\:size-6{width:1.5rem;height:1.5rem}.lg\\:w-4\\/5{width:80%}.lg\\:w-\\[60vw\\]{width:60vw}.lg\\:max-w-5xl{max-width:64rem}.lg\\:text-2xl{font-size:1.5rem;line-height:2rem}}`)),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ (function(at,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react-dom/client"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react-dom/client","react","react-dom"],x):(at=typeof globalThis<"u"?globalThis:at||self,x(at.SDK={},at.jsxRuntime,at.ReactDOM,at.React,at.ReactDOM))})(this,(function(at,x,Um,z,uu){"use strict";function lu(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const p=lu(z),jt=lu(uu);var Hr=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(){}},Ao=typeof window>"u"||"Deno"in globalThis;function Bt(){}function Wm(e,t){return typeof e=="function"?e(t):e}function Hm(e){return typeof e=="number"&&e>=0&&e!==1/0}function Zm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ei(e,t){return typeof e=="function"?e(t):e}function Gm(e,t){return typeof e=="function"?e(t):e}function du(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Si(i,t.options))return!1}else if(!Zr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function fu(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Zn(t.options.mutationKey)!==Zn(s))return!1}else if(!Zr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Si(e,t){return(t?.queryKeyHashFn||Zn)(e)}function Zn(e){return JSON.stringify(e,(t,n)=>xi(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Zr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Zr(e[n],t[n])):!1}function Ci(e,t){if(e===t)return e;const n=pu(e)&&pu(t);if(n||xi(e)&&xi(t)){const r=n?e:Object.keys(e),o=r.length,s=n?t:Object.keys(t),i=s.length,a=n?[]:{},c=new Set(r);let l=0;for(let u=0;u<i;u++){const d=n?u:s[u];(!n&&c.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=Ci(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===i&&l===o?e:a}return t}function Ym(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function pu(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xi(e){if(!hu(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!hu(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function hu(e){return Object.prototype.toString.call(e)==="[object Object]"}function qm(e){return new Promise(t=>{setTimeout(t,e)})}function Km(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return Ci(e,t)}catch(r){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`),r}return Ci(e,t)}return t}function Xm(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Jm(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Do=Symbol();function mu(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===Do&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Do?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Qm(e,t){return typeof e=="function"?e(...t):!!e}var eg=class extends Hr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ao&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},gu=new eg,tg=class extends Hr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ao&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},Mo=new tg;function ng(){let e,t;const n=new Promise((o,s)=>{e=o,t=s});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 rg(e){return Math.min(1e3*2**e,3e4)}function vu(e){return(e??"online")==="online"?Mo.isOnline():!0}var yu=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ti(e){return e instanceof yu}function bu(e){let t=!1,n=0,r=!1,o;const s=ng(),i=g=>{r||(f(new yu(g)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},l=()=>gu.isFocused()&&(e.networkMode==="always"||Mo.isOnline())&&e.canRun(),u=()=>vu(e.networkMode)&&e.canRun(),d=g=>{r||(r=!0,e.onSuccess?.(g),o?.(),s.resolve(g))},f=g=>{r||(r=!0,e.onError?.(g),o?.(),s.reject(g))},h=()=>new Promise(g=>{o=y=>{(r||l())&&g(y)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{if(r)return;const S=e.retry??(Ao?0:3),C=e.retryDelay??rg,w=typeof C=="function"?C(n,v):C,b=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,v);if(t||!b){f(v);return}n++,e.onFail?.(n,v),qm(w).then(()=>l()?void 0:h()).then(()=>{t?f(v):m()})})};return{promise:s,cancel:i,continue:()=>(o?.(),s),cancelRetry:a,continueRetry:c,canStart:u,start:()=>(u()?m():h().then(m),s)}}var og=e=>setTimeout(e,0);function sg(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=og;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var yt=sg(),wu=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Hm(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ao?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},ig=class extends wu{#e;#t;#n;#r;#o;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=cg(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#o?.promise}setOptions(e){this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Km(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#o?.promise;return this.#o?.cancel(e),t?t.then(Bt).catch(Bt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Gm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Do||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ei(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Zm(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#o?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#o?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#o&&(this.#a?this.#o.cancel({revert:!0}):this.#o.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#o)return this.#o.continueRetry(),this.#o.promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(l=>l.options.queryFn);c&&this.setOptions(c.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const n=new AbortController,r=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const c=mu(this.options,t),u=(()=>{const d={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(d),d})();return this.#a=!1,this.options.persister?this.options.persister(c,u,this):c(u)},i=(()=>{const c={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:o};return r(c),c})();this.options.behavior?.onFetch(i,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==i.fetchOptions?.meta)&&this.#s({type:"fetch",meta:i.fetchOptions?.meta});const a=c=>{Ti(c)&&c.silent||this.#s({type:"error",error:c}),Ti(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#o=bu({initialPromise:t?.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:c=>{if(c===void 0){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(l){a(l);return}this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,l)=>{this.#s({type:"failed",failureCount:c,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0}),this.#o.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...ag(n.data,this.options),fetchMeta:e.meta??null};case"success":return this.#t=void 0,{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return Ti(r)&&r.revert&&this.#t?{...this.#t,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function ag(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:vu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cg(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 ug=class extends Hr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??Si(r,t);let s=this.get(o);return s||(s=new ig({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){yt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>du(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>du(e,n)):t}notify(e){yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lg=class extends wu{#e;#t;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#e=[],this.state=e.state||Eu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=bu({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(o,s)=>{this.#r({type:"failed",failureCount:o,error:s})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const n=this.state.status==="pending",r=!this.#n.canStart();try{if(n)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#t.config.onMutate?.(e,this);const s=await this.options.onMutate?.(e);s!==this.state.context&&this.#r({type:"pending",context:s,variables:e,isPaused:r})}const o=await this.#n.start();return await this.#t.config.onSuccess?.(o,e,this.state.context,this),await this.options.onSuccess?.(o,e,this.state.context),await this.#t.config.onSettled?.(o,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(o,null,e,this.state.context),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#t.config.onError?.(o,e,this.state.context,this),await this.options.onError?.(o,e,this.state.context),await this.#t.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,o,e,this.state.context),o}finally{this.#r({type:"error",error:o})}}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),yt.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Eu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dg=class extends Hr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const r=new lg({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Lo(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Lo(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Lo(e);if(typeof t=="string"){const r=this.#t.get(t)?.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=Lo(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){yt.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>fu(t,n))}findAll(e={}){return this.getAll().filter(t=>fu(e,t))}notify(e){yt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return yt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Bt))))}};function Lo(e){return e.options.scope?.id}function Su(e){return{onFetch:(t,n)=>{const r=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const l=async()=>{let u=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=mu(t.options,t.fetchOptions),h=async(m,g,y)=>{if(u)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const S=(()=>{const T={client:t.client,queryKey:t.queryKey,pageParam:g,direction:y?"backward":"forward",meta:t.options.meta};return d(T),T})(),C=await f(S),{maxPages:w}=t.options,b=y?Jm:Xm;return{pages:b(m.pages,C,w),pageParams:b(m.pageParams,g,w)}};if(o&&s.length){const m=o==="backward",g=m?fg:Cu,y={pages:s,pageParams:i},v=g(r,y);a=await h(y,v,m)}else{const m=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:Cu(r,a);if(c>0&&g==null)break;a=await h(a,g),c++}while(c<m)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Cu(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 fg(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var pg=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new ug,this.#t=e.mutationCache||new dg,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=gu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Mo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ei(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#e.get(r.queryHash)?.state.data,i=Wm(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return yt.batch(()=>this.#e.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=yt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Bt).catch(Bt)}invalidateQueries(e,t={}){return yt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=yt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(Bt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Bt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ei(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Bt).catch(Bt)}fetchInfiniteQuery(e){return e.behavior=Su(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Bt).catch(Bt)}ensureInfiniteQueryData(e){return e.behavior=Su(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Mo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Zn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Zr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(Zn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Zr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Si(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.queryFn===Do&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},hg=class extends Hr{#e;#t=void 0;#n;#r;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#o()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),Ym(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Zn(n.mutationKey)!==Zn(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#o(),this.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#o(),this.#i()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#o(){const t=this.#n?.state??Eu();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#i(t){yt.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#t.variables,r=this.#t.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#t)})})}},xu=p.createContext(void 0),mg=e=>{const t=p.useContext(xu);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gg=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),x.jsx(xu.Provider,{value:e,children:t}));function mr(e,t){const n=mg(),[r]=p.useState(()=>new hg(n,e));p.useEffect(()=>{r.setOptions(e)},[r,e]);const o=p.useSyncExternalStore(p.useCallback(i=>r.subscribe(yt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=p.useCallback((i,a)=>{r.mutate(i,a).catch(Bt)},[r]);if(o.error&&Qm(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Zt=function(){return Zt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Zt.apply(this,arguments)};function Tu(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);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function nn(e,t,n,r){function o(s){return s instanceof n?s:new n(function(i){i(s)})}return new(n||(n=Promise))(function(s,i){function a(u){try{l(r.next(u))}catch(d){i(d)}}function c(u){try{l(r.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):o(u.value).then(a,c)}l((r=r.apply(e,t||[])).next())})}function rn(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=a(0),i.throw=a(1),i.return=a(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],o=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function vg(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function Oi(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Ou="4.6.2";function Fo(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function yg(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function bg(e,t){t===void 0&&(t=1/0);var n=window.requestIdleCallback;return n?new Promise(function(r){return n.call(window,function(){return r()},{timeout:t})}):Fo(Math.min(e,t))}function _u(e){return!!e&&typeof e.then=="function"}function Pu(e,t){try{var n=e();_u(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function Iu(e,t,n){return n===void 0&&(n=16),nn(this,void 0,void 0,function(){var r,o,s,i;return rn(this,function(a){switch(a.label){case 0:r=Array(e.length),o=Date.now(),s=0,a.label=1;case 1:return s<e.length?(r[s]=t(e[s],s),i=Date.now(),i>=o+n?(o=i,[4,yg()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,r]}})})}function Gr(e){return e.then(void 0,function(){}),e}function wg(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Eg(e,t){return!wg(e,t)}function _i(e){return parseInt(e)}function Gt(e){return parseFloat(e)}function mn(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Tt(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function ku(e,t){if(t===void 0&&(t=1),Math.abs(t)>=1)return Math.round(e/t)*t;var n=1/t;return Math.round(e*n)/n}function Sg(e){for(var t,n,r="Unexpected syntax '".concat(e,"'"),o=/^\s*([a-z-]*)(.*)$/i.exec(e),s=o[1]||void 0,i={},a=/([.:#][\w-]+|\[.+?\])/gi,c=function(f,h){i[f]=i[f]||[],i[f].push(h)};;){var l=a.exec(o[2]);if(!l)break;var u=l[0];switch(u[0]){case".":c("class",u.slice(1));break;case"#":c("id",u.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(u);if(d)c(d[1],(n=(t=d[4])!==null&&t!==void 0?t:d[5])!==null&&n!==void 0?n:"");else throw new Error(r);break}default:throw new Error(r)}}return[s,i]}function Cg(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r>127)return new TextEncoder().encode(e);t[n]=r}return t}function kn(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,l=t[1]&65535,u=0,d=0,f=0,h=0;h+=s+l,f+=h>>>16,h&=65535,f+=o+c,d+=f>>>16,f&=65535,d+=r+a,u+=d>>>16,d&=65535,u+=n+i,u&=65535,e[0]=u<<16|d,e[1]=f<<16|h}function Ut(e,t){var n=e[0]>>>16,r=e[0]&65535,o=e[1]>>>16,s=e[1]&65535,i=t[0]>>>16,a=t[0]&65535,c=t[1]>>>16,l=t[1]&65535,u=0,d=0,f=0,h=0;h+=s*l,f+=h>>>16,h&=65535,f+=o*l,d+=f>>>16,f&=65535,f+=s*c,d+=f>>>16,f&=65535,d+=r*l,u+=d>>>16,d&=65535,d+=o*c,u+=d>>>16,d&=65535,d+=s*a,u+=d>>>16,d&=65535,u+=n*l+r*c+o*a+s*i,u&=65535,e[0]=u<<16|d,e[1]=f<<16|h}function gr(e,t){var n=e[0];t%=64,t===32?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Dt(e,t){t%=64,t!==0&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Xe(e,t){e[0]^=t[0],e[1]^=t[1]}var xg=[4283543511,3981806797],Tg=[3301882366,444984403];function Ru(e){var t=[0,e[0]>>>1];Xe(e,t),Ut(e,xg),t[1]=e[0]>>>1,Xe(e,t),Ut(e,Tg),t[1]=e[0]>>>1,Xe(e,t)}var $o=[2277735313,289559509],zo=[1291169091,658871167],Nu=[0,5],Og=[0,1390208809],_g=[0,944331445];function Pg(e,t){var n=Cg(e);t=t||0;var r=[0,n.length],o=r[1]%16,s=r[1]-o,i=[0,t],a=[0,t],c=[0,0],l=[0,0],u;for(u=0;u<s;u=u+16)c[0]=n[u+4]|n[u+5]<<8|n[u+6]<<16|n[u+7]<<24,c[1]=n[u]|n[u+1]<<8|n[u+2]<<16|n[u+3]<<24,l[0]=n[u+12]|n[u+13]<<8|n[u+14]<<16|n[u+15]<<24,l[1]=n[u+8]|n[u+9]<<8|n[u+10]<<16|n[u+11]<<24,Ut(c,$o),gr(c,31),Ut(c,zo),Xe(i,c),gr(i,27),kn(i,a),Ut(i,Nu),kn(i,Og),Ut(l,zo),gr(l,33),Ut(l,$o),Xe(a,l),gr(a,31),kn(a,i),Ut(a,Nu),kn(a,_g);c[0]=0,c[1]=0,l[0]=0,l[1]=0;var d=[0,0];switch(o){case 15:d[1]=n[u+14],Dt(d,48),Xe(l,d);case 14:d[1]=n[u+13],Dt(d,40),Xe(l,d);case 13:d[1]=n[u+12],Dt(d,32),Xe(l,d);case 12:d[1]=n[u+11],Dt(d,24),Xe(l,d);case 11:d[1]=n[u+10],Dt(d,16),Xe(l,d);case 10:d[1]=n[u+9],Dt(d,8),Xe(l,d);case 9:d[1]=n[u+8],Xe(l,d),Ut(l,zo),gr(l,33),Ut(l,$o),Xe(a,l);case 8:d[1]=n[u+7],Dt(d,56),Xe(c,d);case 7:d[1]=n[u+6],Dt(d,48),Xe(c,d);case 6:d[1]=n[u+5],Dt(d,40),Xe(c,d);case 5:d[1]=n[u+4],Dt(d,32),Xe(c,d);case 4:d[1]=n[u+3],Dt(d,24),Xe(c,d);case 3:d[1]=n[u+2],Dt(d,16),Xe(c,d);case 2:d[1]=n[u+1],Dt(d,8),Xe(c,d);case 1:d[1]=n[u],Xe(c,d),Ut(c,$o),gr(c,31),Ut(c,zo),Xe(i,c)}return Xe(i,r),Xe(a,r),kn(i,a),kn(a,i),Ru(i),Ru(a),kn(i,a),kn(a,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)}function Ig(e){var t;return Zt({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
3
+ `)},e)}function kg(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Rg(e){return typeof e!="function"}function Ng(e,t){var n=Gr(new Promise(function(r){var o=Date.now();Pu(e.bind(null,t),function(){for(var s=[],i=0;i<arguments.length;i++)s[i]=arguments[i];var a=Date.now()-o;if(!s[0])return r(function(){return{error:s[1],duration:a}});var c=s[1];if(Rg(c))return r(function(){return{value:c,duration:a}});r(function(){return new Promise(function(l){var u=Date.now();Pu(c,function(){for(var d=[],f=0;f<arguments.length;f++)d[f]=arguments[f];var h=a+Date.now()-u;if(!d[0])return l({error:d[1],duration:h});l({value:d[1],duration:h})})})})})}));return function(){return n.then(function(o){return o()})}}function Ag(e,t,n,r){var o=Object.keys(e).filter(function(i){return Eg(n,i)}),s=Gr(Iu(o,function(i){return Ng(e[i],t)},r));return function(){return nn(this,void 0,void 0,function(){var a,c,l,u,d;return rn(this,function(f){switch(f.label){case 0:return[4,s];case 1:return a=f.sent(),[4,Iu(a,function(h){return Gr(h())},r)];case 2:return c=f.sent(),[4,Promise.all(c)];case 3:for(l=f.sent(),u={},d=0;d<o.length;++d)u[o[d]]=l[d];return[2,u]}})})}}function Au(){var e=window,t=navigator;return Tt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Dg(){var e=window,t=navigator;return Tt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Au()}function Yr(){var e=window,t=navigator;return Tt(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,(t.vendor||"").indexOf("Google")===0,"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function Yt(){var e=window,t=navigator;return Tt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function Pi(){var e=window,t=e.HTMLElement,n=e.Document;return Tt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function qr(){var e=window;return kg(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function Du(){var e,t,n=window;return Tt(["buildID"in navigator,"MozAppearance"in((t=(e=document.documentElement)===null||e===void 0?void 0:e.style)!==null&&t!==void 0?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function Mg(){var e=window;return Tt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Lg(){var e=window,t=e.URLPattern;return Tt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Fg(){var e=window;return Tt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function Kr(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return Tt([!("getStorageUpdates"in t),r&&"popover"in r.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function $g(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return Tt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function zg(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Vg(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ii(){var e=Yr(),t=Du(),n=window,r=navigator,o="connection";return e?Tt([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?Tt(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function jg(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return Tt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function Bg(){return Hg()?-4:Ug()}function Ug(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(Wg())return-1;var n=4500,r=5e3,o=new t(1,r,44100),s=o.createOscillator();s.type="triangle",s.frequency.value=1e4;var i=o.createDynamicsCompressor();i.threshold.value=-50,i.knee.value=40,i.ratio.value=12,i.attack.value=0,i.release.value=.25,s.connect(i),i.connect(o.destination),s.start(0);var a=Zg(o),c=a[0],l=a[1],u=Gr(c.then(function(d){return Gg(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return l(),u}}function Wg(){return Yt()&&!Pi()&&!Fg()}function Hg(){return Yt()&&Kr()&&qr()||Yr()&&jg()&&Lg()}function Zg(e){var t=3,n=500,r=500,o=5e3,s=function(){},i=new Promise(function(a,c){var l=!1,u=0,d=0;e.oncomplete=function(m){return a(m.renderedBuffer)};var f=function(){setTimeout(function(){return c(Mu("timeout"))},Math.min(r,d+o-Date.now()))},h=function(){try{var m=e.startRendering();switch(_u(m)&&Gr(m),e.state){case"running":d=Date.now(),l&&f();break;case"suspended":document.hidden||u++,l&&u>=t?c(Mu("suspended")):setTimeout(h,n);break}}catch(g){c(g)}};h(),s=function(){l||(l=!0,d>0&&f())}});return[i,s]}function Gg(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function Mu(e){var t=new Error(e);return t.name=e,t}function Lu(e,t,n){var r,o,s;return n===void 0&&(n=50),nn(this,void 0,void 0,function(){var i,a;return rn(this,function(c){switch(c.label){case 0:i=document,c.label=1;case 1:return i.body?[3,3]:[4,Fo(n)];case 2:return c.sent(),[3,1];case 3:a=i.createElement("iframe"),c.label=4;case 4:return c.trys.push([4,,10,11]),[4,new Promise(function(l,u){var d=!1,f=function(){d=!0,l()},h=function(y){d=!0,u(y)};a.onload=f,a.onerror=h;var m=a.style;m.setProperty("display","block","important"),m.position="absolute",m.top="0",m.left="0",m.visibility="hidden",t&&"srcdoc"in a?a.srcdoc=t:a.src="about:blank",i.body.appendChild(a);var g=function(){var y,v;d||(((v=(y=a.contentWindow)===null||y===void 0?void 0:y.document)===null||v===void 0?void 0:v.readyState)==="complete"?f():setTimeout(g,10))};g()})];case 5:c.sent(),c.label=6;case 6:return!((o=(r=a.contentWindow)===null||r===void 0?void 0:r.document)===null||o===void 0)&&o.body?[3,8]:[4,Fo(n)];case 7:return c.sent(),[3,6];case 8:return[4,e(a,a.contentWindow)];case 9:return[2,c.sent()];case 10:return(s=a.parentNode)===null||s===void 0||s.removeChild(a),[7];case 11:return[2]}})})}function Yg(e){for(var t=Sg(e),n=t[0],r=t[1],o=document.createElement(n??"div"),s=0,i=Object.keys(r);s<i.length;s++){var a=i[s],c=r[a].join(" ");a==="style"?qg(o.style,c):o.setAttribute(a,c)}return o}function qg(e,t){for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],s=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(o);if(s){var i=s[1],a=s[2],c=s[4];e.setProperty(i,a,c||"")}}}function Kg(){for(var e=window;;){var t=e.parent;if(!t||t===e)return!1;try{if(t.location.origin!==e.location.origin)return!0}catch(n){if(n instanceof Error&&n.name==="SecurityError")return!0;throw n}e=t}}var Xg="mmMwWLliI0O&1",Jg="48px",vr=["monospace","sans-serif","serif"],Fu=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function Qg(){var e=this;return Lu(function(t,n){var r=n.document;return nn(e,void 0,void 0,function(){var o,s,i,a,c,l,u,d,f,h,m,g;return rn(this,function(y){for(o=r.body,o.style.fontSize=Jg,s=r.createElement("div"),s.style.setProperty("visibility","hidden","important"),i={},a={},c=function(v){var S=r.createElement("span"),C=S.style;return C.position="absolute",C.top="0",C.left="0",C.fontFamily=v,S.textContent=Xg,s.appendChild(S),S},l=function(v,S){return c("'".concat(v,"',").concat(S))},u=function(){return vr.map(c)},d=function(){for(var v={},S=function(T){v[T]=vr.map(function(E){return l(T,E)})},C=0,w=Fu;C<w.length;C++){var b=w[C];S(b)}return v},f=function(v){return vr.some(function(S,C){return v[C].offsetWidth!==i[S]||v[C].offsetHeight!==a[S]})},h=u(),m=d(),o.appendChild(s),g=0;g<vr.length;g++)i[vr[g]]=h[g].offsetWidth,a[vr[g]]=h[g].offsetHeight;return[2,Fu.filter(function(v){return f(m[v])})]})})})}function ev(){var e=navigator.plugins;if(e){for(var t=[],n=0;n<e.length;++n){var r=e[n];if(r){for(var o=[],s=0;s<r.length;++s){var i=r[s];o.push({type:i.type,suffixes:i.suffixes})}t.push({name:r.name,description:r.description,mimeTypes:o})}}return t}}function tv(){return nv(uv())}function nv(e){var t,n=!1,r,o,s=rv(),i=s[0],a=s[1];return ov(i,a)?(n=sv(a),e?r=o="skipped":(t=iv(i,a),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function rv(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function ov(e,t){return!!(t&&e.toDataURL)}function sv(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function iv(e,t){av(e,t);var n=ki(e),r=ki(e);if(n!==r)return["unstable","unstable"];cv(e,t);var o=ki(e);return[o,n]}function av(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';var n="Cwm fjordbank gly ".concat("😃");t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}function cv(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(var n=0,r=[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]];n<r.length;n++){var o=r[n],s=o[0],i=o[1],a=o[2];t.fillStyle=s,t.beginPath(),t.arc(i,a,40,0,Math.PI*2,!0),t.closePath(),t.fill()}t.fillStyle="#f9c",t.arc(60,60,60,0,Math.PI*2,!0),t.arc(60,60,20,0,Math.PI*2,!0),t.fill("evenodd")}function ki(e){return e.toDataURL()}function uv(){return Yt()&&Kr()&&qr()}function lv(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=_i(e.maxTouchPoints):e.msMaxTouchPoints!==void 0&&(t=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}var r="ontouchstart"in window;return{maxTouchPoints:t,touchEvent:n,touchStart:r}}function dv(){return navigator.oscpu}function fv(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))Yr()&&Mg()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function pv(){return window.screen.colorDepth}function hv(){return mn(Gt(navigator.deviceMemory),void 0)}function mv(){if(!(Yt()&&Kr()&&qr()))return gv()}function gv(){var e=screen,t=function(r){return mn(_i(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var vv=2500,yv=10,Vo,Ri;function bv(){if(Ri===void 0){var e=function(){var t=Ni();Ai(t)?Ri=setTimeout(e,vv):(Vo=t,Ri=void 0)};e()}}function wv(){var e=this;return bv(),function(){return nn(e,void 0,void 0,function(){var t;return rn(this,function(n){switch(n.label){case 0:return t=Ni(),Ai(t)?Vo?[2,Oi([],Vo,!0)]:zg()?[4,Vg()]:[3,2]:[3,2];case 1:n.sent(),t=Ni(),n.label=2;case 2:return Ai(t)||(Vo=t),[2,t]}})})}}function Ev(){var e=this;if(Yt()&&Kr()&&qr())return function(){return Promise.resolve(void 0)};var t=wv();return function(){return nn(e,void 0,void 0,function(){var n,r;return rn(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(s){return s===null?null:ku(s,yv)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Ni(){var e=screen;return[mn(Gt(e.availTop),null),mn(Gt(e.width)-Gt(e.availWidth)-mn(Gt(e.availLeft),0),null),mn(Gt(e.height)-Gt(e.availHeight)-mn(Gt(e.availTop),0),null),mn(Gt(e.availLeft),null)]}function Ai(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Sv(){return mn(_i(navigator.hardwareConcurrency),void 0)}function Cv(){var e,t=(e=window.Intl)===null||e===void 0?void 0:e.DateTimeFormat;if(t){var n=new t().resolvedOptions().timeZone;if(n)return n}var r=-xv();return"UTC".concat(r>=0?"+":"").concat(r)}function xv(){var e=new Date().getFullYear();return Math.max(Gt(new Date(e,0,1).getTimezoneOffset()),Gt(new Date(e,6,1).getTimezoneOffset()))}function Tv(){try{return!!window.sessionStorage}catch{return!0}}function Ov(){try{return!!window.localStorage}catch{return!0}}function _v(){if(!(Au()||Dg()))try{return!!window.indexedDB}catch{return!0}}function Pv(){return!!window.openDatabase}function Iv(){return navigator.cpuClass}function kv(){var e=navigator.platform;return e==="MacIntel"&&Yt()&&!Pi()?$g()?"iPad":"iPhone":e}function Rv(){return navigator.vendor||""}function Nv(){for(var e=[],t=0,n=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];t<n.length;t++){var r=n[t],o=window[r];o&&typeof o=="object"&&e.push(r)}return e.sort()}function Av(){var e=document;try{e.cookie="cookietest=1; SameSite=Strict;";var t=e.cookie.indexOf("cookietest=")!==-1;return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch{return!1}}function Dv(){var e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}function Mv(e){var t=e===void 0?{}:e,n=t.debug;return nn(this,void 0,void 0,function(){var r,o,s,i,a,c;return rn(this,function(l){switch(l.label){case 0:return Lv()?(r=Dv(),o=Object.keys(r),s=(c=[]).concat.apply(c,o.map(function(u){return r[u]})),[4,Fv(s)]):[2,void 0];case 1:return i=l.sent(),n&&$v(r,i),a=o.filter(function(u){var d=r[u],f=Tt(d.map(function(h){return i[h]}));return f>d.length*.6}),a.sort(),[2,a]}})})}function Lv(){return Yt()||Ii()}function Fv(e){var t;return nn(this,void 0,void 0,function(){var n,r,o,s,c,i,a,c;return rn(this,function(l){switch(l.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),s={},$u(r),c=0;c<e.length;++c)i=Yg(e[c]),i.tagName==="DIALOG"&&i.show(),a=n.createElement("div"),$u(a),a.appendChild(i),r.appendChild(a),o[c]=i;l.label=1;case 1:return n.body?[3,3]:[4,Fo(50)];case 2:return l.sent(),[3,1];case 3:n.body.appendChild(r);try{for(c=0;c<e.length;++c)o[c].offsetParent||(s[e[c]]=!0)}finally{(t=r.parentNode)===null||t===void 0||t.removeChild(r)}return[2,s]}})})}function $u(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function $v(e,t){for(var n="DOM blockers debug:\n```",r=0,o=Object.keys(e);r<o.length;r++){var s=o[r];n+=`
4
+ `.concat(s,":");for(var i=0,a=e[s];i<a.length;i++){var c=a[i];n+=`
5
+ `.concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function zv(){for(var e=0,t=["rec2020","p3","srgb"];e<t.length;e++){var n=t[e];if(matchMedia("(color-gamut: ".concat(n,")")).matches)return n}}function Vv(){if(zu("inverted"))return!0;if(zu("none"))return!1}function zu(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function jv(){if(Vu("active"))return!0;if(Vu("none"))return!1}function Vu(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var Bv=100;function Uv(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=Bv;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function Wv(){if(yr("no-preference"))return 0;if(yr("high")||yr("more"))return 1;if(yr("low")||yr("less"))return-1;if(yr("forced"))return 10}function yr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function Hv(){if(ju("reduce"))return!0;if(ju("no-preference"))return!1}function ju(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function Zv(){if(Bu("reduce"))return!0;if(Bu("no-preference"))return!1}function Bu(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function Gv(){if(Uu("high"))return!0;if(Uu("standard"))return!1}function Uu(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var ze=Math,Ot=function(){return 0};function Yv(){var e=ze.acos||Ot,t=ze.acosh||Ot,n=ze.asin||Ot,r=ze.asinh||Ot,o=ze.atanh||Ot,s=ze.atan||Ot,i=ze.sin||Ot,a=ze.sinh||Ot,c=ze.cos||Ot,l=ze.cosh||Ot,u=ze.tan||Ot,d=ze.tanh||Ot,f=ze.exp||Ot,h=ze.expm1||Ot,m=ze.log1p||Ot,g=function(O){return ze.pow(ze.PI,O)},y=function(O){return ze.log(O+ze.sqrt(O*O-1))},v=function(O){return ze.log(O+ze.sqrt(O*O+1))},S=function(O){return ze.log((1+O)/(1-O))/2},C=function(O){return ze.exp(O)-1/ze.exp(O)/2},w=function(O){return(ze.exp(O)+1/ze.exp(O))/2},b=function(O){return ze.exp(O)-1},T=function(O){return(ze.exp(2*O)-1)/(ze.exp(2*O)+1)},E=function(O){return ze.log(1+O)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:y(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:v(1),atanh:o(.5),atanhPf:S(.5),atan:s(.5),sin:i(-1e300),sinh:a(1),sinhPf:C(1),cos:c(10.000000000123),cosh:l(1),coshPf:w(1),tan:u(-1e300),tanh:d(1),tanhPf:T(1),exp:f(1),expm1:h(1),expm1Pf:b(1),log1p:m(10),log1pPf:E(10),powPI:g(-100)}}var qv="mmMwWLliI0fiflO&1",Di={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function Kv(){return Xv(function(e,t){for(var n={},r={},o=0,s=Object.keys(Di);o<s.length;o++){var i=s[o],a=Di[i],c=a[0],l=c===void 0?{}:c,u=a[1],d=u===void 0?qv:u,f=e.createElement("span");f.textContent=d,f.style.whiteSpace="nowrap";for(var h=0,m=Object.keys(l);h<m.length;h++){var g=m[h],y=l[g];y!==void 0&&(f.style[g]=y)}n[i]=f,t.append(e.createElement("br"),f)}for(var v=0,S=Object.keys(Di);v<S.length;v++){var i=S[v];r[i]=n[i].getBoundingClientRect().width}return r})}function Xv(e,t){return t===void 0&&(t=4e3),Lu(function(n,r){var o=r.document,s=o.body,i=s.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",Yr()?s.style.zoom="".concat(1/r.devicePixelRatio):Yt()&&(s.style.zoom="reset");var a=o.createElement("div");return a.textContent=Oi([],Array(t/20<<0),!0).map(function(){return"word"}).join(" "),s.appendChild(a),e(o,s)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}function Jv(){return navigator.pdfViewerEnabled}function Qv(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function ey(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(ty())return-3;try{return e.canMakePayments()?1:0}catch(t){return ny(t)}}var ty=Kg;function ny(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function ry(){var e,t=document.createElement("a"),n=(e=t.attributionSourceId)!==null&&e!==void 0?e:t.attributionsourceid;return n===void 0?void 0:String(n)}var Wu=-1,Hu=-2,oy=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),sy=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),iy=["FRAGMENT_SHADER","VERTEX_SHADER"],ay=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Zu="WEBGL_debug_renderer_info",cy="WEBGL_polygon_mode";function uy(e){var t,n,r,o,s,i,a=e.cache,c=Gu(a);if(!c)return Wu;if(!Ku(c))return Hu;var l=qu()?null:c.getExtension(Zu);return{version:((t=c.getParameter(c.VERSION))===null||t===void 0?void 0:t.toString())||"",vendor:((n=c.getParameter(c.VENDOR))===null||n===void 0?void 0:n.toString())||"",vendorUnmasked:l?(r=c.getParameter(l.UNMASKED_VENDOR_WEBGL))===null||r===void 0?void 0:r.toString():"",renderer:((o=c.getParameter(c.RENDERER))===null||o===void 0?void 0:o.toString())||"",rendererUnmasked:l?(s=c.getParameter(l.UNMASKED_RENDERER_WEBGL))===null||s===void 0?void 0:s.toString():"",shadingLanguageVersion:((i=c.getParameter(c.SHADING_LANGUAGE_VERSION))===null||i===void 0?void 0:i.toString())||""}}function ly(e){var t=e.cache,n=Gu(t);if(!n)return Wu;if(!Ku(n))return Hu;var r=n.getSupportedExtensions(),o=n.getContextAttributes(),s=[],i=[],a=[],c=[],l=[];if(o)for(var u=0,d=Object.keys(o);u<d.length;u++){var f=d[u];i.push("".concat(f,"=").concat(o[f]))}for(var h=Yu(n),m=0,g=h;m<g.length;m++){var y=g[m],v=n[y];a.push("".concat(y,"=").concat(v).concat(oy.has(v)?"=".concat(n.getParameter(v)):""))}if(r)for(var S=0,C=r;S<C.length;S++){var w=C[S];if(!(w===Zu&&qu()||w===cy&&py())){var b=n.getExtension(w);if(!b){s.push(w);continue}for(var T=0,E=Yu(b);T<E.length;T++){var y=E[T],v=b[y];c.push("".concat(y,"=").concat(v).concat(sy.has(v)?"=".concat(n.getParameter(v)):""))}}}for(var O=0,D=iy;O<D.length;O++)for(var k=D[O],L=0,F=ay;L<F.length;L++){var N=F[L],R=dy(n,k,N);l.push("".concat(k,".").concat(N,"=").concat(R.join(",")))}return c.sort(),a.sort(),{contextAttributes:i,parameters:a,shaderPrecisions:l,extensions:r,extensionParameters:c,unsupportedExtensions:s}}function Gu(e){if(e.webgl)return e.webgl.context;var t=document.createElement("canvas"),n;t.addEventListener("webglCreateContextError",function(){return n=void 0});for(var r=0,o=["webgl","experimental-webgl"];r<o.length;r++){var s=o[r];try{n=t.getContext(s)}catch{}if(n)break}return e.webgl={context:n},n}function dy(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Yu(e){var t=Object.keys(e.__proto__);return t.filter(fy)}function fy(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function qu(){return Du()}function py(){return Yr()||Yt()}function Ku(e){return typeof e.getParameter=="function"}function hy(){var e=Ii()||Yt();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function my(){if(!window.Intl)return-1;var e=window.Intl.DateTimeFormat;if(!e)return-2;var t=e().resolvedOptions().locale;return!t&&t!==""?-3:t}var gy={fonts:Qg,domBlockers:Mv,fontPreferences:Kv,audio:Bg,screenFrame:Ev,canvas:tv,osCpu:dv,languages:fv,colorDepth:pv,deviceMemory:hv,screenResolution:mv,hardwareConcurrency:Sv,timezone:Cv,sessionStorage:Tv,localStorage:Ov,indexedDB:_v,openDatabase:Pv,cpuClass:Iv,platform:kv,plugins:ev,touchSupport:lv,vendor:Rv,vendorFlavors:Nv,cookiesEnabled:Av,colorGamut:zv,invertedColors:Vv,forcedColors:jv,monochrome:Uv,contrast:Wv,reducedMotion:Hv,reducedTransparency:Zv,hdr:Gv,math:Yv,pdfViewerEnabled:Jv,architecture:Qv,applePay:ey,privateClickMeasurement:ry,audioBaseLatency:hy,dateTimeLocale:my,webGlBasics:uy,webGlExtensions:ly};function vy(e){return Ag(gy,e,[])}var yy="$ if upgrade to Pro: https://fpjs.dev/pro";function by(e){var t=wy(e),n=Ey(t);return{score:t,comment:yy.replace(/\$/g,"".concat(n))}}function wy(e){if(Ii())return .4;if(Yt())return Pi()&&!(Kr()&&qr())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function Ey(e){return ku(.99+.01*e,1e-4)}function Sy(e){for(var t="",n=0,r=Object.keys(e).sort();n<r.length;n++){var o=r[n],s=e[o],i="error"in s?"error":JSON.stringify(s.value);t+="".concat(t?"|":"").concat(o.replace(/([:|\\])/g,"\\$1"),":").concat(i)}return t}function Xu(e){return JSON.stringify(e,function(t,n){return n instanceof Error?Ig(n):n},2)}function Ju(e){return Pg(Sy(e))}function Cy(e){var t,n=by(e);return{get visitorId(){return t===void 0&&(t=Ju(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:Ou}}function xy(e){return e===void 0&&(e=50),bg(e,e*2)}function Ty(e,t){var n=Date.now();return{get:function(r){return nn(this,void 0,void 0,function(){var o,s,i;return rn(this,function(a){switch(a.label){case 0:return o=Date.now(),[4,e()];case 1:return s=a.sent(),i=Cy(s),(t||r?.debug)&&console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(i.version,`
6
6
  userAgent: `).concat(navigator.userAgent,`
7
7
  timeBetweenLoadAndGet: `).concat(o-n,`
8
8
  visitorId: `).concat(i.visitorId,`
9
- components: `).concat(Mu(s),"\n```")),[2,i]}})})}}}function y0(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(uu,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function b0(e){var t;return e===void 0&&(e={}),Jt(this,void 0,void 0,function(){var n,r,o;return Qt(this,function(s){switch(s.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&y0(),n=e.delayFallback,r=e.debug,[4,g0(n)];case 1:return s.sent(),o=l0({cache:{},debug:r}),[2,v0(o,r)]}})})}var w0={load:b0,hashComponents:Lu,componentsToDebugString:Mu};function $u(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<o;t++)e[t]&&(n=$u(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Fu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=$u(e))&&(r&&(r+=" "),r+=t);return r}const ca="-",E0=e=>{const t=S0(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ca);return a[0]===""&&a.length!==1&&a.shift(),Vu(a,t)||x0(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Vu=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Vu(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ca);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Bu=/^\[(.+)\]$/,x0=e=>{if(Bu.test(e)){const t=Bu.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},S0=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return T0(Object.entries(e.classGroups),n).forEach(([s,i])=>{la(i,r,s,t)}),r},la=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Wu(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(C0(o)){la(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{la(i,Wu(t,s),n,r)})})},Wu=(e,t)=>{let n=e;return t.split(ca).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},C0=e=>e.isThemeGetter,T0=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,O0=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},ju="!",k0=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let y=a[v];if(c===0){if(y===o&&(r||a.slice(v,v+s)===t)){l.push(a.slice(u,v)),u=v+s;continue}if(y==="/"){d=v;continue}}y==="["?c++:y==="]"&&c--}const h=l.length===0?a:a.substring(u),p=h.startsWith(ju),g=p?h.substring(1):h,m=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},R0=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},P0=e=>({cache:O0(e.cacheSize),parseClassName:k0(e),...E0(e)}),I0=/\s+/,_0=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(I0);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let g=!!p,m=r(g?h.substring(0,p):h);if(!m){if(!g){a=c+(a.length>0?" "+a:a);continue}if(m=r(h),!m){a=c+(a.length>0?" "+a:a);continue}g=!1}const v=R0(u).join(":"),y=d?v+ju:v,b=y+m;if(s.includes(b))continue;s.push(b);const E=o(m,g);for(let x=0;x<E.length;++x){const w=E[x];s.push(y+w)}a=c+(a.length>0?" "+a:a)}return a};function N0(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Hu(t))&&(r&&(r+=" "),r+=n);return r}const Hu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Hu(e[r]))&&(n&&(n+=" "),n+=t);return n};function A0(e,...t){let n,r,o,s=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return n=P0(c),r=n.cache.get,o=n.cache.set,s=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=_0(l,n);return o(l,u),u}return function(){return s(N0.apply(null,arguments))}}const je=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Uu=/^\[(?:([a-z-]+):)?(.+)\]$/i,D0=/^\d+\/\d+$/,M0=new Set(["px","full","screen"]),L0=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$0=/\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$/,F0=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,V0=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,B0=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pn=e=>Tr(e)||M0.has(e)||D0.test(e),Pn=e=>Or(e,"length",Z0),Tr=e=>!!e&&!Number.isNaN(Number(e)),ua=e=>Or(e,"number",Tr),po=e=>!!e&&Number.isInteger(Number(e)),W0=e=>e.endsWith("%")&&Tr(e.slice(0,-1)),Te=e=>Uu.test(e),In=e=>L0.test(e),j0=new Set(["length","size","percentage"]),H0=e=>Or(e,j0,Gu),U0=e=>Or(e,"position",Gu),G0=new Set(["image","url"]),z0=e=>Or(e,G0,X0),Y0=e=>Or(e,"",q0),ho=()=>!0,Or=(e,t,n)=>{const r=Uu.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},Z0=e=>$0.test(e)&&!F0.test(e),Gu=()=>!1,q0=e=>V0.test(e),X0=e=>B0.test(e),da=A0(()=>{const e=je("colors"),t=je("spacing"),n=je("blur"),r=je("brightness"),o=je("borderColor"),s=je("borderRadius"),i=je("borderSpacing"),a=je("borderWidth"),l=je("contrast"),c=je("grayscale"),u=je("hueRotate"),d=je("invert"),h=je("gap"),p=je("gradientColorStops"),g=je("gradientColorStopPositions"),m=je("inset"),v=je("margin"),y=je("opacity"),b=je("padding"),E=je("saturate"),x=je("scale"),w=je("sepia"),T=je("skew"),S=je("space"),I=je("translate"),A=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Te,t],N=()=>[Te,t],R=()=>["",pn,Pn],P=()=>["auto",Tr,Te],C=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],k=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",Te],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>[Tr,Te];return{cacheSize:500,separator:":",theme:{colors:[ho],spacing:[pn,Pn],blur:["none","",In,Te],brightness:j(),borderColor:[e],borderRadius:["none","","full",In,Te],borderSpacing:N(),borderWidth:R(),contrast:j(),grayscale:$(),hueRotate:j(),invert:$(),gap:N(),gradientColorStops:[e],gradientColorStopPositions:[W0,Pn],inset:M(),margin:M(),opacity:j(),padding:N(),saturate:j(),scale:j(),sepia:$(),skew:j(),space:N(),translate:N()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[In]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...C(),Te]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",po,Te]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Te]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",po,Te]}],"grid-cols":[{"grid-cols":[ho]}],"col-start-end":[{col:["auto",{span:["full",po,Te]},Te]}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":[ho]}],"row-start-end":[{row:["auto",{span:[po,Te]},Te]}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Te]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...k()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...k(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...k(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[S]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[S]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Te,t]}],"min-w":[{"min-w":[Te,t,"min","max","fit"]}],"max-w":[{"max-w":[Te,t,"none","full","min","max","fit","prose",{screen:[In]},In]}],h:[{h:[Te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",In,Pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ua]}],"font-family":[{font:[ho]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Te]}],"line-clamp":[{"line-clamp":["none",Tr,ua]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pn,Te]}],"list-image":[{"list-image":["none",Te]}],"list-style-type":[{list:["none","disc","decimal",Te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[..._(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pn,Pn]}],"underline-offset":[{"underline-offset":["auto",pn,Te]}],"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:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te]}],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",Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...C(),U0]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",H0]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},z0]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[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":[y]}],"border-style":[{border:[..._(),"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":[y]}],"divide-style":[{divide:_()}],"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:["",..._()]}],"outline-offset":[{"outline-offset":[pn,Te]}],"outline-w":[{outline:[pn,Pn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:R()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[pn,Pn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",In,Y0]}],"shadow-color":[{shadow:[ho]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",In,Te]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[E]}],sepia:[{sepia:[w]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[w]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Te]}],duration:[{duration:j()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:j()}],animate:[{animate:["none","spin","ping","pulse","bounce",Te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[po,Te]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te]}],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",Te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pn,Pn,ua]}],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"]}}}),K0=[];function mo(e){f.useEffect(e,K0)}const zu={};function ht(e,t){const n=f.useRef(zu);return n.current===zu&&(n.current=e(t)),n}function J0(e,t){return function(r,...o){const s=new URL(e);return s.searchParams.set("code",r.toString()),o.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}const it=J0("https://base-ui.com/production-error","Base UI"),ds=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(ds.displayName="ToastContext");function Yu(){const e=f.useContext(ds);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":it(73));return e}var Q0=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
9
+ components: `).concat(Xu(s),"\n```")),[2,i]}})})}}}function Oy(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(Ou,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function _y(e){var t;return e===void 0&&(e={}),nn(this,void 0,void 0,function(){var n,r,o;return rn(this,function(s){switch(s.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Oy(),n=e.delayFallback,r=e.debug,[4,xy(n)];case 1:return s.sent(),o=vy({cache:{},debug:r}),[2,Ty(o,r)]}})})}var Py={load:_y,hashComponents:Ju,componentsToDebugString:Xu};function Qu(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<o;t++)e[t]&&(n=Qu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function el(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Qu(e))&&(r&&(r+=" "),r+=t);return r}const Mi="-",Iy=e=>{const t=Ry(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(Mi);return a[0]===""&&a.length!==1&&a.shift(),tl(a,t)||ky(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},tl=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?tl(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(Mi);return t.validators.find(({validator:i})=>i(s))?.classGroupId},nl=/^\[(.+)\]$/,ky=e=>{if(nl.test(e)){const t=nl.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Ry=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Ay(Object.entries(e.classGroups),n).forEach(([s,i])=>{Li(i,r,s,t)}),r},Li=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:rl(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(Ny(o)){Li(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Li(i,rl(t,s),n,r)})})},rl=(e,t)=>{let n=e;return t.split(Mi).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},Ny=e=>e.isThemeGetter,Ay=(e,t)=>t?e.map(([n,r])=>{const o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([i,a])=>[t+i,a])):s);return[n,o]}):e,Dy=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(s,i)=>{n.set(s,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(s){let i=n.get(s);if(i!==void 0)return i;if((i=r.get(s))!==void 0)return o(s,i),i},set(s,i){n.has(s)?n.set(s,i):o(s,i)}}},ol="!",My=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let l=0,u=0,d;for(let y=0;y<a.length;y++){let v=a[y];if(l===0){if(v===o&&(r||a.slice(y,y+s)===t)){c.push(a.slice(u,y)),u=y+s;continue}if(v==="/"){d=y;continue}}v==="["?l++:v==="]"&&l--}const f=c.length===0?a:a.substring(u),h=f.startsWith(ol),m=h?f.substring(1):f,g=d&&d>u?d-u:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},Ly=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},Fy=e=>({cache:Dy(e.cacheSize),parseClassName:My(e),...Iy(e)}),$y=/\s+/,zy=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split($y);let a="";for(let c=i.length-1;c>=0;c-=1){const l=i[c],{modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=n(l);let m=!!h,g=r(m?f.substring(0,h):f);if(!g){if(!m){a=l+(a.length>0?" "+a:a);continue}if(g=r(f),!g){a=l+(a.length>0?" "+a:a);continue}m=!1}const y=Ly(u).join(":"),v=d?y+ol:y,S=v+g;if(s.includes(S))continue;s.push(S);const C=o(g,m);for(let w=0;w<C.length;++w){const b=C[w];s.push(v+b)}a=l+(a.length>0?" "+a:a)}return a};function Vy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=sl(t))&&(r&&(r+=" "),r+=n);return r}const sl=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=sl(e[r]))&&(n&&(n+=" "),n+=t);return n};function jy(e,...t){let n,r,o,s=i;function i(c){const l=t.reduce((u,d)=>d(u),e());return n=Fy(l),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const l=r(c);if(l)return l;const u=zy(c,n);return o(c,u),u}return function(){return s(Vy.apply(null,arguments))}}const Ye=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},il=/^\[(?:([a-z-]+):)?(.+)\]$/i,By=/^\d+\/\d+$/,Uy=new Set(["px","full","screen"]),Wy=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hy=/\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$/,Zy=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Gy=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Yy=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gn=e=>br(e)||Uy.has(e)||By.test(e),Rn=e=>wr(e,"length",nb),br=e=>!!e&&!Number.isNaN(Number(e)),Fi=e=>wr(e,"number",br),Xr=e=>!!e&&Number.isInteger(Number(e)),qy=e=>e.endsWith("%")&&br(e.slice(0,-1)),Te=e=>il.test(e),Nn=e=>Wy.test(e),Ky=new Set(["length","size","percentage"]),Xy=e=>wr(e,Ky,al),Jy=e=>wr(e,"position",al),Qy=new Set(["image","url"]),eb=e=>wr(e,Qy,ob),tb=e=>wr(e,"",rb),Jr=()=>!0,wr=(e,t,n)=>{const r=il.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},nb=e=>Hy.test(e)&&!Zy.test(e),al=()=>!1,rb=e=>Gy.test(e),ob=e=>Yy.test(e),$i=jy(()=>{const e=Ye("colors"),t=Ye("spacing"),n=Ye("blur"),r=Ye("brightness"),o=Ye("borderColor"),s=Ye("borderRadius"),i=Ye("borderSpacing"),a=Ye("borderWidth"),c=Ye("contrast"),l=Ye("grayscale"),u=Ye("hueRotate"),d=Ye("invert"),f=Ye("gap"),h=Ye("gradientColorStops"),m=Ye("gradientColorStopPositions"),g=Ye("inset"),y=Ye("margin"),v=Ye("opacity"),S=Ye("padding"),C=Ye("saturate"),w=Ye("scale"),b=Ye("sepia"),T=Ye("skew"),E=Ye("space"),O=Ye("translate"),D=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",Te,t],F=()=>[Te,t],N=()=>["",gn,Rn],R=()=>["auto",br,Te],_=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],M=()=>["","0",Te],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[br,Te];return{cacheSize:500,separator:":",theme:{colors:[Jr],spacing:[gn,Rn],blur:["none","",Nn,Te],brightness:U(),borderColor:[e],borderRadius:["none","","full",Nn,Te],borderSpacing:F(),borderWidth:N(),contrast:U(),grayscale:M(),hueRotate:U(),invert:M(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[qy,Rn],inset:L(),margin:L(),opacity:U(),padding:F(),saturate:U(),scale:U(),sepia:M(),skew:U(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Te]}],container:["container"],columns:[{columns:[Nn]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[..._(),Te]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xr,Te]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Te]}],grow:[{grow:M()}],shrink:[{shrink:M()}],order:[{order:["first","last","none",Xr,Te]}],"grid-cols":[{"grid-cols":[Jr]}],"col-start-end":[{col:["auto",{span:["full",Xr,Te]},Te]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[Jr]}],"row-start-end":[{row:["auto",{span:[Xr,Te]},Te]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Te]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[S]}],px:[{px:[S]}],py:[{py:[S]}],ps:[{ps:[S]}],pe:[{pe:[S]}],pt:[{pt:[S]}],pr:[{pr:[S]}],pb:[{pb:[S]}],pl:[{pl:[S]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Te,t]}],"min-w":[{"min-w":[Te,t,"min","max","fit"]}],"max-w":[{"max-w":[Te,t,"none","full","min","max","fit","prose",{screen:[Nn]},Nn]}],h:[{h:[Te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Nn,Rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Fi]}],"font-family":[{font:[Jr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Te]}],"line-clamp":[{"line-clamp":["none",br,Fi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",gn,Te]}],"list-image":[{"list-image":["none",Te]}],"list-style-type":[{list:["none","disc","decimal",Te]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",gn,Rn]}],"underline-offset":[{"underline-offset":["auto",gn,Te]}],"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",Te]}],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",Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[..._(),Jy]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xy]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eb]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[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":[v]}],"border-style":[{border:[...I(),"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":[v]}],"divide-style":[{divide:I()}],"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:["",...I()]}],"outline-offset":[{"outline-offset":[gn,Te]}],"outline-w":[{outline:[gn,Rn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[gn,Rn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Nn,tb]}],"shadow-color":[{shadow:[Jr]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...P(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":P()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Nn,Te]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Te]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",Te]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",Te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[Xr,Te]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Te]}],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",Te]}],"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",Te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[gn,Rn,Fi]}],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"]}}}),sb=[];function Qr(e){p.useEffect(e,sb)}const cl={};function ft(e,t){const n=p.useRef(cl);return n.current===cl&&(n.current=e(t)),n}function ib(e,t){return function(r,...o){const s=new URL(e);return s.searchParams.set("code",r.toString()),o.forEach(i=>s.searchParams.append("args[]",i)),`${t} error #${r}; visit ${s} for the full message.`}}const Qe=ib("https://base-ui.com/production-error","Base UI"),jo=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(jo.displayName="ToastContext");function ul(){const e=p.useContext(jo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Qe(73));return e}const ne=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":Qe(1));let a;if(e&&t&&n&&r&&o&&s)a=(c,l,u,d)=>{const f=e(c,l,u,d),h=t(c,l,u,d),m=n(c,l,u,d),g=r(c,l,u,d),y=o(c,l,u,d);return s(f,h,m,g,y,l,u,d)};else if(e&&t&&n&&r&&o)a=(c,l,u,d)=>{const f=e(c,l,u,d),h=t(c,l,u,d),m=n(c,l,u,d),g=r(c,l,u,d);return o(f,h,m,g,l,u,d)};else if(e&&t&&n&&r)a=(c,l,u,d)=>{const f=e(c,l,u,d),h=t(c,l,u,d),m=n(c,l,u,d);return r(f,h,m,l,u,d)};else if(e&&t&&n)a=(c,l,u,d)=>{const f=e(c,l,u,d),h=t(c,l,u,d);return n(f,h,l,u,d)};else if(e&&t)a=(c,l,u,d)=>{const f=e(c,l,u,d);return t(f,l,u,d)};else if(e)a=e;else throw new Error("Missing arguments");return a};var ab=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const o={};e(o)===o&&(r=!0)}catch{}if(r){let o;try{throw new Error}catch(s){({stack:o}=s)}console.warn(`The result function returned its own inputs without modification. e.g
10
10
  \`createSelector([state => state.todos], todos => todos)\`
11
11
  This could lead to inefficient memoization and unnecessary re-renders.
12
- Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},ew=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(!(a.apply(null,s)===a.apply(null,i))){let c;try{throw new Error}catch(u){({stack:c}=u)}console.warn(`An input selector returned a different result when passed same arguments.
12
+ Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},cb=(e,t,n)=>{const{memoize:r,memoizeOptions:o}=t,{inputSelectorResults:s,inputSelectorResultsCopy:i}=e,a=r(()=>({}),...o);if(!(a.apply(null,s)===a.apply(null,i))){let l;try{throw new Error}catch(u){({stack:l}=u)}console.warn(`An input selector returned a different result when passed same arguments.
13
13
  This means your output selector will likely run more frequently than intended.
14
14
  Avoid returning a new reference inside your input selector, e.g.
15
- \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:i,stack:c})}},tw={inputStabilityCheck:"once",identityFunctionCheck:"once"},fs=Symbol("NOT_FOUND");function nw(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function rw(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ow(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Zu=e=>Array.isArray(e)?e:[e];function sw(e){const t=Array.isArray(e[0])?e[0]:e;return ow(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function qu(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var iw=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...tw,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Q0},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:ew}}};function aw(e){let t;return{get(n){return t&&e(t.key,n)?t.value:fs},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function cw(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return fs}function o(a,l){r(a)===fs&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var lw=(e,t)=>e===t;function uw(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function dw(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=lw,maxSize:o=1,resultEqualityCheck:s}=n,i=uw(r);let a=0;const l=o<=1?aw(i):cw(o,i);function c(){let u=l.get(arguments);if(u===fs){if(u=e.apply(null,arguments),a++,s){const h=l.getEntries().find(p=>s(p.value,u));h&&(u=h.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var fw=class{constructor(e){this.value=e}deref(){return this.value}},pw=typeof WeakRef<"u"?WeakRef:fw,hw=0,Xu=1;function ps(){return{s:hw,v:void 0,o:null,p:null}}function Ku(e,t={}){let n=ps();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:l}=arguments;for(let d=0,h=l;d<h;d++){const p=arguments[d];if(typeof p=="function"||typeof p=="object"&&p!==null){let g=a.o;g===null&&(a.o=g=new WeakMap);const m=g.get(p);m===void 0?(a=ps(),g.set(p,a)):a=m}else{let g=a.p;g===null&&(a.p=g=new Map);const m=g.get(p);m===void 0?(a=ps(),g.set(p,a)):a=m}}const c=a;let u;if(a.s===Xu)u=a.v;else if(u=e.apply(null,arguments),s++,r){const d=o?.deref?.()??o;d!=null&&r(d,u)&&(u=d,s!==0&&s--),o=typeof u=="object"&&u!==null||typeof u=="function"?new pw(u):u}return c.s=Xu,c.v=u,u}return i.clearCache=()=>{n=ps(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Ju(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),nw(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:h=[],argsMemoize:p=Ku,argsMemoizeOptions:g=[],devModeChecks:m={}}=u,v=Zu(h),y=Zu(g),b=sw(o),E=d(function(){return s++,c.apply(null,arguments)},...v);let x=!0;const w=p(function(){i++;const S=qu(b,arguments);if(a=E.apply(null,S),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:I,inputStabilityCheck:A}=iw(x,m);if(I.shouldRun&&I.run(c,S,a),A.shouldRun){const L=qu(b,arguments);A.run({inputSelectorResults:S,inputSelectorResultsCopy:L},{memoize:d,memoizeOptions:v},arguments)}x&&(x=!1)}return a},...y);return Object.assign(w,{resultFunc:c,memoizedResultFunc:E,dependencies:b,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var mw=Ju(Ku),gw=Object.assign((e,t=mw)=>{rw(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,l)=>(i[n[l]]=a,i),{}))},{withTypes:()=>gw});const vw=Ju({memoize:dw,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),he=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":it(1));let a;if(e&&t)a=(l,c,u,d)=>{const h=e(l,c,u,d);return t(h,c,u,d)};else if(e)a=e;else throw new Error("Missing arguments");return a},yw=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,s=r.length-o;if(s>3)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":it(2));return(a,l,c,u)=>{let d=a.__cacheKey__;d||(d={id:n},a.__cacheKey__=d,n+=1);let h=t.get(d);if(!h){let p=e;const g=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{p=[...e.slice(0,-1),()=>g[0],r];break}case 2:{p=[...e.slice(0,-1),()=>g[0],()=>g[1],r];break}case 3:{p=[...e.slice(0,-1),()=>g[0],()=>g[1],()=>g[2],r];break}default:throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":it(2))}h=vw(...p),h.selectorArgs=g,t.set(d,h)}switch(h.selectorArgs[0]=l,h.selectorArgs[1]=c,h.selectorArgs[2]=u,s){case 0:return h(a);case 1:return h(a,l);case 2:return h(a,l,c);case 3:return h(a,l,c,u);default:throw new Error("unreachable")}}};var hs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bw(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ms={exports:{}},fa={};var Qu;function ww(){if(Qu)return fa;Qu=1;var e=W;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,h){var p=h(),g=r({inst:{value:p,getSnapshot:h}}),m=g[0].inst,v=g[1];return s(function(){m.value=p,m.getSnapshot=h,l(m)&&v({inst:m})},[d,p,h]),o(function(){return l(m)&&v({inst:m}),d(function(){l(m)&&v({inst:m})})},[d]),i(p),p}function l(d){var h=d.getSnapshot;d=d.value;try{var p=h();return!n(d,p)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return fa.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,fa}var pa={};var ed;function Ew(){return ed||(ed=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}function t(p,g){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var m=g();if(!d){var v=g();s(m,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=i({inst:{value:m,getSnapshot:g}});var y=v[0].inst,b=v[1];return l(function(){y.value=m,y.getSnapshot=g,n(y)&&b({inst:y})},[p,m,g]),a(function(){return n(y)&&b({inst:y}),p(function(){n(y)&&b({inst:y})})},[p]),c(m),m}function n(p){var g=p.getSnapshot;p=p.value;try{var m=g();return!s(p,m)}catch{return!0}}function r(p,g){return g()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=W,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;pa.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),pa}var td;function ha(){return td||(td=1,process.env.NODE_ENV==="production"?ms.exports=ww():ms.exports=Ew()),ms.exports}var xw=ha(),gs={exports:{}},ma={};var nd;function Sw(){if(nd)return ma;nd=1;var e=W,t=ha();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return ma.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var g=s(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function y(T){if(!b){if(b=!0,E=T,T=h(T),p!==void 0&&m.hasValue){var S=m.value;if(p(S,T))return x=S}return x=T}if(S=x,r(E,T))return S;var I=h(T);return p!==void 0&&p(S,I)?(E=T,S):(E=T,x=I)}var b=!1,E,x,w=d===void 0?null:d;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,d,h,p]);var v=o(c,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),l(v),v},ma}var ga={};var rd;function Cw(){return rd||(rd=1,process.env.NODE_ENV!=="production"&&(function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=W,n=ha(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,l=t.useDebugValue;ga.useSyncExternalStoreWithSelector=function(c,u,d,h,p){var g=s(null);if(g.current===null){var m={hasValue:!1,value:null};g.current=m}else m=g.current;g=a(function(){function y(T){if(!b){if(b=!0,E=T,T=h(T),p!==void 0&&m.hasValue){var S=m.value;if(p(S,T))return x=S}return x=T}if(S=x,r(E,T))return S;var I=h(T);return p!==void 0&&p(S,I)?(E=T,S):(E=T,x=I)}var b=!1,E,x,w=d===void 0?null:d;return[function(){return y(u())},w===null?void 0:function(){return y(w())}]},[u,d,h,p]);var v=o(c,g[0],g[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),ga}var od;function Tw(){return od||(od=1,process.env.NODE_ENV==="production"?gs.exports=Sw():gs.exports=Cw()),gs.exports}var Ow=Tw();const kw=parseInt(f.version,10);function va(e){return kw>=e}const Rw=va(19)?Iw:_w;function sd(e,t,n,r,o){return Rw(e,t,n,r,o)}function Pw(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return xw.useSyncExternalStore(e.subscribe,s,s)}function Iw(e,t,n,r,o){return Pw(e,t,n,r,o)}function _w(e,t,n,r,o){return Ow.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class Nw{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return sd(this,t,n,r,o)}}const ya=f[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Aw=ya&&ya!==f.useLayoutEffect?ya:e=>e();function me(e){const t=ht(Dw).current;return t.next=e,Aw(t.effect),t.trampoline}function Dw(){const e={next:void 0,callback:Mw,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Mw(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const ve=typeof document<"u"?f.useLayoutEffect:()=>{};function mt(){}const tt=Object.freeze({});class vs extends Nw{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){f.useDebugValue(t),ve(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;ve(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){f.useDebugValue(t,i=>Object.keys(i));const o=f.useRef(Object.keys(t)).current,s=Object.keys(t);(o.length!==s.length||o.some((i,a)=>i!==s[a]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const r=Object.values(t);ve(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){f.useDebugValue(t);const r=n!==void 0;if(ve(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r]),process.env.NODE_ENV!=="production"){const o=this.controlledValues??=new Map;o.has(t)||o.set(t,r);const s=o.get(t);s!==void 0&&s!==r&&console.error(`A component is changing the ${r?"":"un"}controlled state of ${t.toString()} to be ${r?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return f.useDebugValue(t),sd(this,this.selectors[t],n,r,o)}useContextCallback(t,n){f.useDebugValue(t);const r=me(n??mt);this.context[t]=r}useStateSetter(t){const n=f.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const ys=null;let id=globalThis.requestAnimationFrame,Lw=class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&id!==requestAnimationFrame&&(id=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}};const bs=new Lw;let _n=class Av{static create(){return new Av}static request(t){return bs.request(t)}static cancel(t){return bs.cancel(t)}currentId=ys;request(t){this.cancel(),this.currentId=bs.request(()=>{this.currentId=ys,t()})}cancel=()=>{this.currentId!==ys&&(bs.cancel(this.currentId),this.currentId=ys)};disposeEffect=()=>this.cancel};function ba(){const e=ht(_n.create).current;return mo(e.disposeEffect),e}const go=0;let zt=class Dv{static create(){return new Dv}currentId=go;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=go,n()},t)}isStarted(){return this.currentId!==go}clear=()=>{this.currentId!==go&&(clearTimeout(this.currentId),this.currentId=go)};disposeEffect=()=>this.clear};function Nn(){const e=ht(zt.create).current;return mo(e.disposeEffect),e}let ad=0;function $w(e){return ad+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ad}`}function ws(){return typeof window<"u"}function An(e){return wa(e)?(e.nodeName||"").toLowerCase():"#document"}function nt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function en(e){var t;return(t=(wa(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function wa(e){return ws()?e instanceof Node||e instanceof nt(e).Node:!1}function $e(e){return ws()?e instanceof Element||e instanceof nt(e).Element:!1}function rt(e){return ws()?e instanceof HTMLElement||e instanceof nt(e).HTMLElement:!1}function vo(e){return!ws()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof nt(e).ShadowRoot}function Dn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Fw(e){return/^(table|td|th)$/.test(An(e))}function Es(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Vw=/transform|translate|scale|rotate|perspective|filter/,Bw=/paint|layout|strict|content/,er=e=>!!e&&e!=="none";let Ea;function xa(e){const t=$e(e)?Rt(e):e;return er(t.transform)||er(t.translate)||er(t.scale)||er(t.rotate)||er(t.perspective)||!xs()&&(er(t.backdropFilter)||er(t.filter))||Vw.test(t.willChange||"")||Bw.test(t.contain||"")}function Ww(e){let t=mn(e);for(;rt(t)&&!hn(t);){if(xa(t))return t;if(Es(t))return null;t=mn(t)}return null}function xs(){return Ea==null&&(Ea=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ea}function hn(e){return/^(html|body|#document)$/.test(An(e))}function Rt(e){return nt(e).getComputedStyle(e)}function Ss(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mn(e){if(An(e)==="html")return e;const t=e.assignedSlot||e.parentNode||vo(e)&&e.host||en(e);return vo(t)?t.host:t}function cd(e){const t=mn(e);return hn(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&Dn(t)?t:cd(t)}function yo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=cd(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=nt(o);if(s){const a=Sa(i);return t.concat(i,i.visualViewport||[],Dn(o)?o:[],a&&n?yo(a):[])}else return t.concat(o,yo(o,[],n))}function Sa(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ae(e){return e?.ownerDocument||document}function Ca(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const kr=typeof navigator<"u",Ta=Hw(),ld=Gw(),ud=Uw(),dd=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),fd=Ta.platform==="MacIntel"&&Ta.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ta.platform),jw=kr&&/apple/i.test(navigator.vendor),Oa=kr&&/android/i.test(ld)||/android/i.test(ud);kr&&ld.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const pd=ud.includes("jsdom/");function Hw(){if(!kr)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Uw(){if(!kr)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Gw(){if(!kr)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const ka="data-base-ui-focusable",hd="active",md="selected",gd="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function $t(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ke(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&vo(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function vd(e,t){if(!$e(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(ke(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function gt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Yt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function zw(e){return e.matches("html,body")}function Ra(e){return rt(e)&&e.matches(gd)}function yd(e){return e?e.getAttribute("role")==="combobox"&&Ra(e):!1}function Pa(e){if(!e||pd)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ia(e){return e?e.hasAttribute(ka)?e:e.querySelector(`[${ka}]`)||e:null}function gn(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...gn(e,o.id,n)])}function bd(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Yw(e){e.preventDefault(),e.stopPropagation()}function Zw(e){return"nativeEvent"in e}function qw(e){return e.pointerType===""&&e.isTrusted?!0:Oa&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Xw(e){return pd?!1:!Oa&&e.width===0&&e.height===0||Oa&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function bo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function wd(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Kw=["top","right","bottom","left"],Rr=Math.min,Pt=Math.max,Cs=Math.round,Ts=Math.floor,tn=e=>({x:e,y:e}),Jw={left:"right",right:"left",bottom:"top",top:"bottom"};function _a(e,t,n){return Pt(e,Rr(t,n))}function vn(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function Mn(e){return e.split("-")[1]}function Na(e){return e==="x"?"y":"x"}function Aa(e){return e==="y"?"height":"width"}function Ft(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Da(e){return Na(Ft(e))}function Qw(e,t,n){n===void 0&&(n=!1);const r=Mn(e),o=Da(e),s=Aa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Os(i)),[i,Os(i)]}function e1(e){const t=Os(e);return[Ma(e),t,Ma(t)]}function Ma(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Ed=["left","right"],xd=["right","left"],t1=["top","bottom"],n1=["bottom","top"];function r1(e,t,n){switch(e){case"top":case"bottom":return n?t?xd:Ed:t?Ed:xd;case"left":case"right":return t?t1:n1;default:return[]}}function o1(e,t,n,r){const o=Mn(e);let s=r1(xt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ma)))),s}function Os(e){const t=xt(e);return Jw[t]+e.slice(t.length)}function s1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sd(e){return typeof e!="number"?s1(e):{top:e,right:e,bottom:e,left:e}}function ks(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 i1(e){return Rt(e).display!=="none"}var a1=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Rs=a1.join(","),Cd=typeof Element>"u",Pr=Cd?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ps=!Cd&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},Is=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Is(t.parentNode));return i},c1=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Td=function(t,n,r){if(Is(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Rs));return n&&Pr.call(t,Rs)&&o.unshift(t),o=o.filter(r),o},_s=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!Is(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=_s(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Pr.call(i,Rs);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!Is(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&h){var p=_s(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},Od=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},kd=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||c1(t))&&!Od(t)?0:t.tabIndex},l1=function(t,n){var r=kd(t);return r<0&&n&&!Od(t)?0:r},u1=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Rd=function(t){return t.tagName==="INPUT"},d1=function(t){return Rd(t)&&t.type==="hidden"},f1=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},p1=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},h1=function(t){if(!t.name)return!0;var n=t.form||Ps(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=p1(o,t.form);return!s||s===t},m1=function(t){return Rd(t)&&t.type==="radio"},g1=function(t){return m1(t)&&!h1(t)},v1=function(t){var n,r=t&&Ps(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=Ps(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},Pd=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},y1=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Pr.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Pr.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,u=Ps(t);if(c&&!c.shadowRoot&&o(c)===!0)return Pd(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=l}if(v1(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Pd(t);return!1},b1=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Pr.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},La=function(t,n){return!(n.disabled||d1(n)||y1(n,t)||f1(n)||b1(n))},$a=function(t,n){return!(g1(n)||kd(n)<0||!La(t,n))},w1=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Id=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=l1(a,i),c=i?Id(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(u1).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},wo=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_s([t],n.includeContainer,{filter:$a.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:w1}):r=Td(t,n.includeContainer,$a.bind(null,n)),Id(r)},E1=function(t,n){n=n||{};var r;return n.getShadowRoot?r=_s([t],n.includeContainer,{filter:La.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Td(t,n.includeContainer,La.bind(null,n)),r},_d=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Pr.call(t,Rs)===!1?!1:$a(n,t)};const Ir=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Nd(e,t){const n=wo(e,Ir()),r=n.length;if(r===0)return;const o=$t(Ae(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Fa(e){return Nd(Ae(e).body,1)||e}function Ad(e){return Nd(Ae(e).body,-1)||e}function Dd(e,t){if(!e)return null;const n=wo(Ae(e).body,Ir()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function x1(e){return Dd(e,1)}function S1(e){return Dd(e,-1)}function _r(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ke(n,r)}function C1(e){wo(e,Ir()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Md(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Ns=yw(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,s)=>{const i=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:s,visibleIndex:i?-1:n,offsetY:r}),r+=o.height||0,i||(n+=1)}),t}),yn={toasts:he(e=>e.toasts),isEmpty:he(e=>e.toasts.length===0),toast:he(Ns,(e,t)=>e.get(t)?.value),toastIndex:he(Ns,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:he(Ns,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:he(Ns,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:he(e=>e.hovering),focused:he(e=>e.focused),expanded:he(e=>e.hovering||e.focused),expandedOrOutOfFocus:he(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:he(e=>e.prevFocusElement)};class T1 extends vs{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},yn)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t){const n=yn.toastIndex(this.state,t);if(n===-1)return;this.state.toasts[n]?.onRemove?.();const o=[...this.state.toasts];o.splice(n,1),this.setToasts(o)}addToast=t=>{const{toasts:n,timeout:r,limit:o}=this.state,s=t.id||$w("toast"),i={...t,id:s,transitionStatus:"starting"},a=[i,...n],l=a.filter(u=>u.transitionStatus!=="ending");if(l.length>o){const u=l.length-o,d=l.slice(-u),h=new Set(d.map(p=>p.id));this.setToasts(a.map(p=>{const g=h.has(p.id);return p.limited!==g?{...p,limited:g}:p}))}else this.setToasts(a.map(u=>u.limited?{...u,limited:!1}:u));const c=i.timeout??r;return i.type!=="loading"&&c>0&&this.scheduleTimer(s,c,()=>this.closeToast(s)),yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s};updateToast=(t,n)=>{this.updateToastInternal(t,n)};updateToastInternal=(t,n)=>{const{timeout:r,toasts:o}=this.state,s=yn.toast(this.state,t)??null;if(!s||s.transitionStatus==="ending")return;const i={...s,...n};this.setToasts(o.map(g=>g.id===t?{...g,...n}:g));const a=i.timeout??r,l=s?.timeout??r,c=Object.hasOwn(n,"timeout"),u=i.transitionStatus!=="ending"&&i.type!=="loading"&&a>0,d=this.timers.has(t),h=l!==a,p=s?.type==="loading";if(!u&&d){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(u&&(!d||h||c||p)){const g=this.timers.get(t);g&&(g.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,a,()=>this.closeToast(t)),yn.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let s;if(n)s=o,this.timers.forEach(c=>{c.timeout?.clear()}),this.timers.clear();else{const c=yn.toast(this.state,t);if(!c)return;s=[c];const u=this.timers.get(t);u?.timeout&&(u.timeout.clear(),this.timers.delete(t))}let i=0;const l={toasts:o.map(c=>{if(n||c.id===t)return{...c,transitionStatus:"ending",height:0};if(c.transitionStatus==="ending")return c;const u=i>=r;return i+=1,c.limited!==u?{...c,limited:u}:c})};(n||o.length===1)&&(l.hovering=!1,l.focused=!1),this.update(l),s.forEach(c=>{c.transitionStatus!=="ending"&&c.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Ca(n.loading),o=this.addToast({...r,type:"loading"}),s=t.then(i=>{const a=Ca(n.success,i);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),i}).catch(i=>{const a=Ca(n.error,i);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(i)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=zt.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=gt(t);ke(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),s=!yn.expandedOrOutOfFocus(this.state),i=s?zt.create():void 0;i?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:i,start:s?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=$t(Ae(this.state.viewport));if(!this.state.viewport||!ke(this.state.viewport,n)||!Pa(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=yn.toasts(this.state),o=yn.toastIndex(this.state,t);let s=null,i=o+1;for(;i<r.length;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i+=1}if(!s)for(i=o-1;i>=0;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Ld=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:s}=t,i=ht(()=>new T1({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return mo(i.disposeEffect),f.useEffect(function(){return s?s[" subscribe"](({action:c,options:u})=>{const d=u.id;c==="promise"&&u.promise?i.promiseToast(u.promise,u):c==="update"&&d?i.updateToast(d,u):c==="close"?i.closeToast(d):i.addToast(u)}):void 0},[i,r,s]),i.useSyncedValues({timeout:r,limit:o}),O.jsx(ds.Provider,{value:i,children:n})};process.env.NODE_ENV!=="production"&&(Ld.displayName="ToastProvider");const $d={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Va={...$d,position:"fixed",top:0,left:0},O1={...$d,position:"absolute"},nn=f.forwardRef(function(t,n){const[r,o]=f.useState();ve(()=>{jw&&o("button")},[]);const s={tabIndex:0,role:r};return O.jsx("span",{...t,ref:n,style:Va,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(nn.displayName="FocusGuard");function Eo(e,t,n,r){const o=ht(Fd).current;return R1(o,e,t,n,r)&&Vd(o,[e,t,n,r]),o.callback}function k1(e){const t=ht(Fd).current;return P1(t,e)&&Vd(t,e),t.callback}function Fd(){return{callback:null,cleanup:null,refs:[]}}function R1(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function P1(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Vd(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}function Bd(e){if(!f.isValidElement(e))return null;const t=e,n=t.props;return(va(19)?n?.ref:t.ref)??null}function Ba(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}let Wa;process.env.NODE_ENV!=="production"&&(Wa=new Set);function I1(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Wa.has(t)||(Wa.add(t),console.warn(`Base UI: ${t}`))}}function _1(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function N1(e,t){return typeof e=="function"?e(t):e}function A1(e,t){return typeof e=="function"?e(t):e}const xo={};function Nr(e,t,n,r,o){let s={...ja(e,xo)};return t&&(s=As(s,t)),n&&(s=As(s,n)),r&&(s=As(s,r)),s}function D1(e){if(e.length===0)return xo;if(e.length===1)return ja(e[0],xo);let t={...ja(e[0],xo)};for(let n=1;n<e.length;n+=1)t=As(t,e[n]);return t}function As(e,t){return Wd(t)?t(e):M1(e,t)}function M1(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Ba(e.style,r);break}case"className":{e[n]=jd(e.className,r);break}default:L1(n,r)?e[n]=$1(e[n],r):e[n]=r}}return e}function L1(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function Wd(e){return typeof e=="function"}function ja(e,t){return Wd(e)?e(t):e??xo}function $1(e,t){return t?e?n=>{if(F1(n)){const o=n;Ha(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const r=t(n);return e?.(n),r}:t:e}function Ha(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function jd(e,t){return t?e?t+" "+e:t:e}function F1(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const V1=500,B1={style:{transition:"none"}},Ua="data-base-ui-click-trigger",W1="data-base-ui-swipe-ignore",j1="data-swipe-ignore",H1=`[${W1}]`,U1=`[${j1}]`,G1={fallbackAxisSide:"end"},z1={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ze(e,t,n={}){const r=t.render,o=Y1(t,n);if(n.enabled===!1)return null;const s=n.state??tt;return q1(e,r,o,s)}function Y1(e,t={}){const{className:n,style:r,render:o}=e,{state:s=tt,ref:i,props:a,stateAttributesMapping:l,enabled:c=!0}=t,u=c?N1(n,s):void 0,d=c?A1(r,s):void 0,h=c?_1(s,l):tt,p=c?Ba(h,Array.isArray(a)?D1(a):a)??tt:tt;return typeof document<"u"&&(c?Array.isArray(i)?p.ref=k1([p.ref,Bd(o),...i]):p.ref=Eo(p.ref,Bd(o),i):Eo(null,null)),c?(u!==void 0&&(p.className=jd(p.className,u)),d!==void 0&&(p.style=Ba(p.style,d)),p):tt}const Z1=Symbol.for("react.lazy");function q1(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&X1(t),t(n,r);const o=Nr(n,t.props);o.ref=n.ref;let s=t;if(s?.$$typeof===Z1&&(s=f.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!f.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
16
- `));return f.cloneElement(s,o)}if(e&&typeof e=="string")return K1(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":it(8))}function X1(e){const t=e.name;if(t.length===0)return;const n=t.charCodeAt(0);n<65||n>90||I1(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function K1(e,t){return e==="button"?W.createElement("button",{type:"button",...t,key:t.key}):e==="img"?W.createElement("img",{alt:"",...t,key:t.key}):f.createElement(e,t)}let J1=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Hd=f.forwardRef(function(t,n){const{render:r,className:o,children:s,...i}=t,a=Yu(),l=Nn(),c=f.useRef(!1),u=f.useRef(!1),d=a.useState("isEmpty"),h=a.useState("toasts"),p=a.useState("focused"),g=a.useState("expanded"),m=a.useState("prevFocusElement"),v=h[0]?.height??0,y=f.useMemo(()=>h.some(N=>N.transitionStatus==="ending"),[h]);f.useEffect(()=>{const N=a.state.viewport;if(!N)return;function R(C){d||C.key==="F6"&&C.target!==N&&(C.preventDefault(),a.setPrevFocusElement($t(Ae(N))),N?.focus({preventScroll:!0}),a.pauseTimers(),a.setFocused(!0))}const P=nt(N);return P.addEventListener("keydown",R),()=>{P.removeEventListener("keydown",R)}},[a,d]),f.useEffect(()=>{const N=a.state.viewport;if(!N||d)return;const R=nt(N);function P(_){_.target===R&&(a.setIsWindowFocused(!1),a.pauseTimers())}function C(_){if(_.relatedTarget||_.target===R)return;const D=gt(_),k=$t(Ae(N));(!ke(N,D)||!Pa(k))&&a.resumeTimers(),l.start(0,()=>a.setIsWindowFocused(!0))}return R.addEventListener("blur",P,!0),R.addEventListener("focus",C,!0),()=>{R.removeEventListener("blur",P,!0),R.removeEventListener("focus",C,!0)}},[a,l,d]),f.useEffect(()=>{const N=a.state.viewport;if(!N||d)return;const R=Ae(N);return R.addEventListener("pointerdown",a.handleDocumentPointerDown,!0),()=>{R.removeEventListener("pointerdown",a.handleDocumentPointerDown,!0)}},[d,a]);function b(N){const R=a.state.viewport;R&&(c.current=!0,N.relatedTarget===R?h[0]?.ref?.current?.focus():a.restoreFocusToPrevElement())}function E(N){N.key==="Tab"&&N.shiftKey&&N.target===a.state.viewport&&(N.preventDefault(),a.restoreFocusToPrevElement(),a.resumeTimers())}f.useEffect(()=>{!a.state.isWindowFocused||y||!u.current||(a.resumeTimers(),a.setHovering(!1),u.current=!1)},[y,a]);function x(){a.pauseTimers(),a.setHovering(!0),u.current=!1}function w(){y?u.current=!0:(a.resumeTimers(),a.setHovering(!1))}function T(){if(c.current){c.current=!1;return}p||Pa(Ae(a.state.viewport).activeElement)&&(a.setFocused(!0),a.pauseTimers())}function S(N){!p||ke(a.state.viewport,N.relatedTarget)||(a.setFocused(!1),a.resumeTimers())}const I={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:x,onMouseMove:x,onMouseLeave:w,onFocus:T,onBlur:S,onKeyDown:E,onClick:T},A={expanded:g},L=ze("div",t,{ref:[n,a.setViewport],state:A,props:[I,{style:{[J1.frontmostHeight]:v?`${v}px`:void 0}},i,{children:O.jsxs(f.Fragment,{children:[!d&&m&&O.jsx(nn,{onFocus:b}),s,!d&&m&&O.jsx(nn,{onFocus:b})]})}]}),M=f.useMemo(()=>h.filter(N=>N.priority==="high"),[h]);return O.jsxs(f.Fragment,{children:[!d&&m&&O.jsx(nn,{onFocus:b}),L,!p&&M.length>0&&O.jsx("div",{style:Va,children:M.map(N=>O.jsxs("div",{role:"alert","aria-atomic":!0,children:[O.jsx("div",{children:N.title}),O.jsx("div",{children:N.description})]},N.id))})]})});process.env.NODE_ENV!=="production"&&(Hd.displayName="ToastViewport");function Ga(e){return va(19)?e:e?"true":void 0}const za=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(za.displayName="ToastRootContext");function Q1(){const e=f.useContext(za);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":it(66));return e}let So=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const eE={[So.startingStyle]:""},tE={[So.endingStyle]:""},tr={transitionStatus(e){return e==="starting"?eE:e==="ending"?tE:null}};function bn(e){return e==null?e:"current"in e?e.current:e}function Ud(e,t=!1,n=!0){const r=ba();return me((o,s=null)=>{r.cancel();function i(){lt.flushSync(o)}const a=bn(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let c=function(){const d=So.startingStyle;if(!l.hasAttribute(d)){r.request(u);return}const h=new MutationObserver(()=>{l.hasAttribute(d)||(h.disconnect(),u())});h.observe(l,{attributes:!0,attributeFilter:[d]}),s?.addEventListener("abort",()=>h.disconnect(),{once:!0})},u=function(){Promise.all(l.getAnimations().map(d=>d.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const d=l.getAnimations();if(n){if(s?.aborted)return;i()}else d.length>0&&d.some(h=>h.pending||h.playState!=="finished")&&u()})};if(t){c();return}r.request(u)}})}function Ar(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=me(o),i=Ud(r,n,!1);f.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let nr=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const nE={...tr,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Co=40,rE=10,Ln=.5,oE=1,sE=`${H1},${U1}`;function Gd(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function iE(e){const n=window.getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}const zd=f.forwardRef(function(t,n){const{toast:r,render:o,className:s,swipeDirection:i=["down","right"],...a}=t,l=r.positionerProps?.anchor!==void 0;let c=[];l||(c=Array.isArray(i)?i:[i]);const u=c.length>0,d=Yu(),[h,p]=f.useState(void 0),[g,m]=f.useState(!1),[v,y]=f.useState(!1),[b,E]=f.useState(!1),[x,w]=f.useState({x:0,y:0}),[T,S]=f.useState({x:0,y:0,scale:1}),[I,A]=f.useState(),[L,M]=f.useState(),[N,R]=f.useState(null),P=f.useRef(null),C=f.useRef({x:0,y:0}),_=f.useRef({x:0,y:0,scale:1}),D=f.useRef(void 0),k=f.useRef(0),$=f.useRef(!1),F=f.useRef({x:0,y:0}),j=f.useRef(!1),V=d.useState("toastIndex",r.id),Y=d.useState("toastVisibleIndex",r.id),q=d.useState("toastOffsetY",r.id),X=d.useState("focused"),U=d.useState("expanded");Ar({open:r.transitionStatus!=="ending",ref:P,onComplete(){r.transitionStatus==="ending"&&d.removeToast(r.id)}});const H=me((te=!1)=>{const z=P.current;if(!z)return;const B=z.style.height;z.style.height="auto";const J=z.offsetHeight;z.style.height=B;function pe(){d.updateToastInternal(r.id,{ref:P,height:J,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}te?lt.flushSync(pe):pe()});ve(H,[H]);function Z(te,z){let B=te,J=z;return!c.includes("left")&&!c.includes("right")?B=te>0?te**Ln:-(Math.abs(te)**Ln):(!c.includes("right")&&te>0&&(B=te**Ln),!c.includes("left")&&te<0&&(B=-(Math.abs(te)**Ln))),!c.includes("up")&&!c.includes("down")?J=z>0?z**Ln:-(Math.abs(z)**Ln):(!c.includes("down")&&z>0&&(J=z**Ln),!c.includes("up")&&z<0&&(J=-(Math.abs(z)**Ln))),{x:B,y:J}}function re(te){if(te.button!==0)return;te.pointerType==="touch"&&d.pauseTimers();const z=gt(te.nativeEvent);if(!(z&&z.closest(`button,a,input,textarea,[role="button"],${sE}`))){if($.current=!1,D.current=void 0,k.current=0,C.current={x:te.clientX,y:te.clientY},F.current=C.current,P.current){const J=iE(P.current);_.current=J,S(J),w({x:J.x,y:J.y})}d.setHovering(!0),m(!0),y(!1),R(null),j.current=!0,P.current?.setPointerCapture(te.pointerId)}}function ne(te){if(!g)return;te.preventDefault(),j.current&&(C.current={x:te.clientX,y:te.clientY},j.current=!1);const{clientY:z,clientX:B,movementX:J,movementY:pe}=te;(pe<0&&z>F.current.y||pe>0&&z<F.current.y)&&(F.current={x:F.current.x,y:z}),(J<0&&B>F.current.x||J>0&&B<F.current.x)&&(F.current={x:B,y:F.current.y});const Se=B-C.current.x,_e=z-C.current.y,Fe=z-F.current.y,Ie=B-F.current.x;if(!v&&Math.sqrt(Se*Se+_e*_e)>=oE&&(y(!0),N===null)){const ct=c.includes("left")||c.includes("right"),Ct=c.includes("up")||c.includes("down");if(ct&&Ct){const Dt=Math.abs(Se),jt=Math.abs(_e);R(Dt>jt?"horizontal":"vertical")}}let be;if(!D.current)N==="vertical"?_e>0?be="down":_e<0&&(be="up"):N==="horizontal"?Se>0?be="right":Se<0&&(be="left"):Math.abs(Se)>=Math.abs(_e)?be=Se>0?"right":"left":be=_e>0?"down":"up",be&&c.includes(be)&&(D.current=be,k.current=Gd(be,Se,_e),p(be));else{const Qe=D.current,ct=Gd(Qe,Ie,Fe);ct>Co?($.current=!1,p(Qe)):!(c.includes("left")&&c.includes("right"))&&!(c.includes("up")&&c.includes("down"))&&k.current-ct>=rE&&($.current=!0)}const Re=Z(Se,_e);let Ce=_.current.x,Be=_.current.y;N==="horizontal"?(c.includes("left")||c.includes("right"))&&(Ce+=Re.x):(N==="vertical"||(c.includes("left")||c.includes("right"))&&(Ce+=Re.x),(c.includes("up")||c.includes("down"))&&(Be+=Re.y)),w({x:Ce,y:Be})}function ee(te){if(!g)return;if(m(!1),y(!1),R(null),P.current?.releasePointerCapture(te.pointerId),$.current){w({x:T.x,y:T.y}),p(void 0);return}let z=!1;const B=x.x-T.x,J=x.y-T.y;let pe;for(const Se of c){switch(Se){case"right":B>Co&&(z=!0,pe="right");break;case"left":B<-Co&&(z=!0,pe="left");break;case"down":J>Co&&(z=!0,pe="down");break;case"up":J<-Co&&(z=!0,pe="up");break}if(z)break}z?(p(pe),E(!0),d.closeToast(r.id)):(w({x:T.x,y:T.y}),p(void 0))}function le(te){if(te.key==="Escape"){if(!P.current||!ke(P.current,$t(Ae(P.current))))return;d.closeToast(r.id)}}f.useEffect(()=>{if(!u)return;const te=P.current;if(!te)return;function z(B){ke(te,B.target)&&B.preventDefault()}return te.addEventListener("touchmove",z,{passive:!1}),()=>{te.removeEventListener("touchmove",z)}},[u]);function K(){if(!g&&x.x===T.x&&x.y===T.y&&!b)return{[nr.swipeMovementX]:"0px",[nr.swipeMovementY]:"0px"};const te=x.x-T.x,z=x.y-T.y;return{transition:g?"none":void 0,transform:g?`translateX(${x.x}px) translateY(${x.y}px) scale(${T.scale})`:void 0,[nr.swipeMovementX]:`${te}px`,[nr.swipeMovementY]:`${z}px`}}const G=r.priority==="high",de={role:G?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":I,"aria-describedby":L,"aria-hidden":G&&!X?!0:void 0,onPointerDown:u?re:void 0,onPointerMove:u?ne:void 0,onPointerUp:u?ee:void 0,onKeyDown:le,inert:Ga(r.limited),style:{...K(),[nr.index]:r.transitionStatus==="ending"?V:Y,[nr.offsetY]:`${q}px`,[nr.height]:r.height?`${r.height}px`:void 0}},fe=f.useMemo(()=>({rootRef:P,toast:r,titleId:I,setTitleId:A,descriptionId:L,setDescriptionId:M,swiping:g,swipeDirection:h,recalculateHeight:H,index:V,visibleIndex:Y,expanded:U}),[r,I,L,g,h,H,V,Y,U]),oe={transitionStatus:r.transitionStatus,expanded:U,limited:r.limited||!1,type:r.type,swiping:fe.swiping,swipeDirection:fe.swipeDirection},ue=ze("div",t,{ref:[n,fe.rootRef],state:oe,stateAttributesMapping:nE,props:[de,a]});return O.jsx(za.Provider,{value:fe,children:ue})});process.env.NODE_ENV!=="production"&&(zd.displayName="ToastRoot");const To={...f};let Yd=0;function aE(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(Yd+=1,r(`${t}-${Yd}`))},[n,t]),o}const Zd=To.useId;function rr(e,t){if(Zd!==void 0){const n=Zd();return e??(t?`${t}-${n}`:n)}return aE(e,t)}const qd=f.forwardRef(function(t,n){const{render:r,className:o,id:s,children:i,...a}=t,{toast:l,setDescriptionId:c}=Q1(),u=i??l.description,d=!!u,h=rr(s);ve(()=>{if(d)return c(h),()=>{c(void 0)}},[d,h,c]);const p={type:l.type},g=ze("p",t,{ref:n,state:p,props:{...a,id:h,children:u}});return d?g:null});process.env.NODE_ENV!=="production"&&(qd.displayName="ToastDescription");let Ya;process.env.NODE_ENV!=="production"&&(Ya=new Set);function Ds(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Ya.has(t)||(Ya.add(t),console.error(`Base UI: ${t}`))}}const Xd=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Xd.displayName="CompositeRootContext");function cE(e=!1){const t=f.useContext(Xd);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":it(16));return t}function lE(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:f.useMemo(()=>{const c={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=o,!s&&n&&(c.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||a)&&(c.disabled=n),c},[r,n,t,i,a,s,o])}}function Ms(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=f.useRef(null),a=cE(!0),l=s??a!==void 0,{props:c}=lE({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!i.current)return;const p=Ls(i.current);if(o){if(!p){const g=To.captureOwnerStack?.()||"";Ds(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${g}`)}}else if(p){const g=To.captureOwnerStack?.()||"";Ds(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${g}`)}},[o]);const u=f.useCallback(()=>{const p=i.current;Ls(p)&&l&&t&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,c.disabled,l]);ve(u,[u]);const d=f.useCallback((p={})=>{const{onClick:g,onMouseDown:m,onKeyUp:v,onKeyDown:y,onPointerDown:b,...E}=p;return Nr({type:o?"button":void 0,onClick(w){if(t){w.preventDefault();return}g?.(w)},onMouseDown(w){t||m?.(w)},onKeyDown(w){if(t||(Ha(w),y?.(w),w.baseUIHandlerPrevented))return;const T=w.target===w.currentTarget,S=w.currentTarget,I=Ls(S),A=!o&&uE(S),L=T&&(o?I:!A),M=w.key==="Enter",N=w.key===" ",R=S.getAttribute("role"),P=R?.startsWith("menuitem")||R==="option"||R==="gridcell";if(T&&l&&N){if(w.defaultPrevented&&P)return;w.preventDefault(),A||o&&I?(S.click(),w.preventBaseUIHandler()):L&&(g?.(w),w.preventBaseUIHandler());return}L&&(!o&&(N||M)&&w.preventDefault(),!o&&M&&g?.(w))},onKeyUp(w){if(!t){if(Ha(w),v?.(w),w.target===w.currentTarget&&o&&l&&Ls(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!o&&!l&&w.key===" "&&g?.(w)}},onPointerDown(w){if(t){w.preventDefault();return}b?.(w)}},o?void 0:{role:"button"},c,E)},[t,c,l,o]),h=me(p=>{i.current=p,u()});return{getButtonProps:d,buttonRef:h}}function Ls(e){return rt(e)&&e.tagName==="BUTTON"}function uE(e){return!!(e?.tagName==="A"&&e?.href)}function dE(e,t){return t!=null&&!bo(t)?0:typeof e=="function"?e():e}function $s(e,t,n){const r=dE(e,n);return typeof r=="number"?r:r?.[t]}function Kd(e){return typeof e=="function"?e():e}function Jd(e,t){return t||e==="click"||e==="mousedown"}const Za="none",Dr="trigger-press",St="trigger-hover",Qd="outside-press",fE="close-press",Oo="focus-out",ef="escape-key",tf="imperative-action";function Ye(e,t,n,r){let o=!1,s=!1;const i=tt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}function pE(e,t,n){const r=tt;return{reason:e,event:t??new Event("base-ui"),...r}}function rn(e){const t=ht(hE,e).current;return t.next=e,ve(t.effect),t}function hE(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Fs(e){return`data-base-ui-${e}`}let nf=0;function qa(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(nf);const s=()=>e?.focus({preventScroll:n});o?s():nf=requestAnimationFrame(s)}const Xa={inert:new WeakMap,"aria-hidden":new WeakMap},rf="data-base-ui-inert",Ka={inert:new WeakSet,"aria-hidden":new WeakSet};let ko=new WeakMap,Ja=0;function mE(e){return Ka[e]}function of(e){return e?vo(e)?e.host:of(e.parentNode):null}const Qa=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=of(n);return e.contains(r)?r:null}).filter(n=>n!=null),sf=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},af=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{An(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function gE(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,l=null;const c=Qa(t,e),u=o?Qa(t,s):[],d=new Set(u),h=o?af(t,sf(c),new Set(c)).filter(m=>!d.has(m)):[],p=[],g=[];if(i){const m=Xa[i],v=mE(i);l=v,a=m;const y=Qa(t,Array.from(t.querySelectorAll("[aria-live]"))),b=c.concat(y);af(t,sf(b),new Set(b)).forEach(x=>{const w=x.getAttribute(i),T=w!==null&&w!=="false",S=(m.get(x)||0)+1;m.set(x,S),p.push(x),S===1&&T&&v.add(x),T||x.setAttribute(i,i==="inert"?"":"true")})}return o&&h.forEach(m=>{const v=(ko.get(m)||0)+1;ko.set(m,v),g.push(m),v===1&&m.setAttribute(rf,"")}),Ja+=1,()=>{a&&p.forEach(m=>{const y=(a.get(m)||0)-1;a.set(m,y),y||(!l?.has(m)&&i&&m.removeAttribute(i),l?.delete(m))}),o&&g.forEach(m=>{const v=(ko.get(m)||0)-1;ko.set(m,v),v||m.removeAttribute(rf)}),Ja-=1,Ja||(Xa.inert=new WeakMap,Xa["aria-hidden"]=new WeakMap,Ka.inert=new WeakSet,Ka["aria-hidden"]=new WeakSet,ko=new WeakMap)}}function cf(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=Ae(e[0]).body;return gE(e,i,n,r,{mark:o,markerIgnoreElements:s})}const ec=f.createContext(null);process.env.NODE_ENV!=="production"&&(ec.displayName="PortalContext");const lf=()=>f.useContext(ec),vE=Fs("portal");function uf(e={}){const{ref:t,container:n,componentProps:r=tt,elementProps:o}=e,s=rr(),a=lf()?.portalNode,[l,c]=f.useState(null),[u,d]=f.useState(null),h=me(v=>{v!==null&&d(v)}),p=f.useRef(null);ve(()=>{if(n===null){p.current&&(p.current=null,d(null),c(null));return}if(s==null)return;const v=(n&&(wa(n)?n:n.current))??a??document.body;if(v==null){p.current&&(p.current=null,d(null),c(null));return}p.current!==v&&(p.current=v,d(null),c(v))},[n,a,s]);const g=ze("div",r,{ref:[t,h],props:[{id:s,[vE]:""},o]});return{portalNode:u,portalSubtree:l&&g?lt.createPortal(g,l):null}}const tc=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,...l}=t,{portalNode:c,portalSubtree:u}=uf({container:o,ref:n,componentProps:t,elementProps:l}),d=f.useRef(null),h=f.useRef(null),p=f.useRef(null),g=f.useRef(null),[m,v]=f.useState(null),y=m?.modal,b=m?.open,E=typeof a=="boolean"?a:!!m&&!m.modal&&m.open&&!!c;f.useEffect(()=>{if(!c||y)return;function w(T){c&&T.relatedTarget&&_r(T)&&(T.type==="focusin"?Md:C1)(c)}return c.addEventListener("focusin",w,!0),c.addEventListener("focusout",w,!0),()=>{c.removeEventListener("focusin",w,!0),c.removeEventListener("focusout",w,!0)}},[c,y]),f.useEffect(()=>{!c||b||Md(c)},[b,c]);const x=f.useMemo(()=>({beforeOutsideRef:d,afterOutsideRef:h,beforeInsideRef:p,afterInsideRef:g,portalNode:c,setFocusManagerState:v}),[c]);return O.jsxs(f.Fragment,{children:[u,O.jsxs(ec.Provider,{value:x,children:[E&&c&&O.jsx(nn,{"data-type":"outside",ref:d,onFocus:w=>{if(_r(w,c))p.current?.focus();else{const T=m?m.domReference:null;Ad(T)?.focus()}}}),E&&c&&O.jsx("span",{"aria-owns":c.id,style:z1}),c&&lt.createPortal(r,c),E&&c&&O.jsx(nn,{"data-type":"outside",ref:h,onFocus:w=>{if(_r(w,c))g.current?.focus();else{const T=m?m.domReference:null;Fa(T)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Ye(Oo,w.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(tc.displayName="FloatingPortal");function df(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class yE{nodesRef={current:[]};events=df();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const nc=f.createContext(null);process.env.NODE_ENV!=="production"&&(nc.displayName="FloatingNodeContext");const rc=f.createContext(null);process.env.NODE_ENV!=="production"&&(rc.displayName="FloatingTreeContext");const or=()=>f.useContext(nc)?.id||null,Mr=e=>{const t=f.useContext(rc);return e??t};function bE(e){const t=rr(),n=Mr(e),r=or();return ve(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function wE(e){const{children:t,id:n}=e,r=or();return O.jsx(nc.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function EE(e){const{children:t,externalTree:n}=e,r=ht(()=>n??new yE).current;return O.jsx(rc.Provider,{value:r,children:t})}function xE(e,t){const n=nt(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const ff=20;let $n=[];function oc(){$n=$n.filter(e=>e.deref()?.isConnected)}function SE(e){oc(),e&&An(e)!=="body"&&($n.push(new WeakRef(e)),$n.length>ff&&($n=$n.slice(-ff)))}function sc(){return oc(),$n[$n.length-1]?.deref()}function CE(e){if(!e)return null;const t=Ir();return _d(e,t)?e:wo(e,t)[0]||e}function TE(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():i1(e)}function pf(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Ir(),o=E1(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return _d(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function hf(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:h,externalTree:p,getInsideElements:g}=e,m="rootStore"in t?t.rootStore:t,v=m.useState("open"),y=m.useState("domReferenceElement"),b=m.useState("floatingElement"),{events:E,dataRef:x}=m.context,w=me(()=>x.current.floatingContext?.nodeId),T=o===!1,S=yd(y)&&T,I=f.useRef(["content"]),A=rn(o),L=rn(s),M=rn(c),N=Mr(p),R=lf(),P=f.useRef(!1),C=f.useRef(!1),_=f.useRef(!1),D=f.useRef(-1),k=f.useRef(""),$=f.useRef(""),F=f.useRef(null),j=f.useRef(null),V=Eo(F,h,R?.beforeInsideRef),Y=Eo(j,R?.afterInsideRef),q=Nn(),X=Nn(),U=ba(),H=R!=null,Z=Ia(b),re=me((K=Z)=>K?wo(K,Ir()):[]),ne=me(()=>g?.().filter(K=>K!=null)??[]),ee=me(K=>{const G=re(K);return I.current.map(()=>G).filter(Boolean).flat()});f.useEffect(()=>{if(r||!a)return;function K(de){de.key==="Tab"&&ke(Z,$t(Ae(Z)))&&re().length===0&&!S&&Yw(de)}const G=Ae(Z);return G.addEventListener("keydown",K),()=>{G.removeEventListener("keydown",K)}},[r,y,Z,a,I,S,re,ee]),f.useEffect(()=>{if(r||!v)return;const K=Ae(Z);function G(){_.current=!1}function de(oe){const ue=gt(oe),te=ne(),z=ke(b,ue)||ke(y,ue)||ke(R?.portalNode,ue)||te.some(B=>B===ue||ke(B,ue));_.current=!z,$.current=oe.pointerType||"keyboard",ue?.closest(`[${Ua}]`)&&(C.current=!0)}function fe(){$.current="keyboard"}return K.addEventListener("pointerdown",de,!0),K.addEventListener("pointerup",G,!0),K.addEventListener("pointercancel",G,!0),K.addEventListener("keydown",fe,!0),()=>{K.removeEventListener("pointerdown",de,!0),K.removeEventListener("pointerup",G,!0),K.removeEventListener("pointercancel",G,!0),K.removeEventListener("keydown",fe,!0)}},[r,b,y,Z,v,R,ne]),f.useEffect(()=>{if(r||!l)return;const K=Ae(Z);function G(){C.current=!0,X.start(0,()=>{C.current=!1})}function de(z){const B=gt(z),pe=re().indexOf(B);pe!==-1&&(D.current=pe)}function fe(z){const B=z.relatedTarget,J=z.currentTarget,pe=gt(z);queueMicrotask(()=>{const Se=w(),_e=m.context.triggerElements,Fe=ne(),Ie=B?.hasAttribute(Fs("focus-guard"))&&[F.current,j.current,R?.beforeInsideRef.current,R?.afterInsideRef.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,bn(d),bn(u)].includes(B),be=!(ke(y,B)||ke(b,B)||ke(B,b)||ke(R?.portalNode,B)||Fe.some(Re=>Re===B||ke(Re,B))||B!=null&&_e.hasElement(B)||_e.hasMatchingElement(Re=>ke(Re,B))||Ie||N&&(gn(N.nodesRef.current,Se).find(Re=>ke(Re.context?.elements.floating,B)||ke(Re.context?.elements.domReference,B))||bd(N.nodesRef.current,Se).find(Re=>[Re.context?.elements.floating,Ia(Re.context?.elements.floating)].includes(B)||Re.context?.elements.domReference===B)));if(J===y&&Z&&pf(Z,I),i&&J!==y&&!TE(pe)&&$t(K)===K.body){if(rt(Z)&&(Z.focus(),i==="popup")){U.request(()=>{Z.focus()});return}const Re=D.current,Ce=re(),Be=Ce[Re]||Ce[Ce.length-1]||Z;rt(Be)&&Be.focus()}if(x.current.insideReactTree){x.current.insideReactTree=!1;return}(S||!a)&&B&&be&&!C.current&&(S||B!==sc())&&(P.current=!0,m.setOpen(!1,Ye(Oo,z)))})}function oe(){_.current||(x.current.insideReactTree=!0,q.start(0,()=>{x.current.insideReactTree=!1}))}const ue=rt(y)?y:null,te=[];if(!(!b&&!ue))return ue&&(ue.addEventListener("focusout",fe),ue.addEventListener("pointerdown",G),te.push(()=>{ue.removeEventListener("focusout",fe),ue.removeEventListener("pointerdown",G)})),b&&(b.addEventListener("focusin",de),b.addEventListener("focusout",fe),R&&(b.addEventListener("focusout",oe,!0),te.push(()=>{b.removeEventListener("focusout",oe,!0)})),te.push(()=>{b.removeEventListener("focusin",de),b.removeEventListener("focusout",fe)})),()=>{te.forEach(z=>{z()})}},[r,y,b,Z,a,N,R,m,l,i,re,S,w,I,x,q,X,U,u,d,ne]),f.useEffect(()=>{if(r||!b||!v)return;const K=Array.from(R?.portalNode?.querySelectorAll(`[${Fs("portal")}]`)||[]),de=(N?bd(N.nodesRef.current,w()):[]).find(B=>yd(B.context?.elements.domReference||null))?.context?.elements.domReference,oe=[...[b,...K,F.current,j.current,R?.beforeOutsideRef.current,R?.afterOutsideRef.current,...ne()],de,bn(d),bn(u),S?y:null].filter(B=>B!=null),ue=cf(oe,{ariaHidden:a||S,mark:!1}),te=[b,...K].filter(B=>B!=null),z=cf(te);return()=>{z(),ue()}},[v,r,y,b,a,I,R,S,N,w,u,d,ne]),ve(()=>{if(!v||r||!rt(Z))return;const K=Ae(Z),G=$t(K);queueMicrotask(()=>{const de=ee(Z),fe=A.current,oe=typeof fe=="function"?fe(M.current||""):fe;if(oe===void 0||oe===!1)return;let ue;oe===!0||oe===null?ue=de[0]||Z:ue=bn(oe),ue=ue||de[0]||Z,!ke(Z,G)&&qa(ue,{preventScroll:ue===Z})})},[r,v,Z,T,ee,A,M]),ve(()=>{if(r||!Z)return;const K=Ae(Z),G=$t(K);SE(G);function de(oe){if(oe.open||(k.current=xE(oe.nativeEvent,$.current)),oe.reason===St&&oe.nativeEvent.type==="mouseleave"&&(P.current=!0),oe.reason===Qd)if(oe.nested)P.current=!1;else if(qw(oe.nativeEvent)||Xw(oe.nativeEvent))P.current=!1;else{let ue=!1;document.createElement("div").focus({get preventScroll(){return ue=!0,!1}}),ue?P.current=!1:P.current=!0}}E.on("openchange",de);function fe(){const oe=L.current;let ue=typeof oe=="function"?oe(k.current):oe;if(ue===void 0||ue===!1)return null;if(ue===null&&(ue=!0),typeof ue=="boolean"){const z=y||sc();return z&&z.isConnected?z:null}const te=y||sc();return bn(ue)||te||null}return()=>{E.off("openchange",de);const oe=$t(K),ue=ne(),te=ke(b,oe)||ue.some(B=>B===oe||ke(B,oe))||N&&gn(N.nodesRef.current,w(),!1).some(B=>ke(B.context?.elements.floating,oe)),z=fe();queueMicrotask(()=>{const B=CE(z),J=typeof L.current!="boolean";L.current&&!P.current&&rt(B)&&(!(!J&&B!==oe&&oe!==K.body)||te)&&B.focus({preventScroll:!0}),P.current=!1})}},[r,b,Z,L,x,E,N,y,w,ne]),ve(()=>{if(!dd||v||!b)return;const K=$t(Ae(b));!rt(K)||!Ra(K)||ke(b,K)&&K.blur()},[v,b]),ve(()=>{if(!(r||!R))return R.setFocusManagerState({modal:a,closeOnFocusOut:l,open:v,onOpenChange:m.setOpen,domReference:y}),()=>{R.setFocusManagerState(null)}},[r,R,a,v,m,l,y]),ve(()=>{if(!(r||!Z))return pf(Z,I),()=>{queueMicrotask(oc)}},[r,Z,I]);const le=!r&&(a?!S:!0)&&(H||a);return O.jsxs(f.Fragment,{children:[le&&O.jsx(nn,{"data-type":"inside",ref:V,onFocus:K=>{if(a){const G=ee();qa(G[G.length-1])}else R?.portalNode&&(P.current=!1,_r(K,R.portalNode)?Fa(y)?.focus():bn(d??R.beforeOutsideRef)?.focus())}}),n,le&&O.jsx(nn,{"data-type":"inside",ref:Y,onFocus:K=>{a?qa(ee()[0]):R?.portalNode&&(l&&(P.current=!0),_r(K,R.portalNode)?Ad(y)?.focus():bn(u??R.afterOutsideRef)?.focus())}})]})}function mf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=Dr}=t,d=f.useRef(void 0),h=ba(),p=Nn(),g=f.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){const v=d.current,y=m.nativeEvent,b=n.select("open");if(m.button!==0||s==="click"||bo(v,!0)&&a)return;const E=r.current.openEvent,x=E?.type,w=n.select("domReferenceElement")!==m.currentTarget,T=b&&w||!(b&&i&&(!(E&&l)||x==="click"||x==="mousedown"));if(Ra(y.target)){const I=Ye(u,y,y.target);T&&v==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,I)}):n.setOpen(T,I);return}const S=m.currentTarget;h.request(()=>{const I=Ye(u,y,S);T&&v==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,I)}):n.setOpen(T,I)})},onClick(m){if(s==="mousedown-only")return;const v=d.current;if(s==="mousedown"&&v){d.current=void 0;return}if(bo(v,!0)&&a)return;const y=n.select("open"),b=r.current.openEvent,E=n.select("domReferenceElement")!==m.currentTarget,x=y&&E||!(y&&i&&(!(b&&l)||wd(b))),w=Ye(u,m.nativeEvent,m.currentTarget);x&&v==="touch"&&c>0?p.start(c,()=>{n.setOpen(!0,w)}):n.setOpen(x,w)},onKeyDown(){d.current=void 0}}),[r,s,a,n,l,i,h,p,c,u]);return f.useMemo(()=>o?{reference:g}:tt,[o,g])}const OE={intentional:"onClick",sloppy:"onPointerDown"};function kE(){return!1}function RE(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function gf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="sloppy",referencePress:u=kE,referencePressEvent:d="sloppy",bubbles:h,externalTree:p}=t,g=Mr(p),m=me(typeof l=="function"?l:()=>!1),v=typeof l=="function"?m:l,y=v!==!1,b=me(()=>c),E=f.useRef(!1),x=f.useRef(!1),w=f.useRef(!1),{escapeKey:T,outsidePress:S}=RE(h),I=f.useRef(null),A=Nn(),L=Nn(),M=me(()=>{L.clear(),s.current.insideReactTree=!1}),N=f.useRef(!1),R=f.useRef(""),P=me(u),C=me(j=>{if(!r||!i||!a||j.key!=="Escape"||N.current)return;const V=s.current.floatingContext?.nodeId,Y=g?gn(g.nodesRef.current,V):[];if(!T&&Y.length>0){let U=!0;if(Y.forEach(H=>{H.context?.open&&!H.context.dataRef.current.__escapeKeyBubbles&&(U=!1)}),!U)return}const q=Zw(j)?j.nativeEvent:j,X=Ye(ef,q);n.setOpen(!1,X),!T&&!X.isPropagationAllowed&&j.stopPropagation()}),_=me(()=>{s.current.insideReactTree=!0,L.start(0,M)});f.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=S;const j=new zt,V=new zt;function Y(){j.clear(),N.current=!0}function q(){j.start(xs()?5:0,()=>{N.current=!1})}function X(){w.current=!0,V.start(0,()=>{w.current=!1})}function U(){E.current=!1,x.current=!1}function H(){const B=R.current,J=B==="pen"||!B?"mouse":B,pe=b(),Se=typeof pe=="function"?pe():pe;return typeof Se=="string"?Se:Se[J]}function Z(B){const J=H();return J==="intentional"&&B.type!=="click"||J==="sloppy"&&B.type==="click"}function re(B){const J=s.current.floatingContext?.nodeId,pe=g&&gn(g.nodesRef.current,J).some(Se=>Yt(B,Se.context?.elements.floating));return Yt(B,n.select("floatingElement"))||Yt(B,n.select("domReferenceElement"))||pe}function ne(B){if(Z(B)){M();return}if(s.current.insideReactTree){M();return}const J=gt(B),pe=`[${Fs("inert")}]`;let Se=Array.from(Ae(n.select("floatingElement")).querySelectorAll(pe));const _e=$e(J)?J.getRootNode():null;vo(_e)&&(Se=Se.concat(Array.from(_e.querySelectorAll(pe))));const Fe=n.context.triggerElements;if(J&&(Fe.hasElement(J)||Fe.hasMatchingElement(Ce=>ke(Ce,J))))return;let Ie=$e(J)?J:null;for(;Ie&&!hn(Ie);){const Ce=mn(Ie);if(hn(Ce)||!$e(Ce))break;Ie=Ce}if(Se.length&&$e(J)&&!zw(J)&&!ke(J,n.select("floatingElement"))&&Se.every(Ce=>!ke(Ie,Ce)))return;if(rt(J)&&!("touches"in B)){const Ce=hn(J),Be=Rt(J),Qe=/auto|scroll/,ct=Ce||Qe.test(Be.overflowX),Ct=Ce||Qe.test(Be.overflowY),Dt=ct&&J.clientWidth>0&&J.scrollWidth>J.clientWidth,jt=Ct&&J.clientHeight>0&&J.scrollHeight>J.clientHeight,ye=Be.direction==="rtl",Ze=jt&&(ye?B.offsetX<=J.offsetWidth-J.clientWidth:B.offsetX>J.clientWidth),ie=Dt&&B.offsetY>J.clientHeight;if(Ze||ie)return}if(re(B))return;if(H()==="intentional"&&w.current){V.clear(),w.current=!1;return}if(typeof v=="function"&&!v(B))return;const be=s.current.floatingContext?.nodeId,Re=g?gn(g.nodesRef.current,be):[];if(Re.length>0){let Ce=!0;if(Re.forEach(Be=>{Be.context?.open&&!Be.context.dataRef.current.__outsidePressBubbles&&(Ce=!1)}),!Ce)return}n.setOpen(!1,Ye(Qd,B)),M()}function ee(B){H()!=="sloppy"||B.pointerType==="touch"||!n.select("open")||!i||Yt(B,n.select("floatingElement"))||Yt(B,n.select("domReferenceElement"))||ne(B)}function le(B){if(H()!=="sloppy"||!n.select("open")||!i||Yt(B,n.select("floatingElement"))||Yt(B,n.select("domReferenceElement")))return;const J=B.touches[0];J&&(I.current={startTime:Date.now(),startX:J.clientX,startY:J.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function K(B){R.current="touch";const J=gt(B);function pe(){le(B),J?.removeEventListener(B.type,pe)}J?.addEventListener(B.type,pe)}function G(B){if(A.clear(),B.type==="pointerdown"&&(R.current=B.pointerType),B.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)return;const J=gt(B);function pe(){B.type==="pointerdown"?ee(B):ne(B),J?.removeEventListener(B.type,pe)}J?.addEventListener(B.type,pe)}function de(B){if(!E.current)return;const J=x.current;if(U(),H()==="intentional"){if(B.type==="pointercancel"){J&&X();return}if(!re(B)){if(J){X();return}typeof v=="function"&&!v(B)||(V.clear(),w.current=!0,M())}}}function fe(B){if(H()!=="sloppy"||!I.current||Yt(B,n.select("floatingElement"))||Yt(B,n.select("domReferenceElement")))return;const J=B.touches[0];if(!J)return;const pe=Math.abs(J.clientX-I.current.startX),Se=Math.abs(J.clientY-I.current.startY),_e=Math.sqrt(pe*pe+Se*Se);_e>5&&(I.current.dismissOnTouchEnd=!0),_e>10&&(ne(B),A.clear(),I.current=null)}function oe(B){const J=gt(B);function pe(){fe(B),J?.removeEventListener(B.type,pe)}J?.addEventListener(B.type,pe)}function ue(B){H()!=="sloppy"||!I.current||Yt(B,n.select("floatingElement"))||Yt(B,n.select("domReferenceElement"))||(I.current.dismissOnTouchEnd&&ne(B),A.clear(),I.current=null)}function te(B){const J=gt(B);function pe(){ue(B),J?.removeEventListener(B.type,pe)}J?.addEventListener(B.type,pe)}const z=Ae(o);return a&&(z.addEventListener("keydown",C),z.addEventListener("compositionstart",Y),z.addEventListener("compositionend",q)),y&&(z.addEventListener("click",G,!0),z.addEventListener("pointerdown",G,!0),z.addEventListener("pointerup",de,!0),z.addEventListener("pointercancel",de,!0),z.addEventListener("mousedown",G,!0),z.addEventListener("mouseup",de,!0),z.addEventListener("touchstart",K,!0),z.addEventListener("touchmove",oe,!0),z.addEventListener("touchend",te,!0)),()=>{a&&(z.removeEventListener("keydown",C),z.removeEventListener("compositionstart",Y),z.removeEventListener("compositionend",q)),y&&(z.removeEventListener("click",G,!0),z.removeEventListener("pointerdown",G,!0),z.removeEventListener("pointerup",de,!0),z.removeEventListener("pointercancel",de,!0),z.removeEventListener("mousedown",G,!0),z.removeEventListener("mouseup",de,!0),z.removeEventListener("touchstart",K,!0),z.removeEventListener("touchmove",oe,!0),z.removeEventListener("touchend",te,!0)),j.clear(),V.clear(),U(),w.current=!1}},[s,o,a,y,v,r,i,T,S,C,M,b,g,n,A]),f.useEffect(M,[v,M]);const D=f.useMemo(()=>({onKeyDown:C,[OE[d]]:j=>{P()&&n.setOpen(!1,Ye(Dr,j.nativeEvent))},...d!=="intentional"&&{onClick(j){P()&&n.setOpen(!1,Ye(Dr,j.nativeEvent))}}}),[C,n,d,P]),k=me(j=>{if(!r||!i||j.button!==0)return;const V=gt(j.nativeEvent);ke(n.select("floatingElement"),V)&&(E.current||(E.current=!0,x.current=!1))}),$=me(j=>{!r||!i||(j.defaultPrevented||j.nativeEvent.defaultPrevented)&&E.current&&(x.current=!0)}),F=f.useMemo(()=>({onKeyDown:C,onPointerDown:$,onMouseDown:$,onClickCapture:_,onMouseDownCapture(j){_(),k(j)},onPointerDownCapture(j){_(),k(j)},onMouseUpCapture:_,onTouchEndCapture:_,onTouchMoveCapture:_}),[C,_,k,$]);return f.useMemo(()=>i?{reference:D,floating:F,trigger:D}:{},[i,D,F])}function vf(e,t,n){let{reference:r,floating:o}=e;const s=Ft(t),i=Da(t),a=Aa(i),l=xt(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Mn(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}async function PE(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=vn(t,e),g=Sd(p),v=a[h?d==="floating"?"reference":"floating":d],y=ks(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},w=ks(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:E,strategy:l}):b);return{top:(y.top-w.top+g.top)/x.y,bottom:(w.bottom-y.bottom+g.bottom)/x.y,left:(y.left-w.left+g.left)/x.x,right:(w.right-y.right+g.right)/x.x}}const IE=50,_E=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:PE},l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=vf(c,r,l),h=r,p=0;const g={};for(let m=0;m<s.length;m++){const v=s[m];if(!v)continue;const{name:y,fn:b}=v,{x:E,y:x,data:w,reset:T}=await b({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});u=E??u,d=x??d,g[y]={...g[y],...w},T&&p<IE&&(p++,typeof T=="object"&&(T.placement&&(h=T.placement),T.rects&&(c=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=vf(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:g}},NE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=vn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=xt(o),b=Ft(a),E=xt(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(E||!m?[Os(a)]:e1(a)),T=g!=="none";!h&&T&&w.push(...o1(a,m,g,x));const S=[a,...w],I=await l.detectOverflow(t,v),A=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(I[y]),d){const P=Qw(o,i,x);A.push(I[P[0]],I[P[1]])}if(L=[...L,{placement:o,overflows:A}],!A.every(P=>P<=0)){var M,N;const P=(((M=s.flip)==null?void 0:M.index)||0)+1,C=S[P];if(C&&(!(d==="alignment"?b!==Ft(C):!1)||L.every(k=>Ft(k.placement)===b?k.overflows[0]>0:!0)))return{data:{index:P,overflows:L},reset:{placement:C}};let _=(N=L.filter(D=>D.overflows[0]<=0).sort((D,k)=>D.overflows[1]-k.overflows[1])[0])==null?void 0:N.placement;if(!_)switch(p){case"bestFit":{var R;const D=(R=L.filter(k=>{if(T){const $=Ft(k.placement);return $===b||$==="y"}return!0}).map(k=>[k.placement,k.overflows.filter($=>$>0).reduce(($,F)=>$+F,0)]).sort((k,$)=>k[1]-$[1])[0])==null?void 0:R[0];D&&(_=D);break}case"initialPlacement":_=a;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function yf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bf(e){return Kw.some(t=>e[t]>=0)}const AE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=vn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=yf(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bf(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=yf(i,n.floating);return{data:{escapedOffsets:a,escaped:bf(a)}}}default:return{}}}}},wf=new Set(["left","top"]);async function DE(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=xt(n),a=Mn(n),l=Ft(n)==="y",c=wf.has(i)?-1:1,u=s&&l?-1:1,d=vn(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const ME=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await DE(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},LE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:b,y:E}=y;return{x:b,y:E}}},...c}=vn(e,t),u={x:n,y:r},d=await s.detectOverflow(t,c),h=Ft(xt(o)),p=Na(h);let g=u[p],m=u[h];if(i){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",E=g+d[y],x=g-d[b];g=_a(E,g,x)}if(a){const y=h==="y"?"top":"left",b=h==="y"?"bottom":"right",E=m+d[y],x=m-d[b];m=_a(E,m,x)}const v=l.fn({...t,[p]:g,[h]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[p]:i,[h]:a}}}}}},$E=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=vn(e,t),u={x:n,y:r},d=Ft(o),h=Na(d);let p=u[h],g=u[d];const m=vn(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const E=h==="y"?"height":"width",x=s.reference[h]-s.floating[E]+v.mainAxis,w=s.reference[h]+s.reference[E]-v.mainAxis;p<x?p=x:p>w&&(p=w)}if(c){var y,b;const E=h==="y"?"width":"height",x=wf.has(xt(o)),w=s.reference[d]-s.floating[E]+(x&&((y=i.offset)==null?void 0:y[d])||0)+(x?0:v.crossAxis),T=s.reference[d]+s.reference[E]+(x?0:((b=i.offset)==null?void 0:b[d])||0)-(x?v.crossAxis:0);g<w?g=w:g>T&&(g=T)}return{[h]:p,[d]:g}}}},FE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=vn(e,t),u=await i.detectOverflow(t,c),d=xt(o),h=Mn(o),p=Ft(o)==="y",{width:g,height:m}=s.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=h==="end"?"top":"bottom");const b=m-u.top-u.bottom,E=g-u.left-u.right,x=Rr(m-u[v],b),w=Rr(g-u[y],E),T=!t.middlewareData.shift;let S=x,I=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=b),T&&!h){const L=Pt(u.left,0),M=Pt(u.right,0),N=Pt(u.top,0),R=Pt(u.bottom,0);p?I=g-2*(L!==0||M!==0?L+M:Pt(u.left,u.right)):S=m-2*(N!==0||R!==0?N+R:Pt(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:S});const A=await i.getDimensions(a.floating);return g!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function Ef(e){const t=Rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Cs(n)!==s||Cs(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function ic(e){return $e(e)?e:e.contextElement}function Lr(e){const t=ic(e);if(!rt(t))return tn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ef(t);let i=(s?Cs(n.width):n.width)/r,a=(s?Cs(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const VE=tn(0);function xf(e){const t=nt(e);return!xs()||!t.visualViewport?VE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function BE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==nt(e)?!1:t}function sr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=ic(e);let i=tn(1);t&&(r?$e(r)&&(i=Lr(r)):i=Lr(e));const a=BE(s,n,r)?xf(s):tn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=nt(s),p=r&&$e(r)?nt(r):r;let g=h,m=Sa(g);for(;m&&r&&p!==g;){const v=Lr(m),y=m.getBoundingClientRect(),b=Rt(m),E=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,x=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=E,c+=x,g=nt(m),m=Sa(g)}}return ks({width:u,height:d,x:l,y:c})}function Vs(e,t){const n=Ss(e).scrollLeft;return t?t.left+n:sr(en(e)).left+n}function Sf(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Vs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function WE(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=en(r),a=t?Es(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=tn(1);const u=tn(0),d=rt(r);if((d||!d&&!s)&&((An(r)!=="body"||Dn(i))&&(l=Ss(r)),d)){const p=sr(r);c=Lr(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=i&&!d&&!s?Sf(i,l):tn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function jE(e){return Array.from(e.getClientRects())}function HE(e){const t=en(e),n=Ss(e),r=e.ownerDocument.body,o=Pt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Pt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Vs(e);const a=-n.scrollTop;return Rt(r).direction==="rtl"&&(i+=Pt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const Cf=25;function UE(e,t){const n=nt(e),r=en(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const u=xs();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}const c=Vs(r);if(c<=0){const u=r.ownerDocument,d=u.body,h=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-p);g<=Cf&&(s-=g)}else c<=Cf&&(s+=c);return{width:s,height:i,x:a,y:l}}function GE(e,t){const n=sr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=rt(e)?Lr(e):tn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Tf(e,t,n){let r;if(t==="viewport")r=UE(e,n);else if(t==="document")r=HE(en(e));else if($e(t))r=GE(t,n);else{const o=xf(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ks(r)}function Of(e,t){const n=mn(e);return n===t||!$e(n)||hn(n)?!1:Rt(n).position==="fixed"||Of(n,t)}function zE(e,t){const n=t.get(e);if(n)return n;let r=yo(e,[],!1).filter(a=>$e(a)&&An(a)!=="body"),o=null;const s=Rt(e).position==="fixed";let i=s?mn(e):e;for(;$e(i)&&!hn(i);){const a=Rt(i),l=xa(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Dn(i)&&!l&&Of(e,i))?r=r.filter(u=>u!==i):o=a,i=mn(i)}return t.set(e,r),r}function YE(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Es(t)?[]:zE(t,this._c):[].concat(n),r],a=Tf(t,i[0],o);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let h=1;h<i.length;h++){const p=Tf(t,i[h],o);l=Pt(p.top,l),c=Rr(p.right,c),u=Rr(p.bottom,u),d=Pt(p.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function ZE(e){const{width:t,height:n}=Ef(e);return{width:t,height:n}}function qE(e,t,n){const r=rt(t),o=en(t),s=n==="fixed",i=sr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=tn(0);function c(){l.x=Vs(o)}if(r||!r&&!s)if((An(t)!=="body"||Dn(o))&&(a=Ss(t)),r){const p=sr(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?Sf(o,a):tn(0),d=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:i.width,height:i.height}}function ac(e){return Rt(e).position==="static"}function kf(e,t){if(!rt(e)||Rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return en(e)===n&&(n=n.ownerDocument.body),n}function Rf(e,t){const n=nt(e);if(Es(e))return n;if(!rt(e)){let o=mn(e);for(;o&&!hn(o);){if($e(o)&&!ac(o))return o;o=mn(o)}return n}let r=kf(e,t);for(;r&&Fw(r)&&ac(r);)r=kf(r,t);return r&&hn(r)&&ac(r)&&!xa(r)?n:r||Ww(e)||n}const XE=async function(e){const t=this.getOffsetParent||Rf,n=this.getDimensions,r=await n(e.floating);return{reference:qE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function KE(e){return Rt(e).direction==="rtl"}const JE={convertOffsetParentRelativeRectToViewportRelativeRect:WE,getDocumentElement:en,getClippingRect:YE,getOffsetParent:Rf,getElementRects:XE,getClientRects:jE,getDimensions:ZE,getScale:Lr,isElement:$e,isRTL:KE};function Pf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QE(e,t){let n=null,r;const o=en(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(a||t(),!h||!p)return;const g=Ts(d),m=Ts(o.clientWidth-(u+h)),v=Ts(o.clientHeight-(d+p)),y=Ts(u),E={rootMargin:-g+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Pt(0,Rr(1,l))||1};let x=!0;function w(T){const S=T[0].intersectionRatio;if(S!==l){if(!x)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!Pf(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(w,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return i(!0),s}function If(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ic(e),u=o||s?[...c?yo(c):[],...t?yo(t):[]]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=c&&a?QE(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let g,m=l?sr(e):null;l&&v();function v(){const y=sr(e);m&&!Pf(m,y)&&n(),m=y,g=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const ex=ME,tx=LE,nx=NE,rx=FE,ox=AE,sx=$E,ix=(e,t,n)=>{const r=new Map,o={platform:JE,...n},s={...o.platform,_c:r};return _E(e,t,{...o,platform:s})};var ax=typeof document<"u",cx=function(){},Bs=ax?W.useLayoutEffect:cx;function Ws(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(!Ws(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Ws(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _f(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Nf(e,t){const n=_f(e);return Math.round(t*n)/n}function cc(e){const t=f.useRef(e);return Bs(()=>{t.current=e}),t}function lx(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);Ws(h,r)||p(r);const[g,m]=f.useState(null),[v,y]=f.useState(null),b=f.useCallback(k=>{k!==T.current&&(T.current=k,m(k))},[]),E=f.useCallback(k=>{k!==S.current&&(S.current=k,y(k))},[]),x=s||g,w=i||v,T=f.useRef(null),S=f.useRef(null),I=f.useRef(u),A=l!=null,L=cc(l),M=cc(o),N=cc(c),R=f.useCallback(()=>{if(!T.current||!S.current)return;const k={placement:t,strategy:n,middleware:h};M.current&&(k.platform=M.current),ix(T.current,S.current,k).then($=>{const F={...$,isPositioned:N.current!==!1};P.current&&!Ws(I.current,F)&&(I.current=F,lt.flushSync(()=>{d(F)}))})},[h,t,n,M,N]);Bs(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[c]);const P=f.useRef(!1);Bs(()=>(P.current=!0,()=>{P.current=!1}),[]),Bs(()=>{if(x&&(T.current=x),w&&(S.current=w),x&&w){if(L.current)return L.current(x,w,R);R()}},[x,w,R,L,A]);const C=f.useMemo(()=>({reference:T,floating:S,setReference:b,setFloating:E}),[b,E]),_=f.useMemo(()=>({reference:x,floating:w}),[x,w]),D=f.useMemo(()=>{const k={position:n,left:0,top:0};if(!_.floating)return k;const $=Nf(_.floating,u.x),F=Nf(_.floating,u.y);return a?{...k,transform:"translate("+$+"px, "+F+"px)",..._f(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:F}},[n,a,_.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:R,refs:C,elements:_,floatingStyles:D}),[u,R,C,_,D])}const ux=(e,t)=>{const n=ex(e);return{name:n.name,fn:n.fn,options:[e,t]}},dx=(e,t)=>{const n=tx(e);return{name:n.name,fn:n.fn,options:[e,t]}},fx=(e,t)=>({fn:sx(e).fn,options:[e,t]}),px=(e,t)=>{const n=nx(e);return{name:n.name,fn:n.fn,options:[e,t]}},hx=(e,t)=>{const n=rx(e);return{name:n.name,fn:n.fn,options:[e,t]}},mx=(e,t)=>{const n=ox(e);return{name:n.name,fn:n.fn,options:[e,t]}},gx={open:he(e=>e.open),domReferenceElement:he(e=>e.domReferenceElement),referenceElement:he(e=>e.positionReference??e.referenceElement),floatingElement:he(e=>e.floatingElement),floatingId:he(e=>e.floatingId)};class lc extends vs{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:df(),nested:n,noEmit:r,triggerElements:s},gx)}setOpen=(t,n)=>{if((!t||!this.state.open||wd(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function uc(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,i]=f.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),ve(()=>{if(!e&&s&&r!=="ending"&&n){const a=_n.request(()=>{o("ending")});return()=>{_n.cancel(a)}}},[e,s,r,n]),ve(()=>{if(!e||t)return;const a=_n.request(()=>{o(void 0)});return()=>{_n.cancel(a)}},[t,e]),ve(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=_n.request(()=>{o("idle")});return()=>{_n.cancel(a)}},[t,e,s,o,r]),f.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}function vx(e,t){const n=f.useRef(null),r=f.useRef(null);return f.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function Af(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=vx(e,n),i=me(a=>{if(s(a),!a||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:a,...r});return}l==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return ve(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function Df(e){const t=e.useState("open");ve(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Mf(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=uc(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=me(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Ar({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class js{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function yx(){return new lc({open:!1,floatingElement:null,referenceElement:null,triggerElements:new js,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Lf(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:yx(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:tt,inactiveTriggerProps:tt,popupProps:tt}}const Hs=he(e=>e.triggerIdProp??e.activeTriggerId),$f={open:he(e=>e.openProp??e.open),mounted:he(e=>e.mounted),transitionStatus:he(e=>e.transitionStatus),floatingRootContext:he(e=>e.floatingRootContext),preventUnmountingOnClose:he(e=>e.preventUnmountingOnClose),payload:he(e=>e.payload),activeTriggerId:Hs,activeTriggerElement:he(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:he((e,t)=>t!==void 0&&Hs(e)===t),isOpenedByTrigger:he((e,t)=>t!==void 0&&Hs(e)===t&&e.open),isMountedByTrigger:he((e,t)=>t!==void 0&&Hs(e)===t&&e.mounted),triggerProps:he((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:he(e=>e.popupProps),popupElement:he(e=>e.popupElement),positionerElement:he(e=>e.positionerElement)};function bx(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=rr(),s=or()!=null;if(process.env.NODE_ENV!=="production"){const a=r.reference;a&&!$e(a)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=ht(()=>new lc({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new js,floatingId:o,nested:s,noEmit:!1})).current;return ve(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=$e(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function wx(e={}){const{nodeId:t,externalTree:n}=e,r=bx(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=f.useState(null),l=f.useRef(null),c=Mr(n);ve(()=>{s.domReference&&(l.current=s.domReference)},[s.domReference]);const u=lx({...e,elements:{...s,...i&&{reference:i}}}),d=f.useCallback(S=>{const I=$e(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),getClientRects:()=>S.getClientRects(),contextElement:S}:S;a(I),u.refs.setReference(I)},[u.refs]),[h,p]=f.useState(null),[g,m]=f.useState(null);o.useSyncedValue("referenceElement",h),o.useSyncedValue("domReferenceElement",$e(h)?h:null),o.useSyncedValue("floatingElement",g);const v=f.useCallback(S=>{($e(S)||S===null)&&(l.current=S,p(S)),($e(u.refs.reference.current)||u.refs.reference.current===null||S!==null&&!$e(S))&&u.refs.setReference(S)},[u.refs,p]),y=f.useCallback(S=>{m(S),u.refs.setFloating(S)},[u.refs]),b=f.useMemo(()=>({...u.refs,setReference:v,setFloating:y,setPositionReference:d,domReference:l}),[u.refs,v,y,d]),E=f.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),x=o.useState("open"),w=o.useState("floatingId"),T=f.useMemo(()=>({...u,dataRef:o.context.dataRef,open:x,onOpenChange:o.setOpen,events:o.context.events,floatingId:w,refs:b,elements:E,nodeId:t,rootStore:o}),[u,b,E,t,o,x,w]);return ve(()=>{o.context.dataRef.current.floatingContext=T;const S=c?.nodesRef.current.find(I=>I.id===t);S&&(S.context=T)}),f.useMemo(()=>({...u,context:T,refs:b,elements:E,rootStore:o}),[u,b,E,T,o])}function Ff(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=rr(),i=or()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),u=t.context.triggerElements,d=ht(()=>new lc({open:a,referenceElement:l,floatingElement:c,triggerElements:u,onOpenChange:o,floatingId:s,nested:i,noEmit:n})).current;return ve(()=>{const h={open:a,floatingId:s,referenceElement:l,floatingElement:c};$e(l)&&(h.domReferenceElement=l),d.state.positionReference===d.state.referenceElement&&(h.positionReference=l),d.update(h)},[a,s,l,c,d]),d.context.onOpenChange=o,d.context.nested=i,d.context.noEmit=n,d}const Ex=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${gd}`;function xx(e){return e?!!e.closest(Ex):!1}class dc{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new zt,this.restTimeout=new zt,this.handleCloseOptions=void 0}static create(){return new dc}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function fc(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function Sx(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t;fc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Vf(e){const t=ht(dc.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),mo(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Cx(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:l=0}=t,c=Vf(n),u=Mr(),d=or(),h=me(()=>Jd(i.current.openEvent?.type,c.interactedInside)),p=me(()=>{const E=i.current.openEvent?.type;return E?.includes("mouse")&&E!=="mousedown"}),g=me(E=>vd(E,n.context.triggerElements)),m=f.useCallback(E=>{const x=$s(l,"close",c.pointerType),w=()=>{n.setOpen(!1,Ye(St,E)),u?.events.emit("floating.closed",E)};x?c.openChangeTimeout.start(x,w):(c.openChangeTimeout.clear(),w())},[l,n,c,u]),v=me(()=>{fc(c)}),y=me(E=>{const x=gt(E);if(!xx(x)){c.interactedInside=!1;return}c.interactedInside=x?.closest("[aria-haspopup]")!=null});ve(()=>{r||(c.pointerType=void 0,c.restTimeoutPending=!1,c.interactedInside=!1,v())},[r,c,v]),f.useEffect(()=>v,[v]),ve(()=>{if(a&&r&&c.handleCloseOptions?.blockPointerEvents&&p()&&$e(s)&&o){const E=s,x=o,w=Ae(o),T=u?.nodesRef.current.find(I=>I.id===d)?.context?.elements.floating;T&&(T.style.pointerEvents="");const S=c.handleCloseOptions?.getScope?.()??c.pointerEventsScopeElement??T??E.closest("[data-rootownerid]")??w.body;return Sx(c,{scopeElement:S,referenceElement:E,floatingElement:x}),()=>{v()}}},[a,r,s,o,c,p,u,d,v]);const b=Nn();f.useEffect(()=>{if(!a)return;function E(){c.openChangeTimeout.clear(),b.clear(),u?.events.off("floating.closed",w),v()}function x(S){if(u&&d&&gn(u.nodesRef.current,d).length>0){u.events.on("floating.closed",w);return}if(!g(S.relatedTarget)){if(c.handler){c.handler(S);return}v(),h()||m(S)}}function w(S){!u||!d||gn(u.nodesRef.current,d).length>0||b.start(0,()=>{u.events.off("floating.closed",w),n.setOpen(!1,Ye(St,S)),u.events.emit("floating.closed",S)})}const T=o;return T&&(T.addEventListener("mouseenter",E),T.addEventListener("mouseleave",x),T.addEventListener("pointerdown",y,!0)),()=>{T&&(T.removeEventListener("mouseenter",E),T.removeEventListener("mouseleave",x),T.removeEventListener("pointerdown",y,!0)),u?.events.off("floating.closed",w)}},[a,o,n,i,h,g,m,v,y,c,u,d,b])}const Tx={current:null};function Ox(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:l=!1,restMs:c=0,move:u=!0,triggerElementRef:d=Tx,externalTree:h,isActiveTrigger:p=!0,getHandleCloseContext:g}=t,m=Mr(h),v=Vf(n),y=rn(a),b=rn(i),E=rn(c),x=rn(s);p&&(v.handleCloseOptions=y.current?.__options);const w=me(()=>Jd(r.current.openEvent?.type,v.interactedInside)),T=me(M=>vd(M,n.context.triggerElements)),S=me((M,N,R)=>{const P=n.context.triggerElements;if(P.hasElement(N))return!M||!ke(M,N);if(!$e(R))return!1;const C=R;return P.hasMatchingElement(_=>ke(_,C))&&(!M||!ke(M,C))}),I=f.useCallback((M,N=!0)=>{const R=$s(b.current,"close",v.pointerType);R?v.openChangeTimeout.start(R,()=>{n.setOpen(!1,Ye(St,M)),m?.events.emit("floating.closed",M)}):N&&(v.openChangeTimeout.clear(),n.setOpen(!1,Ye(St,M)),m?.events.emit("floating.closed",M))},[b,n,v,m]),A=me(()=>{if(!v.handler)return;Ae(n.select("domReferenceElement")).removeEventListener("mousemove",v.handler),v.handler=void 0});f.useEffect(()=>A,[A]);const L=me(()=>{fc(v)});return f.useEffect(()=>{if(!s)return;function M(N){N.open||(A(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return o.on("openchange",M),()=>{o.off("openchange",M)}},[s,o,v,A]),f.useEffect(()=>{if(!s)return;const M=d.current??(p?n.select("domReferenceElement"):null);if(!$e(M))return;function N(P){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,l&&!bo(v.pointerType)||Kd(E.current)>0&&!$s(b.current,"open"))return;const _=$s(b.current,"open",v.pointerType),D=P.currentTarget??null,k=n.select("domReferenceElement"),$=D==null?!1:S(k,D,P.target),F=n.select("open"),j=!F||$;$&&F?n.setOpen(!0,Ye(St,P,D)):_?v.openChangeTimeout.start(_,()=>{j&&n.setOpen(!0,Ye(St,P,D))}):j&&n.setOpen(!0,Ye(St,P,D))}function R(P){if(w()){L();return}A();const C=n.select("domReferenceElement"),_=Ae(C);v.restTimeout.clear(),v.restTimeoutPending=!1;const D=r.current.floatingContext??g?.();if(T(P.relatedTarget))return;if(y.current&&D){n.select("open")||v.openChangeTimeout.clear();const F=d.current;v.handler=y.current({...D,tree:m,x:P.clientX,y:P.clientY,onClose(){L(),A(),x.current&&!w()&&F===n.select("domReferenceElement")&&I(P,!0)}}),_.addEventListener("mousemove",v.handler),v.handler(P);return}(v.pointerType!=="touch"||!ke(n.select("floatingElement"),P.relatedTarget))&&I(P)}return u&&M.addEventListener("mousemove",N,{once:!0}),M.addEventListener("mouseenter",N),M.addEventListener("mouseleave",R),()=>{u&&M.removeEventListener("mousemove",N),M.removeEventListener("mouseenter",N),M.removeEventListener("mouseleave",R)}},[A,L,r,b,I,n,s,y,v,p,S,w,T,l,u,E,d,m,x,g]),f.useMemo(()=>{if(!s)return;function M(N){v.pointerType=N.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(N){const{nativeEvent:R}=N,P=N.currentTarget,C=n.select("domReferenceElement"),_=n.select("open"),D=S(C,P,N.target);if(l&&!bo(v.pointerType))return;const k=Kd(E.current);if(_&&!D||k===0||!D&&v.restTimeoutPending&&N.movementX**2+N.movementY**2<2)return;v.restTimeout.clear();function $(){if(v.restTimeoutPending=!1,w())return;const F=n.select("open");!v.blockMouseMove&&(!F||D)&&n.setOpen(!0,Ye(St,R,P))}v.pointerType==="touch"?lt.flushSync(()=>{$()}):D&&_?$():(v.restTimeoutPending=!0,v.restTimeout.start(k,$))}}},[s,v,w,S,l,n,E])}function Us(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),r=e.map(c=>c?.item),o=e.map(c=>c?.trigger),s=f.useCallback(c=>Gs(c,e,"reference"),t),i=f.useCallback(c=>Gs(c,e,"floating"),n),a=f.useCallback(c=>Gs(c,e,"item"),r),l=f.useCallback(c=>Gs(c,e,"trigger"),o);return f.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:l}),[s,i,a,l])}function Gs(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[ka]="");for(const i in e)o&&e&&(i===hd||i===md)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const l=t[i]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&Bf(s,a,o,r)}return Bf(s,e,o,r),s}function Bf(e,t,n,r){for(const o in t){const s=t[o];n&&(o===hd||o===md)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const kx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Wf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,l=rr(),c=s?.id||l,u=f.useMemo(()=>Ia(i)?.id||o,[i,o]),d=kx.get(a)??a,p=or()!=null,g=f.useMemo(()=>d==="tooltip"||a==="label"?tt:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&p&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[d,p,a]),m=f.useMemo(()=>d==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?u:void 0}:{...g,"aria-expanded":r?"true":"false","aria-controls":r?u:void 0,...d==="menu"&&{id:c}},[d,u,r,c,a,g]),v=f.useMemo(()=>{const b={id:u,...d&&{role:d}};return d==="tooltip"||a==="label"?b:{...b,...d==="menu"&&{"aria-labelledby":c}}},[d,u,c,a]),y=f.useCallback(({active:b,selected:E})=>{const x={role:"option",...b&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...x,"aria-selected":E}}return{}},[u,a]);return f.useMemo(()=>({reference:m,floating:v,item:y,trigger:g}),[m,v,g,y])}const jf=.1,Rx=jf*jf,Ve=.5;function zs(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function Ys(e,t,n,r,o,s,i,a,l,c){let u=!1;return zs(e,t,n,r,o,s)&&(u=!u),zs(e,t,o,s,i,a)&&(u=!u),zs(e,t,i,a,l,c)&&(u=!u),zs(e,t,l,c,n,r)&&(u=!u),u}function Px(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Zs(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),l=Math.min(r,s),c=Math.max(r,s);return e>=i&&e<=a&&t>=l&&t<=c}function Ix(e={}){const{blockPointerEvents:t=!1}=e,n=new zt,r=({x:o,y:s,placement:i,elements:a,onClose:l,nodeId:c,tree:u})=>{const d=i?.split("-")[0];let h=!1,p=null,g=null,m=typeof performance<"u"?performance.now():0;function v(b,E){const x=performance.now(),w=x-m;if(p===null||g===null||w===0)return p=b,g=E,m=x,!1;const T=b-p,S=E-g,I=T*T+S*S,A=w*w*Rx;return p=b,g=E,m=x,I<A}function y(){n.clear(),l()}return function(E){n.clear();const x=a.domReference,w=a.floating;if(!x||!w||d==null||o==null||s==null)return;const{clientX:T,clientY:S}=E,I=gt(E),A=E.type==="mouseleave",L=ke(w,I),M=ke(x,I);if(L&&(h=!0,!A))return;if(M&&(h=!1,!A)){h=!0;return}if(A&&$e(E.relatedTarget)&&ke(w,E.relatedTarget))return;function N(){return!!(u&&gn(u.nodesRef.current,c).length>0)}function R(){N()||y()}if(N())return;const P=x.getBoundingClientRect(),C=w.getBoundingClientRect(),_=o>C.right-C.width/2,D=s>C.bottom-C.height/2,k=C.width>P.width,$=C.height>P.height,F=(k?P:C).left,j=(k?P:C).right,V=($?P:C).top,Y=($?P:C).bottom;if(d==="top"&&s>=P.bottom-1||d==="bottom"&&s<=P.top+1||d==="left"&&o>=P.right-1||d==="right"&&o<=P.left+1){R();return}let q=!1;switch(d){case"top":q=Zs(T,S,F,P.top+1,j,C.bottom-1);break;case"bottom":q=Zs(T,S,F,C.top+1,j,P.bottom-1);break;case"left":q=Zs(T,S,C.right-1,Y,P.left+1,V);break;case"right":q=Zs(T,S,P.right-1,Y,C.left+1,V);break}if(q)return;if(h&&!Px(T,S,P)){R();return}if(!A&&v(T,S)){R();return}let X=!1;switch(d){case"top":{const U=k?Ve/2:Ve*4,H=k||_?o+U:o-U,Z=k?o-U:_?o+U:o-U,re=s+Ve+1,ne=_||k?C.bottom-Ve:C.top,ee=_?k?C.bottom-Ve:C.top:C.bottom-Ve;X=Ys(T,S,H,re,Z,re,C.left,ne,C.right,ee);break}case"bottom":{const U=k?Ve/2:Ve*4,H=k||_?o+U:o-U,Z=k?o-U:_?o+U:o-U,re=s-Ve,ne=_||k?C.top+Ve:C.bottom,ee=_?k?C.top+Ve:C.bottom:C.top+Ve;X=Ys(T,S,H,re,Z,re,C.left,ne,C.right,ee);break}case"left":{const U=$?Ve/2:Ve*4,H=$||D?s+U:s-U,Z=$?s-U:D?s+U:s-U,re=o+Ve+1,ne=D||$?C.right-Ve:C.left,ee=D?$?C.right-Ve:C.left:C.right-Ve;X=Ys(T,S,ne,C.top,ee,C.bottom,re,H,re,Z);break}case"right":{const U=$?Ve/2:Ve*4,H=$||D?s+U:s-U,Z=$?s-U:D?s+U:s-U,re=o-Ve,ne=D||$?C.left+Ve:C.right,ee=D?$?C.left+Ve:C.right:C.left+Ve;X=Ys(T,S,re,H,re,Z,ne,C.top,ee,C.bottom);break}}X?h||n.start(40,R):R()}};return r.__options={blockPointerEvents:t},r}const Hf=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,...a}=t,{portalNode:l,portalSubtree:c}=uf({container:o,ref:n,componentProps:t,elementProps:a});return!c&&!l?null:O.jsxs(f.Fragment,{children:[c,l&&lt.createPortal(r,l)]})});process.env.NODE_ENV!=="production"&&(Hf.displayName="FloatingPortalLite");const _x=Hf,Uf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Uf.displayName="DirectionContext");function Nx(){return f.useContext(Uf)?.direction??"ltr"}const Ax=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0,offsetParent:d="real"}=vn(e,t)||{};if(c==null)return{};const h=Sd(u),p={x:n,y:r},g=Da(o),m=Aa(g),v=await i.getDimensions(c),y=g==="y",b=y?"top":"left",E=y?"bottom":"right",x=y?"clientHeight":"clientWidth",w=s.reference[m]+s.reference[g]-p[g]-s.floating[m],T=p[g]-s.reference[g],S=d==="real"?await i.getOffsetParent?.(c):a.floating;let I=a.floating[x]||s.floating[m];(!I||!await i.isElement?.(S))&&(I=a.floating[x]||s.floating[m]);const A=w/2-T/2,L=I/2-v[m]/2-1,M=Math.min(h[b],L),N=Math.min(h[E],L),R=M,P=I-v[m]-N,C=I/2-v[m]/2+A,_=_a(R,C,P),D=!l.arrow&&Mn(o)!=null&&C!==_&&s.reference[m]/2-(C<R?M:N)-v[m]/2<0,k=D?C<R?C-R:C-P:0;return{[g]:p[g]+k,data:{[g]:_,centerOffset:C-_-k,...D&&{alignmentOffset:k}},reset:D}}}),Dx=(e,t)=>({...Ax(e),options:[e,t]}),Mx={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await mx().fn(e)).data?.referenceHidden||s}}}},qs={sideX:"left",sideY:"top"},Lx={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:a}=e,l=nt(o),c=l.getComputedStyle(o);if(!(c.transitionDuration!=="0s"&&c.transitionDuration!==""))return{x:t,y:n,data:qs};const d=await s.getOffsetParent?.(o);let h={width:0,height:0};if(i==="fixed"&&l?.visualViewport)h={width:l.visualViewport.width,height:l.visualViewport.height};else if(d===l){const b=Ae(o);h={width:b.documentElement.clientWidth,height:b.documentElement.clientHeight}}else await s.isElement?.(d)&&(h=await s.getDimensions(d));const p=xt(a);let g=t,m=n;p==="left"&&(g=h.width-(t+r.width)),p==="top"&&(m=h.height-(n+r.height));const v=p==="left"?"right":qs.sideX,y=p==="top"?"bottom":qs.sideY;return{x:g,y:m,data:{sideX:v,sideY:y}}}};function Gf(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function zf(e,t,n){const{rects:r,placement:o}=e;return{side:Gf(t,xt(o),n),align:Mn(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $x(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:l=5,sticky:c=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:h=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b,lazyFlip:E=!1,externalTree:x}=e,[w,T]=f.useState(null);!g&&w!==null&&T(null);const S=m.side||"flip",I=m.align||"flip",A=m.fallbackAxisSide||"end",L=typeof t=="function"?t:void 0,M=me(L),N=L?M:t,R=rn(t),C=Nx()==="rtl",_=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[r],D=s==="center"?_:`${_}-${s}`;let k=l;const $=1,F=r==="bottom"?$:0,j=r==="top"?$:0,V=r==="right"?$:0,Y=r==="left"?$:0;typeof k=="number"?k={top:k+F,right:k+Y,bottom:k+j,left:k+V}:k&&(k={top:(k.top||0)+F,right:(k.right||0)+Y,bottom:(k.bottom||0)+j,left:(k.left||0)+V});const q={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:k},X=f.useRef(null),U=rn(o),H=rn(i),ne=[ux(ye=>{const Ze=zf(ye,r,C),ie=typeof U.current=="function"?U.current(Ze):U.current,ge=typeof H.current=="function"?H.current(Ze):H.current;return{mainAxis:ie,crossAxis:ge,alignmentAxis:ge}},[typeof o!="function"?o:0,typeof i!="function"?i:0,C,r])],ee=I==="none"&&S!=="shift",le=!ee&&(c||v||S==="shift"),K=S==="none"?null:px({...q,padding:{top:k.top+$,right:k.right+$,bottom:k.bottom+$,left:k.left+$},mainAxis:!v&&S==="flip",crossAxis:I==="flip"?"alignment":!1,fallbackAxisSideDirection:A}),G=ee?null:dx(ye=>{const Ze=Ae(ye.elements.floating).documentElement;return{...q,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:I!=="none",crossAxis:le,limiter:c||v?void 0:fx(ie=>{if(!X.current)return{};const{width:ge,height:Oe}=X.current.getBoundingClientRect(),we=Ft(xt(ie.placement)),Me=we==="y"?ge:Oe,Ke=we==="y"?k.left+k.right:k.top+k.bottom;return{offset:Me/2+Ke/2}})}},[q,c,v,k,I]);S==="shift"||I==="shift"||s==="center"?ne.push(G,K):ne.push(K,G),ne.push(hx({...q,apply({elements:{floating:ye},availableWidth:Ze,availableHeight:ie,rects:ge}){const Oe=ye.style;Oe.setProperty("--available-width",`${Ze}px`),Oe.setProperty("--available-height",`${ie}px`);const we=window.devicePixelRatio||1,{x:Me,y:Ke,width:et,height:Tt}=ge.reference,Et=(Math.round((Me+et)*we)-Math.round(Me*we))/we,Kt=(Math.round((Ke+Tt)*we)-Math.round(Ke*we))/we;Oe.setProperty("--anchor-width",`${Et}px`),Oe.setProperty("--anchor-height",`${Kt}px`)}}),Dx(()=>({element:X.current||document.createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(ye){const{elements:Ze,middlewareData:ie,placement:ge,rects:Oe,y:we}=ye,Me=xt(ge),Ke=Ft(Me),et=X.current,Tt=ie.arrow?.x||0,Et=ie.arrow?.y||0,Kt=et?.clientWidth||0,dn=et?.clientHeight||0,Ot=Tt+Kt/2,Er=Et+dn/2,Yi=Math.abs(ie.shift?.y||0),I2=Oe.reference.height/2,ns=typeof o=="function"?o(zf(ye,r,C)):o,_2=Yi>ns,N2={top:`${Ot}px calc(100% + ${ns}px)`,bottom:`${Ot}px ${-ns}px`,left:`calc(100% + ${ns}px) ${Er}px`,right:`${-ns}px ${Er}px`}[Me],A2=`${Ot}px ${Oe.reference.y+I2-we}px`;return Ze.floating.style.setProperty("--transform-origin",le&&Ke==="y"&&_2?A2:N2),{}}},Mx,b),ve(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const de=f.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:fe,elements:oe,x:ue,y:te,middlewareData:z,update:B,placement:J,context:pe,isPositioned:Se,floatingStyles:_e}=wx({rootContext:p,placement:D,middleware:ne,strategy:n,whileElementsMounted:h?void 0:(...ye)=>If(...ye,de),nodeId:y,externalTree:x}),{sideX:Fe,sideY:Ie}=z.adaptiveOrigin||qs,be=Se?n:"fixed",Re=f.useMemo(()=>{const ye=b?{position:be,[Fe]:ue,[Ie]:te}:{position:be,..._e};return Se||(ye.opacity=0),ye},[b,be,Fe,ue,Ie,te,_e,Se]),Ce=f.useRef(null);ve(()=>{if(!g)return;const ye=R.current,Ze=typeof ye=="function"?ye():ye,ge=(Yf(Ze)?Ze.current:Ze)||null||null;ge!==Ce.current&&(fe.setPositionReference(ge),Ce.current=ge)},[g,fe,N,R]),f.useEffect(()=>{if(!g)return;const ye=R.current;typeof ye!="function"&&Yf(ye)&&ye.current!==Ce.current&&(fe.setPositionReference(ye.current),Ce.current=ye.current)},[g,fe,N,R]),f.useEffect(()=>{if(h&&g&&oe.domReference&&oe.floating)return If(oe.domReference,oe.floating,B,de)},[h,g,oe,B,de]);const Be=xt(J),Qe=Gf(r,Be,C),ct=Mn(J)||"center",Ct=!!z.hide?.referenceHidden;ve(()=>{E&&g&&Se&&T(Be)},[E,g,Se,Be]);const Dt=f.useMemo(()=>({position:"absolute",top:z.arrow?.y,left:z.arrow?.x}),[z.arrow]),jt=z.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:Re,arrowStyles:Dt,arrowRef:X,arrowUncentered:jt,side:Qe,align:ct,physicalSide:Be,anchorHidden:Ct,refs:fe,context:pe,isPositioned:Se,update:B}),[Re,Dt,X,jt,Qe,ct,Be,Ct,fe,pe,Se,B])}function Yf(e){return e!=null&&"current"in e}let ir=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=So.startingStyle]="startingStyle",e[e.endingStyle=So.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),pc=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Fx={[pc.popupOpen]:""},Vx={[pc.popupOpen]:"",[pc.pressed]:""},Bx={[ir.open]:""},Wx={[ir.closed]:""},jx={[ir.anchorHidden]:""},Zf={open(e){return e?Fx:null}},Hx={open(e){return e?Vx:null}},$r={open(e){return e?Bx:Wx},anchorHidden(e){return e?jx:null}};function qf(e){return e==="starting"?B1:tt}function Xf(){const e=f.useContext(ds);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":it(73));const t=e.useState("toasts");return f.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function on(...e){return da(Fu(e))}const Kf={Viewport:"_Viewport_ai81v_1",Toast:"_Toast_ai81v_14"};let Fr=null,Ro=3e3;function Ux({timeout:e}){const t=Xf();return f.useEffect(()=>(Fr=t,Ro=e,()=>{Fr=null}),[t,e]),null}const ar={success:(e,t)=>Fr?.add({description:e,timeout:t?.timeout||Ro}),error:(e,t)=>Fr?.add({description:e,timeout:t?.timeout||Ro}),info:(e,t)=>Fr?.add({description:e,timeout:t?.timeout||Ro}),warning:(e,t)=>Fr?.add({description:e,timeout:t?.timeout||Ro})};function Gx({toastConfigs:e}){const t=e?.timeout??3e3;return O.jsxs(Ld,{timeout:t,children:[O.jsx(Ux,{timeout:t}),O.jsx(zx,{configs:e})]})}function zx({configs:e}){const{toasts:t}=Xf();return O.jsx(_x,{children:O.jsx(Hd,{className:on(Kf.Viewport,e?.viewportClassName),children:t.map(n=>O.jsx(zd,{toast:n,className:on("pointer-events-none flex items-center justify-center px-6 py-3 min-w-[200px] max-w-[80vw]","text-white text-base rounded-md bg-black/80",Kf.Toast,e?.className),style:e?.style,children:O.jsx(qd,{className:"text-xs",children:n.description})},n.id))})})}class Yx{baseUrl;credentials;interceptors;timeout;onError;headers;constructor({baseUrl:t,timeout:n=1/0,responseInterceptor:r=l=>l.data,requestInterceptor:o=l=>l,onError:s=()=>{},headers:i,credentials:a="include"}){this.baseUrl=t,this.timeout=n,this.credentials=a,this.interceptors={request:o,response:r},this.headers=new Headers({"Content-Type":"application/json",...i}),this.onError=s}async request(t){const n=new AbortController;t.url=`${this.baseUrl}${t.url}`,t=this.interceptors.request(t);const r=new Headers(this.headers);Object.entries(t.headers||{}).forEach(([a,l])=>{r.set(a,l)});const o=this.headers.get("content-type");let s=null;if(t.data instanceof FormData)s=t.data,r.delete("Content-Type");else if(t.data!==void 0&&t.method!=="GET")if(o==="application/x-www-form-urlencoded"){const a=new URLSearchParams;for(const l in t.data)t.data[l]!==void 0&&a.append(l,t.data[l]);s=a.toString()}else s=JSON.stringify(t.data);else if(t.method==="GET"){const a=new URLSearchParams;for(const c in t.data)t.data[c]!==void 0&&a.append(c,t.data[c]);const l=a.toString();t.url+=l?`?${l}`:""}const i=fetch(t.url,{method:t.method,headers:r,body:s,signal:t.signal||n.signal,credentials:this.credentials});try{const a=t.timeout||this.timeout,{timeoutId:l,timeoutPromise:c}=this._setTimeout(a,n),u=await Promise.race([i,c].filter(Boolean));if(l&&clearTimeout(l),u.ok){const d=await u.json();return this.interceptors.response(d,u).catch(h=>(this.onError({data:h,response:u}),Promise.reject(d)))}else{const d=await u.json();return this.onError({data:d,response:u}),Promise.reject(d)}}catch(a){return a.name!=="AbortError"&&this.onError({}),Promise.reject(a)}}_setTimeout(t,n){let r=null,o=null;return t!==1/0&&(o=new Promise((s,i)=>{r=setTimeout(()=>{i(new Error("请求超时")),n.abort()},t)})),{timeoutPromise:o,timeoutId:r}}get(t,n,r){return this.request({...r,url:t,method:"GET",data:n})}post(t,n,r){return this.request({...r,url:t,method:"POST",data:n})}put(t,n,r){return this.request({...r,url:t,method:"PUT",data:n})}delete(t,n){return this.request({...n,url:t,method:"DELETE"})}patch(t,n,r){return this.request({...r,url:t,method:"PATCH",data:n})}}const Fn=new Yx({baseUrl:"https://apis.sdk.mobileztgame.com",credentials:"omit",headers:{"Content-Type":"application/x-www-form-urlencoded"},async responseInterceptor(e,t){if(["/passport-api/v2/ztgame/auth/login","/passport-api/v2/sms-captchas","/passport-api/v2/ztgame/auth/mobile-register"].some(r=>t.url.includes(r)))return e;if(e?.code!==0)throw new Error(e.error);return e},onError({response:e,data:t}){if(e&&e?.status!==401){const n=`${t?.message||t?.detail||"未知错误"}`;ar.error(n)}}}),He={ROLE_ID:"roleid",GIANT:"giant",MOBILE:"mobile",WECHAT:"wx",QQ:"qq",APPLE:"apple"},Xs={default:{types:[He.GIANT,He.MOBILE],default:He.GIANT},5273:{types:[He.ROLE_ID],default:He.ROLE_ID},5199:{types:[He.ROLE_ID],default:He.ROLE_ID},5012:{types:[He.ROLE_ID],default:He.ROLE_ID},5242:{types:[He.GIANT,He.MOBILE],default:He.MOBILE}};function wt(...e){return da(Fu(e))}function Zx(e){return e==="5199"||e==="5012"}function Ks(e,t){return t||Xs[e]?.types||Xs.default?.types||[]}function qx(e,t){return t||Xs[e]?.default||Xs.default?.default}function Jf({loginTypes:e,gameId:t}){return Ks(t,e).includes(He.GIANT)}function Qf({loginTypes:e,gameId:t}){return Ks(t,e).includes(He.ROLE_ID)}function ep({loginTypes:e,gameId:t}){return Ks(t,e).includes(He.MOBILE)}async function Xx({gameId:e}){let t=localStorage.getItem("UNIQUE_ID");t||(t=(await(await w0.load()).get()).visitorId,localStorage.setItem("UNIQUE_ID",t)),Fn.headers.set("X-GAME-ID",e),Fn.headers.set("X-Login-H5","1"),Fn.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}const Kx=[{code:"86",name:"中国大陆"},{code:"886",name:"台湾地区"},{code:"852",name:"香港特别行政区"},{code:"853",name:"澳门特别行政区"},{code:"1",name:"美国"},{code:"81",name:"日本"},{code:"376",name:"安道尔"},{code:"971",name:"阿拉伯联合酋长国"},{code:"93",name:"阿富汗"},{code:"1268",name:"安提瓜和巴布达"},{code:"1264",name:"安圭拉"},{code:"355",name:"阿尔巴尼亚"},{code:"374",name:"亚美尼亚"},{code:"244",name:"安哥拉"},{code:"54",name:"阿根廷"},{code:"1684",name:"美属萨摩亚"},{code:"43",name:"奥地利"},{code:"61",name:"澳大利亚"},{code:"297",name:"阿鲁巴"},{code:"994",name:"阿塞拜疆"},{code:"387",name:"波斯尼亚和黑塞哥维那"},{code:"1246",name:"巴巴多斯"},{code:"880",name:"孟加拉国"},{code:"32",name:"比利时"},{code:"226",name:"布基纳法索"},{code:"359",name:"保加利亚"},{code:"973",name:"巴林"},{code:"257",name:"布隆迪"},{code:"229",name:"贝宁"},{code:"1441",name:"百慕大群岛"},{code:"673",name:"文莱"},{code:"591",name:"玻利维亚"},{code:"599",name:"荷兰加勒比"},{code:"55",name:"巴西"},{code:"1242",name:"巴哈马"},{code:"975",name:"不丹"},{code:"267",name:"博茨瓦纳"},{code:"375",name:"白俄罗斯"},{code:"501",name:"伯利兹"},{code:"1",name:"加拿大"},{code:"243",name:"刚果民主共和国"},{code:"236",name:"中非共和国"},{code:"242",name:"刚果共和国"},{code:"41",name:"瑞士"},{code:"225",name:"象牙海岸"},{code:"682",name:"库克群岛"},{code:"56",name:"智利"},{code:"237",name:"喀麦隆"},{code:"57",name:"哥伦比亚"},{code:"506",name:"哥斯达黎加"},{code:"53",name:"古巴"},{code:"238",name:"开普"},{code:"599",name:"库拉索"},{code:"357",name:"塞浦路斯"},{code:"420",name:"捷克"},{code:"49",name:"德国"},{code:"253",name:"吉布提"},{code:"45",name:"丹麦"},{code:"1767",name:"多米尼加"},{code:"1809",name:"多米尼加共和国"},{code:"213",name:"阿尔及利亚"},{code:"593",name:"厄瓜多尔"},{code:"372",name:"爱沙尼亚"},{code:"20",name:"埃及"},{code:"291",name:"厄立特里亚"},{code:"34",name:"西班牙"},{code:"251",name:"埃塞俄比亚"},{code:"358",name:"芬兰"},{code:"679",name:"斐济"},{code:"691",name:"密克罗尼西亚"},{code:"298",name:"法罗群岛"},{code:"33",name:"法国"},{code:"241",name:"加蓬"},{code:"44",name:"英国"},{code:"1473",name:"格林纳达"},{code:"995",name:"格鲁吉亚"},{code:"594",name:"法属圭亚那"},{code:"233",name:"加纳"},{code:"350",name:"直布罗陀"},{code:"299",name:"格陵兰岛"},{code:"220",name:"冈比亚"},{code:"224",name:"几内亚"},{code:"590",name:"瓜德罗普岛"},{code:"240",name:"赤道几内亚"},{code:"30",name:"希腊"},{code:"502",name:"瓜地马拉"},{code:"1671",name:"关岛"},{code:"245",name:"几内亚比绍共和国"},{code:"592",name:"圭亚那"},{code:"504",name:"洪都拉斯"},{code:"385",name:"克罗地亚"},{code:"509",name:"海地"},{code:"36",name:"匈牙利"},{code:"62",name:"印度尼西亚"},{code:"353",name:"爱尔兰"},{code:"972",name:"以色列"},{code:"91",name:"印度"},{code:"964",name:"伊拉克"},{code:"98",name:"伊朗"},{code:"354",name:"冰岛"},{code:"39",name:"意大利"},{code:"1876",name:"牙买加"},{code:"962",name:"约旦"},{code:"254",name:"肯尼亚"},{code:"996",name:"吉尔吉斯斯坦"},{code:"855",name:"柬埔寨"},{code:"686",name:"基里巴斯"},{code:"269",name:"科摩罗"},{code:"1869",name:"圣基茨和尼维斯"},{code:"850",name:"朝鲜"},{code:"82",name:"韩国"},{code:"965",name:"科威特"},{code:"1345",name:"开曼群岛"},{code:"7",name:"哈萨克斯坦"},{code:"856",name:"老挝"},{code:"961",name:"黎巴嫩"},{code:"1758",name:"圣露西亚"},{code:"423",name:"列支敦士登"},{code:"94",name:"斯里兰卡"},{code:"231",name:"利比里亚"},{code:"266",name:"莱索托"},{code:"370",name:"立陶宛"},{code:"352",name:"卢森堡"},{code:"371",name:"拉脱维亚"},{code:"218",name:"利比亚"},{code:"212",name:"摩洛哥"},{code:"377",name:"摩纳哥"},{code:"373",name:"摩尔多瓦"},{code:"382",name:"黑山"},{code:"261",name:"马达加斯加"},{code:"692",name:"马绍尔群岛"},{code:"389",name:"马其顿"},{code:"223",name:"马里"},{code:"95",name:"缅甸"},{code:"976",name:"蒙古"},{code:"222",name:"毛里塔尼亚"},{code:"1664",name:"蒙特塞拉特岛"},{code:"356",name:"马耳他"},{code:"230",name:"毛里求斯"},{code:"960",name:"马尔代夫"},{code:"265",name:"马拉维"},{code:"52",name:"墨西哥"},{code:"60",name:"马来西亚"},{code:"258",name:"莫桑比克"},{code:"264",name:"纳米比亚"},{code:"687",name:"新喀里多尼亚"},{code:"227",name:"尼日尔"},{code:"234",name:"尼日利亚"},{code:"505",name:"尼加拉瓜"},{code:"31",name:"荷兰"},{code:"47",name:"挪威"},{code:"977",name:"尼泊尔"},{code:"674",name:"拿鲁岛"},{code:"64",name:"新西兰"},{code:"968",name:"阿曼"},{code:"507",name:"巴拿马"},{code:"51",name:"秘鲁"},{code:"689",name:"法属波利尼西亚"},{code:"675",name:"巴布亚新几内亚"},{code:"63",name:"菲律宾"},{code:"92",name:"巴基斯坦"},{code:"48",name:"波兰"},{code:"508",name:"圣彼埃尔和密克隆岛"},{code:"1787",name:"波多黎各"},{code:"351",name:"葡萄牙"},{code:"680",name:"帕劳"},{code:"595",name:"巴拉圭"},{code:"974",name:"卡塔尔"},{code:"262",name:"留尼汪"},{code:"40",name:"罗马尼亚"},{code:"381",name:"塞尔维亚"},{code:"7",name:"俄罗斯"},{code:"250",name:"卢旺达"},{code:"966",name:"沙特阿拉伯"},{code:"677",name:"所罗门群岛"},{code:"248",name:"塞舌尔"},{code:"249",name:"苏丹"},{code:"46",name:"瑞典"},{code:"65",name:"新加坡"},{code:"386",name:"斯洛文尼亚"},{code:"421",name:"斯洛伐克"},{code:"232",name:"塞拉利昂"},{code:"378",name:"圣马力诺"},{code:"221",name:"塞内加尔"},{code:"252",name:"索马里"},{code:"597",name:"苏里南"},{code:"239",name:"圣多美和普林西比"},{code:"503",name:"萨尔瓦多"},{code:"963",name:"叙利亚"},{code:"268",name:"斯威士兰"},{code:"1649",name:"特克斯和凯科斯群岛"},{code:"235",name:"乍得"},{code:"228",name:"多哥"},{code:"66",name:"泰国"},{code:"992",name:"塔吉克斯坦"},{code:"670",name:"东帝汶"},{code:"993",name:"土库曼斯坦"},{code:"216",name:"突尼斯"},{code:"676",name:"汤加"},{code:"90",name:"土耳其"},{code:"1868",name:"特立尼达和多巴哥"},{code:"255",name:"坦桑尼亚"},{code:"380",name:"乌克兰"},{code:"256",name:"乌干达"},{code:"598",name:"乌拉圭"},{code:"998",name:"乌兹别克斯坦"},{code:"1784",name:"圣文森特和格林纳丁斯"},{code:"58",name:"委内瑞拉"},{code:"1284",name:"英属处女群岛"},{code:"84",name:"越南"},{code:"678",name:"瓦努阿图"},{code:"685",name:"萨摩亚"},{code:"967",name:"也门"},{code:"269",name:"马约特"},{code:"27",name:"南非"},{code:"260",name:"赞比亚"},{code:"263",name:"津巴布韦"}].map(e=>({label:e.name,value:e.code})),tp=W.createContext(void 0),Jx={enabled:!0,days:7},np={"--primary-color":"#787bf4","--icon-color":"#a9aad1","--input-border-color":"#cad0e0","--input-label-color":"var(--jssdk-primary-color)","--input-bg-color":"#fff"};function Po(){const e=W.use(tp);if(!e)throw new Error("useConfig 必须在 ConfigProvider 中使用");return e}function rp({children:e,value:t}){const n=Ks(t.gameId,t.loginTypes),r=qx(t.gameId,t.defaultLoginType),o=W.useRef(null),[s,i]=W.useState(r),[a,l]=W.useState(!0);W.useEffect(()=>{Xx({gameId:t.gameId})},[t.gameId]);const c={...t,loginTypes:n,defaultLoginType:r,autoLoginConfig:{...Jx,...t.autoLoginConfig}};W.useEffect(()=>{t.gameId&&document.body.classList.add(`game-${t.gameId}`)},[t.gameId]);function u(d){Object.entries(d).forEach(([h,p])=>{const g=`--jssdk-${h.replace(/^--/,"")}`;document.documentElement.style.setProperty(g,p)})}return W.useEffect(()=>{const d=o.current;if(d){const h={...np,...t.styleVars};u(h)}return()=>{d&&u(np)}},[t.styleVars]),O.jsx("div",{ref:o,children:O.jsx(tp,{value:{...c,currentLoginType:s,setCurrentLoginType:i,isShowGiantLogo:a,setIsShowGiantLogo:l},children:e})})}function op({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=f.useRef(e!==void 0),[s,i]=f.useState(t),a=o?e:s;if(process.env.NODE_ENV!=="production"){f.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
17
- `))},[r,n,e]);const{current:c}=f.useRef(t);f.useEffect(()=>{!o&&JSON.stringify(c)!==JSON.stringify(t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
18
- `))},[JSON.stringify(t)])}const l=f.useCallback(c=>{o||i(c)},[]);return[a,l]}function It(e){return rr(e,"base-ui")}const sp="ArrowUp",ip="ArrowDown",ap="ArrowLeft",cp="ArrowRight",lp="Home",up="End",Qx=new Set([ap,cp]),eS=new Set([sp,ip]),tS=new Set([...Qx,...eS]);[...tS];const dp=new Set([sp,ip,ap,cp,lp,up]);let fp={},pp={},hp="";function nS(e){if(typeof document>"u")return!1;const t=Ae(e);return nt(t).innerWidth-t.documentElement.clientWidth>0}function rS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ae(e),r=n.documentElement,o=n.body,s=Dn(r)?r:o,i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const l=s.offsetWidth;s.style.overflowY="hidden";const c=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,l===c}function oS(e){const t=Ae(e),n=t.documentElement,r=t.body,o=Dn(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function sS(e){const t=Ae(e),n=t.documentElement,r=t.body,o=nt(n);let s=0,i=0,a=!1;const l=_n.create();if(dd&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){const h=o.getComputedStyle(n),p=o.getComputedStyle(r),v=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,fp={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hp=n.style.scrollBehavior,pp={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const y=n.scrollHeight>n.clientHeight,b=n.scrollWidth>n.clientWidth,E=h.overflowY==="scroll"||p.overflowY==="scroll",x=h.overflowX==="scroll"||p.overflowX==="scroll",w=Math.max(0,o.innerWidth-r.clientWidth),T=Math.max(0,o.innerHeight-r.clientHeight),S=parseFloat(p.marginTop)+parseFloat(p.marginBottom),I=parseFloat(p.marginLeft)+parseFloat(p.marginRight),A=Dn(n)?n:r;if(a=rS(e),a){n.style.scrollbarGutter=v,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(y||E)&&(n.style.overflowY="scroll"),(b||x)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:S||T?`calc(100dvh - ${S+T}px)`:"100dvh",width:I||w?`calc(100vw - ${I+w}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,fp),Object.assign(r.style,pp),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=hp)}function d(){u(),l.request(c)}return c(),o.addEventListener("resize",d),()=>{l.cancel(),u(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",d)}}let iS=class{lockCount=0;restore=null;timeoutLock=zt.create();timeoutUnlock=zt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Ae(t).documentElement,o=nt(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=mt;return}const s=fd||!nS(t);this.restore=s?oS(t):sS(t)}};const aS=new iS;function mp(e=!0,t=null){ve(()=>{if(e)return aS.acquire(t)},[e,t])}function cS(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function hc(e,t){const n=f.useRef(e),r=me(t);ve(()=>{n.current!==e&&r(n.current)},[e,r]),ve(()=>{n.current=e},[e])}function gp(e){const[t,n]=f.useState(null),r=me((i,a)=>{e||n(a||(fd?"touch":""))});hc(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=cS(r);return f.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function lS(e){const{store:t,parentContext:n,actionsRef:r}=e,o=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),a=t.useState("popupElement"),{openMethod:l,triggerProps:c}=gp(o);Df(t);const{forceUnmount:u}=Mf(o,t),d=me(A=>{const L=Ye(A);return L.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},L}),h=f.useCallback(()=>{t.setOpen(!1,d(tf))},[t,d]);f.useImperativeHandle(r,()=>({unmount:u,close:h}),[u,h]);const p=Ff({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,m]=f.useState(0),v=g===0,y=Wf(p),b=gf(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(A){if(!t.context.outsidePressEnabledRef.current||"button"in A&&A.button!==0||"touches"in A&&A.touches.length!==1)return!1;const L=gt(A);if(v&&!s){const M=L;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===M||t.context.backdropRef.current===M||ke(M,a)&&!M?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:v});mp(o&&i===!0,a);const{getReferenceProps:E,getFloatingProps:x,getTriggerProps:w}=Us([y,b]);t.useContextCallback("onNestedDialogOpen",A=>{m(A+1)}),t.useContextCallback("onNestedDialogClose",()=>{m(0)}),f.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(g),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,g]);const T=f.useMemo(()=>E(c),[E,c]),S=f.useMemo(()=>w(c),[w,c]),I=f.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:l,activeTriggerProps:T,inactiveTriggerProps:S,popupProps:I,floatingRootContext:p,nestedOpenDialogCount:g})}const mc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(mc.displayName="DialogRootContext");function Vn(e){const t=f.useContext(mc);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":it(27));return t}const uS={...$f,modal:he(e=>e.modal),nested:he(e=>e.nested),nestedOpenDialogCount:he(e=>e.nestedOpenDialogCount),disablePointerDismissal:he(e=>e.disablePointerDismissal),openMethod:he(e=>e.openMethod),descriptionElementId:he(e=>e.descriptionElementId),titleElementId:he(e=>e.titleElementId),viewportElement:he(e=>e.viewportElement),role:he(e=>e.role)};class dS extends vs{constructor(t){super(fS(t),{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new js,onOpenChange:void 0,onOpenChangeComplete:void 0},uS)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const r={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",r);const o={open:t},s=n.trigger?.id??null;(s||t)&&(o.activeTriggerId=s,o.activeTriggerElement=n.trigger??null),this.update(o)}}function fS(e={}){return{...Lf(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}const pS={...$r,...tr},vp=f.forwardRef(function(t,n){const{render:r,className:o,forceRender:s=!1,...i}=t,{store:a}=Vn(),l=a.useState("open"),c=a.useState("nested"),u=a.useState("mounted"),d=a.useState("transitionStatus");return ze("div",t,{state:{open:l,transitionStatus:d},ref:[a.context.backdropRef,n],stateAttributesMapping:pS,props:[{role:"presentation",hidden:!u,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!c})});process.env.NODE_ENV!=="production"&&(vp.displayName="DialogBackdrop");const yp=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...a}=t,{store:l}=Vn(),c=l.useState("open");function u(g){c&&l.setOpen(!1,Ye(fE,g.nativeEvent))}const{getButtonProps:d,buttonRef:h}=Ms({disabled:s,native:i});return ze("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:u},a,d]})});process.env.NODE_ENV!=="production"&&(yp.displayName="DialogClose");const bp=f.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{store:a}=Vn(),l=It(s);return a.useSyncedValueWithCleanup("descriptionElementId",l),ze("p",t,{ref:n,props:[{id:l},i]})});process.env.NODE_ENV!=="production"&&(bp.displayName="DialogDescription");let hS=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),mS=(function(e){return e[e.open=ir.open]="open",e[e.closed=ir.closed]="closed",e[e.startingStyle=ir.startingStyle]="startingStyle",e[e.endingStyle=ir.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const gc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(gc.displayName="DialogPortalContext");function gS(){const e=f.useContext(gc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":it(26));return e}const vS={...$r,...tr,nestedDialogOpen(e){return e?{[mS.nestedDialogOpen]:""}:null}},wp=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,...a}=t,{store:l}=Vn(),c=l.useState("descriptionElementId"),u=l.useState("disablePointerDismissal"),d=l.useState("floatingRootContext"),h=l.useState("popupProps"),p=l.useState("modal"),g=l.useState("mounted"),m=l.useState("nested"),v=l.useState("nestedOpenDialogCount"),y=l.useState("open"),b=l.useState("openMethod"),E=l.useState("titleElementId"),x=l.useState("transitionStatus"),w=l.useState("role");gS(),Ar({open:y,ref:l.context.popupRef,onComplete(){y&&l.context.onOpenChangeComplete?.(!0)}});function T(M){return M==="touch"?l.context.popupRef.current:!0}const S=s===void 0?T:s,I=v>0,L=ze("div",t,{state:{open:y,nested:m,transitionStatus:x,nestedDialogOpen:I},props:[h,{"aria-labelledby":E??void 0,"aria-describedby":c??void 0,role:w,tabIndex:-1,hidden:!g,onKeyDown(M){dp.has(M.key)&&M.stopPropagation()},style:{[hS.nestedDialogs]:v}},a],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:vS});return O.jsx(hf,{context:d,openInteractionType:b,disabled:!g,closeOnFocusOut:!u,initialFocus:S,returnFocus:o,modal:p!==!1,restoreFocus:"popup",children:L})});process.env.NODE_ENV!=="production"&&(wp.displayName="DialogPopup");const vc=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r?.getBoundingClientRect();s=`polygon(
19
- 0% 0%,
20
- 100% 0%,
21
- 100% 100%,
22
- 0% 100%,
23
- 0% 0%,
24
- ${i.left}px ${i.top}px,
25
- ${i.left}px ${i.bottom}px,
26
- ${i.right}px ${i.bottom}px,
27
- ${i.right}px ${i.top}px,
28
- ${i.left}px ${i.top}px
29
- )`}return O.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(vc.displayName="InternalBackdrop");const Ep=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vn(),i=s.useState("mounted"),a=s.useState("modal"),l=s.useState("open");return i||r?O.jsx(gc.Provider,{value:r,children:O.jsxs(tc,{ref:n,...o,children:[i&&a===!0&&O.jsx(vc,{ref:s.context.internalBackdropRef,inert:Ga(!l)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Ep.displayName="DialogPortal");const xp=f.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{store:a}=Vn(),l=It(s);return a.useSyncedValueWithCleanup("titleElementId",l),ze("h2",t,{ref:n,props:[{id:l},i]})});process.env.NODE_ENV!=="production"&&(xp.displayName="DialogTitle");const Sp=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:a,payload:l,handle:c,...u}=t,d=Vn(!0),h=c?.store??d?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":it(79));const p=It(a),g=h.useState("floatingRootContext"),m=h.useState("isOpenedByTrigger",p),v=f.useRef(null),{registerTrigger:y,isMountedByThisTrigger:b}=Af(p,v,h,{payload:l}),{getButtonProps:E,buttonRef:x}=Ms({disabled:s,native:i}),w=mf(g,{enabled:g!=null}),T=Us([w]),S={disabled:s,open:m},I=h.useState("triggerProps",b);return ze("button",t,{state:S,ref:[x,n,y,v],props:[T.getReferenceProps(),I,{[Ua]:"",id:p},u,E],stateAttributesMapping:Zf})});process.env.NODE_ENV!=="production"&&(Sp.displayName="DialogTrigger");function Cp(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}let Tp=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Js={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Io={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},yS={disabled:!1,...Io},Vr={valid(e){return e===null?null:e?{[Tp.valid]:""}:{[Tp.invalid]:""}}},yc=f.createContext({invalid:void 0,name:void 0,validityData:{state:Js,errors:[],error:"",value:"",initialValue:null},setValidityData:mt,disabled:void 0,touched:Io.touched,setTouched:mt,dirty:Io.dirty,setDirty:mt,filled:Io.filled,setFilled:mt,focused:Io.focused,setFocused:mt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:yS,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=tt)=>e,getInputValidationProps:(e=tt)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(yc.displayName="FieldRootContext");function _o(e=!0){const t=f.useContext(yc);if(t.setValidityData===mt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":it(28));return t}function bc(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const wc=f.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:mt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(wc.displayName="FormContext");function No(){return f.useContext(wc)}function Op(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:s,commit:i}=e,{formRef:a}=No(),{invalid:l,markedDirtyRef:c,validityData:u,setValidityData:d}=_o(),h=me(e.getValue);ve(()=>{if(!t)return;let p=n;p===void 0&&(p=h()),u.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,u.initialValue,h]),ve(()=>{!t||!r||a.current.fields.set(r,{getValue:h,name:o,controlRef:s,validityData:bc(u,l),validate(p=!0){let g=n;g===void 0&&(g=h()),c.current=!0,p?lt.flushSync(()=>i(g)):i(g)}})},[i,s,t,a,h,r,l,c,o,u,n]),ve(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const Ec=f.createContext({controlId:void 0,registerControlId:mt,labelId:void 0,setLabelId:mt,messageIds:[],setMessageIds:mt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Ec.displayName="LabelableContext");function Bn(){return f.useContext(Ec)}function bS(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Bn(),i=It(t),a=n?o:void 0,l=ht(()=>Symbol("labelable-control")),c=f.useRef(!1),u=f.useRef(t!=null),d=me(()=>{!c.current||s===mt||(c.current=!1,s(l.current,void 0))});return ve(()=>{if(s===mt)return;let h;if(n){const p=r?.current;$e(p)&&p.closest("label")!=null?h=t??null:h=a??i}else if(t!=null)u.current=!0,h=t;else if(u.current)h=i;else{d();return}if(h===void 0){d();return}c.current=!0,s(l.current,h)},[t,r,a,s,n,i,l,d]),f.useEffect(()=>d,[d]),o??i}let kp=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function Rp(e){return f.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[kp.checked]:""}:{[kp.unchecked]:""}},...Vr}),[e.indeterminate])}const Pp=f.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(Pp.displayName="FieldItemContext");function wS(){return f.useContext(Pp)}function ES(e,t,n,r=!0,o){const[s,i]=f.useState(),a=It(o?`${o}-label`:void 0),l=e??t??s;return ve(()=>{const c=e||t||!r?void 0:xS(n.current,a);s!==c&&i(c)}),l}function xS(e,t){const n=SS(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function SS(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const Ip=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ip.displayName="CheckboxGroupContext");function CS(e=!0){const t=f.useContext(Ip);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.":it(3));return t}const xc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(xc.displayName="CheckboxRootContext");function TS(){const e=f.useContext(xc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.":it(14));return e}const OS="data-parent",Sc=f.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,id:l,indeterminate:c=!1,inputRef:u,name:d,onCheckedChange:h,parent:p=!1,readOnly:g=!1,render:m,required:v=!1,uncheckedValue:y,value:b,nativeButton:E=!1,...x}=t,{clearErrors:w}=No(),{disabled:T,name:S,setDirty:I,setFilled:A,setFocused:L,setTouched:M,state:N,validationMode:R,validityData:P,shouldValidateOnChange:C,validation:_}=_o(),D=wS(),{labelId:k,controlId:$,registerControlId:F,getDescriptionProps:j}=Bn(),V=CS(),Y=V?.parent,q=Y&&V.allValues,X=T||D.disabled||V?.disabled||a,U=S??d,H=b??U,Z=It(),re=It();let ne=$;q?ne=p?re:`${Y.id}-${H}`:l&&(ne=l);let ee={};q&&(p?ee=V.parent.getParentProps():H&&(ee=V.parent.getChildProps(H)));const le=me(h),{checked:K=r,indeterminate:G=c,onCheckedChange:de,...fe}=ee,oe=V?.value,ue=V?.setValue,te=V?.defaultValue,z=f.useRef(null),B=ht(()=>Symbol("checkbox-control")),J=f.useRef(!1),{getButtonProps:pe,buttonRef:Se}=Ms({disabled:X,native:E}),_e=V?.validation??_,[Fe,Ie]=op({controlled:H&&oe&&!p?oe.includes(H):K,default:H&&te&&!p?te.includes(H):s,name:"Checkbox",state:"checked"});ve(()=>{F!==mt&&(J.current=!0,F(B.current,ne))},[ne,V,F,p,B]),f.useEffect(()=>{const ye=B.current;return()=>{!J.current||F===mt||(J.current=!1,F(ye,void 0))}},[F,B]),Op({enabled:!V,id:Z,commit:_e.commit,value:Fe,controlRef:z,name:U,getValue:()=>Fe});const be=f.useRef(null),Re=Eo(u,be,_e.inputRef),Ce=ES(i,k,be,!E,ne??void 0);ve(()=>{be.current&&(be.current.indeterminate=G,Fe&&A(!0))},[Fe,G,A]),hc(Fe,()=>{V&&!p||(w(U),A(Fe),I(Fe!==P.initialValue),C()?_e.commit(Fe):_e.commit(Fe,!0))});const Be=Nr({checked:Fe,disabled:X,name:p?void 0:U,id:E?void 0:ne??void 0,required:v,ref:Re,style:U?O1:Va,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ye){if(ye.nativeEvent.defaultPrevented)return;const Ze=ye.target.checked,ie=Ye(Za,ye.nativeEvent);if(de?.(Ze,ie),le(Ze,ie),!ie.isCanceled&&(Ie(Ze),H&&oe&&ue&&!p)){const ge=Ze?[...oe,H]:oe.filter(Oe=>Oe!==H);ue(ge,ie)}},onFocus(){z.current?.focus()}},b!==void 0?{value:(V?Fe&&b:b)||""}:tt,j,V?_e.getValidationProps:_e.getInputValidationProps),Qe=q?!!K:Fe,ct=q&&G||c;f.useEffect(()=>{if(!Y||!H)return;const ye=Y.disabledStatesRef.current;return ye.set(H,X),()=>{ye.delete(H)}},[Y,X,H]);const Ct=f.useMemo(()=>({...N,checked:Qe,disabled:X,readOnly:g,required:v,indeterminate:ct}),[N,Qe,X,g,v,ct]),Dt=Rp(Ct),jt=ze("span",t,{state:Ct,ref:[Se,z,n,V?.registerControlRef],props:[{id:E?ne??void 0:Z,role:"checkbox","aria-checked":G?"mixed":Fe,"aria-readonly":g||void 0,"aria-required":v||void 0,"aria-labelledby":Ce,[OS]:p?"":void 0,onFocus(){L(!0)},onBlur(){const ye=be.current;ye&&(M(!0),L(!1),R==="onBlur"&&_e.commit(V?oe:ye.checked))},onClick(ye){g||X||(ye.preventDefault(),be.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ye.shiftKey,ctrlKey:ye.ctrlKey,altKey:ye.altKey,metaKey:ye.metaKey})))}},j,_e.getValidationProps,x,fe,pe],stateAttributesMapping:Dt});return O.jsxs(xc.Provider,{value:Ct,children:[jt,!Fe&&!V&&U&&!p&&y!==void 0&&O.jsx("input",{type:"hidden",name:U,value:y}),O.jsx("input",{...Be})]})});process.env.NODE_ENV!=="production"&&(Sc.displayName="CheckboxRoot");const Cc=f.forwardRef(function(t,n){const{render:r,className:o,keepMounted:s=!1,...i}=t,a=TS(),l=a.checked||a.indeterminate,{mounted:c,transitionStatus:u,setMounted:d}=uc(l),h=f.useRef(null),p={...a,transitionStatus:u};Ar({open:l,ref:h,onComplete(){l||d(!1)}});const g=Rp(a),m=f.useMemo(()=>({...g,...tr,...Vr}),[g]),v=s||c,y=ze("span",t,{ref:[n,h],state:p,stateAttributesMapping:m,props:i});return v?y:null});process.env.NODE_ENV!=="production"&&(Cc.displayName="CheckboxIndicator");function kS(e,t){const n=It(e);return ve(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function RS(e={}){const{id:t,fallbackControlId:n,native:r=!1,setLabelId:o,focusControl:s}=e,{controlId:i,setLabelId:a}=Bn(),l=me(p=>{a(p),o?.(p)}),c=kS(t,l),u=i??n;function d(p){if(s){s(p,u);return}if(!u)return;const g=Ae(p.currentTarget).getElementById(u);rt(g)&&PS(g)}function h(p){gt(p.nativeEvent)?.closest("button,input,select,textarea")||(!p.defaultPrevented&&p.detail>1&&p.preventDefault(),!r&&d(p))}return r?{id:c,htmlFor:u??void 0,onMouseDown:h}:{id:c,onClick:h,onPointerDown(p){p.preventDefault()}}}function PS(e){e.focus({focusVisible:!0})}const _p=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(_p.displayName="ToolbarRootContext");function IS(e){return f.useContext(_p)}function _S(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:l,handle:c,triggerId:u,defaultTriggerId:d=null}=e,h=Vn(!0),p=!!h,g=ht(()=>c?.store??new dS({open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:a,disablePointerDismissal:i,nested:p})).current;Cp(()=>{n===void 0&&g.state.open===!1&&r===!0&&g.update({open:!0,activeTriggerId:d})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",u),g.useSyncedValues({disablePointerDismissal:i,nested:p,modal:a}),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",s);const m=g.useState("payload");lS({store:g,actionsRef:l,parentContext:h?.store.context});const v=f.useMemo(()=>({store:g}),[g]);return O.jsx(mc.Provider,{value:v,children:typeof t=="function"?t({payload:m}):t})}const Np=f.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});process.env.NODE_ENV!=="production"&&(Np.displayName="FieldsetRootContext");function NS(e=!1){const t=f.useContext(Np);if(!t&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.":it(86));return t}const Ap=function(t){const n=It(),r=t.controlId===void 0?n:t.controlId,[o,s]=f.useState(r),[i,a]=f.useState(t.labelId),[l,c]=f.useState([]),u=ht(()=>new Map),{messageIds:d}=Bn(),h=me((m,v)=>{const y=u.current;if(v===void 0){y.delete(m);return}y.set(m,v),s(b=>{if(y.size===0)return;let E;for(const x of y.values()){if(b!==void 0&&x===b)return b;E===void 0&&(E=x)}return E})}),p=f.useCallback(m=>Nr({"aria-describedby":d.concat(l).join(" ")||void 0},m),[d,l]),g=f.useMemo(()=>({controlId:o,registerControlId:h,labelId:i,setLabelId:a,messageIds:l,setMessageIds:c,getDescriptionProps:p}),[o,h,i,a,l,c,p]);return O.jsx(Ec.Provider,{value:g,children:t.children})};process.env.NODE_ENV!=="production"&&(Ap.displayName="LabelableProvider");const Qs=Object.keys(Js);function AS(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Qs)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function DS(e){const{formRef:t,clearErrors:n}=No(),{setValidityData:r,validate:o,validityData:s,validationDebounceTime:i,invalid:a,markedDirtyRef:l,state:c,name:u,shouldValidateOnChange:d}=e,{controlId:h,getDescriptionProps:p}=Bn(),g=Nn(),m=f.useRef(null),v=me(async(E,x=!1)=>{const w=m.current;if(!w)return;if(x){if(c.valid!==!1)return;const R=w.validity;if(!R.valueMissing){const C={value:E,state:{...Js,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(w.setCustomValidity(""),h){const _=t.current.fields.get(h);_&&t.current.fields.set(h,{..._,...bc(C,!1)})}r(C);return}const P=Qs.reduce((C,_)=>(C[_]=R[_],C),{});if(!P.valid&&!AS(P))return}function T(R){const P=Qs.reduce((_,D)=>(_[D]=R.validity[D],_),{});let C=!1;for(const _ of Qs)if(_!=="valid"){if(_==="valueMissing"&&P[_])C=!0;else if(P[_])return P}return C&&!l.current&&(P.valid=!0,P.valueMissing=!1),P}g.clear();let S=null,I=[];const A=T(w);let L;const M=d();if(w.validationMessage&&!M)L=w.validationMessage,I=[w.validationMessage];else{const R=Array.from(t.current.fields.values()).reduce((C,_)=>(_.name&&(C[_.name]=_.getValue()),C),{}),P=o(E,R);typeof P=="object"&&P!==null&&"then"in P?S=await P:S=P,S!==null?(A.valid=!1,A.customError=!0,Array.isArray(S)?(I=S,w.setCustomValidity(S.join(`
30
- `))):S&&(I=[S],w.setCustomValidity(S))):M&&(w.setCustomValidity(""),A.customError=!1,w.validationMessage?(L=w.validationMessage,I=[w.validationMessage]):w.validity.valid&&!A.valid&&(A.valid=!0))}const N={value:E,state:A,error:L??(Array.isArray(S)?S[0]:S??""),errors:I,initialValue:s.initialValue};if(h){const R=t.current.fields.get(h);R&&t.current.fields.set(h,{...R,...bc(N,a)})}r(N)}),y=f.useCallback((E={})=>Nr(p,c.valid===!1?{"aria-invalid":!0}:tt,E),[p,c.valid]),b=f.useCallback((E={})=>Nr({onChange(x){if(x.nativeEvent.defaultPrevented)return;if(n(u),!d()){v(x.currentTarget.value,!0);return}const w=x.currentTarget;if(w.value===""){v(w.value);return}g.clear(),i?g.start(i,()=>{v(w.value)}):v(w.value)}},y(E)),[y,n,u,g,v,i,d]);return f.useMemo(()=>({getValidationProps:y,getInputValidationProps:b,inputRef:m,commit:v}),[y,b,v])}const Dp=f.forwardRef(function(t,n){const{errors:r,validationMode:o,submitAttemptedRef:s}=No(),{render:i,className:a,validate:l,validationDebounceTime:c=0,validationMode:u=o,name:d,disabled:h=!1,invalid:p,dirty:g,touched:m,actionsRef:v,...y}=t,{disabled:b}=NS(),E=me(l||(()=>null)),x=b||h,[w,T]=f.useState(!1),[S,I]=f.useState(!1),[A,L]=f.useState(!1),[M,N]=f.useState(!1),R=g??S,P=m??w,C=f.useRef(!1),_=me(re=>{g===void 0&&(re&&(C.current=!0),I(re))}),D=me(re=>{m===void 0&&T(re)}),k=me(()=>u==="onChange"||u==="onSubmit"&&s.current),$=!!d&&Object.hasOwn(r,d)&&r[d]!==void 0,F=p===!0||$,[j,V]=f.useState({state:Js,error:"",errors:[],value:null,initialValue:null}),Y=!F&&j.state.valid,q=f.useMemo(()=>({disabled:x,touched:P,dirty:R,valid:Y,filled:A,focused:M}),[x,P,R,Y,A,M]),X=DS({setValidityData:V,validate:E,validityData:j,validationDebounceTime:c,invalid:F,markedDirtyRef:C,state:q,name:d,shouldValidateOnChange:k}),U=f.useCallback(()=>{C.current=!0,X.commit(j.value)},[X,j]);f.useImperativeHandle(v,()=>({validate:U}),[U]);const H=f.useMemo(()=>({invalid:F,name:d,validityData:j,setValidityData:V,disabled:x,touched:P,setTouched:D,dirty:R,setDirty:_,filled:A,setFilled:L,focused:M,setFocused:N,validate:E,validationMode:u,validationDebounceTime:c,shouldValidateOnChange:k,state:q,markedDirtyRef:C,validation:X}),[F,d,j,x,P,D,R,_,A,L,M,N,E,u,c,k,q,X]),Z=ze("div",t,{ref:n,state:q,props:y,stateAttributesMapping:Vr});return O.jsx(yc.Provider,{value:H,children:Z})});process.env.NODE_ENV!=="production"&&(Dp.displayName="FieldRootInner");const wn=f.forwardRef(function(t,n){return O.jsx(Ap,{children:O.jsx(Dp,{...t,ref:n})})});process.env.NODE_ENV!=="production"&&(wn.displayName="FieldRoot");const Tc=f.forwardRef(function(t,n){const{render:r,className:o,id:s,nativeLabel:i=!0,...a}=t,l=_o(!1),{labelId:c}=Bn(),u=f.useRef(null),d=RS({id:c??s,native:i});return process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!u.current)return;const p=u.current.tagName==="LABEL";if(i){if(!p){const g=To.captureOwnerStack?.()||"";Ds(`<Field.Label> expected a <label> element because the \`nativeLabel\` prop is true. Rendering a non-<label> disables native label association, so \`htmlFor\` will not work. Use a real <label> in the \`render\` prop, or set \`nativeLabel\` to \`false\`.${g}`)}}else if(p){const g=To.captureOwnerStack?.()||"";Ds(`<Field.Label> expected a non-<label> element because the \`nativeLabel\` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the \`render\` prop, or set \`nativeLabel\` to \`true\`.${g}`)}},[i]),ze("label",t,{ref:[n,u],state:l.state,props:[d,a],stateAttributesMapping:Vr})});process.env.NODE_ENV!=="production"&&(Tc.displayName="FieldLabel");const MS={...Vr,...tr},Oc=f.forwardRef(function(t,n){const{render:r,id:o,className:s,match:i,...a}=t,l=It(o),{validityData:c,state:u,name:d}=_o(!1),{setMessageIds:h}=Bn(),{errors:p}=No(),g=d?p[d]:null;let m=!1;g||i===!0?m=!0:i?m=!!c.state[i]:m=c.state.valid===!1;const{mounted:v,transitionStatus:y,setMounted:b}=uc(m);ve(()=>{if(!(!m||!l))return h(N=>N.concat(l)),()=>{h(N=>N.filter(R=>R!==l))}},[m,l,h]);const E=f.useRef(null),[x,w]=f.useState(null),[T,S]=f.useState(null),I=g||(c.errors.length>1?O.jsx("ul",{children:c.errors.map(N=>O.jsx("li",{children:N},N))}):c.error);let A=c.error;g!=null?A=Array.isArray(g)?JSON.stringify(g):g:c.errors.length>1&&(A=JSON.stringify(c.errors)),m&&A!==T&&(S(A),w(I)),Ar({open:m,ref:E,onComplete(){m||b(!1)}});const L={...u,transitionStatus:y},M=ze("div",t,{ref:[n,E],state:L,props:[{id:l,children:m?I:x},a],stateAttributesMapping:MS,enabled:v});return v?M:null});process.env.NODE_ENV!=="production"&&(Oc.displayName="FieldError");const cr=f.forwardRef(function(t,n){const{render:r,className:o,id:s,name:i,value:a,disabled:l=!1,onValueChange:c,defaultValue:u,autoFocus:d=!1,...h}=t,{state:p,name:g,disabled:m,setTouched:v,setDirty:y,validityData:b,setFocused:E,setFilled:x,validationMode:w,validation:T}=_o(),S=m||l,I=g??i,A={...p,disabled:S},{labelId:L}=Bn(),M=bS({id:s});ve(()=>{const D=a!=null;T.inputRef.current?.value||D&&a!==""?x(!0):D&&a===""&&x(!1)},[T.inputRef,x,a]);const N=f.useRef(null);ve(()=>{d&&N.current===$t(Ae(N.current))&&E(!0)},[d,E]);const[R]=op({controlled:a,default:u,name:"FieldControl",state:"value"}),P=a!==void 0,C=P?R:void 0;return Op({id:M,name:I,commit:T.commit,value:C,getValue:()=>T.inputRef.current?.value,controlRef:T.inputRef}),ze("input",t,{ref:[n,N],state:A,props:[{id:M,disabled:S,name:I,ref:T.inputRef,"aria-labelledby":L,autoFocus:d,...P?{value:C}:{defaultValue:u},onChange(D){const k=D.currentTarget.value;c?.(k,Ye(Za,D.nativeEvent)),y(k!==b.initialValue),x(k!=="")},onFocus(){E(!0)},onBlur(D){v(!0),E(!1),w==="onBlur"&&T.commit(D.currentTarget.value)},onKeyDown(D){D.currentTarget.tagName==="INPUT"&&D.key==="Enter"&&(v(!0),T.commit(D.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:Vr})});process.env.NODE_ENV!=="production"&&(cr.displayName="FieldControl");const ei=f.forwardRef(function(t,n){const{render:r,className:o,validationMode:s="onSubmit",errors:i,onSubmit:a,onFormSubmit:l,actionsRef:c,...u}=t,d=f.useRef({fields:new Map}),h=f.useRef(!1),p=f.useRef(!1),g=me(w=>{w&&(w.focus(),w.tagName==="INPUT"&&w.select())}),[m,v]=f.useState(i);hc(i,()=>{v(i)}),f.useEffect(()=>{if(!h.current)return;h.current=!1;const w=Array.from(d.current.fields.values()).filter(T=>T.validityData.state.valid===!1);w.length&&g(w[0].controlRef.current)},[m,g]);const y=f.useCallback(w=>{const T=Array.from(d.current.fields.values());if(w){const S=T.find(I=>I.name===w);S&&S.validate(!1)}else T.forEach(S=>{S.validate(!1)})},[]);f.useImperativeHandle(c,()=>({validate:y}),[y]);const b=ze("form",t,{ref:n,props:[{noValidate:!0,onSubmit(w){p.current=!0;let T=Array.from(d.current.fields.values());T.forEach(I=>{I.validate()}),T=Array.from(d.current.fields.values());const S=T.filter(I=>!I.validityData.state.valid);if(S.length)w.preventDefault(),g(S[0].controlRef.current);else if(h.current=!0,a?.(w),l){w.preventDefault();const I=T.reduce((A,L)=>(L.name&&(A[L.name]=L.getValue()),A),{});l(I,pE(Za,w.nativeEvent))}}},u]}),E=me(w=>{if(w&&m&&tt.hasOwnProperty.call(m,w)){const T={...m};delete T[w],v(T)}}),x=f.useMemo(()=>({formRef:d,validationMode:s,errors:m??tt,clearErrors:E,submitAttemptedRef:p}),[d,s,m,E]);return O.jsx(wc.Provider,{value:x,children:b})});process.env.NODE_ENV!=="production"&&(ei.displayName="Form");const kc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(kc.displayName="PopoverRootContext");function En(e){const t=f.useContext(kc);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":it(47));return t}function LS(){return{...Lf(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const $S={...$f,disabled:he(e=>e.disabled),instantType:he(e=>e.instantType),openMethod:he(e=>e.openMethod),openChangeReason:he(e=>e.openChangeReason),modal:he(e=>e.modal),stickIfOpen:he(e=>e.stickIfOpen),titleElementId:he(e=>e.titleElementId),descriptionElementId:he(e=>e.descriptionElementId),openOnHover:he(e=>e.openOnHover),closeDelay:he(e=>e.closeDelay),hasViewport:he(e=>e.hasViewport)};class Rc extends vs{constructor(t){const n={...LS(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:f.createRef(),beforeContentFocusGuardRef:f.createRef(),stickIfOpenTimeout:new zt,triggerElements:new js},$S)}setOpen=(t,n)=>{const r=n.reason===St,o=n.reason===Dr&&n.event.detail===0,s=!t&&(n.reason===ef||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const l=()=>{const c={open:t,openChangeReason:n.reason},u=n.trigger?.id??null;(u||t)&&(c.activeTriggerId=u,c.activeTriggerElement=n.trigger??null),this.update(c)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(V1,()=>{this.set("stickIfOpen",!1)}),lt.flushSync(l)):l(),o||s?this.set("instantType",o?"click":"dismiss"):n.reason===Oo?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const r=ht(()=>new Rc(n)).current,o=t??r;return mo(r.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function Mp({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:l,defaultTriggerId:c=null}=e,u=Rc.useStore(a?.store,{modal:i,open:r,openProp:n,activeTriggerId:c,triggerIdProp:l});Cp(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:c})}),u.useControlledProp("openProp",n),u.useControlledProp("triggerIdProp",l);const d=u.useState("open"),h=u.useState("positionerElement"),p=u.useState("payload"),g=u.useState("openChangeReason");u.useContextCallback("onOpenChange",o),u.useContextCallback("onOpenChangeComplete",s);const{openMethod:m,triggerProps:v}=gp(d);Df(u);const{forceUnmount:y}=Mf(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});mp(d&&i===!0&&g!==St&&m!=="touch",h),f.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);const b=f.useCallback(P=>{const C=Ye(P);return C.preventUnmountOnClose=()=>{u.set("preventUnmountingOnClose",!0)},C},[u]),E=f.useCallback(()=>{u.setOpen(!1,b(tf))},[u,b]);f.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:E}),[y,E]);const x=Ff({popupStore:u,onOpenChange:u.setOpen}),w=gf(x,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=Wf(x),{getReferenceProps:S,getFloatingProps:I,getTriggerProps:A}=Us([w,T]),L=f.useMemo(()=>S(v),[S,v]),M=f.useMemo(()=>A(v),[A,v]),N=f.useMemo(()=>I(),[I]);u.useSyncedValues({modal:i,openMethod:m,activeTriggerProps:L,inactiveTriggerProps:M,popupProps:N,floatingRootContext:x,nested:or()!=null});const R=f.useMemo(()=>({store:u}),[u]);return O.jsx(kc.Provider,{value:R,children:typeof t=="function"?t({payload:p}):t})}function FS(e){return En(!0)?O.jsx(Mp,{props:e}):O.jsx(EE,{children:O.jsx(Mp,{props:e})})}const VS=300,Lp=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:a,payload:l,openOnHover:c=!1,delay:u=VS,closeDelay:d=0,id:h,...p}=t,g=En(!0),m=a?.store??g?.store;if(!m)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":it(74));const v=It(h),y=m.useState("isTriggerActive",v),b=m.useState("floatingRootContext"),E=m.useState("isOpenedByTrigger",v),x=f.useRef(null),{registerTrigger:w,isMountedByThisTrigger:T}=Af(v,x,m,{payload:l,disabled:s,openOnHover:c,closeDelay:d}),S=m.useState("openChangeReason"),I=m.useState("stickIfOpen"),A=m.useState("openMethod"),L=Ox(b,{enabled:b!=null&&c&&(A!=="touch"||S!==Dr),mouseOnly:!0,move:!1,handleClose:Ix(),restMs:u,delay:{close:d},triggerElementRef:x,isActiveTrigger:y}),M=mf(b,{enabled:b!=null,stickIfOpen:I}),N=Us([M]),R=m.useState("triggerProps",T),P={disabled:s,open:E},{getButtonProps:C,buttonRef:_}=Ms({disabled:s,native:i}),D=f.useMemo(()=>({open(V){return V&&S===Dr?Hx.open(V):Zf.open(V)}}),[S]),k=ze("button",t,{state:P,ref:[_,n,w,x],props:[N.getReferenceProps(),L,R,{[Ua]:"",id:v},p,C],stateAttributesMapping:D}),$=f.useRef(null),F=me(V=>{lt.flushSync(()=>{m.setOpen(!1,Ye(Oo,V.nativeEvent,V.currentTarget))}),S1($.current)?.focus()}),j=me(V=>{const Y=m.select("positionerElement");if(Y&&_r(V,Y))m.context.beforeContentFocusGuardRef.current?.focus();else{lt.flushSync(()=>{m.setOpen(!1,Ye(Oo,V.nativeEvent,V.currentTarget))});let q=x1(m.context.triggerFocusTargetRef.current||x.current);for(;q!==null&&ke(Y,q);){const X=q;if(q=Fa(q),q===X)break}q?.focus()}});return y?O.jsxs(f.Fragment,{children:[O.jsx(nn,{ref:$,onFocus:F}),O.jsx(f.Fragment,{children:k},v),O.jsx(nn,{ref:m.context.triggerFocusTargetRef,onFocus:j})]}):O.jsx(f.Fragment,{children:k},v)});process.env.NODE_ENV!=="production"&&(Lp.displayName="PopoverTrigger");const Pc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Pc.displayName="PopoverPortalContext");function BS(){const e=f.useContext(Pc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":it(45));return e}const $p=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=En();return s.useState("mounted")||r?O.jsx(Pc.Provider,{value:r,children:O.jsx(tc,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&($p.displayName="PopoverPortal");const Ic=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ic.displayName="PopoverPositionerContext");function Fp(){const e=f.useContext(Ic);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":it(46));return e}const Vp=f.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:l="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:h=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=G1,...y}=t,{store:b}=En(),E=BS(),x=bE(),w=b.useState("floatingRootContext"),T=b.useState("mounted"),S=b.useState("open"),I=b.useState("openChangeReason"),A=b.useState("activeTriggerElement"),L=b.useState("modal"),M=b.useState("positionerElement"),N=b.useState("instantType"),R=b.useState("transitionStatus"),P=b.useState("hasViewport"),C=f.useRef(null),_=Ud(M,!1,!1),D=$x({anchor:s,floatingRootContext:w,positionMethod:i,mounted:T,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:h,sticky:g,disableAnchorTracking:m,keepMounted:E,nodeId:x,collisionAvoidance:v,adaptiveOrigin:P?Lx:void 0}),k=f.useMemo(()=>{const q={};return S||(q.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...D.positionerStyles,...q}}},[S,T,D.positionerStyles]),$=f.useMemo(()=>({props:k,...D}),[k,D]),F=w.useState("domReferenceElement");ve(()=>{const q=F,X=C.current;if(q&&(C.current=q),X&&q&&q!==X){b.set("instantType",void 0);const U=new AbortController;return _(()=>{b.set("instantType","trigger-change")},U.signal),()=>{U.abort()}}},[F,_,b]);const j={open:S,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:N},V=f.useCallback(q=>{b.set("positionerElement",q)},[b]),Y=ze("div",t,{state:j,props:[$.props,qf(R),y],ref:[n,V],stateAttributesMapping:$r});return O.jsxs(Ic.Provider,{value:$,children:[T&&L===!0&&I!==St&&O.jsx(vc,{ref:b.context.internalBackdropRef,inert:Ga(!S),cutout:A}),O.jsx(wE,{id:x,children:Y})]})});process.env.NODE_ENV!=="production"&&(Vp.displayName="PopoverPositioner");const Bp=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Bp.displayName="ClosePartContext");function WS(){const[e,t]=f.useState(0),n=me(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:f.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function jS(e){const{value:t,children:n}=e;return O.jsx(Bp.Provider,{value:t,children:n})}const HS={...$r,...tr},Wp=f.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,...a}=t,{store:l}=En(),c=Fp(),u=IS()!=null,{context:d,hasClosePart:h}=WS(),p=l.useState("open"),g=l.useState("openMethod"),m=l.useState("instantType"),v=l.useState("transitionStatus"),y=l.useState("popupProps"),b=l.useState("titleElementId"),E=l.useState("descriptionElementId"),x=l.useState("modal"),w=l.useState("mounted"),T=l.useState("openChangeReason"),S=l.useState("activeTriggerElement"),I=l.useState("floatingRootContext");Ar({open:p,ref:l.context.popupRef,onComplete(){p&&l.context.onOpenChangeComplete?.(!0)}});const A=l.useState("disabled"),L=l.useState("openOnHover"),M=l.useState("closeDelay");Cx(I,{enabled:L&&!A,closeDelay:M});function N(k){return k==="touch"?l.context.popupRef.current:!0}const R=s===void 0?N:s,P={open:p,side:c.side,align:c.align,instant:m,transitionStatus:v},C=x!==!1&&h,_=f.useCallback(k=>{l.set("popupElement",k)},[l]),D=ze("div",t,{state:P,ref:[n,l.context.popupRef,_],props:[y,{"aria-labelledby":b,"aria-describedby":E,onKeyDown(k){u&&dp.has(k.key)&&k.stopPropagation()}},qf(v),a],stateAttributesMapping:HS});return O.jsx(hf,{context:I,openInteractionType:g,modal:C,disabled:!w||T===St,initialFocus:R,returnFocus:i,restoreFocus:"popup",previousFocusableElement:rt(S)?S:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:O.jsx(jS,{value:d,children:D})})});process.env.NODE_ENV!=="production"&&(Wp.displayName="PopoverPopup");const jp=f.forwardRef(function(t,n){const{className:r,render:o,...s}=t,{store:i}=En(),a=i.useState("open"),{arrowRef:l,side:c,align:u,arrowUncentered:d,arrowStyles:h}=Fp();return ze("div",t,{state:{open:a,side:c,align:u,uncentered:d},ref:[n,l],props:[{style:h,"aria-hidden":!0},s],stateAttributesMapping:$r})});process.env.NODE_ENV!=="production"&&(jp.displayName="PopoverArrow");const US={...$r,...tr},Hp=f.forwardRef(function(t,n){const{className:r,render:o,...s}=t,{store:i}=En(),a=i.useState("open"),l=i.useState("mounted"),c=i.useState("transitionStatus"),u=i.useState("openChangeReason");return ze("div",t,{state:{open:a,transitionStatus:c},ref:[i.context.backdropRef,n],props:[{role:"presentation",hidden:!l,style:{pointerEvents:u===St?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:US})});process.env.NODE_ENV!=="production"&&(Hp.displayName="PopoverBackdrop");const Up=f.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{store:i}=En(),a=It(s.id);return ve(()=>(i.set("titleElementId",a),()=>{i.set("titleElementId",void 0)}),[i,a]),ze("h2",t,{ref:n,props:[{id:a},s]})});process.env.NODE_ENV!=="production"&&(Up.displayName="PopoverTitle");const Gp=f.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{store:i}=En(),a=It(s.id);return ve(()=>(i.set("descriptionElementId",a),()=>{i.set("descriptionElementId",void 0)}),[i,a]),ze("p",t,{ref:n,props:[{id:a},s]})});process.env.NODE_ENV!=="production"&&(Gp.displayName="PopoverDescription");function lr({as:e,children:t,className:n,disabled:r,...o}){const s=e||"button",i=s==="button";return O.jsx(s,{className:da("align-middle inline-flex items-center justify-center transition-all cursor-pointer hover:brightness-110 active:brightness-90 active:scale-90 disabled:cursor-not-allowed disabled:grayscale",n),...i?{disabled:r}:{"aria-disabled":r},...r&&!i?{onClick:a=>{a.preventDefault(),a.stopPropagation()}}:{},...o,children:t})}const GS=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),zS=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),zp=e=>{const t=zS(e);return t.charAt(0).toUpperCase()+t.slice(1)},Yp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),YS=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var ZS={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"};const qS=W.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>W.createElement("svg",{ref:l,...ZS,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Yp("lucide",o),...!s&&!YS(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,u])=>W.createElement(c,u)),...Array.isArray(s)?s:[s]]));const Br=(e,t)=>{const n=W.forwardRef(({className:r,...o},s)=>W.createElement(qS,{ref:s,iconNode:t,className:Yp(`lucide-${GS(zp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=zp(e),n};const _c=Br("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const XS=Br("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const KS=Br("eye-closed",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);const JS=Br("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"}]]);const QS=Br("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const Zp=Br("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function eC(e){return Fn.get("/channel/game/role/mail-captcha",e)}function tC(e){return Fn.get("/channel/game/role/auth",e)}function nC(e){return Fn.post("/passport-api/v2/ztgame/auth/login",{account:e.account,password:e.password,channel_login:1,channel_id:6})}function rC(e){return Fn.post("/passport-api/v2/sms-captchas",{mobile:e.mobile,type:e.type||"register",is_voice:0,nationcode:e.countryCode})}function oC(e){return Fn.post("/passport-api/v2/ztgame/auth/mobile-register",{mobile:e.mobile,captcha:e.captcha,channel_login:1,channel_id:6,nationcode:e.countryCode,ad_id:""})}const sC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAYAAADk3wSdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFJ0lEQVQ4jW2VW4ydVRXHf2tfvu87Z+5znEtnxnLR0pYJatEHWxhBEZUSCE8YESImRnzwQTEEY6KJGrQJXiFGXzAxaowkSkyoIgjYlEqEIIrSS6KmpTPDdJgz55w5t++29/bhjDQFVrKf9lq/rGSt/3/J+v2XExRQgNsKuJbH9QLFKaE4BWqUu6TCvXhGQsajOD6D4BJfQBCuvvaLLE/uhLTN/8PwVlGCxIJZCJ9XYzwYBEIGdLkztBE8d1rvSJWlbSLw/oJy9UZe8AOAGglfNbt4UE2CSkBikASwfKpE6blOncdndtOauAjy3gWM8516wCGiuFGPyT2Mhw+EQvC9wZ+UEAw4UfXZtBU6cZX7Fm+C4IDwBmgAPHdguEGPy1VqSO0MObhewHc9UgC5gAKXKmpbW3fV8i1/8JovsDyzG5ortxK4DpFzwP1A2yAcUpHciwURCLngOgFVBkIOOPBd/qrWir/MrTV/k6nk2N3v/Rx/uHgJmqvfrqb5l3sioBVofTsi18hrDywGqQ46IQBFwHcCRT1QrrmfDjXaP/TrvNRerrIiM/xq98d4bH6ROK3fV3XlV0QU60azajTOGND6R4YIpAqiAsEDVnB1UM30lonQ/t0/G3t4uXkZqxM1TkztpDmUXP7uzVcO2SA3FVrR0hoEOkrRCAFCGDMScUJX3V6lPCEIrqexsb82quVHnji6xJ9PH8Bbtc9G2f4dW42PznbDzc5qerGlnURURMidEPT2sIw5bFTMYVMp94rxEASfyananu6RI0/t49G/f4gdMxu/jExxm/QF1fMURtEdshRKMSo5GZa1OKJlDVSSc1STx4wedi/paomKPMELSfAv9NKY5569jNGk89nIFLeFIAQFISiMC9jCMZzlHJ+cfPn5uem9G6AQBdXkReKoacxw0TDDHhWX4BQqLjY3z4zTaVapVLODIch5YchAHNa7rJ4k1//pit3LRRT9h9a2RCvJJtai7JgbN1ObqOlzqJlzMJxPjF7cZnSkT78V/1Hk/GJLgKBlKyqLfUcX33m0mJu9lLIU4giSGOJ4gjhG2Zn6uxhvk+kqfRvDWPdKc8UrfPgTz+E2R34cUvMwKhAEvOL0Rcud95+pLZw4eeB94N2VGAtRNHjW7qOajBlG+gcb3QXq3XHaZUzFdvfOmY2r5JNnjw39+2/Iz3Z9vGbCDyTORyr94ul/LEbFr+8YhWoLmvJpbDSQqggYPUsSf0TSjYmw0p6nnlnqmWUji8Frp4bzm1eS7PfHf3sJ5eMLjHQtJ/eUPH39GAzNvI2txUdIZ66mtzVwKQGshaHqz00ImsxruqWmkRleS4W1VOvQqBz2OvnJ2aW1B55cXD1BfQqG50fpRbdTn/oG0UQNayC24MIAGllQqiO+FX13pXnp3Sebk5zuaZZ7hvVU86+e5vlMcIWjwDxJmG3i3/5B9PwkageoKWAanAKXDUzCmrMovWRE5V+aH//vcaS8oe+n97/at3ObheLFAtK+h7wCevo6dA10ddsjuxASEAW6UqLNMSR6BpHv4GkaPIjJH1oYXn+onY1E3UJuXE3VPb0tvZ9Cg66A0oNz4FNQMfg20Gkj5lvI+C9Qc8vI1GCJX3d+D6mzlEHy2PhH3lF1B95T8d9ECYQAFBByCH3wLXBnnsWd2QP9Q6CXt+X2Fs6/7Xy5F4oAOyxfQ/sGRfa919NCAX75GVBLmF1AzGBCF8abDp8ARuDVnoJMvo/JSrz/OpIaKJ7CN25Batul4U1AgP8BRjZPP9WeeTQAAAAASUVORK5CYII=";function iC(e){return O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 500 500",...e,children:[O.jsx("path",{fill:"url(#a)",d:"M0 250C0 111.929 111.929 0 250 0s250 111.929 250 250-111.929 250-250 250S0 388.071 0 250Z"}),O.jsx("path",{fill:"#fff",d:"M159.432 341h-33.008V158.949h33.008V341Zm220.263-76.172c0 11.087-1.946 21.286-5.84 30.596-3.808 9.31-9.098 17.35-15.869 24.121-6.771 6.686-14.811 11.934-24.121 15.742-9.31 3.809-19.424 5.713-30.342 5.713h-89.121c-2.369 0-4.57-.423-6.601-1.27-2.031-.846-3.809-1.988-5.332-3.427-1.439-1.524-2.582-3.301-3.428-5.332-.846-2.032-1.27-4.232-1.27-6.602V175.58c0-2.285.424-4.443 1.27-6.475.846-2.031 1.989-3.808 3.428-5.332a16.354 16.354 0 0 1 5.332-3.554c2.031-.847 4.232-1.27 6.601-1.27h89.121c10.918 0 21.032 1.905 30.342 5.713 9.31 3.809 17.35 9.098 24.121 15.869 6.771 6.686 12.061 14.727 15.869 24.121 3.894 9.31 5.84 19.466 5.84 30.469v29.707Zm-33.007-29.707c0-6.432-1.058-12.314-3.174-17.646-2.032-5.332-4.952-9.86-8.76-13.584-3.809-3.809-8.379-6.729-13.711-8.76-5.247-2.116-11.087-3.174-17.52-3.174h-72.744v116.035h72.744c6.433 0 12.273-1.015 17.52-3.047 5.332-2.116 9.902-5.035 13.711-8.759 3.808-3.809 6.728-8.337 8.76-13.584 2.116-5.332 3.174-11.257 3.174-17.774v-29.707Z"}),O.jsx("defs",{children:O.jsxs("linearGradient",{id:"a",x1:250,x2:250,y1:0,y2:500,gradientUnits:"userSpaceOnUse",children:[O.jsx("stop",{stopColor:"#497EFE"}),O.jsx("stop",{offset:1,stopColor:"#947AFA"})]})})]})}function Nc(){const{gameId:e,loginTypes:t,currentLoginType:n,setCurrentLoginType:r}=Po(),o=Qf({loginTypes:t,gameId:e}),s=ep({loginTypes:t,gameId:e}),i=Jf({loginTypes:t,gameId:e}),a=[];return i&&n!==He.GIANT&&a.push({type:He.GIANT,label:"巨人账号",icon:O.jsx("img",{className:"size-4",src:sC})}),s&&n!==He.MOBILE&&a.push({type:He.MOBILE,label:"手机号登录",icon:O.jsx(QS,{className:"size-4"})}),o&&n!==He.ROLE_ID&&a.push({type:He.ROLE_ID,label:"ID 登录",icon:O.jsx(iC,{className:"size-4"})}),a.length?O.jsx("div",{className:"text-gray-500 text-xs flex justify-center items-center gap-2 mb-4",children:a.map((l,c)=>O.jsxs(lr,{className:"h-7 px-3 border rounded-full border-gray-300 gap-1.5",onClick:()=>r(l.type),children:[l.icon,O.jsx("span",{children:l.label})]},l.type))}):null}function aC(e){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 90 90",fill:"currentColor",...e,children:O.jsx("path",{d:"M41.415 1.601c6.427-2.244 13.363 2.04 14.18 8.773.611 5.508-2.959 10.609-8.365 11.833-.408.102-.918.203-1.326.305-.918.204-1.735.409-2.653.613-.306.102-.714.204-1.122.306h-.101c-.816.306-1.633.51-2.448.816-.306.102-.715.306-1.021.408l-2.754 1.223c-.408.103-.714.307-1.02.511-1.224.612-2.346 1.326-3.468 2.142l-.307.306c-.612.409-1.122.919-1.632 1.327-.51.408-1.02.816-1.53 1.326-.408.306-.714.713-1.122 1.02-.408.407-.816.918-1.326 1.428-.306.612-.409 1.224-.612 1.836-.204 1.122-.51 2.143-.714 3.265-.204 1.02-.408 2.04-.51 3.06 0 .611-.103 1.122-.103 1.734v1.632c0 1.02 0 1.938.103 2.958.102 1.02.306 2.143.51 3.163.204.816.408 1.733.612 2.55.204.816.408 1.53.612 2.346.102.306.204.51.408.714.51.612 1.122 1.122 1.632 1.734 1.02.918 2.04 1.836 3.162 2.754.816.612 1.734 1.224 2.55 1.836.51.306.919.612 1.429.918.102 0 .204 0 .204.103.204 0 .306.102.51.204.408.204.714.408 1.122.612.918.408 1.734.714 2.652 1.122.714.204 1.326.51 2.04.714 1.122.306 2.143.612 3.265.918.51.204 1.122.204 1.632 0 .306-.102.51-.102.816-.204.816-.204 1.53-.51 2.346-.714 1.53-.408 2.958-1.02 4.386-1.633h.102c.816-.408 1.735-.815 2.55-1.325.307-.204.714-.408 1.02-.612 1.02-.714 2.04-1.428 3.06-2.244.613-.51 1.123-1.02 1.735-1.53l2.142-2.143c.408-.408.714-.816.816-1.428 0-.102.103-.102.103-.204.306-1.02.611-2.142.815-3.162.306-1.326.612-2.755.714-4.183v-.204c.102-1.224.103-2.448.103-3.672-.102-.816-.102-1.53-.204-2.346 0-.102 0-.204-.102-.205-.918.408-1.735.715-2.55 1.225-1.633.918-3.061 1.938-4.489 3.06-.102.101-.204.102-.306.204-1.02.918-1.938 1.734-2.856 2.652-1.02 1.02-2.041 2.04-2.96 3.162-1.937 2.244-4.487 3.469-7.445 3.673-5.713.306-10.61-3.673-11.324-9.283-.816-5.61 2.959-10.813 8.467-11.935a52.639 52.639 0 0 0 7.856-2.142h.101c.816-.408 1.734-.715 2.55-1.122 3.264-1.53 6.121-3.672 8.773-6.12 1.327-1.327 2.652-2.653 3.876-4.082 2.347-2.55 5.305-3.774 8.773-3.57 5.1.306 9.283 4.285 9.895 9.283.204 1.53.102 3.06-.408 4.489-.612 1.938-1.224 3.876-1.734 5.916-.102 1.02-.408 1.939-.51 2.958-.408 2.449-.51 4.795-.306 7.141v.306c.102.816.204 1.53.306 2.347a46.28 46.28 0 0 0 1.224 5.406c.102 0 .102.102.102.204.51 1.632 1.224 3.264 1.224 4.794.306 3.162-.51 5.917-2.55 8.365-1.632 1.938-3.774 3.06-6.223 3.57-1.734.408-3.57.817-5.304 1.326-.102.102-.204.102-.306.102-1.836.612-3.775 1.326-5.509 2.244h-.101c-.918.408-1.735.919-2.551 1.429-.306.204-.714.51-1.02.714a30.738 30.738 0 0 0-2.856 2.244c-.816.714-1.633 1.53-2.347 2.244a.22.22 0 0 1-.204.204c-.918.918-1.734 1.836-2.55 2.754-2.346 2.55-5.202 3.877-8.67 3.775-3.06-.102-5.61-1.428-7.651-3.672-1.428-1.633-2.958-3.163-4.488-4.591v-.102c-.51-.408-1.02-.918-1.53-1.326-.715-.612-1.53-1.122-2.245-1.734l-1.53-.918c-.612-.306-1.122-.612-1.734-.918l-2.754-1.225c-1.326-.612-2.653-1.02-4.081-1.428-1.326-.407-2.652-.714-3.978-1.02a11.146 11.146 0 0 1-3.673-1.224c-3.264-1.734-5.1-4.489-5.61-8.16-.204-1.633 0-3.265.51-4.795.816-2.244 1.428-4.59 1.938-6.936.102-.102.102-.103.102-.204.102-.715.204-1.531.306-2.347.102-.714.205-1.428.205-2.142V43.63l-.087-.956a39.328 39.328 0 0 0-1.24-6.695c-.102-.102-.102-.205-.102-.306-.51-1.734-1.224-3.469-1.53-5.203-1.122-5.712 2.55-11.22 8.263-12.445.714-.204 1.53-.306 2.244-.51 1.224-.306 2.55-.612 3.775-1.02 1.224-.408 2.448-.816 3.672-1.326l1.223-.612c.918-.408 1.837-.918 2.755-1.428 1.122-.714 2.244-1.53 3.366-2.346.408-.306.715-.612 1.122-.918.408-.408.918-.918 1.428-1.326a40.49 40.49 0 0 0 2.96-2.96c1.53-1.835 3.161-3.16 5.405-3.977Z"})})}function cC(e){return O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",fill:"currentColor",...e,children:O.jsx("path",{d:"M842.667 384H768V277.333a234.667 234.667 0 1 0-469.333 0V384H224a53.393 53.393 0 0 0-53.333 53.333V928A53.393 53.393 0 0 0 224 981.333h618.667A53.393 53.393 0 0 0 896 928V437.333A53.393 53.393 0 0 0 842.667 384zm-288 295.007v110.326a21.333 21.333 0 0 1-42.667 0V679.007a64 64 0 1 1 42.667 0zM725.333 384h-384V277.333c0-105.866 86.134-192 192-192s192 86.134 192 192z"})})}function qp({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=f.useRef(e!==void 0),[s,i]=f.useState(t),a=o?e:s;if(process.env.NODE_ENV!=="production"){f.useEffect(()=>{o!==(e!==void 0)&&console.error([`Base UI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
31
- `))},[r,n,e]);const{current:c}=f.useRef(t);f.useEffect(()=>{!o&&!Object.is(c,t)&&console.error([`Base UI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
32
- `))},[JSON.stringify(t)])}const l=f.useCallback(c=>{o||i(c)},[]);return[a,l]}const Xp={};function Wr(e,t){const n=f.useRef(Xp);return n.current===Xp&&(n.current=e(t)),n}const Ac=f[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],lC=Ac&&Ac!==f.useLayoutEffect?Ac:e=>e();function qe(e){const t=Wr(uC).current;return t.next=e,lC(t.effect),t.trampoline}function uC(){const e={next:void 0,callback:dC,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function dC(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const Ue=typeof document<"u"?f.useLayoutEffect:()=>{};function fC(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function jr(e,t,n,r){const o=Wr(Kp).current;return hC(o,e,t,n,r)&&Jp(o,[e,t,n,r]),o.callback}function pC(e){const t=Wr(Kp).current;return mC(t,e)&&Jp(t,e),t.callback}function Kp(){return{callback:null,cleanup:null,refs:[]}}function hC(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function mC(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Jp(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}function gC(e,t){return typeof e=="function"?e(t):e}const vC=parseInt(f.version,10);function Qp(e){return vC>=e}function eh(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Ao={};function ti(e,t,n,r,o){let s={...Dc(e,Ao)};return t&&(s=ni(s,t)),n&&(s=ni(s,n)),r&&(s=ni(s,r)),s}function yC(e){if(e.length===0)return Ao;if(e.length===1)return Dc(e[0],Ao);let t={...Dc(e[0],Ao)};for(let n=1;n<e.length;n+=1)t=ni(t,e[n]);return t}function ni(e,t){return th(t)?t(e):bC(e,t)}function bC(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=eh(e.style,r);break}case"className":{e[n]=nh(e.className,r);break}default:wC(n,r)?e[n]=EC(e[n],r):e[n]=r}}return e}function wC(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function th(e){return typeof e=="function"}function Dc(e,t){return th(e)?e(t):e??Ao}function EC(e,t){return t?e?n=>{if(xC(n)){const o=n;Mc(o);const s=t(o);return o.baseUIHandlerPrevented||e?.(o),s}const r=t(n);return e?.(n),r}:t:e}function Mc(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function nh(e,t){return t?e?t+" "+e:t:e}function xC(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const SC=500,CC={style:{transition:"none"}},Wn={},TC={fallbackAxisSide:"end"};function _t(e,t,n={}){const r=t.render,o=OC(t,n);if(n.enabled===!1)return null;const s=n.state??Wn;return kC(e,r,o,s)}function OC(e,t={}){const{className:n,render:r}=e,{state:o=Wn,ref:s,props:i,disableStyleHooks:a,customStyleHookMapping:l,enabled:c=!0}=t,u=c?gC(n,o):void 0;let d;a!==!0&&(d=f.useMemo(()=>c?fC(o,l):Wn,[o,l,c]));const h=c?eh(d,Array.isArray(i)?yC(i):i)??Wn:Wn;return typeof document<"u"&&(c?Array.isArray(s)?h.ref=pC([h.ref,rh(r),...s]):h.ref=jr(h.ref,rh(r),s):jr(null,null)),c?(u!==void 0&&(h.className=nh(h.className,u)),h):Wn}function kC(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const o=ti(n,t.props);return o.ref=n.ref,f.cloneElement(t,o)}if(e&&typeof e=="string")return RC(e,n);throw new Error("Base UI: Render element or function are not defined.")}function RC(e,t){return e==="button"?O.jsx("button",{type:"button",...t}):e==="img"?O.jsx("img",{alt:"",...t}):f.createElement(e,t)}function rh(e){return e&&typeof e!="function"?Qp(19)?e.props.ref:e.ref:null}function ri(){return typeof window<"u"}function jn(e){return oh(e)?(e.nodeName||"").toLowerCase():"#document"}function vt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function sn(e){var t;return(t=(oh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function oh(e){return ri()?e instanceof Node||e instanceof vt(e).Node:!1}function We(e){return ri()?e instanceof Element||e instanceof vt(e).Element:!1}function dt(e){return ri()?e instanceof HTMLElement||e instanceof vt(e).HTMLElement:!1}function Lc(e){return!ri()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vt(e).ShadowRoot}const PC=new Set(["inline","contents"]);function Do(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Vt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!PC.has(o)}const IC=new Set(["table","td","th"]);function _C(e){return IC.has(jn(e))}const NC=[":popover-open",":modal"];function oi(e){return NC.some(t=>{try{return e.matches(t)}catch{return!1}})}const AC=["transform","translate","scale","rotate","perspective"],DC=["transform","translate","scale","rotate","perspective","filter"],MC=["paint","layout","strict","content"];function $c(e){const t=si(),n=We(e)?Vt(e):e;return AC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||DC.some(r=>(n.willChange||"").includes(r))||MC.some(r=>(n.contain||"").includes(r))}function LC(e){let t=Sn(e);for(;dt(t)&&!xn(t);){if($c(t))return t;if(oi(t))return null;t=Sn(t)}return null}function si(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const $C=new Set(["html","body","#document"]);function xn(e){return $C.has(jn(e))}function Vt(e){return vt(e).getComputedStyle(e)}function ii(e){return We(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sn(e){if(jn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lc(e)&&e.host||sn(e);return Lc(t)?t.host:t}function sh(e){const t=Sn(e);return xn(t)?e.ownerDocument?e.ownerDocument.body:e.body:dt(t)&&Do(t)?t:sh(t)}function Hn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=sh(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=vt(o);if(s){const a=Fc(i);return t.concat(i,i.visualViewport||[],Do(o)?o:[],a&&n?Hn(a):[])}return t.concat(o,Hn(o,[],n))}function Fc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Mo=typeof navigator<"u",Vc=WC(),ih=HC(),ah=jC(),ch=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),FC=Vc.platform==="MacIntel"&&Vc.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Vc.platform),VC=Mo&&/apple/i.test(navigator.vendor),Bc=Mo&&/android/i.test(ih)||/android/i.test(ah);Mo&&ih.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const BC=ah.includes("jsdom/");function WC(){if(typeof navigator>"u")return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints}}function jC(){if(!Mo)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function HC(){if(!Mo)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform}const Wc="data-base-ui-focusable",lh="active",uh="selected",UC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Hr(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function ft(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function an(e){return"composedPath"in e?e.composedPath()[0]:e.target}function jc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function GC(e){return e.matches("html,body")}function Je(e){return e?.ownerDocument||document}function zC(e){return dt(e)&&e.matches(UC)}function dh(e){return e?e.getAttribute("role")==="combobox"&&zC(e):!1}function Hc(e){return e?e.hasAttribute(Wc)?e:e.querySelector(`[${Wc}]`)||e:null}function ur(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...ur(e,o.id,n)])}function fh(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Uc(e){e.preventDefault(),e.stopPropagation()}function YC(e){return"nativeEvent"in e}function ZC(e){return e.mozInputSource===0&&e.isTrusted?!0:Bc&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function qC(e){return BC?!1:!Bc&&e.width===0&&e.height===0||Bc&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Lo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}const XC=["top","right","bottom","left"],Un=Math.min,Nt=Math.max,ai=Math.round,ci=Math.floor,cn=e=>({x:e,y:e}),KC={left:"right",right:"left",bottom:"top",top:"bottom"},JC={start:"end",end:"start"};function Gc(e,t,n){return Nt(e,Un(t,n))}function Cn(e,t){return typeof e=="function"?e(t):e}function Bt(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function zc(e){return e==="x"?"y":"x"}function Yc(e){return e==="y"?"height":"width"}const QC=new Set(["top","bottom"]);function Zt(e){return QC.has(Bt(e))?"y":"x"}function Zc(e){return zc(Zt(e))}function eT(e,t,n){n===void 0&&(n=!1);const r=Gn(e),o=Zc(e),s=Yc(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=li(i)),[i,li(i)]}function tT(e){const t=li(e);return[qc(e),t,qc(t)]}function qc(e){return e.replace(/start|end/g,t=>JC[t])}const ph=["left","right"],hh=["right","left"],nT=["top","bottom"],rT=["bottom","top"];function oT(e,t,n){switch(e){case"top":case"bottom":return n?t?hh:ph:t?ph:hh;case"left":case"right":return t?nT:rT;default:return[]}}function sT(e,t,n,r){const o=Gn(e);let s=oT(Bt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(qc)))),s}function li(e){return e.replace(/left|right|bottom|top/g,t=>KC[t])}function iT(e){return{top:0,right:0,bottom:0,left:0,...e}}function mh(e){return typeof e!="number"?iT(e):{top:e,right:e,bottom:e,left:e}}function ui(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}}var aT=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],di=aT.join(","),gh=typeof Element>"u",Ur=gh?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fi=!gh&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},pi=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&e(t.parentNode);return i},cT=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},vh=function(t,n,r){if(pi(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(di));return n&&Ur.call(t,di)&&o.unshift(t),o=o.filter(r),o},yh=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!pi(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Ur.call(i,di);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var d=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),h=!pi(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(d&&h){var p=e(d===!0?i.children:d.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},bh=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wh=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||cT(t))&&!bh(t)?0:t.tabIndex},lT=function(t,n){var r=wh(t);return r<0&&n&&!bh(t)?0:r},uT=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Eh=function(t){return t.tagName==="INPUT"},dT=function(t){return Eh(t)&&t.type==="hidden"},fT=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},pT=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},hT=function(t){if(!t.name)return!0;var n=t.form||fi(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=pT(o,t.form);return!s||s===t},mT=function(t){return Eh(t)&&t.type==="radio"},gT=function(t){return mT(t)&&!hT(t)},vT=function(t){var n,r=t&&fi(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,d;r=fi(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(o))}}return s},xh=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},yT=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ur.call(t,"details>summary:first-of-type"),i=s?t.parentElement:t;if(Ur.call(i,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=fi(t);if(l&&!l.shadowRoot&&o(l)===!0)return xh(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(vT(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xh(t);return!1},bT=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ur.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Xc=function(t,n){return!(n.disabled||pi(n)||dT(n)||yT(n,t)||fT(n)||bT(n))},Kc=function(t,n){return!(gT(n)||wh(n)<0||!Xc(t,n))},wT=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},ET=function e(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=lT(a,i),c=i?e(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(uT).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},hi=function(t,n){n=n||{};var r;return n.getShadowRoot?r=yh([t],n.includeContainer,{filter:Kc.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:wT}):r=vh(t,n.includeContainer,Kc.bind(null,n)),ET(r)},xT=function(t,n){n=n||{};var r;return n.getShadowRoot?r=yh([t],n.includeContainer,{filter:Xc.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=vh(t,n.includeContainer,Xc.bind(null,n)),r},Sh=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ur.call(t,di)===!1?!1:Kc(n,t)};const $o=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ch(e,t){const n=hi(e,$o()),r=n.length;if(r===0)return;const o=Hr(Je(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function Th(e){return Ch(Je(e).body,1)||e}function Oh(e){return Ch(Je(e).body,-1)||e}function Fo(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function ST(e){hi(e,$o()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kh(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Rh="ArrowUp",Ph="ArrowDown",Ih="ArrowLeft",_h="ArrowRight",Nh="Home",Ah="End",CT=new Set([Ih,_h]),TT=new Set([Rh,Ph]),OT=new Set([...CT,...TT]);[...OT];const kT=new Set([Rh,Ph,Ih,_h,Nh,Ah]),Dh=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Dh.displayName="DirectionContext");function RT(e=!0){const t=f.useContext(Dh);if(t===void 0&&!e)throw new Error("Base UI: DirectionContext is missing.");return t?.direction??"ltr"}const PT={...f};let Mh=0;function IT(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(Mh+=1,r(`${t}-${Mh}`))},[n,t]),o}const Lh=PT.useId;function Vo(e,t){if(Lh!==void 0){const n=Lh();return e??(t?`${t}-${n}`:n)}return IT(e,t)}function mi(e){return Vo(e,"base-ui")}const _T=[];function $h(e){f.useEffect(e,_T)}const Bo=0;class dr{static create(){return new dr}currentId=Bo;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Bo,n()},t)}isStarted(){return this.currentId!==Bo}clear=()=>{this.currentId!==Bo&&(clearTimeout(this.currentId),this.currentId=Bo)};disposeEffect=()=>this.clear}function Wo(){const e=Wr(dr.create).current;return $h(e.disposeEffect),e}const gi=null;let Fh=globalThis.requestAnimationFrame;class NT{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV==="test"&&Fh!==requestAnimationFrame&&(Fh=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const vi=new NT;class ln{static create(){return new ln}static request(t){return vi.request(t)}static cancel(t){return vi.cancel(t)}currentId=gi;request(t){this.cancel(),this.currentId=vi.request(()=>{this.currentId=gi,t()})}cancel=()=>{this.currentId!==gi&&(vi.cancel(this.currentId),this.currentId=gi)};disposeEffect=()=>this.cancel}function Vh(){const e=Wr(ln.create).current;return $h(e.disposeEffect),e}function AT(e,t=!1){const n=Vh(),r=Wo();return qe((o,s=null)=>{n.cancel(),r.clear();const i=e.current;i&&(typeof i.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?o():n.request(()=>{function a(){i&&Promise.allSettled(i.getAnimations().map(l=>l.finished)).then(()=>{s!=null&&s.aborted||lt.flushSync(o)})}t?r.start(0,a):a()}))})}function Bh(e,t=!1,n=!1){const[r,o]=f.useState(e&&t?"idle":void 0),[s,i]=f.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),Ue(()=>{if(!e&&s&&r!=="ending"&&n){const a=ln.request(()=>{o("ending")});return()=>{ln.cancel(a)}}},[e,s,r,n]),Ue(()=>{if(!e||t)return;const a=ln.request(()=>{lt.flushSync(()=>{o(void 0)})});return()=>{ln.cancel(a)}},[t,e]),Ue(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=ln.request(()=>{o("idle")});return()=>{ln.cancel(a)}},[t,e,s,o,r]),f.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}let yi=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const DT={[yi.startingStyle]:""},MT={[yi.endingStyle]:""},bi={transitionStatus(e){return e==="starting"?DT:e==="ending"?MT:null}},Wh=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Wh.displayName="CompositeRootContext");function LT(e=!1){const t=f.useContext(Wh);if(t===void 0&&!e)throw new Error("Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.");return t}function $T(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:f.useMemo(()=>{const c={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=o,!s&&n&&(c.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||a)&&(c.disabled=n),c},[r,n,t,i,a,s,o])}}function Jc(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0}=e,s=f.useRef(null),i=LT(!0)!==void 0,a=qe(()=>{const u=s.current;return!!(u?.tagName==="A"&&u?.href)}),{props:l}=$T({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:r,isNativeButton:o});return Ue(()=>{const u=s.current;u instanceof HTMLButtonElement&&i&&t&&l.disabled===void 0&&u.disabled&&(u.disabled=!1)},[t,l.disabled,i]),{getButtonProps:f.useCallback((u={})=>{const{onClick:d,onMouseDown:h,onKeyUp:p,onKeyDown:g,onPointerDown:m,...v}=u;return ti({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}d?.(b)},onMouseDown(b){t||h?.(b)},onKeyDown(b){t||(Mc(b),g?.(b)),!b.baseUIHandlerPrevented&&b.target===b.currentTarget&&!o&&!a()&&b.key==="Enter"&&!t&&(d?.(b),b.preventDefault())},onKeyUp(b){t||(Mc(b),p?.(b)),!b.baseUIHandlerPrevented&&b.target===b.currentTarget&&!o&&!t&&b.key===" "&&d?.(b)},onPointerDown(b){if(t){b.preventDefault();return}m?.(b)}},o?void 0:{role:"button"},l,v)},[t,l,o,a]),buttonRef:s}}function qt(e){const t=Wr(FT,e).current;return t.next=e,Ue(t.effect),t}function FT(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function wi(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=qt(n),i=qe(o),a=AT(r,n);f.useEffect(()=>{t&&a(()=>{n===s.current&&i()})},[t,n,i,a,s])}const Ei=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ei.displayName="DialogContext");let fr=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=yi.startingStyle]="startingStyle",e[e.endingStyle=yi.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e})({}),Qc=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const VT={[Qc.popupOpen]:""},BT={[Qc.popupOpen]:"",[Qc.pressed]:""},WT={[fr.open]:""},jT={[fr.closed]:""},HT={[fr.anchorHidden]:""},jh={open(e){return e?VT:null}},UT={open(e){return e?BT:null}},Gr={open(e){return e?WT:jT},anchorHidden(e){return e?HT:null}};function GT(e){const{open:t,setOpen:n,disabled:r,nativeButton:o}=e,s=qe(c=>{t&&n(!1,c.nativeEvent,"close-press")}),{getButtonProps:i,buttonRef:a}=Jc({disabled:r,native:o});return{getRootProps:c=>ti({onClick:s},c,i),ref:a}}function Hh(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}const el=f.createContext(null);process.env.NODE_ENV!=="production"&&(el.displayName="FloatingNodeContext");const tl=f.createContext(null);process.env.NODE_ENV!=="production"&&(tl.displayName="FloatingTreeContext");const jo=()=>f.useContext(el)?.id||null,Ho=()=>f.useContext(tl);function zT(e){const t=Vo(),n=Ho(),o=jo();return Ue(()=>{if(!t)return;const s={id:t,parentId:o};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,t,o]),t}function YT(e){const{children:t,id:n}=e,r=jo();return O.jsx(el.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ZT(e){const{children:t}=e,n=f.useRef([]),r=f.useCallback(i=>{n.current=[...n.current,i]},[]),o=f.useCallback(i=>{n.current=n.current.filter(a=>a!==i)},[]),[s]=f.useState(()=>Hh());return O.jsx(tl.Provider,{value:f.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:s}),[r,o,s]),children:t})}function Uo(e){return`data-base-ui-${e}`}const Uh=Uo("safe-polygon");function nl(e,t,n){if(n&&!Lo(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function rl(e){return typeof e=="function"?e():e}function qT(e,t={}){const{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:d=0,move:h=!0}=t,p=Ho(),g=jo(),m=qt(c),v=qt(l),y=qt(n),b=qt(d),E=f.useRef(void 0),x=Wo(),w=f.useRef(void 0),T=Wo(),S=f.useRef(!0),I=f.useRef(!1),A=f.useRef(()=>{}),L=f.useRef(!1),M=qe(()=>{const D=o.current.openEvent?.type;return D?.includes("mouse")&&D!=="mousedown"});f.useEffect(()=>{if(!a)return;function D({open:k}){k||(x.clear(),T.clear(),S.current=!0,L.current=!1)}return s.on("openchange",D),()=>{s.off("openchange",D)}},[a,s,x,T]),f.useEffect(()=>{if(!a||!m.current||!n)return;function D($){M()&&r(!1,$,"hover")}const k=Je(i.floating).documentElement;return k.addEventListener("mouseleave",D),()=>{k.removeEventListener("mouseleave",D)}},[i.floating,n,r,a,m,M]);const N=f.useCallback((D,k=!0,$="hover")=>{const F=nl(v.current,"close",E.current);F&&!w.current?x.start(F,()=>r(!1,D,$)):k&&(x.clear(),r(!1,D,$))},[v,r,x]),R=qe(()=>{A.current(),w.current=void 0}),P=qe(()=>{if(I.current){const D=Je(i.floating).body;D.style.pointerEvents="",D.removeAttribute(Uh),I.current=!1}}),C=qe(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);f.useEffect(()=>{if(!a)return;function D(V){if(x.clear(),S.current=!1,u&&!Lo(E.current)||rl(b.current)>0&&!nl(v.current,"open"))return;const Y=nl(v.current,"open",E.current);Y?x.start(Y,()=>{y.current||r(!0,V,"hover")}):n||r(!0,V,"hover")}function k(V){if(C()){P();return}A.current();const Y=Je(i.floating);if(T.clear(),L.current=!1,m.current&&o.current.floatingContext){n||x.clear(),w.current=m.current({...o.current.floatingContext,tree:p,x:V.clientX,y:V.clientY,onClose(){P(),R(),C()||N(V,!0,"safe-polygon")}});const X=w.current;Y.addEventListener("mousemove",X),A.current=()=>{Y.removeEventListener("mousemove",X)};return}(E.current!=="touch"||!ft(i.floating,V.relatedTarget))&&N(V)}function $(V){C()||o.current.floatingContext&&m.current?.({...o.current.floatingContext,tree:p,x:V.clientX,y:V.clientY,onClose(){P(),R(),C()||N(V)}})(V)}function F(){x.clear()}function j(V){C()||N(V,!1)}if(We(i.domReference)){const V=i.domReference,Y=i.floating;return n&&V.addEventListener("mouseleave",$),h&&V.addEventListener("mousemove",D,{once:!0}),V.addEventListener("mouseenter",D),V.addEventListener("mouseleave",k),Y&&(Y.addEventListener("mouseleave",$),Y.addEventListener("mouseenter",F),Y.addEventListener("mouseleave",j)),()=>{n&&V.removeEventListener("mouseleave",$),h&&V.removeEventListener("mousemove",D),V.removeEventListener("mouseenter",D),V.removeEventListener("mouseleave",k),Y&&(Y.removeEventListener("mouseleave",$),Y.removeEventListener("mouseenter",F),Y.removeEventListener("mouseleave",j))}}},[i,a,e,u,h,N,R,P,r,n,y,p,v,m,o,C,b,x,T]),Ue(()=>{if(a&&n&&m.current?.__options?.blockPointerEvents&&M()){I.current=!0;const D=i.floating;if(We(i.domReference)&&D){const k=Je(i.floating).body;k.setAttribute(Uh,"");const $=i.domReference,F=p?.nodesRef.current.find(j=>j.id===g)?.context?.elements.floating;return F&&(F.style.pointerEvents=""),k.style.pointerEvents="none",$.style.pointerEvents="auto",D.style.pointerEvents="auto",()=>{k.style.pointerEvents="",$.style.pointerEvents="",D.style.pointerEvents=""}}}},[a,n,g,i,p,m,M]),Ue(()=>{n||(E.current=void 0,L.current=!1,R(),P())},[n,R,P]),f.useEffect(()=>()=>{R(),x.clear(),T.clear(),P()},[a,i.domReference,R,P,x,T]);const _=f.useMemo(()=>{function D(k){E.current=k.pointerType}return{onPointerDown:D,onPointerEnter:D,onMouseMove(k){const{nativeEvent:$}=k;function F(){!S.current&&!y.current&&r(!0,$,"hover")}u&&!Lo(E.current)||n||rl(b.current)===0||L.current&&k.movementX**2+k.movementY**2<2||(T.clear(),E.current==="touch"?F():(L.current=!0,T.start(rl(b.current),F)))}}},[u,r,n,y,b,T]);return f.useMemo(()=>a?{reference:_}:{},[a,_])}const xi={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1},Go=f.forwardRef(function(t,n){const[r,o]=f.useState();Ue(()=>{VC&&o("button")},[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,style:xi};return O.jsx("span",{...t,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Go.displayName="FocusGuard");let Gh=0;function zr(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Gh);const s=()=>e?.focus({preventScroll:n});o?s():Gh=requestAnimationFrame(s)}const Yr={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function zh(e){return e==="inert"?Yr.inert:e==="aria-hidden"?Yr["aria-hidden"]:Yr.none}let Si=new WeakSet,Ci={},ol=0;const XT=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Yh=e=>e&&(e.host||Yh(e.parentNode)),KT=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Yh(n);return e.contains(r)?r:null}).filter(n=>n!=null);function JT(e,t,n,r){const o="data-base-ui-inert",s=r?"inert":n?"aria-hidden":null,i=KT(t,e),a=new Set,l=new Set(i),c=[];Ci[o]||(Ci[o]=new WeakMap);const u=Ci[o];i.forEach(d),h(t),a.clear();function d(p){!p||a.has(p)||(a.add(p),p.parentNode&&d(p.parentNode))}function h(p){!p||l.has(p)||[].forEach.call(p.children,g=>{if(jn(g)!=="script")if(a.has(g))h(g);else{const m=s?g.getAttribute(s):null,v=m!==null&&m!=="false",y=zh(s),b=(y.get(g)||0)+1,E=(u.get(g)||0)+1;y.set(g,b),u.set(g,E),c.push(g),b===1&&v&&Si.add(g),E===1&&g.setAttribute(o,""),!v&&s&&g.setAttribute(s,s==="inert"?"":"true")}})}return ol+=1,()=>{c.forEach(p=>{const g=zh(s),v=(g.get(p)||0)-1,y=(u.get(p)||0)-1;g.set(p,v),u.set(p,y),v||(!Si.has(p)&&s&&p.removeAttribute(s),Si.delete(p)),y||p.removeAttribute(o)}),ol-=1,ol||(Yr.inert=new WeakMap,Yr["aria-hidden"]=new WeakMap,Yr.none=new WeakMap,Si=new WeakSet,Ci={})}}function Zh(e,t=!1,n=!1){const r=Je(e[0]).body;return JT(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const sl=f.createContext(null);process.env.NODE_ENV!=="production"&&(sl.displayName="PortalContext");const qh=()=>f.useContext(sl),Xh=Uo("portal");function QT(e={}){const{id:t,root:n}=e,r=Vo(),o=qh(),[s,i]=f.useState(null),a=f.useRef(null);return Ue(()=>()=>{s?.remove(),queueMicrotask(()=>{a.current=null})},[s]),Ue(()=>{if(!r||a.current)return;const l=t?document.getElementById(t):null;if(!l)return;const c=document.createElement("div");c.id=r,c.setAttribute(Xh,""),l.appendChild(c),a.current=c,i(c)},[t,r]),Ue(()=>{if(n===null||!r||a.current)return;let l=n||o?.portalNode;l&&!We(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));const u=document.createElement("div");u.id=r,u.setAttribute(Xh,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function Kh(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=QT({id:n,root:r}),[i,a]=f.useState(null),l=f.useRef(null),c=f.useRef(null),u=f.useRef(null),d=f.useRef(null),h=i?.modal,p=i?.open,g=!!i&&!i.modal&&i.open&&o&&!!(r||s);return f.useEffect(()=>{if(!s||!o||h)return;function m(v){s&&Fo(v)&&(v.type==="focusin"?kh:ST)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,h]),f.useEffect(()=>{s&&(p||kh(s))},[p,s]),O.jsxs(sl.Provider,{value:f.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[o,s]),children:[g&&s&&O.jsx(Go,{"data-type":"outside",ref:l,onFocus:m=>{if(Fo(m,s))u.current?.focus();else{const v=i?i.domReference:null;Oh(v)?.focus()}}}),g&&s&&O.jsx("span",{"aria-owns":s.id,style:xi}),s&&lt.createPortal(t,s),g&&s&&O.jsx(Go,{"data-type":"outside",ref:c,onFocus:m=>{if(Fo(m,s))d.current?.focus();else{const v=i?i.domReference:null;Th(v)?.focus(),i?.closeOnFocusOut&&i?.onOpenChange(!1,m.nativeEvent,"focus-out")}}})]})}const Jh=20;let pr=[];function eO(e){pr=pr.filter(t=>t.isConnected),e&&jn(e)!=="body"&&(pr.push(e),pr.length>Jh&&(pr=pr.slice(-Jh)))}function Qh(){return pr.slice().reverse().find(e=>e.isConnected)}function tO(e){const t=$o();return Sh(e,t)?e:hi(e,t)[0]||e}function em(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=$o(),o=xT(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return Sh(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const tm=f.forwardRef(function(t,n){return O.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:xi})});process.env.NODE_ENV!=="production"&&(tm.displayName="VisuallyHiddenDismiss");function nm(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:d=!0,outsideElementsInert:h=!1,getInsideElements:p=()=>[]}=e,{open:g,onOpenChange:m,events:v,dataRef:y,elements:{domReference:b,floating:E}}=t,x=qe(()=>y.current.floatingContext?.nodeId),w=qe(p),T=typeof i=="number"&&i<0,S=dh(b)&&T,I=XT(),A=I?s:!0,L=!A||I&&h,M=qt(o),N=qt(i),R=qt(a),P=Ho(),C=qh(),_=f.useRef(null),D=f.useRef(null),k=f.useRef(!1),$=f.useRef(!1),F=f.useRef(-1),j=C!=null,V=Hc(E),Y=qe((ee=V)=>ee?hi(ee,$o()):[]),q=qe(ee=>{const le=Y(ee);return M.current.map(K=>b&&K==="reference"?b:V&&K==="floating"?V:le).filter(Boolean).flat()});f.useEffect(()=>{if(r||!c)return;function ee(K){if(K.key==="Tab"){ft(V,Hr(Je(V)))&&Y().length===0&&!S&&Uc(K);const G=q(),de=an(K);M.current[0]==="reference"&&de===b&&(Uc(K),K.shiftKey?zr(G[G.length-1]):zr(G[1])),M.current[1]==="floating"&&de===V&&K.shiftKey&&(Uc(K),zr(G[0]))}}const le=Je(V);return le.addEventListener("keydown",ee),()=>{le.removeEventListener("keydown",ee)}},[r,b,V,c,M,S,Y,q]),f.useEffect(()=>{if(r||!E)return;function ee(le){const K=an(le),de=Y().indexOf(K);de!==-1&&(F.current=de)}return E.addEventListener("focusin",ee),()=>{E.removeEventListener("focusin",ee)}},[r,E,Y]),f.useEffect(()=>{if(r||!d)return;function ee(){$.current=!0,setTimeout(()=>{$.current=!1})}function le(K){const G=K.relatedTarget,de=K.currentTarget,fe=an(K);queueMicrotask(()=>{const oe=x(),ue=!(ft(b,G)||ft(E,G)||ft(G,E)||ft(C?.portalNode,G)||G?.hasAttribute(Uo("focus-guard"))||P&&(ur(P.nodesRef.current,oe).find(te=>ft(te.context?.elements.floating,G)||ft(te.context?.elements.domReference,G))||fh(P.nodesRef.current,oe).find(te=>[te.context?.elements.floating,Hc(te.context?.elements.floating)].includes(G)||te.context?.elements.domReference===G)));if(de===b&&V&&em(V,M),l&&de!==b&&!fe?.isConnected&&Hr(Je(V))===Je(V).body){dt(V)&&V.focus();const te=F.current,z=Y(),B=z[te]||z[z.length-1]||V;dt(B)&&B.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(S||!c)&&G&&ue&&!$.current&&G!==Qh()&&(k.current=!0,m(!1,K,"focus-out"))})}if(E&&dt(b))return b.addEventListener("focusout",le),b.addEventListener("pointerdown",ee),E.addEventListener("focusout",le),()=>{b.removeEventListener("focusout",le),b.removeEventListener("pointerdown",ee),E.removeEventListener("focusout",le)}},[r,b,E,V,c,P,C,m,d,l,Y,S,x,M,y]);const X=f.useRef(null),U=f.useRef(null),H=jr(X,C?.beforeInsideRef),Z=jr(U,C?.afterInsideRef);f.useEffect(()=>{if(r||!E)return;const ee=Array.from(C?.portalNode?.querySelectorAll(`[${Uo("portal")}]`)||[]),le=P?fh(P.nodesRef.current,x()):[],K=P&&!c?le.map(oe=>oe.context?.elements.floating):[],G=le.find(oe=>dh(oe.context?.elements.domReference||null))?.context?.elements.domReference,de=[E,G,...ee,...K,...w(),_.current,D.current,X.current,U.current,C?.beforeOutsideRef.current,C?.afterOutsideRef.current,M.current.includes("reference")||S?b:null].filter(oe=>oe!=null),fe=c||S?Zh(de,!L,L):Zh(de);return()=>{fe()}},[r,b,E,c,M,C,S,A,L,P,x,w]),Ue(()=>{if(r||!dt(V))return;const ee=Je(V),le=Hr(ee);queueMicrotask(()=>{const K=q(V),G=N.current,de=(typeof G=="number"?K[G]:G.current)||V,fe=ft(V,le);!T&&!fe&&g&&zr(de,{preventScroll:de===V})})},[r,g,V,T,q,N]),Ue(()=>{if(r||!V)return;const ee=Je(V),le=Hr(ee);eO(le);function K({reason:fe,event:oe,nested:ue}){if(["hover","safe-polygon"].includes(fe)&&oe.type==="mouseleave"&&(k.current=!0),fe==="outside-press")if(ue)k.current=!1;else if(ZC(oe)||qC(oe))k.current=!1;else{let te=!1;document.createElement("div").focus({get preventScroll(){return te=!0,!1}}),te?k.current=!1:k.current=!0}}v.on("openchange",K);const G=ee.createElement("span");G.setAttribute("tabindex","-1"),G.setAttribute("aria-hidden","true"),Object.assign(G.style,xi),j&&b&&b.insertAdjacentElement("afterend",G);function de(){if(typeof R.current=="boolean"){const fe=b||Qh();return fe&&fe.isConnected?fe:G}return R.current.current||G}return()=>{v.off("openchange",K);const fe=Hr(ee),oe=ft(E,fe)||P&&ur(P.nodesRef.current,x(),!1).some(te=>ft(te.context?.elements.floating,fe)),ue=de();queueMicrotask(()=>{const te=tO(ue);R.current&&!k.current&&dt(te)&&(!(te!==fe&&fe!==ee.body)||oe)&&te.focus({preventScroll:!0}),G.remove()})}},[r,E,V,R,y,v,P,j,b,x]),f.useEffect(()=>{queueMicrotask(()=>{k.current=!1})},[r]),Ue(()=>{if(!r&&C)return C.setFocusManagerState({modal:c,closeOnFocusOut:d,open:g,onOpenChange:m,domReference:b}),()=>{C.setFocusManagerState(null)}},[r,C,c,g,m,d,b]),Ue(()=>{r||V&&em(V,M)},[r,V,M]);function re(ee){return r||!u||!c?null:O.jsx(tm,{ref:ee==="start"?_:D,onClick:le=>m(!1,le.nativeEvent),children:typeof u=="string"?u:"Dismiss"})}const ne=!r&&A&&(c?!S:!0)&&(j||c);return O.jsxs(f.Fragment,{children:[ne&&O.jsx(Go,{"data-type":"inside",ref:H,onFocus:ee=>{if(c){const le=q();zr(o[0]==="reference"?le[0]:le[le.length-1])}else C?.preserveTabOrder&&C.portalNode&&(k.current=!1,Fo(ee,C.portalNode)?Th(b)?.focus():C.beforeOutsideRef.current?.focus())}}),!S&&re("start"),n,re("end"),ne&&O.jsx(Go,{"data-type":"inside",ref:Z,onFocus:ee=>{c?zr(q()[0]):C?.preserveTabOrder&&C.portalNode&&(d&&(k.current=!0),Fo(ee,C.portalNode)?Oh(b)?.focus():C.afterOutsideRef.current?.focus())}})]})}function rm(e,t={}){const{open:n,onOpenChange:r,dataRef:o}=e,{enabled:s=!0,event:i="click",toggle:a=!0,ignoreMouse:l=!1,stickIfOpen:c=!0}=t,u=f.useRef(void 0),d=Vh(),h=f.useMemo(()=>({onPointerDown(p){u.current=p.pointerType},onMouseDown(p){const g=u.current,m=p.nativeEvent;if(p.button!==0||i==="click"||Lo(g,!0)&&l)return;const v=o.current.openEvent,y=v?.type,b=!(n&&a&&(!(v&&c)||y==="click"||y==="mousedown"));d.request(()=>{r(b,m,"click")})},onClick(p){const g=u.current;if(i==="mousedown"&&g){u.current=void 0;return}if(Lo(g,!0)&&l)return;const m=o.current.openEvent,v=m?.type;r(!(n&&a&&(!(m&&c)||v==="click"||v==="mousedown"||v==="keydown"||v==="keyup")),p.nativeEvent,"click")},onKeyDown(){u.current=void 0}}),[o,i,l,r,n,c,a,d]);return f.useMemo(()=>s?{reference:h}:Wn,[s,h])}function om(e,t,n){let{reference:r,floating:o}=e;const s=Zt(t),i=Zc(t),a=Yc(i),l=Bt(t),c=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,h=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Gn(t)){case"start":p[i]-=h*(n&&c?-1:1);break;case"end":p[i]+=h*(n&&c?-1:1);break}return p}const nO=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=om(c,r,l),h=r,p={},g=0;for(let m=0;m<a.length;m++){const{name:v,fn:y}=a[m],{x:b,y:E,data:x,reset:w}=await y({x:u,y:d,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=b??u,d=E??d,p={...p,[v]:{...p[v],...x}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:u,y:d}=om(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:o,middlewareData:p}};async function zo(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Cn(t,e),g=mh(p),v=a[h?d==="floating"?"reference":"floating":d],y=ui(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(E))?await(s.getScale==null?void 0:s.getScale(E))||{x:1,y:1}:{x:1,y:1},w=ui(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:E,strategy:l}):b);return{top:(y.top-w.top+g.top)/x.y,bottom:(w.bottom-y.bottom+g.bottom)/x.y,left:(y.left-w.left+g.left)/x.x,right:(w.right-y.right+g.right)/x.x}}const rO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Cn(e,t)||{};if(c==null)return{};const d=mh(u),h={x:n,y:r},p=Zc(o),g=Yc(p),m=await i.getDimensions(c),v=p==="y",y=v?"top":"left",b=v?"bottom":"right",E=v?"clientHeight":"clientWidth",x=s.reference[g]+s.reference[p]-h[p]-s.floating[g],w=h[p]-s.reference[p],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let S=T?T[E]:0;(!S||!await(i.isElement==null?void 0:i.isElement(T)))&&(S=a.floating[E]||s.floating[g]);const I=x/2-w/2,A=S/2-m[g]/2-1,L=Un(d[y],A),M=Un(d[b],A),N=L,R=S-m[g]-M,P=S/2-m[g]/2+I,C=Gc(N,P,R),_=!l.arrow&&Gn(o)!=null&&P!==C&&s.reference[g]/2-(P<N?L:M)-m[g]/2<0,D=_?P<N?P-N:P-R:0;return{[p]:h[p]+D,data:{[p]:C,centerOffset:P-C-D,..._&&{alignmentOffset:D}},reset:_}}}),oO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=Cn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=Bt(o),b=Zt(a),E=Bt(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(E||!m?[li(a)]:tT(a)),T=g!=="none";!h&&T&&w.push(...sT(a,m,g,x));const S=[a,...w],I=await zo(t,v),A=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(I[y]),d){const P=eT(o,i,x);A.push(I[P[0]],I[P[1]])}if(L=[...L,{placement:o,overflows:A}],!A.every(P=>P<=0)){var M,N;const P=(((M=s.flip)==null?void 0:M.index)||0)+1,C=S[P];if(C&&(!(d==="alignment"?b!==Zt(C):!1)||L.every(k=>k.overflows[0]>0&&Zt(k.placement)===b)))return{data:{index:P,overflows:L},reset:{placement:C}};let _=(N=L.filter(D=>D.overflows[0]<=0).sort((D,k)=>D.overflows[1]-k.overflows[1])[0])==null?void 0:N.placement;if(!_)switch(p){case"bestFit":{var R;const D=(R=L.filter(k=>{if(T){const $=Zt(k.placement);return $===b||$==="y"}return!0}).map(k=>[k.placement,k.overflows.filter($=>$>0).reduce(($,F)=>$+F,0)]).sort((k,$)=>k[1]-$[1])[0])==null?void 0:R[0];D&&(_=D);break}case"initialPlacement":_=a;break}if(o!==_)return{reset:{placement:_}}}return{}}}};function sm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function im(e){return XC.some(t=>e[t]>=0)}const sO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Cn(e,t);switch(r){case"referenceHidden":{const s=await zo(t,{...o,elementContext:"reference"}),i=sm(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:im(i)}}}case"escaped":{const s=await zo(t,{...o,altBoundary:!0}),i=sm(s,n.floating);return{data:{escapedOffsets:i,escaped:im(i)}}}default:return{}}}}},am=new Set(["left","top"]);async function iO(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Bt(n),a=Gn(n),l=Zt(n)==="y",c=am.has(i)?-1:1,u=s&&l?-1:1,d=Cn(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const aO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,l=await iO(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},cO=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:y,y:b}=v;return{x:y,y:b}}},...l}=Cn(e,t),c={x:n,y:r},u=await zo(t,l),d=Zt(Bt(o)),h=zc(d);let p=c[h],g=c[d];if(s){const v=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=p+u[v],E=p-u[y];p=Gc(b,p,E)}if(i){const v=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=g+u[v],E=g-u[y];g=Gc(b,g,E)}const m=a.fn({...t,[h]:p,[d]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:s,[d]:i}}}}}},lO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Cn(e,t),u={x:n,y:r},d=Zt(o),h=zc(d);let p=u[h],g=u[d];const m=Cn(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const E=h==="y"?"height":"width",x=s.reference[h]-s.floating[E]+v.mainAxis,w=s.reference[h]+s.reference[E]-v.mainAxis;p<x?p=x:p>w&&(p=w)}if(c){var y,b;const E=h==="y"?"width":"height",x=am.has(Bt(o)),w=s.reference[d]-s.floating[E]+(x&&((y=i.offset)==null?void 0:y[d])||0)+(x?0:v.crossAxis),T=s.reference[d]+s.reference[E]+(x?0:((b=i.offset)==null?void 0:b[d])||0)-(x?v.crossAxis:0);g<w?g=w:g>T&&(g=T)}return{[h]:p,[d]:g}}}},uO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Cn(e,t),u=await zo(t,c),d=Bt(o),h=Gn(o),p=Zt(o)==="y",{width:g,height:m}=s.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=h==="end"?"top":"bottom");const b=m-u.top-u.bottom,E=g-u.left-u.right,x=Un(m-u[v],b),w=Un(g-u[y],E),T=!t.middlewareData.shift;let S=x,I=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(S=b),T&&!h){const L=Nt(u.left,0),M=Nt(u.right,0),N=Nt(u.top,0),R=Nt(u.bottom,0);p?I=g-2*(L!==0||M!==0?L+M:Nt(u.left,u.right)):S=m-2*(N!==0||R!==0?N+R:Nt(u.top,u.bottom))}await l({...t,availableWidth:I,availableHeight:S});const A=await i.getDimensions(a.floating);return g!==A.width||m!==A.height?{reset:{rects:!0}}:{}}}};function cm(e){const t=Vt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ai(n)!==s||ai(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function il(e){return We(e)?e:e.contextElement}function Zr(e){const t=il(e);if(!dt(t))return cn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=cm(t);let i=(s?ai(n.width):n.width)/r,a=(s?ai(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const dO=cn(0);function lm(e){const t=vt(e);return!si()||!t.visualViewport?dO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vt(e)?!1:t}function hr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=il(e);let i=cn(1);t&&(r?We(r)&&(i=Zr(r)):i=Zr(e));const a=fO(s,n,r)?lm(s):cn(0);let l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const h=vt(s),p=r&&We(r)?vt(r):r;let g=h,m=Fc(g);for(;m&&r&&p!==g;){const v=Zr(m),y=m.getBoundingClientRect(),b=Vt(m),E=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,x=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=E,c+=x,g=vt(m),m=Fc(g)}}return ui({width:u,height:d,x:l,y:c})}function al(e,t){const n=ii(e).scrollLeft;return t?t.left+n:hr(sn(e)).left+n}function um(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:al(e,r)),s=r.top+t.scrollTop;return{x:o,y:s}}function pO(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=sn(r),a=t?oi(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=cn(1);const u=cn(0),d=dt(r);if((d||!d&&!s)&&((jn(r)!=="body"||Do(i))&&(l=ii(r)),dt(r))){const p=hr(r);c=Zr(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}const h=i&&!d&&!s?um(i,l,!0):cn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function hO(e){return Array.from(e.getClientRects())}function mO(e){const t=sn(e),n=ii(e),r=e.ownerDocument.body,o=Nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+al(e);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(i+=Nt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}function gO(e,t){const n=vt(e),r=sn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;const c=si();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:a,y:l}}const vO=new Set(["absolute","fixed"]);function yO(e,t){const n=hr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=dt(e)?Zr(e):cn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function dm(e,t,n){let r;if(t==="viewport")r=gO(e,n);else if(t==="document")r=mO(sn(e));else if(We(t))r=yO(t,n);else{const o=lm(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ui(r)}function fm(e,t){const n=Sn(e);return n===t||!We(n)||xn(n)?!1:Vt(n).position==="fixed"||fm(n,t)}function bO(e,t){const n=t.get(e);if(n)return n;let r=Hn(e,[],!1).filter(a=>We(a)&&jn(a)!=="body"),o=null;const s=Vt(e).position==="fixed";let i=s?Sn(e):e;for(;We(i)&&!xn(i);){const a=Vt(i),l=$c(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&vO.has(o.position)||Do(i)&&!l&&fm(e,i))?r=r.filter(u=>u!==i):o=a,i=Sn(i)}return t.set(e,r),r}function wO(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?oi(t)?[]:bO(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const d=dm(t,u,o);return c.top=Nt(d.top,c.top),c.right=Un(d.right,c.right),c.bottom=Un(d.bottom,c.bottom),c.left=Nt(d.left,c.left),c},dm(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function EO(e){const{width:t,height:n}=cm(e);return{width:t,height:n}}function xO(e,t,n){const r=dt(t),o=sn(t),s=n==="fixed",i=hr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=cn(0);function c(){l.x=al(o)}if(r||!r&&!s)if((jn(t)!=="body"||Do(o))&&(a=ii(t)),r){const p=hr(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();const u=o&&!r&&!s?um(o,a):cn(0),d=i.left+a.scrollLeft-l.x-u.x,h=i.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:i.width,height:i.height}}function cl(e){return Vt(e).position==="static"}function pm(e,t){if(!dt(e)||Vt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return sn(e)===n&&(n=n.ownerDocument.body),n}function hm(e,t){const n=vt(e);if(oi(e))return n;if(!dt(e)){let o=Sn(e);for(;o&&!xn(o);){if(We(o)&&!cl(o))return o;o=Sn(o)}return n}let r=pm(e,t);for(;r&&_C(r)&&cl(r);)r=pm(r,t);return r&&xn(r)&&cl(r)&&!$c(r)?n:r||LC(e)||n}const SO=async function(e){const t=this.getOffsetParent||hm,n=this.getDimensions,r=await n(e.floating);return{reference:xO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function CO(e){return Vt(e).direction==="rtl"}const TO={convertOffsetParentRelativeRectToViewportRelativeRect:pO,getDocumentElement:sn,getClippingRect:wO,getOffsetParent:hm,getElementRects:SO,getClientRects:hO,getDimensions:EO,getScale:Zr,isElement:We,isRTL:CO};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function OO(e,t){let n=null,r;const o=sn(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const c=e.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=c;if(a||t(),!h||!p)return;const g=ci(d),m=ci(o.clientWidth-(u+h)),v=ci(o.clientHeight-(d+p)),y=ci(u),E={rootMargin:-g+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Nt(0,Un(1,l))||1};let x=!0;function w(T){const S=T[0].intersectionRatio;if(S!==l){if(!x)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},1e3)}S===1&&!mm(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(w,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,E)}n.observe(e)}return i(!0),s}function gm(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=il(e),u=o||s?[...c?Hn(c):[],...Hn(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=c&&a?OO(c,n):null;let h=-1,p=null;i&&(p=new ResizeObserver(y=>{let[b]=y;b&&b.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=p)==null||E.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let g,m=l?hr(e):null;l&&v();function v(){const y=hr(e);m&&!mm(m,y)&&n(),m=y,g=requestAnimationFrame(v)}return n(),()=>{var y;u.forEach(b=>{o&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),d?.(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const kO=aO,RO=cO,PO=oO,IO=uO,_O=sO,vm=rO,NO=lO,AO=(e,t,n)=>{const r=new Map,o={platform:TO,...n},s={...o.platform,_c:r};return nO(e,t,{...o,platform:s})};var DO=typeof document<"u",MO=function(){},Ti=DO?W.useLayoutEffect:MO;function Oi(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(!Oi(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Oi(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ym(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bm(e,t){const n=ym(e);return Math.round(t*n)/n}function ll(e){const t=f.useRef(e);return Ti(()=>{t.current=e}),t}function LO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=f.useState(r);Oi(h,r)||p(r);const[g,m]=f.useState(null),[v,y]=f.useState(null),b=f.useCallback(k=>{k!==T.current&&(T.current=k,m(k))},[]),E=f.useCallback(k=>{k!==S.current&&(S.current=k,y(k))},[]),x=s||g,w=i||v,T=f.useRef(null),S=f.useRef(null),I=f.useRef(u),A=l!=null,L=ll(l),M=ll(o),N=ll(c),R=f.useCallback(()=>{if(!T.current||!S.current)return;const k={placement:t,strategy:n,middleware:h};M.current&&(k.platform=M.current),AO(T.current,S.current,k).then($=>{const F={...$,isPositioned:N.current!==!1};P.current&&!Oi(I.current,F)&&(I.current=F,lt.flushSync(()=>{d(F)}))})},[h,t,n,M,N]);Ti(()=>{c===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[c]);const P=f.useRef(!1);Ti(()=>(P.current=!0,()=>{P.current=!1}),[]),Ti(()=>{if(x&&(T.current=x),w&&(S.current=w),x&&w){if(L.current)return L.current(x,w,R);R()}},[x,w,R,L,A]);const C=f.useMemo(()=>({reference:T,floating:S,setReference:b,setFloating:E}),[b,E]),_=f.useMemo(()=>({reference:x,floating:w}),[x,w]),D=f.useMemo(()=>{const k={position:n,left:0,top:0};if(!_.floating)return k;const $=bm(_.floating,u.x),F=bm(_.floating,u.y);return a?{...k,transform:"translate("+$+"px, "+F+"px)",...ym(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:$,top:F}},[n,a,_.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:R,refs:C,elements:_,floatingStyles:D}),[u,R,C,_,D])}const $O=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?vm({element:r.current,padding:o}).fn(n):{}:r?vm({element:r,padding:o}).fn(n):{}}}},FO=(e,t)=>({...kO(e),options:[e,t]}),VO=(e,t)=>({...RO(e),options:[e,t]}),BO=(e,t)=>({...NO(e),options:[e,t]}),WO=(e,t)=>({...PO(e),options:[e,t]}),jO=(e,t)=>({...IO(e),options:[e,t]}),HO=(e,t)=>({..._O(e),options:[e,t]}),UO=(e,t)=>({...$O(e),options:[e,t]}),GO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},wm=e=>({escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0});function Em(e,t={}){const{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:p,capture:g}=t,m=Ho(),v=qe(typeof l=="function"?l:()=>!1),y=typeof l=="function"?v:l,b=f.useRef(!1),{escapeKey:E,outsidePress:x}=wm(p),{escapeKey:w,outsidePress:T}=wm(g),S=f.useRef(!1),I=Wo(),A=qe(C=>{if(!n||!i||!a||C.key!=="Escape"||S.current)return;const _=s.current.floatingContext?.nodeId,D=m?ur(m.nodesRef.current,_):[];if(!E&&(C.stopPropagation(),D.length>0)){let k=!0;if(D.forEach($=>{$.context?.open&&!$.context.dataRef.current.__escapeKeyBubbles&&(k=!1)}),!k)return}r(!1,YC(C)?C.nativeEvent:C,"escape-key")}),L=qe(C=>{const _=()=>{A(C),an(C)?.removeEventListener("keydown",_)};an(C)?.addEventListener("keydown",_)}),M=qe(C=>{const _=s.current.insideReactTree;s.current.insideReactTree=!1;const D=b.current;if(b.current=!1,c==="click"&&D||_||typeof y=="function"&&!y(C))return;const k=an(C),$=`[${Uo("inert")}]`,F=Je(o.floating).querySelectorAll($);let j=We(k)?k:null;for(;j&&!xn(j);){const X=Sn(j);if(xn(X)||!We(X))break;j=X}if(F.length&&We(k)&&!GC(k)&&!ft(k,o.floating)&&Array.from(F).every(X=>!ft(j,X)))return;if(dt(k)){const X=xn(k),U=Vt(k),H=/auto|scroll/,Z=X||H.test(U.overflowX),re=X||H.test(U.overflowY),ne=Z&&k.clientWidth>0&&k.scrollWidth>k.clientWidth,ee=re&&k.clientHeight>0&&k.scrollHeight>k.clientHeight,le=U.direction==="rtl",K=ee&&(le?C.offsetX<=k.offsetWidth-k.clientWidth:C.offsetX>k.clientWidth),G=ne&&C.offsetY>k.clientHeight;if(K||G)return}const V=s.current.floatingContext?.nodeId,Y=m&&ur(m.nodesRef.current,V).some(X=>jc(C,X.context?.elements.floating));if(jc(C,o.floating)||jc(C,o.domReference)||Y)return;const q=m?ur(m.nodesRef.current,V):[];if(q.length>0){let X=!0;if(q.forEach(U=>{U.context?.open&&!U.context.dataRef.current.__outsidePressBubbles&&(X=!1)}),!X)return}r(!1,C,"outside-press")}),N=qe(C=>{const _=()=>{M(C),an(C)?.removeEventListener(c,_)};an(C)?.addEventListener(c,_)});f.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=E,s.current.__outsidePressBubbles=x;const C=new dr;function _(j){r(!1,j,"ancestor-scroll")}function D(){C.clear(),S.current=!0}function k(){C.start(si()?5:0,()=>{S.current=!1})}const $=Je(o.floating);a&&($.addEventListener("keydown",w?L:A,w),$.addEventListener("compositionstart",D),$.addEventListener("compositionend",k)),y&&$.addEventListener(c,T?N:M,T);let F=[];return h&&(We(o.domReference)&&(F=Hn(o.domReference)),We(o.floating)&&(F=F.concat(Hn(o.floating))),!We(o.reference)&&o.reference&&o.reference.contextElement&&(F=F.concat(Hn(o.reference.contextElement)))),F=F.filter(j=>j!==$.defaultView?.visualViewport),F.forEach(j=>{j.addEventListener("scroll",_,{passive:!0})}),()=>{a&&($.removeEventListener("keydown",w?L:A,w),$.removeEventListener("compositionstart",D),$.removeEventListener("compositionend",k)),y&&$.removeEventListener(c,T?N:M,T),F.forEach(j=>{j.removeEventListener("scroll",_)}),C.clear()}},[s,o,a,y,c,n,r,h,i,E,x,A,w,L,M,T,N]),f.useEffect(()=>{s.current.insideReactTree=!1},[s,y,c]);const R=f.useMemo(()=>({onKeyDown:A,...u&&{[GO[d]]:C=>{r(!1,C.nativeEvent,"reference-press")},...d!=="click"&&{onClick(C){r(!1,C.nativeEvent,"reference-press")}}}}),[A,r,u,d]),P=f.useMemo(()=>({onKeyDown:A,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[zO[c]]:()=>{s.current.insideReactTree=!0},onBlurCapture(){m||(s.current.insideReactTree=!0,I.start(0,()=>{s.current.insideReactTree=!1}))}}),[A,c,s,m,I]);return f.useMemo(()=>i?{reference:R,floating:P}:{},[i,R,P])}function ul(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Vo(),s=f.useRef({}),[i]=f.useState(()=>Hh()),a=jo()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!We(p)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=f.useState(r.reference),u=qe((p,g,m)=>{s.current.openEvent=p?g:void 0,i.emit("openchange",{open:p,event:g,reason:m,nested:a}),n?.(p,g,m)}),d=f.useMemo(()=>({setPositionReference:c}),[]),h=f.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return f.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:h,events:i,floatingId:o,refs:d}),[t,u,h,i,o,d])}function YO(e={}){const{nodeId:t}=e,n=ul({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,i]=f.useState(null),[a,l]=f.useState(null),u=o?.domReference||s,d=f.useRef(null),h=Ho();Ue(()=>{u&&(d.current=u)},[u]);const p=LO({...e,elements:{...o,...a&&{reference:a}}}),g=f.useCallback(E=>{const x=We(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),getClientRects:()=>E.getClientRects(),contextElement:E}:E;l(x),p.refs.setReference(x)},[p.refs]),m=f.useCallback(E=>{(We(E)||E===null)&&(d.current=E,i(E)),(We(p.refs.reference.current)||p.refs.reference.current===null||E!==null&&!We(E))&&p.refs.setReference(E)},[p.refs]),v=f.useMemo(()=>({...p.refs,setReference:m,setPositionReference:g,domReference:d}),[p.refs,m,g]),y=f.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),b=f.useMemo(()=>({...p,...r,refs:v,elements:y,nodeId:t}),[p,v,y,t,r]);return Ue(()=>{r.dataRef.current.floatingContext=b;const E=h?.nodesRef.current.find(x=>x.id===t);E&&(E.context=b)}),f.useMemo(()=>({...p,context:b,refs:v,elements:y}),[p,v,y,b])}function xm(e=[]){const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),r=e.map(a=>a?.item),o=f.useCallback(a=>dl(a,e,"reference"),t),s=f.useCallback(a=>dl(a,e,"floating"),n),i=f.useCallback(a=>dl(a,e,"item"),r);return f.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}function dl(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Wc]="");for(const i in e)o&&e&&(i===lh||i===uh)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const l=t[i]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&Sm(s,a,o,r)}return Sm(s,e,o,r),s}function Sm(e,t,n,r){for(const o in t){const s=t[o];n&&(o===lh||o===uh)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const ZO=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Cm(e,t={}){const{open:n,elements:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,a=Vo(),l=r.domReference?.id||a,c=f.useMemo(()=>Hc(r.floating)?.id||o,[r.floating,o]),u=ZO.get(i)??i,h=jo()!=null,p=f.useMemo(()=>u==="tooltip"||i==="label"?{[`aria-${i==="label"?"labelledby":"describedby"}`]:n?c:void 0}:{"aria-expanded":n?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":n?c:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:l},...u==="menu"&&h&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},[u,c,h,n,l,i]),g=f.useMemo(()=>{const v={id:c,...u&&{role:u}};return u==="tooltip"||i==="label"?v:{...v,...u==="menu"&&{"aria-labelledby":l}}},[u,c,l,i]),m=f.useCallback(({active:v,selected:y})=>{const b={role:"option",...v&&{id:`${c}-fui-option`}};switch(i){case"select":return{...b,"aria-selected":v&&y};case"combobox":return{...b,"aria-selected":y}}return{}},[c,i]);return f.useMemo(()=>s?{reference:p,floating:g,item:m}:{},[s,p,g,m])}function Tm(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[l,c]=t[i]||[0,0],[u,d]=t[a]||[0,0];c>=r!=d>=r&&n<=(u-l)*(r-c)/(d-c)+l&&(o=!o)}return o}function qO(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function XO(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o=new dr;let s=!1,i=null,a=null,l=performance.now();function c(d,h){const p=performance.now(),g=p-l;if(i===null||a===null||g===0)return i=d,a=h,l=p,null;const m=d-i,v=h-a,b=Math.sqrt(m*m+v*v)/g;return i=d,a=h,l=p,b}const u=({x:d,y:h,placement:p,elements:g,onClose:m,nodeId:v,tree:y})=>function(E){function x(){o.clear(),m()}if(o.clear(),!g.domReference||!g.floating||p==null||d==null||h==null)return;const{clientX:w,clientY:T}=E,S=[w,T],I=an(E),A=E.type==="mouseleave",L=ft(g.floating,I),M=ft(g.domReference,I),N=g.domReference.getBoundingClientRect(),R=g.floating.getBoundingClientRect(),P=p.split("-")[0],C=d>R.right-R.width/2,_=h>R.bottom-R.height/2,D=qO(S,N),k=R.width>N.width,$=R.height>N.height,F=(k?N:R).left,j=(k?N:R).right,V=($?N:R).top,Y=($?N:R).bottom;if(L&&(s=!0,!A))return;if(M&&(s=!1),M&&!A){s=!0;return}if(A&&We(E.relatedTarget)&&ft(g.floating,E.relatedTarget)||y&&ur(y.nodesRef.current,v).some(({context:U})=>U?.open))return;if(P==="top"&&h>=N.bottom-1||P==="bottom"&&h<=N.top+1||P==="left"&&d>=N.right-1||P==="right"&&d<=N.left+1)return x();let q=[];switch(P){case"top":q=[[F,N.top+1],[F,R.bottom-1],[j,R.bottom-1],[j,N.top+1]];break;case"bottom":q=[[F,R.top+1],[F,N.bottom-1],[j,N.bottom-1],[j,R.top+1]];break;case"left":q=[[R.right-1,Y],[R.right-1,V],[N.left+1,V],[N.left+1,Y]];break;case"right":q=[[N.right-1,Y],[N.right-1,V],[R.left+1,V],[R.left+1,Y]];break}function X([U,H]){switch(P){case"top":{const Z=[k?U+t/2:C?U+t*4:U-t*4,H+t+1],re=[k?U-t/2:C?U+t*4:U-t*4,H+t+1],ne=[[R.left,C||k?R.bottom-t:R.top],[R.right,C?k?R.bottom-t:R.top:R.bottom-t]];return[Z,re,...ne]}case"bottom":{const Z=[k?U+t/2:C?U+t*4:U-t*4,H-t],re=[k?U-t/2:C?U+t*4:U-t*4,H-t],ne=[[R.left,C||k?R.top+t:R.bottom],[R.right,C?k?R.top+t:R.bottom:R.top+t]];return[Z,re,...ne]}case"left":{const Z=[U+t+1,$?H+t/2:_?H+t*4:H-t*4],re=[U+t+1,$?H-t/2:_?H+t*4:H-t*4];return[...[[_||$?R.right-t:R.left,R.top],[_?$?R.right-t:R.left:R.right-t,R.bottom]],Z,re]}case"right":{const Z=[U-t,$?H+t/2:_?H+t*4:H-t*4],re=[U-t,$?H-t/2:_?H+t*4:H-t*4],ne=[[_||$?R.left+t:R.right,R.top],[_?$?R.left+t:R.right:R.left+t,R.bottom]];return[Z,re,...ne]}default:return[]}}if(!Tm([w,T],q)){if(s&&!D)return x();if(!A&&r){const U=c(E.clientX,E.clientY);if(U!==null&&U<.1)return x()}Tm([w,T],X([d,h]))?!s&&r&&o.start(40,x):x()}};return u.__options={blockPointerEvents:n},u}function KO(e){const{descriptionElementId:t,initialFocus:n,modal:r,mounted:o,openMethod:s,ref:i,setPopupElement:a,titleElementId:l}=e,c=f.useRef(null),u=jr(i,c,a),d=f.useCallback(g=>g==="touch"?c:0,[]),h=f.useMemo(()=>n==null?d(s??""):typeof n=="function"?n(s??""):n,[d,n,s]);return{popupProps:{"aria-labelledby":l??void 0,"aria-describedby":t??void 0,"aria-modal":o&&r===!0?!0:void 0,role:"dialog",tabIndex:-1,ref:u,hidden:!o,onKeyDown(g){kT.has(g.key)&&g.stopPropagation()}},resolvedInitialFocus:h}}const fl=f.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r?.getBoundingClientRect();s=`polygon(
33
- 0% 0%,
34
- 100% 0%,
35
- 100% 100%,
36
- 0% 100%,
37
- 0% 0%,
38
- ${i.left}px ${i.top}px,
39
- ${i.left}px ${i.bottom}px,
40
- ${i.right}px ${i.bottom}px,
41
- ${i.right}px ${i.top}px,
42
- ${i.left}px ${i.top}px
43
- )`}return O.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(fl.displayName="InternalBackdrop");function Om(e){return Qp(19)?e:e?"true":void 0}const JO=()=>{};let km={},Rm={},Pm="";function QO(e){if(typeof document>"u")return!1;const t=Je(e);return vt(t).innerWidth-t.documentElement.clientWidth>0}function ek(e){const n=Je(e).documentElement,r=n.style.overflow;return n.style.overflow="hidden",()=>{n.style.overflow=r}}function tk(e){const t=Je(e),n=t.documentElement,r=t.body,o=vt(n);let s=0,i=0;const a=ln.create();if(ch&&(o.visualViewport?.scale??1)!==1)return()=>{};function l(){const d=o.getComputedStyle(n),h=o.getComputedStyle(r);s=n.scrollTop,i=n.scrollLeft,km={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Pm=n.style.scrollBehavior,Rm={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const p=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable"),g=n.scrollHeight>n.clientHeight,m=n.scrollWidth>n.clientWidth,v=d.overflowY==="scroll"||h.overflowY==="scroll",y=d.overflowX==="scroll"||h.overflowX==="scroll",b=Math.max(0,o.innerWidth-n.clientWidth),E=Math.max(0,o.innerHeight-n.clientHeight),x=parseFloat(h.marginTop)+parseFloat(h.marginBottom),w=parseFloat(h.marginLeft)+parseFloat(h.marginRight);Object.assign(n.style,{scrollbarGutter:"stable",overflowY:!p&&(g||v)?"scroll":"hidden",overflowX:!p&&(m||y)?"scroll":"hidden"}),Object.assign(r.style,{position:"relative",height:x||E?`calc(100dvh - ${x+E}px)`:"100dvh",width:w||b?`calc(100vw - ${w+b}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,km),Object.assign(r.style,Rm),n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Pm}function u(){c(),a.request(l)}return l(),o.addEventListener("resize",u),()=>{a.cancel(),c(),o.removeEventListener("resize",u)}}class nk{lockCount=0;restore=null;timeoutLock=dr.create();timeoutUnlock=dr.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Je(t).documentElement,o=vt(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=JO;return}const s=FC||!QO(t);this.restore=s?ek(t):tk(t)}}const rk=new nk;function Im(e){const{enabled:t=!0,mounted:n,open:r,referenceElement:o=null}=e;Ue(()=>{if(ch&&n&&!r){const s=Je(o),i=s.body.style.userSelect,a=s.body.style.webkitUserSelect;return s.body.style.userSelect="none",s.body.style.webkitUserSelect="none",()=>{s.body.style.userSelect=i,s.body.style.webkitUserSelect=a}}},[n,r,o]),Ue(()=>{if(t)return rk.acquire(o)},[t,o])}function ok(e){const t=f.useRef(""),n=f.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType)},[]);return{onClick:f.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o&&e(o,o.pointerType),e(o,t.current),t.current=""},[e]),onPointerDown:n}}function _m(e){const[t,n]=f.useState(null);!e&&t!==null&&n(null);const r=f.useCallback((i,a)=>{e||n(a)},[e,n]),{onClick:o,onPointerDown:s}=ok(r);return f.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function Nm(e){if(e)return{"focus-out":"focus-out","escape-key":"escape-key","outside-press":"outside-press","list-navigation":"list-navigation",click:"trigger-press",hover:"trigger-hover",focus:"trigger-focus","reference-press":"trigger-press","safe-polygon":"trigger-hover","ancestor-scroll":void 0}[e]}function sk(e){const{defaultOpen:t,dismissible:n,modal:r,onNestedDialogClose:o,onNestedDialogOpen:s,onOpenChange:i,open:a,onOpenChangeComplete:l}=e,[c,u]=qp({controlled:a,default:t,name:"DialogRoot",state:"open"}),d=f.useRef(null),h=f.useRef(null),p=f.useRef(null),[g,m]=f.useState(void 0),[v,y]=f.useState(void 0),[b,E]=f.useState(null),[x,w]=f.useState(null),{mounted:T,setMounted:S,transitionStatus:I}=Bh(c),A=qe((U,H,Z)=>{i?.(U,H,Z),u(U)}),L=qe(()=>{S(!1),l?.(!1)});wi({enabled:!e.actionsRef,open:c,ref:d,onComplete(){c||L()}}),f.useImperativeHandle(e.actionsRef,()=>({unmount:L}),[L]);const N=ul({elements:{reference:b,floating:x},open:c,onOpenChange:(U,H,Z)=>{A(U,H,Nm(Z))}}),[R,P]=f.useState(0),C=R===0,_=Cm(N),D=rm(N),k=Em(N,{outsidePressEvent:"mousedown",outsidePress(U){if(U.button!==0)return!1;const H=an(U);if(C&&n){const Z=H;return r?Z?p.current===Z||h.current===Z:!1:!0}return!1},escapeKey:C});Im({enabled:c&&r===!0,mounted:T,open:c,referenceElement:x});const{getReferenceProps:$,getFloatingProps:F}=xm([_,D,k]);f.useEffect(()=>(s&&c&&s(R),o&&!c&&o(),()=>{o&&c&&o()}),[c,o,s,R]);const j=f.useCallback(U=>{P(U+1)},[]),V=f.useCallback(()=>{P(0)},[]),{openMethod:Y,triggerProps:q}=_m(c),X=f.useMemo(()=>$(q),[$,q]);return f.useMemo(()=>({modal:r,setOpen:A,open:c,titleElementId:g,setTitleElementId:m,descriptionElementId:v,setDescriptionElementId:y,onNestedDialogOpen:j,onNestedDialogClose:V,nestedOpenDialogCount:R,openMethod:Y,mounted:T,transitionStatus:I,triggerProps:X,getPopupProps:F,setTriggerElement:E,setPopupElement:w,popupRef:d,backdropRef:h,internalBackdropRef:p,floatingRootContext:N}),[r,A,c,g,v,j,V,R,Y,T,I,X,F,N])}function Am(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function Dm(e,t,n){const{rects:r,placement:o}=e;return{side:Am(t,Bt(o),n),align:Gn(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ik(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:l=5,sticky:c=!1,arrowPadding:u=5,trackAnchor:d=!0,keepMounted:h=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:b}=e,E=m.side||"flip",x=m.align||"flip",w=m.fallbackAxisSide||"end",T=typeof t=="function"?t:void 0,S=qe(T),I=T?S:t,A=qt(t),M=RT()==="rtl",N={top:"top",right:"right",bottom:"bottom",left:"left","inline-end":M?"left":"right","inline-start":M?"right":"left"}[r],R=s==="center"?N:`${N}-${s}`,P={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:l},C=f.useRef(null),_=qt(o),D=qt(i),F=[FO(Ie=>{const be=Dm(Ie,r,M),Re=typeof _.current=="function"?_.current(be):_.current,Ce=typeof D.current=="function"?D.current(be):D.current;return{mainAxis:Re,crossAxis:Ce,alignmentAxis:Ce}},[typeof o!="function"?o:0,typeof i!="function"?i:0,M,r])],j=x==="none"&&E!=="shift",V=!j&&(c||v||E==="shift"),Y=E==="none"?null:WO({...P,mainAxis:!v&&E==="flip",crossAxis:x==="flip"?"alignment":!1,fallbackAxisSideDirection:w}),q=j?null:VO(Ie=>{const be=Je(Ie.elements.floating).documentElement;return{...P,rootBoundary:v?{x:0,y:0,width:be.clientWidth,height:be.clientHeight}:void 0,mainAxis:x!=="none",crossAxis:V,limiter:c||v?void 0:BO(()=>{if(!C.current)return{};const{height:Re}=C.current.getBoundingClientRect();return{offset:Re/2+(typeof l=="number"?l:0)}})}},[P,c,v,l,x]);E==="shift"||x==="shift"||s==="center"?F.push(q,Y):F.push(Y,q),F.push(jO({...P,apply({elements:{floating:Ie},rects:{reference:be},availableWidth:Re,availableHeight:Ce}){Object.entries({"--available-width":`${Re}px`,"--available-height":`${Ce}px`,"--anchor-width":`${be.width}px`,"--anchor-height":`${be.height}px`}).forEach(([Be,Qe])=>{Ie.style.setProperty(Be,Qe)})}}),UO(()=>({element:C.current||document.createElement("div"),padding:u}),[u]),HO(),{name:"transformOrigin",fn(Ie){const{elements:be,middlewareData:Re,placement:Ce,rects:Be,y:Qe}=Ie,ct=Bt(Ce),Ct=Zt(ct),Dt=C.current,jt=Re.arrow?.x||0,ye=Re.arrow?.y||0,Ze=Dt?.clientWidth||0,ie=Dt?.clientHeight||0,ge=jt+Ze/2,Oe=ye+ie/2,we=Math.abs(Re.shift?.y||0),Me=Be.reference.height/2,Ke=we>(typeof o=="function"?o(Dm(Ie,r,M)):o),et={top:`${ge}px calc(100% + ${o}px)`,bottom:`${ge}px ${-o}px`,left:`calc(100% + ${o}px) ${Oe}px`,right:`${-o}px ${Oe}px`}[ct],Tt=`${ge}px ${Be.reference.y+Me-Qe}px`;return be.floating.style.setProperty("--transform-origin",V&&Ct==="y"&&Ke?Tt:et),{}}},b);let X=p;!g&&p&&(X={...p,elements:{reference:null,floating:null,domReference:null}});const U=f.useMemo(()=>({elementResize:d&&typeof ResizeObserver<"u",layoutShift:d&&typeof IntersectionObserver<"u"}),[d]),{refs:H,elements:Z,x:re,y:ne,middlewareData:ee,update:le,placement:K,context:G,isPositioned:de,floatingStyles:fe}=YO({rootContext:X,placement:R,middleware:F,strategy:n,whileElementsMounted:h?void 0:(...Ie)=>gm(...Ie,U),nodeId:y}),{sideX:oe,sideY:ue}=ee.adaptiveOrigin||{},te=f.useMemo(()=>b?{position:n,[oe]:`${re}px`,[ue]:`${ne}px`}:fe,[b,oe,ue,n,re,ne,fe]),z=f.useRef(null);Ue(()=>{if(!g)return;const Ie=A.current,be=typeof Ie=="function"?Ie():Ie,Ce=(Mm(be)?be.current:be)||null||null;Ce!==z.current&&(H.setPositionReference(Ce),z.current=Ce)},[g,H,I,A]),f.useEffect(()=>{if(!g)return;const Ie=A.current;typeof Ie!="function"&&Mm(Ie)&&Ie.current!==z.current&&(H.setPositionReference(Ie.current),z.current=Ie.current)},[g,H,I,A]),f.useEffect(()=>{if(h&&g&&Z.domReference&&Z.floating)return gm(Z.domReference,Z.floating,le,U)},[h,g,Z,le,U]);const B=Bt(K),J=Am(r,B,M),pe=Gn(K)||"center",Se=!!ee.hide?.referenceHidden,_e=f.useMemo(()=>({position:"absolute",top:ee.arrow?.y,left:ee.arrow?.x}),[ee.arrow]),Fe=ee.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:te,arrowStyles:_e,arrowRef:C,arrowUncentered:Fe,side:J,align:pe,anchorHidden:Se,refs:H,context:G,isPositioned:de,update:le}),[te,_e,C,Fe,J,pe,Se,H,G,de,le])}function Mm(e){return e!=null&&"current"in e}const ki=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(ki.displayName="DialogRootContext");function ak(){const e=f.useContext(ki),t=f.useContext(Ei);if(!(t===void 0&&e===void 0))return{...e,...t}}function mr(){const e=f.useContext(ki),t=f.useContext(Ei);if(t===void 0)throw new Error("Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.");return{...e,...t}}const ck={...Gr,...bi},Lm=f.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{open:i,nested:a,mounted:l,transitionStatus:c,backdropRef:u}=mr(),d=f.useMemo(()=>({open:i,transitionStatus:c}),[i,c]);return _t("div",t,{state:d,ref:[u,n],customStyleHookMapping:ck,props:[{role:"presentation",hidden:!l,style:{userSelect:"none",WebkitUserSelect:"none"}},s],enabled:!a})});process.env.NODE_ENV!=="production"&&(Lm.displayName="DialogBackdrop");const $m=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...a}=t,{open:l,setOpen:c}=mr(),{getRootProps:u,ref:d}=GT({disabled:s,open:l,setOpen:c,nativeButton:i}),h=f.useMemo(()=>({disabled:s}),[s]);return _t("button",t,{state:h,ref:[n,d],props:[a,u]})});process.env.NODE_ENV!=="production"&&($m.displayName="DialogClose");const Fm=f.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{setDescriptionElementId:a}=mr(),l=mi(s);return Ue(()=>(a(l),()=>{a(void 0)}),[l,a]),_t("p",t,{ref:n,props:[{id:l},i]})});process.env.NODE_ENV!=="production"&&(Fm.displayName="DialogDescription");let lk=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),uk=(function(e){return e[e.open=fr.open]="open",e[e.closed=fr.closed]="closed",e[e.startingStyle=fr.startingStyle]="startingStyle",e[e.endingStyle=fr.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const pl=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(pl.displayName="DialogPortalContext");function dk(){const e=f.useContext(pl);if(e===void 0)throw new Error("Base UI: <Dialog.Portal> is missing.");return e}const fk={...Gr,...bi,nestedDialogOpen(e){return e?{[uk.nestedDialogOpen]:""}:null}},Vm=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,...a}=t,{descriptionElementId:l,dismissible:c,floatingRootContext:u,getPopupProps:d,modal:h,mounted:p,nested:g,nestedOpenDialogCount:m,open:v,openMethod:y,popupRef:b,setPopupElement:E,titleElementId:x,transitionStatus:w,onOpenChangeComplete:T,internalBackdropRef:S}=mr();dk(),wi({open:v,ref:b,onComplete(){v&&T?.(!0)}});const I=jr(n,b),{popupProps:A,resolvedInitialFocus:L}=KO({descriptionElementId:l,initialFocus:s,modal:h,mounted:p,openMethod:y,ref:I,setPopupElement:E,titleElementId:x}),M=m>0,N=f.useMemo(()=>({open:v,nested:g,transitionStatus:w,nestedDialogOpen:M}),[v,g,w,M]),R=_t("div",t,{state:N,props:[d(),A,{style:{[lk.nestedDialogs]:m}},a],customStyleHookMapping:fk});return O.jsxs(f.Fragment,{children:[p&&h===!0&&O.jsx(fl,{ref:S,inert:Om(!v)}),O.jsx(nm,{context:u,disabled:!p,closeOnFocusOut:c,initialFocus:L,returnFocus:o,modal:h!==!1,children:R})]})});process.env.NODE_ENV!=="production"&&(Vm.displayName="DialogPopup");function pk(e){const{children:t,keepMounted:n=!1,container:r}=e,{mounted:o}=mr();return o||n?O.jsx(pl.Provider,{value:n,children:O.jsx(Kh,{root:r,children:t})}):null}const Bm=function(t){const{children:n,defaultOpen:r=!1,dismissible:o=!0,modal:s=!0,onOpenChange:i,open:a,actionsRef:l,onOpenChangeComplete:c}=t,u=ak(),d=sk({open:a,defaultOpen:r,onOpenChange:i,modal:s,dismissible:o,actionsRef:l,onOpenChangeComplete:c,onNestedDialogClose:u?.onNestedDialogClose,onNestedDialogOpen:u?.onNestedDialogOpen}),h=!!u,p=f.useMemo(()=>({...d,nested:h,onOpenChangeComplete:c}),[d,h,c]),g=f.useMemo(()=>({dismissible:o}),[o]);return O.jsx(Ei.Provider,{value:p,children:O.jsx(ki.Provider,{value:g,children:n})})};process.env.NODE_ENV!=="production"&&(Bm.displayName="DialogRoot");const Wm=f.forwardRef(function(t,n){const{render:r,className:o,id:s,...i}=t,{setTitleElementId:a}=mr(),l=mi(s);return Ue(()=>(a(l),()=>{a(void 0)}),[l,a]),_t("h2",t,{ref:n,props:[{id:l},i]})});process.env.NODE_ENV!=="production"&&(Wm.displayName="DialogTitle");const jm=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...a}=t,{open:l,setTriggerElement:c,triggerProps:u}=mr(),d=f.useMemo(()=>({disabled:s,open:l}),[s,l]),{getButtonProps:h,buttonRef:p}=Jc({disabled:s,native:i});return _t("button",t,{state:d,ref:[p,n,c],props:[u,a,h],customStyleHookMapping:jh})});process.env.NODE_ENV!=="production"&&(jm.displayName="DialogTrigger");const hk=300,hl=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(hl.displayName="PopoverRootContext");function Tn(e){const t=f.useContext(hl);if(t===void 0&&!e)throw new Error("Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.");return t}function Hm({props:e}){const{open:t,onOpenChange:n,defaultOpen:r=!1,delay:o=hk,closeDelay:s=0,openOnHover:i=!1,onOpenChangeComplete:a,modal:l=!1}=e,[c,u]=f.useState(),[d,h]=f.useState(),[p,g]=f.useState(),[m,v]=f.useState(null),[y,b]=f.useState(null),[E,x]=f.useState(null),[w,T]=f.useState(!0),S=f.useRef(null),I=Wo(),[A,L]=qp({controlled:t,default:r,name:"Popover",state:"open"}),{mounted:M,setMounted:N,transitionStatus:R}=Bh(A);Im({enabled:A&&l===!0&&E!=="trigger-hover",mounted:M,open:A,referenceElement:y});const P=qe(()=>{N(!1),T(!0),x(null),a?.(!1)});wi({enabled:!e.actionsRef,open:A,ref:S,onComplete(){A||P()}}),f.useImperativeHandle(e.actionsRef,()=>({unmount:P}),[P]),f.useEffect(()=>{A||I.clear()},[I,A]);const C=qe((H,Z,re)=>{const ne=re==="trigger-hover",ee=re==="trigger-press"&&Z.detail===0,le=!H&&(re==="escape-key"||re==null);function K(){n?.(H,Z,re),L(H),H&&x(re??null)}ne?(T(!0),I.start(SC,()=>{T(!1)}),lt.flushSync(K)):K(),u(ee||le?ee?"click":"dismiss":void 0)}),_=ul({elements:{reference:m,floating:y},open:A,onOpenChange(H,Z,re){C(H,Z,Nm(re))}}),{openMethod:D,triggerProps:k}=_m(A),$=o,F=qT(_,{enabled:i&&(D!=="touch"||E!=="trigger-press"),mouseOnly:!0,move:!1,handleClose:XO({blockPointerEvents:!0}),restMs:$,delay:{close:s}}),j=rm(_,{stickIfOpen:w}),V=Em(_),Y=Cm(_),{getReferenceProps:q,getFloatingProps:X}=xm([F,j,V,Y]),U=f.useMemo(()=>({open:A,setOpen:C,mounted:M,setMounted:N,transitionStatus:R,triggerElement:m,setTriggerElement:v,positionerElement:y,setPositionerElement:b,popupRef:S,titleId:d,setTitleId:h,descriptionId:p,setDescriptionId:g,triggerProps:ti(q(),k),popupProps:X(),floatingRootContext:_,instantType:c,openMethod:D,openReason:E,onOpenChangeComplete:a,openOnHover:i,delay:o,closeDelay:s,modal:l}),[A,C,M,N,R,y,d,p,q,m,k,X,_,c,D,E,a,i,o,s,l]);return O.jsx(hl.Provider,{value:U,children:e.children})}function mk(e){return Tn(!0)?O.jsx(Hm,{props:e}):O.jsx(ZT,{children:O.jsx(Hm,{props:e})})}const Um=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,...a}=t,{open:l,setTriggerElement:c,triggerProps:u,openReason:d}=Tn(),h=f.useMemo(()=>({disabled:s,open:l}),[s,l]),{getButtonProps:p,buttonRef:g}=Jc({disabled:s,native:i}),m=f.useMemo(()=>({open(y){return y&&d==="trigger-press"?UT.open(y):jh.open(y)}}),[d]);return _t("button",t,{state:h,ref:[g,c,n],props:[u,a,p],customStyleHookMapping:m})});process.env.NODE_ENV!=="production"&&(Um.displayName="PopoverTrigger");const ml=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(ml.displayName="PopoverPortalContext");function gk(){const e=f.useContext(ml);if(e===void 0)throw new Error("Base UI: <Popover.Portal> is missing.");return e}function vk(e){const{children:t,keepMounted:n=!1,container:r}=e,{mounted:o}=Tn();return o||n?O.jsx(ml.Provider,{value:n,children:O.jsx(Kh,{root:r,children:t})}):null}const gl=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(gl.displayName="PopoverPositionerContext");function Gm(){const e=f.useContext(gl);if(!e)throw new Error("Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.");return e}const zm=f.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:l="center",sideOffset:c=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:h=5,arrowPadding:p=5,sticky:g=!1,trackAnchor:m=!0,collisionAvoidance:v=TC,...y}=t,{floatingRootContext:b,open:E,mounted:x,setPositionerElement:w,modal:T,openReason:S,openMethod:I,triggerElement:A}=Tn(),L=gk(),M=zT(),N=ik({anchor:s,floatingRootContext:b,positionMethod:i,mounted:x,side:a,sideOffset:c,align:l,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:h,sticky:g,trackAnchor:m,keepMounted:L,nodeId:M,collisionAvoidance:v}),R=f.useMemo(()=>{const D={};return E||(D.pointerEvents="none"),{role:"presentation",hidden:!x,style:{...N.positionerStyles,...D}}},[E,x,N.positionerStyles]),P=f.useMemo(()=>({props:R,...N}),[R,N]),C=f.useMemo(()=>({open:E,side:P.side,align:P.align,anchorHidden:P.anchorHidden}),[E,P.side,P.align,P.anchorHidden]),_=_t("div",t,{state:C,props:[P.props,y],ref:[n,w],customStyleHookMapping:Gr});return O.jsxs(gl.Provider,{value:P,children:[x&&T===!0&&S!=="trigger-hover"&&I!=="touch"&&O.jsx(fl,{inert:Om(!E),cutout:A}),O.jsx(YT,{id:M,children:_})]})});process.env.NODE_ENV!=="production"&&(zm.displayName="PopoverPositioner");const yk={...Gr,...bi},Ym=f.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,...a}=t,{open:l,instantType:c,transitionStatus:u,popupProps:d,titleId:h,descriptionId:p,popupRef:g,mounted:m,openReason:v,onOpenChangeComplete:y,modal:b,openMethod:E}=Tn(),x=Gm();wi({open:l,ref:g,onComplete(){l&&y?.(!0)}});const w=f.useMemo(()=>s==null?E==="touch"?g:0:typeof s=="function"?s(E??""):s,[s,E,g]),T=f.useMemo(()=>({open:l,side:x.side,align:x.align,instant:c,transitionStatus:u}),[l,x.side,x.align,c,u]),S=_t("div",t,{state:T,ref:[n,g],props:[d,{"aria-labelledby":h,"aria-describedby":p},u==="starting"?CC:Wn,a],customStyleHookMapping:yk});return O.jsx(nm,{context:x.context,modal:b==="trap-focus",disabled:!m||v==="trigger-hover",initialFocus:w,returnFocus:i,children:S})});process.env.NODE_ENV!=="production"&&(Ym.displayName="PopoverPopup");const Zm=f.forwardRef(function(t,n){const{className:r,render:o,...s}=t,{open:i}=Tn(),{arrowRef:a,side:l,align:c,arrowUncentered:u,arrowStyles:d}=Gm(),h=f.useMemo(()=>({open:i,side:l,align:c,uncentered:u}),[i,l,c,u]);return _t("div",t,{state:h,ref:[n,a],props:[{style:d,"aria-hidden":!0},s],customStyleHookMapping:Gr})});process.env.NODE_ENV!=="production"&&(Zm.displayName="PopoverArrow");const bk={...Gr,...bi},qm=f.forwardRef(function(t,n){const{className:r,render:o,...s}=t,{open:i,mounted:a,transitionStatus:l,openReason:c}=Tn(),u=f.useMemo(()=>({open:i,transitionStatus:l}),[i,l]);return _t("div",t,{state:u,ref:n,props:[{role:"presentation",hidden:!a,style:{pointerEvents:c==="trigger-hover"?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],customStyleHookMapping:bk})});process.env.NODE_ENV!=="production"&&(qm.displayName="PopoverBackdrop");const Xm=f.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{setTitleId:i}=Tn(),a=mi(s.id);return Ue(()=>(i(a),()=>{i(void 0)}),[i,a]),_t("h2",t,{ref:n,props:[{id:a},s]})});process.env.NODE_ENV!=="production"&&(Xm.displayName="PopoverTitle");const Km=f.forwardRef(function(t,n){const{render:r,className:o,...s}=t,{setDescriptionId:i}=Tn(),a=mi(s.id);return Ue(()=>(i(a),()=>{i(void 0)}),[i,a]),_t("p",t,{ref:n,props:[{id:a},s]})});process.env.NODE_ENV!=="production"&&(Km.displayName="PopoverDescription");function wk(e){return O.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[O.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-[canvas]"}),O.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-gray-200 dark:fill-none"}),O.jsx("path",{d:"M10.3333 3.34539L5.47654 7.71648C4.55842 8.54279 3.36693 9 2.13172 9H0V8H2.13172C3.11989 8 4.07308 7.63423 4.80758 6.97318L9.66437 2.60207C10.0447 2.25979 10.622 2.2598 11.0023 2.60207L15.8591 6.97318C16.5936 7.63423 17.5468 8 18.5349 8H20V9H18.5349C17.2998 9 16.1083 8.54278 15.1901 7.71648L10.3333 3.34539Z",className:"dark:fill-gray-300"})]})}function Ek({children:e,title:t,description:n,content:r,zIndex:o,classNames:s={},rootProps:i}){return O.jsxs(mk,{delay:0,...i,children:[O.jsx(Um,{className:s.trigger,children:e}),O.jsxs(vk,{children:[O.jsx(qm,{style:{zIndex:o},className:on("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",s.backdrop)}),O.jsx(zm,{sideOffset:8,className:s.positioner,style:{zIndex:o?o+1:void 0},children:O.jsxs(Ym,{className:on("origin-[var(--transform-origin)] bg-white p-1 rounded shadow-sm text-gray-900 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",s.popup),children:[O.jsx(Zm,{className:"data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",children:O.jsx(wk,{})}),t&&O.jsx(Xm,{className:"text-base font-medium",children:t}),n&&O.jsx(Km,{className:"text-base text-gray-600",children:n}),r]})})]})]})}var vl,Jm;function xk(){if(Jm)return vl;Jm=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,l=typeof hs=="object"&&hs&&hs.Object===Object&&hs,c=typeof self=="object"&&self&&self.Object===Object&&self,u=l||c||Function("return this")(),d=Object.prototype,h=d.toString,p=Math.max,g=Math.min,m=function(){return u.Date.now()};function v(w,T,S){var I,A,L,M,N,R,P=0,C=!1,_=!1,D=!0;if(typeof w!="function")throw new TypeError(e);T=x(T)||0,y(S)&&(C=!!S.leading,_="maxWait"in S,L=_?p(x(S.maxWait)||0,T):L,D="trailing"in S?!!S.trailing:D);function k(H){var Z=I,re=A;return I=A=void 0,P=H,M=w.apply(re,Z),M}function $(H){return P=H,N=setTimeout(V,T),C?k(H):M}function F(H){var Z=H-R,re=H-P,ne=T-Z;return _?g(ne,L-re):ne}function j(H){var Z=H-R,re=H-P;return R===void 0||Z>=T||Z<0||_&&re>=L}function V(){var H=m();if(j(H))return Y(H);N=setTimeout(V,F(H))}function Y(H){return N=void 0,D&&I?k(H):(I=A=void 0,M)}function q(){N!==void 0&&clearTimeout(N),P=0,I=R=A=N=void 0}function X(){return N===void 0?M:Y(m())}function U(){var H=m(),Z=j(H);if(I=arguments,A=this,R=H,Z){if(N===void 0)return $(R);if(_)return N=setTimeout(V,T),k(R)}return N===void 0&&(N=setTimeout(V,T)),M}return U.cancel=q,U.flush=X,U}function y(w){var T=typeof w;return!!w&&(T=="object"||T=="function")}function b(w){return!!w&&typeof w=="object"}function E(w){return typeof w=="symbol"||b(w)&&h.call(w)==n}function x(w){if(typeof w=="number")return w;if(E(w))return t;if(y(w)){var T=typeof w.valueOf=="function"?w.valueOf():w;w=y(T)?T+"":T}if(typeof w!="string")return w===0?w:+w;w=w.replace(r,"");var S=s.test(w);return S||i.test(w)?a(w.slice(2),S?2:8):o.test(w)?t:+w}return vl=v,vl}xk();function Sk(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[t,n]=W.useState(e),r=W.useCallback(()=>{n(!0)},[]),o=W.useCallback(()=>{n(!1)},[]),s=W.useCallback(()=>{n(i=>!i)},[]);return{value:t,setValue:n,setTrue:r,setFalse:o,toggle:s}}var Qm=typeof window<"u"?W.useLayoutEffect:W.useEffect;function Ck(e){const[t,n]=W.useState(e),r=W.useCallback(()=>{n(i=>i+1)},[]),o=W.useCallback(()=>{n(i=>i-1)},[]),s=W.useCallback(()=>{n(e)},[e]);return{count:t,increment:r,decrement:o,reset:s,setCount:n}}function Tk(e,t){const n=W.useRef(e);Qm(()=>{n.current=e},[e]),W.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function Ok({countStart:e,countStop:t=0,intervalMs:n=1e3,isIncrement:r=!1}){const{count:o,increment:s,decrement:i,reset:a}=Ck(e),{value:l,setTrue:c,setFalse:u}=Sk(!1),d=W.useCallback(()=>{u(),a()},[u,a]),h=W.useCallback(()=>{if(o===t){u();return}r?s():i()},[o,t,i,s,r,u]);return Tk(h,l?n:null),[o,{startCountdown:c,stopCountdown:u,resetCountdown:d}]}var kk=typeof window>"u";function Rk(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=a=>kk?t:window.matchMedia(a).matches,[o,s]=W.useState(()=>n?r(e):t);function i(){s(r(e))}return Qm(()=>{const a=window.matchMedia(e);return i(),a.addListener?a.addListener(i):a.addEventListener("change",i),()=>{a.removeListener?a.removeListener(i):a.removeEventListener("change",i)}},[e]),o}function zn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function eg(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function tg(...e){return t=>{let n=!1;const r=e.map(o=>{const s=eg(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():eg(e[o],null)}}}}function gr(...e){return f.useCallback(tg(...e),e)}function Pk(e,t){const n=f.createContext(t),r=s=>{const{children:i,...a}=s,l=f.useMemo(()=>a,Object.values(a));return O.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function o(s){const i=f.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function Ik(e,t=[]){let n=[];function r(s,i){const a=f.createContext(i),l=n.length;n=[...n,i];const c=d=>{const{scope:h,children:p,...g}=d,m=h?.[e]?.[l]||a,v=f.useMemo(()=>g,Object.values(g));return O.jsx(m.Provider,{value:v,children:p})};c.displayName=s+"Provider";function u(d,h){const p=h?.[e]?.[l]||a,g=f.useContext(p);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,u]}const o=()=>{const s=n.map(i=>f.createContext(i));return function(a){const l=a?.[e]||s;return f.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,_k(o,...t)]}function _k(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Yo=globalThis?.document?f.useLayoutEffect:()=>{},Nk=f[" useId ".trim().toString()]||(()=>{}),Ak=0;function yl(e){const[t,n]=f.useState(Nk());return Yo(()=>{n(r=>r??String(Ak++))},[e]),e||(t?`radix-${t}`:"")}var Dk=f[" useInsertionEffect ".trim().toString()]||Yo;function Mk({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=Lk({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o;{const u=f.useRef(e!==void 0);f.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const c=f.useCallback(u=>{if(a){const d=$k(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[a,e,s,i]);return[l,c]}function Lk({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),s=f.useRef(t);return Dk(()=>{s.current=t},[t]),f.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function $k(e){return typeof e=="function"}function ng(e){const t=Fk(e),n=f.forwardRef((r,o)=>{const{children:s,...i}=r,a=f.Children.toArray(s),l=a.find(Bk);if(l){const c=l.props.children,u=a.map(d=>d===l?f.Children.count(c)>1?f.Children.only(null):f.isValidElement(c)?c.props.children:null:d);return O.jsx(t,{...i,ref:o,children:f.isValidElement(c)?f.cloneElement(c,void 0,u):null})}return O.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function Fk(e){const t=f.forwardRef((n,r)=>{const{children:o,...s}=n;if(f.isValidElement(o)){const i=jk(o),a=Wk(s,o.props);return o.type!==f.Fragment&&(a.ref=r?tg(r,i):i),f.cloneElement(o,a)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vk=Symbol("radix.slottable");function Bk(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vk}function Wk(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const l=s(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function jk(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Hk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],On=Hk.reduce((e,t)=>{const n=ng(`Primitive.${t}`),r=f.forwardRef((o,s)=>{const{asChild:i,...a}=o,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),O.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Uk(e,t){e&&lt.flushSync(()=>e.dispatchEvent(t))}function Zo(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>t.current?.(...n),[])}function Gk(e,t=globalThis?.document){const n=Zo(e);f.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 zk="DismissableLayer",bl="dismissableLayer.update",Yk="dismissableLayer.pointerDownOutside",Zk="dismissableLayer.focusOutside",rg,og=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sg=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...l}=e,c=f.useContext(og),[u,d]=f.useState(null),h=u?.ownerDocument??globalThis?.document,[,p]=f.useState({}),g=gr(t,S=>d(S)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=u?m.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,x=b>=y,w=Kk(S=>{const I=S.target,A=[...c.branches].some(L=>L.contains(I));!x||A||(o?.(S),i?.(S),S.defaultPrevented||a?.())},h),T=Jk(S=>{const I=S.target;[...c.branches].some(L=>L.contains(I))||(s?.(S),i?.(S),S.defaultPrevented||a?.())},h);return Gk(S=>{b===c.layers.size-1&&(r?.(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),f.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(rg=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),ig(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=rg)}},[u,h,n,c]),f.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),ig())},[u,c]),f.useEffect(()=>{const S=()=>p({});return document.addEventListener(bl,S),()=>document.removeEventListener(bl,S)},[]),O.jsx(On.div,{...l,ref:g,style:{pointerEvents:E?x?"auto":"none":void 0,...e.style},onFocusCapture:zn(e.onFocusCapture,T.onFocusCapture),onBlurCapture:zn(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:zn(e.onPointerDownCapture,w.onPointerDownCapture)})});sg.displayName=zk;var qk="DismissableLayerBranch",Xk=f.forwardRef((e,t)=>{const n=f.useContext(og),r=f.useRef(null),o=gr(t,r);return f.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),O.jsx(On.div,{...e,ref:o})});Xk.displayName=qk;function Kk(e,t=globalThis?.document){const n=Zo(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){ag(Yk,n,c,{discrete:!0})};const c={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},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Jk(e,t=globalThis?.document){const n=Zo(e),r=f.useRef(!1);return f.useEffect(()=>{const o=s=>{s.target&&!r.current&&ag(Zk,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ig(){const e=new CustomEvent(bl);document.dispatchEvent(e)}function ag(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Uk(o,s):o.dispatchEvent(s)}var wl="focusScope.autoFocusOnMount",El="focusScope.autoFocusOnUnmount",cg={bubbles:!1,cancelable:!0},Qk="FocusScope",lg=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,l]=f.useState(null),c=Zo(o),u=Zo(s),d=f.useRef(null),h=gr(t,m=>l(m)),p=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let m=function(E){if(p.paused||!a)return;const x=E.target;a.contains(x)?d.current=x:Yn(d.current,{select:!0})},v=function(E){if(p.paused||!a)return;const x=E.relatedTarget;x!==null&&(a.contains(x)||Yn(d.current,{select:!0}))},y=function(E){if(document.activeElement===document.body)for(const w of E)w.removedNodes.length>0&&Yn(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const b=new MutationObserver(y);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),b.disconnect()}}},[r,a,p.paused]),f.useEffect(()=>{if(a){fg.add(p);const m=document.activeElement;if(!a.contains(m)){const y=new CustomEvent(wl,cg);a.addEventListener(wl,c),a.dispatchEvent(y),y.defaultPrevented||(eR(sR(ug(a)),{select:!0}),document.activeElement===m&&Yn(a))}return()=>{a.removeEventListener(wl,c),setTimeout(()=>{const y=new CustomEvent(El,cg);a.addEventListener(El,u),a.dispatchEvent(y),y.defaultPrevented||Yn(m??document.body,{select:!0}),a.removeEventListener(El,u),fg.remove(p)},0)}}},[a,c,u,p]);const g=f.useCallback(m=>{if(!n&&!r||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,y=document.activeElement;if(v&&y){const b=m.currentTarget,[E,x]=tR(b);E&&x?!m.shiftKey&&y===x?(m.preventDefault(),n&&Yn(E,{select:!0})):m.shiftKey&&y===E&&(m.preventDefault(),n&&Yn(x,{select:!0})):y===b&&m.preventDefault()}},[n,r,p.paused]);return O.jsx(On.div,{tabIndex:-1,...i,ref:h,onKeyDown:g})});lg.displayName=Qk;function eR(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Yn(r,{select:t}),document.activeElement!==n)return}function tR(e){const t=ug(e),n=dg(t,e),r=dg(t.reverse(),e);return[n,r]}function ug(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 dg(e,t){for(const n of e)if(!nR(n,{upTo:t}))return n}function nR(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 rR(e){return e instanceof HTMLInputElement&&"select"in e}function Yn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rR(e)&&t&&e.select()}}var fg=oR();function oR(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=pg(e,t),e.unshift(t)},remove(t){e=pg(e,t),e[0]?.resume()}}}function pg(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function sR(e){return e.filter(t=>t.tagName!=="A")}var iR="Portal",hg=f.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=f.useState(!1);Yo(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?Yl.createPortal(O.jsx(On.div,{...r,ref:t}),i):null});hg.displayName=iR;function aR(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var Ri=e=>{const{present:t,children:n}=e,r=cR(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),s=gr(r.ref,lR(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:s}):null};Ri.displayName="Presence";function cR(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),s=f.useRef("none"),i=e?"mounted":"unmounted",[a,l]=aR(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const c=Pi(r.current);s.current=a==="mounted"?c:"none"},[a]),Yo(()=>{const c=r.current,u=o.current;if(u!==e){const h=s.current,p=Pi(c);e?l("MOUNT"):p==="none"||c?.display==="none"?l("UNMOUNT"):l(u&&h!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Yo(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const m=Pi(r.current).includes(p.animationName);if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},h=p=>{p.target===t&&(s.current=Pi(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:f.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Pi(e){return e?.animationName||"none"}function lR(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var xl=0;function uR(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mg()),document.body.insertAdjacentElement("beforeend",e[1]??mg()),xl++,()=>{xl===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xl--}},[])}function mg(){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 Ii="right-scroll-bar-position",_i="width-before-scroll-bar",dR="with-scroll-bars-hidden",fR="--removed-body-scroll-bar-size";function Sl(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pR(e,t){var n=W.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var hR=typeof window<"u"?f.useLayoutEffect:f.useEffect,gg=new WeakMap;function mR(e,t){var n=pR(null,function(r){return e.forEach(function(o){return Sl(o,r)})});return hR(function(){var r=gg.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Sl(a,null)}),s.forEach(function(a){o.has(a)||Sl(a,i)})}gg.set(n,e)},[e]),n}function gR(e){return e}function vR(e,t){t===void 0&&(t=gR);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var l=function(){var u=i;i=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return o}function yR(e){e===void 0&&(e={});var t=vR(null);return t.options=Ht({async:!0,ssr:!1},e),t}var vg=function(e){var t=e.sideCar,n=lu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return f.createElement(r,Ht({},n))};vg.isSideCarExport=!0;function bR(e,t){return e.useMedium(t),vg}var yg=yR(),Cl=function(){},Ni=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:Cl,onWheelCapture:Cl,onTouchMoveCapture:Cl}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,E=e.gapMode,x=lu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,T=mR([n,t]),S=Ht(Ht({},x),o);return f.createElement(f.Fragment,null,u&&f.createElement(w,{sideCar:yg,removeScrollBar:c,shards:d,noRelative:p,noIsolation:g,inert:m,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:E}),i?f.cloneElement(f.Children.only(a),Ht(Ht({},S),{ref:T})):f.createElement(b,Ht({},S,{className:l,ref:T}),a))});Ni.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ni.classNames={fullWidth:_i,zeroRight:Ii};var wR=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ER(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=wR();return t&&e.setAttribute("nonce",t),e}function xR(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function SR(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var CR=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ER())&&(xR(t,n),SR(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},TR=function(){var e=CR();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bg=function(){var e=TR(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},OR={left:0,top:0,right:0,gap:0},Tl=function(e){return parseInt(e||"",10)||0},kR=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Tl(n),Tl(r),Tl(o)]},RR=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return OR;var t=kR(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])}},PR=bg(),qr="data-scroll-locked",IR=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
44
- .`.concat(dR,` {
15
+ \`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:i,stack:l})}},ub={inputStabilityCheck:"once",identityFunctionCheck:"once"},Bo=Symbol("NOT_FOUND");function lb(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function db(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function fb(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var ll=e=>Array.isArray(e)?e:[e];function pb(e){const t=Array.isArray(e[0])?e[0]:e;return fb(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dl(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var hb=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...ub,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:ab},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:cb}}};function mb(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Bo},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function gb(e,t){let n=[];function r(a){const c=n.findIndex(l=>t(a,l.key));if(c>-1){const l=n[c];return c>0&&(n.splice(c,1),n.unshift(l)),l.value}return Bo}function o(a,c){r(a)===Bo&&(n.unshift({key:a,value:c}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var vb=(e,t)=>e===t;function yb(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function bb(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=vb,maxSize:o=1,resultEqualityCheck:s}=n,i=yb(r);let a=0;const c=o<=1?mb(i):gb(o,i);function l(){let u=c.get(arguments);if(u===Bo){if(u=e.apply(null,arguments),a++,s){const f=c.getEntries().find(h=>s(h.value,u));f&&(u=f.value,a!==0&&a--)}c.put(arguments,u)}return u}return l.clearCache=()=>{c.clear(),l.resetResultsCount()},l.resultsCount=()=>a,l.resetResultsCount=()=>{a=0},l}var wb=class{constructor(e){this.value=e}deref(){return this.value}},Eb=typeof WeakRef<"u"?WeakRef:wb,Sb=0,fl=1;function Uo(){return{s:Sb,v:void 0,o:null,p:null}}function pl(e,t={}){let n=Uo();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:c}=arguments;for(let d=0,f=c;d<f;d++){const h=arguments[d];if(typeof h=="function"||typeof h=="object"&&h!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);const g=m.get(h);g===void 0?(a=Uo(),m.set(h,a)):a=g}else{let m=a.p;m===null&&(a.p=m=new Map);const g=m.get(h);g===void 0?(a=Uo(),m.set(h,a)):a=g}}const l=a;let u;if(a.s===fl)u=a.v;else if(u=e.apply(null,arguments),s++,r){const d=o?.deref?.()??o;d!=null&&r(d,u)&&(u=d,s!==0&&s--),o=typeof u=="object"&&u!==null||typeof u=="function"?new Eb(u):u}return l.s=fl,l.v=u,u}return i.clearCache=()=>{n=Uo(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function hl(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,c={},l=o.pop();typeof l=="object"&&(c=l,l=o.pop()),lb(l,`createSelector expects an output function after the inputs, but received: [${typeof l}]`);const u={...n,...c},{memoize:d,memoizeOptions:f=[],argsMemoize:h=pl,argsMemoizeOptions:m=[],devModeChecks:g={}}=u,y=ll(f),v=ll(m),S=pb(o),C=d(function(){return s++,l.apply(null,arguments)},...y);let w=!0;const b=h(function(){i++;const E=dl(S,arguments);if(a=C.apply(null,E),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:O,inputStabilityCheck:D}=hb(w,g);if(O.shouldRun&&O.run(l,E,a),D.shouldRun){const k=dl(S,arguments);D.run({inputSelectorResults:E,inputSelectorResultsCopy:k},{memoize:d,memoizeOptions:y},arguments)}w&&(w=!1)}return a},...v);return Object.assign(b,{resultFunc:l,memoizedResultFunc:C,dependencies:S,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var Cb=hl(pl),xb=Object.assign((e,t=Cb)=>{db(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,c)=>(i[n[c]]=a,i),{}))},{withTypes:()=>xb});const Tb=hl({memoize:bb,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Ob=(...e)=>{const t=new WeakMap;let n=1;const r=e[e.length-1],o=e.length-1||1,s=r.length-o;if(s>3)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":Qe(2));return(a,c,l,u)=>{let d=a.__cacheKey__;d||(d={id:n},a.__cacheKey__=d,n+=1);let f=t.get(d);if(!f){let h=e;const m=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{h=[...e.slice(0,-1),()=>m[0],r];break}case 2:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],r];break}case 3:{h=[...e.slice(0,-1),()=>m[0],()=>m[1],()=>m[2],r];break}default:throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of arguments":Qe(2))}f=Tb(...h),f.selectorArgs=m,t.set(d,f)}switch(f.selectorArgs[0]=c,f.selectorArgs[1]=l,f.selectorArgs[2]=u,s){case 0:return f(a);case 1:return f(a,c);case 2:return f(a,c,l);case 3:return f(a,c,l,u);default:throw new Error("unreachable")}}};var Wo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ho={exports:{}},zi={};var ml;function Pb(){if(ml)return zi;ml=1;var e=z;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,f){var h=f(),m=r({inst:{value:h,getSnapshot:f}}),g=m[0].inst,y=m[1];return s(function(){g.value=h,g.getSnapshot=f,c(g)&&y({inst:g})},[d,h,f]),o(function(){return c(g)&&y({inst:g}),d(function(){c(g)&&y({inst:g})})},[d]),i(h),h}function c(d){var f=d.getSnapshot;d=d.value;try{var h=f();return!n(d,h)}catch{return!0}}function l(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return zi.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,zi}var Vi={};var gl;function Ib(){return gl||(gl=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){u||o.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=m();if(!d){var y=m();s(g,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}y=i({inst:{value:g,getSnapshot:m}});var v=y[0].inst,S=y[1];return c(function(){v.value=g,v.getSnapshot=m,n(v)&&S({inst:v})},[h,g,m]),a(function(){return n(v)&&S({inst:v}),h(function(){n(v)&&S({inst:v})})},[h]),l(g),g}function n(h){var m=h.getSnapshot;h=h.value;try{var g=m();return!s(h,g)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=z,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,l=o.useDebugValue,u=!1,d=!1,f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Vi.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:f,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Vi}var vl;function ji(){return vl||(vl=1,process.env.NODE_ENV==="production"?Ho.exports=Pb():Ho.exports=Ib()),Ho.exports}var kb=ji(),Zo={exports:{}},Bi={};var yl;function Rb(){if(yl)return Bi;yl=1;var e=z,t=ji();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Bi.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function v(T){if(!S){if(S=!0,C=T,T=f(T),h!==void 0&&g.hasValue){var E=g.value;if(h(E,T))return w=E}return w=T}if(E=w,r(C,T))return E;var O=f(T);return h!==void 0&&h(E,O)?(C=T,E):(C=T,w=O)}var S=!1,C,w,b=d===void 0?null:d;return[function(){return v(u())},b===null?void 0:function(){return v(b())}]},[u,d,f,h]);var y=o(l,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=y},[y]),c(y),y},Bi}var Ui={};var bl;function Nb(){return bl||(bl=1,process.env.NODE_ENV!=="production"&&(function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=z,n=ji(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Ui.useSyncExternalStoreWithSelector=function(l,u,d,f,h){var m=s(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=a(function(){function v(T){if(!S){if(S=!0,C=T,T=f(T),h!==void 0&&g.hasValue){var E=g.value;if(h(E,T))return w=E}return w=T}if(E=w,r(C,T))return E;var O=f(T);return h!==void 0&&h(E,O)?(C=T,E):(C=T,w=O)}var S=!1,C,w,b=d===void 0?null:d;return[function(){return v(u())},b===null?void 0:function(){return v(b())}]},[u,d,f,h]);var y=o(l,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=y},[y]),c(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ui}var wl;function Ab(){return wl||(wl=1,process.env.NODE_ENV==="production"?Zo.exports=Rb():Zo.exports=Nb()),Zo.exports}var Db=Ab();const Mb=parseInt(p.version,10);function Wi(e){return Mb>=e}const Lb=Wi(19)?$b:zb;function Re(e,t,n,r,o){return Lb(e,t,n,r,o)}function Fb(e,t,n,r,o){const s=p.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return kb.useSyncExternalStore(e.subscribe,s,s)}function $b(e,t,n,r,o){return Fb(e,t,n,r,o)}function zb(e,t,n,r,o){return Db.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class El{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Re(this,t,n,r,o)}}const Hi=p[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Vb=Hi&&Hi!==p.useLayoutEffect?Hi:e=>e();function ae(e){const t=ft(jb).current;return t.next=e,Vb(t.effect),t.trampoline}function jb(){const e={next:void 0,callback:Bb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Bb(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const se=typeof document<"u"?p.useLayoutEffect:()=>{};function gt(){}const Sl=Object.freeze([]),st=Object.freeze({});class Go extends El{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){p.useDebugValue(t),se(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;se(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this;if(process.env.NODE_ENV!=="production"){p.useDebugValue(t,i=>Object.keys(i));const o=p.useRef(Object.keys(t)).current,s=Object.keys(t);(o.length!==s.length||o.some((i,a)=>i!==s[a]))&&console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.")}const r=Object.values(t);se(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){p.useDebugValue(t);const r=n!==void 0;if(se(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r]),process.env.NODE_ENV!=="production"){const o=this.controlledValues??=new Map;o.has(t)||o.set(t,r);const s=o.get(t);s!==void 0&&s!==r&&console.error(`A component is changing the ${r?"":"un"}controlled state of ${t.toString()} to be ${r?"un":""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`)}}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return p.useDebugValue(t),Re(this,this.selectors[t],n,r,o)}useContextCallback(t,n){p.useDebugValue(t);const r=ae(n??gt);this.context[t]=r}useStateSetter(t){const n=p.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}function Yo(){return typeof window<"u"}function St(e){return Zi(e)?(e.nodeName||"").toLowerCase():"#document"}function qe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function on(e){var t;return(t=(Zi(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zi(e){return Yo()?e instanceof Node||e instanceof qe(e).Node:!1}function De(e){return Yo()?e instanceof Element||e instanceof qe(e).Element:!1}function Ze(e){return Yo()?e instanceof HTMLElement||e instanceof qe(e).HTMLElement:!1}function Er(e){return!Yo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qe(e).ShadowRoot}function An(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Ub(e){return/^(table|td|th)$/.test(St(e))}function qo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Wb=/transform|translate|scale|rotate|perspective|filter/,Hb=/paint|layout|strict|content/,Gn=e=>!!e&&e!=="none";let Gi;function Yi(e){const t=De(e)?Rt(e):e;return Gn(t.transform)||Gn(t.translate)||Gn(t.scale)||Gn(t.rotate)||Gn(t.perspective)||!Ko()&&(Gn(t.backdropFilter)||Gn(t.filter))||Wb.test(t.willChange||"")||Hb.test(t.contain||"")}function Zb(e){let t=yn(e);for(;Ze(t)&&!vn(t);){if(Yi(t))return t;if(qo(t))return null;t=yn(t)}return null}function Ko(){return Gi==null&&(Gi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Gi}function vn(e){return/^(html|body|#document)$/.test(St(e))}function Rt(e){return qe(e).getComputedStyle(e)}function Xo(e){return De(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function yn(e){if(St(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Er(e)&&e.host||on(e);return Er(t)?t.host:t}function Cl(e){const t=yn(e);return vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ze(t)&&An(t)?t:Cl(t)}function eo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Cl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=qe(o);if(s){const a=qi(i);return t.concat(i,i.visualViewport||[],An(o)?o:[],a&&n?eo(a):[])}else return t.concat(o,eo(o,[],n))}function qi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function sn(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function _e(e){return e?.ownerDocument||document}function Pe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const Jo=null;let xl=globalThis.requestAnimationFrame;class Gb{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1;const r=process.env.NODE_ENV!=="production"&&xl!==requestAnimationFrame&&(xl=requestAnimationFrame,!0);return(!this.isScheduled||r)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Qo=new Gb;class an{static create(){return new an}static request(t){return Qo.request(t)}static cancel(t){return Qo.cancel(t)}currentId=Jo;request(t){this.cancel(),this.currentId=Qo.request(()=>{this.currentId=Jo,t()})}cancel=()=>{this.currentId!==Jo&&(Qo.cancel(this.currentId),this.currentId=Jo)};disposeEffect=()=>this.cancel}function es(){const e=ft(an.create).current;return Qr(e.disposeEffect),e}const to=0;class Mt{static create(){return new Mt}currentId=to;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=to,n()},t)}isStarted(){return this.currentId!==to}clear=()=>{this.currentId!==to&&(clearTimeout(this.currentId),this.currentId=to)};disposeEffect=()=>this.clear}function Lt(){const e=ft(Mt.create).current;return Qr(e.disposeEffect),e}let Tl=0;function Yb(e){return Tl+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Tl}`}function Ki(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const Sr=typeof navigator<"u",Xi=Kb(),Ol=Jb(),_l=Xb(),Ji=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Pl=Xi.platform==="MacIntel"&&Xi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Xi.platform),qb=Sr&&/apple/i.test(navigator.vendor),Qi=Sr&&/android/i.test(Ol)||/android/i.test(_l);Sr&&Ol.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const Il=_l.includes("jsdom/");function Kb(){if(!Sr)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Xb(){if(!Sr)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Jb(){if(!Sr)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const ea="data-base-ui-focusable",kl="active",Rl="selected",Nl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Dn="ArrowLeft",Mn="ArrowRight",ta="ArrowUp",no="ArrowDown";function Ct(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function be(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Er(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function it(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Al(e,t){if(!De(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(be(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function qt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Qb(e){return e.matches("html,body")}function na(e){return Ze(e)&&e.matches(Nl)}function e0(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Nl}`)!=null}function ra(e){return e?e.getAttribute("role")==="combobox"&&na(e):!1}function oa(e){if(!e||Il)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function ro(e){return e?e.hasAttribute(ea)?e:e.querySelector(`[${ea}]`)||e:null}function cn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...cn(e,o.id,n)])}function Dl(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function Ft(e){e.preventDefault(),e.stopPropagation()}function t0(e){return"nativeEvent"in e}function Ml(e){return e.pointerType===""&&e.isTrusted?!0:Qi&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ll(e){return Il?!1:!Qi&&e.width===0&&e.height===0||Qi&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function oo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Fl(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const n0=["top","right","bottom","left"],Cr=Math.min,$t=Math.max,ts=Math.round,Yn=Math.floor,un=e=>({x:e,y:e}),r0={left:"right",right:"left",bottom:"top",top:"bottom"};function sa(e,t,n){return $t(e,Cr(t,n))}function bn(e,t){return typeof e=="function"?e(t):e}function Nt(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function ia(e){return e==="x"?"y":"x"}function aa(e){return e==="y"?"height":"width"}function Wt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ca(e){return ia(Wt(e))}function o0(e,t,n){n===void 0&&(n=!1);const r=Ln(e),o=ca(e),s=aa(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ns(i)),[i,ns(i)]}function s0(e){const t=ns(e);return[ua(e),t,ua(t)]}function ua(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const $l=["left","right"],zl=["right","left"],i0=["top","bottom"],a0=["bottom","top"];function c0(e,t,n){switch(e){case"top":case"bottom":return n?t?zl:$l:t?$l:zl;case"left":case"right":return t?i0:a0;default:return[]}}function u0(e,t,n,r){const o=Ln(e);let s=c0(Nt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ua)))),s}function ns(e){const t=Nt(e);return r0[t]+e.slice(t.length)}function l0(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vl(e){return typeof e!="number"?l0(e):{top:e,right:e,bottom:e,left:e}}function so(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 rs(e,t,n){return Math.floor(e/t)!==n}function os(e,t){return t<0||t>=e.length}function la(e,t){return _t(e.current,{disabledIndices:t})}function jl(e,t){return _t(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function _t(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function d0(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:s,cols:i,disabledIndices:a,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,h;if(t.key===ta?h="up":t.key===no&&(h="down"),h){const m=[],g=[];let y=!1,v=0;{let D=null,k=-1;e.forEach((L,F)=>{if(L==null)return;v+=1;const N=L.closest('[role="row"]');N&&(y=!0),(N!==D||k===-1)&&(D=N,k+=1,m[k]=[]),m[k].push(F),g[F]=k})}let S=!1,C=0;if(y)for(const D of m){const k=D.length;k>C&&(C=k),k!==i&&(S=!0)}const w=S&&v<e.length,b=C||i,T=D=>{if(!S||u===-1)return;const k=g[u];if(k==null)return;const L=m[k].indexOf(u),F=D==="up"?-1:1;for(let N=k+F,R=0;R<m.length;R+=1,N+=F){if(N<0||N>=m.length){if(!r||w)return;if(N=N<0?m.length-1:0,o){const I=Math.min(L,m[N].length-1),P=m[N][I]??m[N][0],A=o(t,u,P);N=g[A]??N}}const _=m[N];for(let I=Math.min(L,_.length-1);I>=0;I-=1){const P=_[I];if(!xr(e,P,a))return P}}},E=D=>{if(!w||u===-1)return;const k=u%b,L=D==="up"?-b:b,F=l-l%b,N=Yn(l/b)+1;for(let R=u-k+L,_=0;_<N;_+=1,R+=L){if(R<0||R>l){if(!r)return;R=R<0?F:0}const I=Math.min(R+b-1,l);for(let P=Math.min(R+k,I);P>=R;P-=1)if(!xr(e,P,a))return P}};d&&Ft(t);const O=T(h)??E(h);if(O!==void 0)f=O;else if(u===-1)f=h==="up"?l:c;else if(f=_t(e,{startingIndex:u,amount:b,decrement:h==="up",disabledIndices:a}),r){if(h==="up"&&(u-b<c||f<0)){const D=u%b,k=l%b,L=l-(k-D);k===D?f=l:f=k>D?L:L-b,o&&(f=o(t,u,f))}h==="down"&&u+b>l&&(f=_t(e,{startingIndex:u%b-b,amount:b,disabledIndices:a}),o&&(f=o(t,u,f)))}os(e,f)&&(f=u)}if(n==="both"){const m=Yn(u/i);t.key===(s?Dn:Mn)&&(d&&Ft(t),u%i!==i-1?(f=_t(e,{startingIndex:u,disabledIndices:a}),r&&rs(f,i,m)&&(f=_t(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(f=o(t,u,f)))):r&&(f=_t(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(f=o(t,u,f))),rs(f,i,m)&&(f=u)),t.key===(s?Mn:Dn)&&(d&&Ft(t),u%i!==0?(f=_t(e,{startingIndex:u,decrement:!0,disabledIndices:a}),r&&rs(f,i,m)&&(f=_t(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a}),o&&(f=o(t,u,f)))):r&&(f=_t(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a}),o&&(f=o(t,u,f))),rs(f,i,m)&&(f=u));const g=Yn(l/i)===m;os(e,f)&&(r&&g?(f=t.key===(s?Mn:Dn)?l:_t(e,{startingIndex:u-u%i-1,disabledIndices:a}),o&&(f=o(t,u,f))):f=u)}return f}function f0(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},a)=>{if(s>t&&process.env.NODE_ENV!=="production")throw new Error(`[Floating UI]: Invalid grid - item width at index ${a} is greater than grid columns`);let c=!1;for(;!c;){const l=[];for(let u=0;u<s;u+=1)for(let d=0;d<i;d+=1)l.push(o+u+d*t);o%t+s<=t&&l.every(u=>r[u]==null)?(l.forEach(u=>{r[u]=a}),c=!0):o+=1}}),[...r]}function p0(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function h0(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?ss(o)?!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!0:!1}function m0(e){return e.visibility==="hidden"||e.visibility==="collapse"}function ss(e,t=e?Rt(e):null){return!e||!e.isConnected||!t||m0(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const g0='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function v0(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return Er(n)?n.host:null}function da(e){for(const t of Array.from(e.children))if(St(t)==="summary")return t;return null}function y0(e,t){const n=da(t);return!!n&&(e===n||be(n,e))}function Bl(e){const t=e?St(e):"";return e!=null&&e.matches(g0)&&(t!=="summary"||e.parentElement!=null&&St(e.parentElement)==="details"&&da(e.parentElement)===e)&&(t!=="details"||da(e)==null)&&(t!=="input"||e.type!=="hidden")}function Ul(e){if(!Bl(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=v0(t)){const n=t!==e,r=St(t)==="slot";if(t.hasAttribute("inert")||n&&St(t)==="details"&&!t.open&&!y0(e,t)||t.hasAttribute("hidden")||!r&&!b0(t,n))return!1}return!0}function b0(e,t){const n=Rt(e);return t?n.display!=="none":ss(e,n)}function Wl(e){const t=e.tabIndex;if(t<0){const n=St(e);if(n==="details"||n==="audio"||n==="video"||Ze(e)&&e.isContentEditable)return 0}return t}function fa(e){if(St(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function w0(e,t){const n=fa(e);if(!n)return!0;const r=t.find(o=>{const s=fa(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=fa(o);return s?.name===n.name&&s.form===n.form})===n}function Hl(e){if(Ze(e)&&St(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ze(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Zl(e,t){Hl(e).forEach(n=>{Bl(n)&&t.push(n),Zl(n,t)})}function Gl(e,t,n){Hl(e).forEach(r=>{Ze(r)&&r.matches(t)&&n.push(r),Gl(r,t,n)})}function pa(e){return Ul(e)&&Wl(e)>=0}function Yl(e){const t=[];return Zl(e,t),t.filter(Ul)}function io(e){const t=Yl(e);return t.filter(n=>Wl(n)>=0&&w0(n,t))}function ql(e,t){const n=io(e),r=n.length;if(r===0)return;const o=Ct(_e(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function ha(e){return ql(_e(e).body,1)||e}function Kl(e){return ql(_e(e).body,-1)||e}function Xl(e,t){if(!e)return null;const n=io(_e(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function E0(e){return Xl(e,1)}function S0(e){return Xl(e,-1)}function Tr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!be(n,r)}function C0(e){io(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Jl(e){const t=[];Gl(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const is=Ob(e=>e.toasts,e=>{const t=new Map;let n=0,r=0;return e.forEach((o,s)=>{const i=o.transitionStatus==="ending";t.set(o.id,{value:o,domIndex:s,visibleIndex:i?-1:n,offsetY:r}),r+=o.height||0,i||(n+=1)}),t}),ln={toasts:ne(e=>e.toasts),isEmpty:ne(e=>e.toasts.length===0),toast:ne(is,(e,t)=>e.get(t)?.value),toastIndex:ne(is,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:ne(is,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:ne(is,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:ne(e=>e.hovering),focused:ne(e=>e.focused),expanded:ne(e=>e.hovering||e.focused),expandedOrOutOfFocus:ne(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:ne(e=>e.prevFocusElement)};class x0 extends Go{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},ln)}setFocused(t){this.set("focused",t)}setHovering(t){this.set("hovering",t)}setIsWindowFocused(t){this.set("isWindowFocused",t)}setPrevFocusElement(t){this.set("prevFocusElement",t)}setViewport=t=>{this.set("viewport",t)};disposeEffect=()=>()=>{this.timers.forEach(t=>{t.timeout?.clear()}),this.timers.clear()};removeToast(t,n={}){const r=ln.toastIndex(this.state,t);if(r===-1)return;const o=this.state.toasts[r];n.skipOnRemove||o?.onRemove?.();const s=[...this.state.toasts];s.splice(r,1),this.setToasts(s)}addToast=t=>{const{timeout:n,limit:r}=this.state,o=t.id||Yb("toast");if(t.id){const l=ln.toast(this.state,t.id);if(l)if(l.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:u,transitionStatus:d,...f}=t;return this.updateToastInternal(t.id,f,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:o,updateKey:0,transitionStatus:"starting"},i=[s,...this.state.toasts],a=i.filter(l=>l.transitionStatus!=="ending");if(a.length>r){const l=a.length-r,u=a.slice(-l),d=new Set(u.map(f=>f.id));this.setToasts(i.map(f=>{const h=d.has(f.id);return f.limited!==h?{...f,limited:h}:f}))}else this.setToasts(i.map(l=>l.limited?{...l,limited:!1}:l));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(o,c,()=>this.closeToast(o)),ln.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),o};updateToast=(t,n)=>{this.updateToastInternal(t,n,{markUpdated:!0})};updateToastInternal=(t,n,r={})=>{const{timeout:o,toasts:s}=this.state,i=ln.toast(this.state,t)??null;if(!i||i.transitionStatus==="ending")return;const a={...i,...n,...r.markUpdated&&{updateKey:(i.updateKey??0)+1}};this.setToasts(s.map(g=>g.id===t?a:g));const c=a.timeout??o,l=i?.timeout??o,u=Object.hasOwn(n,"timeout"),d=a.transitionStatus!=="ending"&&a.type!=="loading"&&c>0,f=this.timers.has(t),h=l!==c,m=i?.type==="loading";if(!d&&f){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(d&&(!f||h||u||m||r.resetTimer)){const g=this.timers.get(t);g&&(g.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,c,()=>this.closeToast(t)),ln.expandedOrOutOfFocus(this.state)&&this.pauseTimers()}};closeToast=t=>{const n=t===void 0,{limit:r,toasts:o}=this.state;let s;if(n)s=o,this.timers.forEach(l=>{l.timeout?.clear()}),this.timers.clear();else{const l=ln.toast(this.state,t);if(!l)return;s=[l];const u=this.timers.get(t);u?.timeout&&(u.timeout.clear(),this.timers.delete(t))}let i=0;const c={toasts:o.map(l=>{if(n||l.id===t)return{...l,transitionStatus:"ending",height:0};if(l.transitionStatus==="ending")return l;const u=i>=r;return i+=1,l.limited!==u?{...l,limited:u}:l})};(n||o.length===1)&&(c.hovering=!1,c.focused=!1),this.update(c),s.forEach(l=>{l.transitionStatus!=="ending"&&l.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Ki(n.loading),o=this.addToast({...r,type:"loading"}),s=t.then(i=>{const a=Ki(n.success,i);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),i}).catch(i=>{const a=Ki(n.error,i);return this.updateToast(o,{...a,type:"error",timeout:a.timeout}),Promise.reject(i)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(s),s};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(t=>{if(t.timeout){t.timeout.clear();const n=Date.now()-t.start,r=t.delay-n;t.remaining=r>0?r:0}}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((t,n)=>{t.remaining=t.remaining>0?t.remaining:t.delay,t.timeout??=Mt.create(),t.timeout.start(t.remaining,()=>{this.timers.delete(n),t.callback()}),t.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=t=>{if(t.pointerType!=="touch")return;const n=it(t);be(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),s=!ln.expandedOrOutOfFocus(this.state),i=s?Mt.create():void 0;i?.start(n,()=>{this.timers.delete(t),r()}),this.timers.set(t,{timeout:i,start:s?o:0,delay:n,remaining:n,callback:r})}setToasts(t){const n={toasts:t};t.length===0&&(n.hovering=!1,n.focused=!1),this.update(n)}handleFocusManagement(t){const n=Ct(_e(this.state.viewport));if(!this.state.viewport||!be(this.state.viewport,n)||!oa(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=ln.toasts(this.state),o=ln.toastIndex(this.state,t);let s=null,i=o+1;for(;i<r.length;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i+=1}if(!s)for(i=o-1;i>=0;){if(r[i].transitionStatus!=="ending"){s=r[i];break}i-=1}s?s.ref?.current?.focus():this.restoreFocusToPrevElement()}}const Ql=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:s}=t,i=ft(()=>new x0({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Qr(i.disposeEffect),p.useEffect(function(){return s?s[" subscribe"](({action:l,options:u})=>{const d=u.id;l==="promise"&&u.promise?i.promiseToast(u.promise,u):l==="update"&&d?i.updateToast(d,u):l==="close"?i.closeToast(d):i.addToast(u)}):void 0},[i,r,s]),i.useSyncedValues({timeout:r,limit:o}),x.jsx(jo.Provider,{value:i,children:n})};process.env.NODE_ENV!=="production"&&(Ql.displayName="ToastProvider");const ed={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},as={...ed,position:"fixed",top:0,left:0},td={...ed,position:"absolute"},dn=p.forwardRef(function(t,n){const[r,o]=p.useState();se(()=>{qb&&o("button")},[]);const s={tabIndex:0,role:r};return x.jsx("span",{...t,ref:n,style:as,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(dn.displayName="FocusGuard");function qn(e,t,n,r){const o=ft(nd).current;return O0(o,e,t,n,r)&&rd(o,[e,t,n,r]),o.callback}function T0(e){const t=ft(nd).current;return _0(t,e)&&rd(t,e),t.callback}function nd(){return{callback:null,cleanup:null,refs:[]}}function O0(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function _0(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function rd(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(r[o]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const s=t[o];if(s!=null)switch(typeof s){case"function":{const i=r[o];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}function od(e){if(!p.isValidElement(e))return null;const t=e,n=t.props;return(Wi(19)?n?.ref:t.ref)??null}function ma(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}let ga;process.env.NODE_ENV!=="production"&&(ga=new Set);function P0(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ga.has(t)||(ga.add(t),console.warn(`Base UI: ${t}`))}}function I0(e,t){const n={};for(const r in e){const o=e[r];if(t?.hasOwnProperty(r)){const s=t[r](o);s!=null&&Object.assign(n,s);continue}o===!0?n[`data-${r.toLowerCase()}`]="":o&&(n[`data-${r.toLowerCase()}`]=o.toString())}return n}function k0(e,t){return typeof e=="function"?e(t):e}function R0(e,t){return typeof e=="function"?e(t):e}const va={};function wn(e,t,n,r,o){if(!n&&!r&&!o&&!e)return cs(t);let s=cs(e);return t&&(s=ao(s,t)),n&&(s=ao(s,n)),r&&(s=ao(s,r)),o&&(s=ao(s,o)),s}function N0(e){if(e.length===0)return va;if(e.length===1)return cs(e[0]);let t=cs(e[0]);for(let n=1;n<e.length;n+=1)t=ao(t,e[n]);return t}function cs(e){return ya(e)?{...id(e,va)}:A0(e)}function ao(e,t){return ya(t)?id(t,e):D0(e,t)}function A0(e){const t={...e};for(const n in t){const r=t[n];sd(n,r)&&(t[n]=ad(r))}return t}function D0(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=ma(e.style,r);break}case"className":{e[n]=cd(e.className,r);break}default:sd(n,r)?e[n]=M0(e[n],r):e[n]=r}}return e}function sd(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&r===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function ya(e){return typeof e=="function"}function id(e,t){return ya(e)?e(t):e??va}function M0(e,t){return t?e?(...n)=>{const r=n[0];if(ud(r)){const s=r;us(s);const i=t(...n);return s.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:ad(t):e}function ad(e){return e&&((...t)=>{const n=t[0];return ud(n)&&us(n),e(...t)})}function us(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function cd(e,t){return t?e?t+" "+e:t:e}function ud(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Ve(e,t,n={}){const r=t.render,o=L0(t,n);if(n.enabled===!1)return null;const s=n.state??st;return j0(e,r,o,s)}function L0(e,t={}){const{className:n,style:r,render:o}=e,{state:s=st,ref:i,props:a,stateAttributesMapping:c,enabled:l=!0}=t,u=l?k0(n,s):void 0,d=l?R0(r,s):void 0,f=l?I0(s,c):st,h=l&&a?F0(a):void 0,m=l?ma(f,h)??{}:st;return typeof document<"u"&&(l?Array.isArray(i)?m.ref=T0([m.ref,od(o),...i]):m.ref=qn(m.ref,od(o),i):qn(null,null)),l?(u!==void 0&&(m.className=cd(m.className,u)),d!==void 0&&(m.style=ma(m.style,d)),m):st}function F0(e){return Array.isArray(e)?N0(e):wn(void 0,e)}const $0=Symbol.for("react.lazy"),z0=/^[A-Z][A-Za-z0-9$]*$/,V0=/[a-z]/;function j0(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&B0(t),t(n,r);const o=wn(n,t.props);o.ref=n.ref;let s=t;if(s?.$$typeof===$0&&(s=p.Children.toArray(t)[0]),process.env.NODE_ENV!=="production"&&!p.isValidElement(s))throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.","A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.","https://base-ui.com/r/invalid-render-prop"].join(`
16
+ `));return p.cloneElement(s,o)}if(e&&typeof e=="string")return U0(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":Qe(8))}function B0(e){const t=e.name;t.length!==0&&z0.test(t)&&V0.test(t)&&P0(`The \`render\` prop received a function named \`${t}\` that starts with an uppercase letter.`,"This usually means a React component was passed directly as `render={Component}`.","Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.","If this is an intentional render callback, rename it to start with a lowercase letter.","Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.","https://base-ui.com/r/invalid-render-prop")}function U0(e,t){return e==="button"?z.createElement("button",{type:"button",...t,key:t.key}):e==="img"?z.createElement("img",{alt:"",...t,key:t.key}):p.createElement(e,t)}let W0=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const ld=p.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,...a}=t,c=ul(),l=Lt(),u=p.useRef(!1),d=p.useRef(!1),f=p.useRef(!1),h=c.useState("isEmpty"),m=c.useState("toasts"),g=c.useState("focused"),y=c.useState("expanded"),v=c.useState("prevFocusElement"),S=m[0]?.height??0,C=p.useMemo(()=>m.some(P=>P.transitionStatus==="ending"),[m]);p.useEffect(()=>{const P=c.state.viewport;if(!P)return;function A($){h||$.key==="F6"&&it($)!==P&&($.preventDefault(),c.setPrevFocusElement(Ct(_e(P))),P?.focus({preventScroll:!0}),c.pauseTimers(),c.setFocused(!0))}const M=qe(P);return Pe(M,"keydown",A)},[c,h]),p.useEffect(()=>{const P=c.state.viewport;if(!P||h)return;const A=qe(P);function M(U){it(U)===A&&(c.setIsWindowFocused(!1),c.pauseTimers())}function $(U){if(U.relatedTarget)return;const V=it(U),H=Ct(_e(P));(V===A||!be(P,V)||!oa(H))&&c.resumeTimers(),l.start(0,()=>c.setIsWindowFocused(!0))}return sn(Pe(A,"blur",M,!0),Pe(A,"focus",$,!0))},[c,l,h]),p.useEffect(()=>{const P=c.state.viewport;if(!P||h)return;const A=_e(P);return Pe(A,"pointerdown",c.handleDocumentPointerDown,!0)},[h,c]);function w(P){const A=c.state.viewport;A&&(u.current=!0,P.relatedTarget===A?m[0]?.ref?.current?.focus():c.restoreFocusToPrevElement())}function b(P){P.key==="Tab"&&P.shiftKey&&it(P.nativeEvent)===c.state.viewport&&(P.preventDefault(),c.restoreFocusToPrevElement(),c.resumeTimers())}function T(){const P=c.state.toasts.some(A=>A.transitionStatus==="ending");!c.state.isWindowFocused||P||f.current||!d.current||(c.resumeTimers(),c.setHovering(!1),d.current=!1)}p.useEffect(T,[C,c]);function E(){c.pauseTimers(),c.setHovering(!0),d.current=!1}function O(){C||f.current?d.current=!0:(c.resumeTimers(),c.setHovering(!1))}function D(P){P.pointerType==="touch"&&(f.current=!0)}function k(P){P.pointerType==="touch"&&(f.current=!1,T())}function L(){if(u.current){u.current=!1;return}g||oa(Ct(_e(c.state.viewport)))&&(c.setFocused(!0),c.pauseTimers())}function F(P){!g||be(c.state.viewport,P.relatedTarget)||(c.setFocused(!1),c.resumeTimers())}const N={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:O,onFocus:L,onBlur:F,onKeyDown:b,onClick:L,onPointerDown:D,onPointerUp:k,onPointerCancel:k},R={expanded:y},_=Ve("div",t,{ref:[n,c.setViewport],state:R,props:[N,{style:{[W0.frontmostHeight]:S?`${S}px`:void 0}},a,{children:x.jsxs(p.Fragment,{children:[!h&&v&&x.jsx(dn,{onFocus:w}),i,!h&&v&&x.jsx(dn,{onFocus:w})]})}]}),I=p.useMemo(()=>m.filter(P=>P.priority==="high"),[m]);return x.jsxs(p.Fragment,{children:[!h&&v&&x.jsx(dn,{onFocus:w}),_,!g&&I.length>0&&x.jsx("div",{style:as,children:I.map(P=>x.jsxs("div",{role:"alert","aria-atomic":!0,children:[x.jsx("div",{children:P.title}),x.jsx("div",{children:P.description})]},P.id))})]})});process.env.NODE_ENV!=="production"&&(ld.displayName="ToastViewport");function ls(e){return Wi(19)?e:e?"true":void 0}const ba=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(ba.displayName="ToastRootContext");function H0(){const e=p.useContext(ba);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":Qe(66));return e}let co=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Z0={[co.startingStyle]:""},G0={[co.endingStyle]:""},En={transitionStatus(e){return e==="starting"?Z0:e==="ending"?G0:null}};function Sn(e){return e==null?e:"current"in e?e.current:e}function dd(e,t=!1,n=!0){const r=es();return ae((o,s=null)=>{r.cancel();const i=Sn(e);if(i==null)return;const a=i,c=()=>{jt.flushSync(o)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function l(){Promise.all(a.getAnimations().map(u=>u.finished)).then(()=>{s?.aborted||c()}).catch(()=>{if(n){s?.aborted||c();return}const u=a.getAnimations();!s?.aborted&&u.length>0&&u.some(d=>d.pending||d.playState!=="finished")&&l()})}if(t){const u=co.startingStyle;if(!a.hasAttribute(u)){r.request(l);return}const d=new MutationObserver(()=>{a.hasAttribute(u)||(d.disconnect(),l())});d.observe(a,{attributes:!0,attributeFilter:[u]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(l)})}function Cn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=ae(o),i=dd(r,n,!1);p.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let Kn=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Y0=500,q0={style:{transition:"none"}},wa="data-base-ui-click-trigger",K0="data-base-ui-swipe-ignore",X0="data-swipe-ignore",J0=`[${K0}]`,Q0=`[${X0}]`,ew={fallbackAxisSide:"none"},tw={fallbackAxisSide:"end"},nw={clipPath:"inset(50%)",position:"fixed",top:0,left:0},rw={...En,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},uo=40,ow=10,Fn=.5,sw=1,iw=`${J0},${Q0}`;function fd(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function aw(e){const n=qe(e).getComputedStyle(e).transform;let r=0,o=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const a=i[1].split(", ").map(parseFloat);a.length===6?(r=a[4],o=a[5],s=Math.sqrt(a[0]*a[0]+a[1]*a[1])):a.length===16&&(r=a[12],o=a[13],s=a[0])}}return{x:r,y:o,scale:s}}const pd=p.forwardRef(function(t,n){const{toast:r,render:o,className:s,swipeDirection:i=["down","right"],style:a,...c}=t,l=r.positionerProps?.anchor!==void 0;let u=[];l||(u=Array.isArray(i)?i:[i]);const d=u.length>0,f=ul(),[h,m]=p.useState(void 0),[g,y]=p.useState(!1),[v,S]=p.useState(!1),[C,w]=p.useState(!1),[b,T]=p.useState({x:0,y:0}),[E,O]=p.useState({x:0,y:0,scale:1}),[D,k]=p.useState(),[L,F]=p.useState(),[N,R]=p.useState(null),_=p.useRef(null),I=p.useRef({x:0,y:0}),P=p.useRef({x:0,y:0,scale:1}),A=p.useRef(void 0),M=p.useRef(0),$=p.useRef(!1),U=p.useRef({x:0,y:0}),V=p.useRef(!1),H=f.useState("toastIndex",r.id),Y=f.useState("toastVisibleIndex",r.id),G=f.useState("toastOffsetY",r.id),K=f.useState("focused"),J=f.useState("expanded");Cn({open:r.transitionStatus!=="ending",ref:_,onComplete(){r.transitionStatus==="ending"&&f.removeToast(r.id)}});const X=ae((j=!1)=>{const Z=_.current;if(!Z)return;const B=Z.style.height;Z.style.height="auto";const W=Z.offsetHeight;Z.style.height=B;function ie(){f.updateToastInternal(r.id,{ref:_,height:W,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}j?jt.flushSync(ie):ie()});se(X,[X]);function re(j,Z){let B=j,W=Z;return!u.includes("left")&&!u.includes("right")?B=j>0?j**Fn:-(Math.abs(j)**Fn):(!u.includes("right")&&j>0&&(B=j**Fn),!u.includes("left")&&j<0&&(B=-(Math.abs(j)**Fn))),!u.includes("up")&&!u.includes("down")?W=Z>0?Z**Fn:-(Math.abs(Z)**Fn):(!u.includes("down")&&Z>0&&(W=Z**Fn),!u.includes("up")&&Z<0&&(W=-(Math.abs(Z)**Fn))),{x:B,y:W}}function ue(j){if(j.button!==0)return;j.pointerType==="touch"&&f.pauseTimers();const Z=it(j.nativeEvent);if(!(Z&&Z.closest(`button,a,input,textarea,[role="button"],${iw}`))){if($.current=!1,A.current=void 0,M.current=0,I.current={x:j.clientX,y:j.clientY},U.current=I.current,_.current){const W=aw(_.current);P.current=W,O(W),T({x:W.x,y:W.y})}f.setHovering(!0),y(!0),S(!1),R(null),V.current=!0,_.current?.setPointerCapture(j.pointerId)}}function fe(j){if(!g)return;j.preventDefault(),V.current&&(I.current={x:j.clientX,y:j.clientY},V.current=!1);const{clientY:Z,clientX:B,movementX:W,movementY:ie}=j;(ie<0&&Z>U.current.y||ie>0&&Z<U.current.y)&&(U.current={x:U.current.x,y:Z}),(W<0&&B>U.current.x||W>0&&B<U.current.x)&&(U.current={x:B,y:U.current.y});const ve=B-I.current.x,he=Z-I.current.y,Ce=Z-U.current.y,$e=B-U.current.x;if(!v&&Math.sqrt(ve*ve+he*he)>=sw&&(S(!0),N===null)){const nt=u.includes("left")||u.includes("right"),vt=u.includes("up")||u.includes("down");if(nt&&vt){const rt=Math.abs(ve),ke=Math.abs(he);R(rt>ke?"horizontal":"vertical")}}let xe;if(!A.current)N==="vertical"?he>0?xe="down":he<0&&(xe="up"):N==="horizontal"?ve>0?xe="right":ve<0&&(xe="left"):Math.abs(ve)>=Math.abs(he)?xe=ve>0?"right":"left":xe=he>0?"down":"up",xe&&u.includes(xe)&&(A.current=xe,M.current=fd(xe,ve,he),m(xe));else{const je=A.current,nt=fd(je,$e,Ce);nt>uo?($.current=!1,m(je)):!(u.includes("left")&&u.includes("right"))&&!(u.includes("up")&&u.includes("down"))&&M.current-nt>=ow&&($.current=!0)}const Le=re(ve,he);let Ie=P.current.x,Fe=P.current.y;N==="horizontal"?(u.includes("left")||u.includes("right"))&&(Ie+=Le.x):(N==="vertical"||(u.includes("left")||u.includes("right"))&&(Ie+=Le.x),(u.includes("up")||u.includes("down"))&&(Fe+=Le.y)),T({x:Ie,y:Fe})}function Q(j){if(!g)return;if(y(!1),S(!1),R(null),_.current?.releasePointerCapture(j.pointerId),$.current){T({x:E.x,y:E.y}),m(void 0);return}let Z=!1;const B=b.x-E.x,W=b.y-E.y;let ie;for(const ve of u){switch(ve){case"right":B>uo&&(Z=!0,ie="right");break;case"left":B<-uo&&(Z=!0,ie="left");break;case"down":W>uo&&(Z=!0,ie="down");break;case"up":W<-uo&&(Z=!0,ie="up");break}if(Z)break}Z?(m(ie),w(!0),f.closeToast(r.id)):(T({x:E.x,y:E.y}),m(void 0))}function de(){g&&(y(!1),S(!1),R(null),T({x:E.x,y:E.y}),m(void 0))}function te(j){if(j.key==="Escape"){if(!_.current||!be(_.current,Ct(_e(_.current))))return;f.closeToast(r.id)}}p.useEffect(()=>{if(!d)return;const j=_.current;if(!j)return;function Z(B){be(j,it(B))&&B.preventDefault()}return Pe(j,"touchmove",Z,{passive:!1})},[d]);function we(){if(!g&&b.x===E.x&&b.y===E.y&&!C)return{[Kn.swipeMovementX]:"0px",[Kn.swipeMovementY]:"0px"};const j=b.x-E.x,Z=b.y-E.y;return{transition:g?"none":void 0,transform:g?`translateX(${b.x}px) translateY(${b.y}px) scale(${E.scale})`:void 0,[Kn.swipeMovementX]:`${j}px`,[Kn.swipeMovementY]:`${Z}px`}}const ce=r.priority==="high",le={role:ce?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":D,"aria-describedby":L,"aria-hidden":ce&&!K?!0:void 0,onPointerDown:d?ue:void 0,onPointerMove:d?fe:void 0,onPointerUp:d?Q:void 0,onPointerCancel:d?de:void 0,onKeyDown:te,inert:ls(r.limited),style:{...we(),[Kn.index]:r.transitionStatus==="ending"?H:Y,[Kn.offsetY]:`${G}px`,[Kn.height]:r.height?`${r.height}px`:void 0}},me=p.useMemo(()=>({rootRef:_,toast:r,titleId:D,setTitleId:k,descriptionId:L,setDescriptionId:F,swiping:g,swipeDirection:h,recalculateHeight:X,index:H,visibleIndex:Y,expanded:J}),[r,D,L,g,h,X,H,Y,J]),oe={transitionStatus:r.transitionStatus,expanded:J,limited:r.limited||!1,type:r.type,swiping:me.swiping,swipeDirection:me.swipeDirection},ye=Ve("div",t,{ref:[n,me.rootRef],state:oe,stateAttributesMapping:rw,props:[le,c]});return x.jsx(ba.Provider,{value:me,children:ye})});process.env.NODE_ENV!=="production"&&(pd.displayName="ToastRoot");const lo={...p};let hd=0;function cw(e,t="mui"){const[n,r]=p.useState(e),o=e||n;return p.useEffect(()=>{n==null&&(hd+=1,r(`${t}-${hd}`))},[n,t]),o}const md=lo.useId;function Xn(e,t){if(md!==void 0){const n=md();return e??(t?`${t}-${n}`:n)}return cw(e,t)}const gd=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,children:a,...c}=t,{toast:l,setDescriptionId:u}=H0(),d=a??l.description,f=!!d,h=Xn(i);se(()=>{if(f)return u(h),()=>{u(void 0)}},[f,h,u]);const m={type:l.type},g=Ve("p",t,{ref:n,state:m,props:{...c,id:h,children:d}});return f?g:null});process.env.NODE_ENV!=="production"&&(gd.displayName="ToastDescription");let Ea;process.env.NODE_ENV!=="production"&&(Ea=new Set);function Or(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");Ea.has(t)||(Ea.add(t),console.error(`Base UI: ${t}`))}}const vd=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(vd.displayName="CompositeRootContext");function uw(e=!1){const t=p.useContext(vd);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>.":Qe(16));return t}function lw(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:p.useMemo(()=>{const l={onKeyDown(u){n&&t&&u.key!=="Tab"&&u.preventDefault()}};return r||(l.tabIndex=o,!s&&n&&(l.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(l["aria-disabled"]=n),s&&(!t||a)&&(l.disabled=n),l},[r,n,t,i,a,s,o])}}function _r(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=p.useRef(null),a=uw(!0),c=s??a!==void 0,{props:l}=lw({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&p.useEffect(()=>{if(!i.current)return;const h=ds(i.current);if(o){if(!h){const m=lo.captureOwnerStack?.()||"";Or(`A component that acts as a button expected a native <button> because the \`nativeButton\` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the \`render\` prop, or set \`nativeButton\` to \`false\`.${m}`)}}else if(h){const m=lo.captureOwnerStack?.()||"";Or(`A component that acts as a button expected a non-<button> because the \`nativeButton\` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as \`role\` or \`aria-disabled\`). Use a non-<button> in the \`render\` prop, or set \`nativeButton\` to \`true\`.${m}`)}},[o]);const u=p.useCallback(()=>{const h=i.current;ds(h)&&c&&t&&l.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,l.disabled,c]);se(u,[u]);const d=p.useCallback((h={})=>{const{onClick:m,onMouseDown:g,onKeyUp:y,onKeyDown:v,onPointerDown:S,...C}=h;return wn({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}m?.(b)},onMouseDown(b){t||g?.(b)},onKeyDown(b){if(t||(us(b),v?.(b),b.baseUIHandlerPrevented))return;const T=b.target===b.currentTarget,E=b.currentTarget,O=ds(E),D=!o&&dw(E),k=T&&(o?O:!D),L=b.key==="Enter",F=b.key===" ",N=E.getAttribute("role"),R=N?.startsWith("menuitem")||N==="option"||N==="gridcell";if(T&&c&&F){if(b.defaultPrevented&&R)return;b.preventDefault(),D||o&&O?(E.click(),b.preventBaseUIHandler()):k&&(m?.(b),b.preventBaseUIHandler());return}k&&(!o&&(F||L)&&b.preventDefault(),!o&&L&&m?.(b))},onKeyUp(b){if(!t){if(us(b),y?.(b),b.target===b.currentTarget&&o&&c&&ds(b.currentTarget)&&b.key===" "){b.preventDefault();return}b.baseUIHandlerPrevented||b.target===b.currentTarget&&!o&&!c&&b.key===" "&&m?.(b)}},onPointerDown(b){if(t){b.preventDefault();return}S?.(b)}},o?void 0:{role:"button"},l,C)},[t,l,c,o]),f=ae(h=>{i.current=h,u()});return{getButtonProps:d,buttonRef:f}}function ds(e){return Ze(e)&&e.tagName==="BUTTON"}function dw(e){return!!(e?.tagName==="A"&&e?.href)}function fw(e,t){return t!=null&&!oo(t)?0:typeof e=="function"?e():e}function Sa(e,t,n){const r=fw(e,n);return typeof r=="number"?r:r?.[t]}function yd(e){return typeof e=="function"?e():e}function bd(e,t){return t||e==="click"||e==="mousedown"}const Pr="none",Ir="trigger-press",Pt="trigger-hover",Ca="outside-press",xa="item-press",pw="close-press",Jn="focus-out",wd="escape-key",Ta="list-navigation",hw="cancel-open",Ed="imperative-action",mw="window-resize";function Ae(e,t,n,r){let o=!1,s=!1;const i=st;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}function gw(e,t,n){const r=st;return{reason:e,event:t??new Event("base-ui"),...r}}function ct(e){const t=ft(vw,e).current;return t.next=e,se(t.effect),t}function vw(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function fs(e){return`data-base-ui-${e}`}let ps=0;function hs(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ps);const s=()=>e?.focus({preventScroll:n});if(o)return s(),gt;const i=requestAnimationFrame(s);return ps=i,()=>{ps===i&&(cancelAnimationFrame(i),ps=0)}}const Oa={inert:new WeakMap,"aria-hidden":new WeakMap},Sd="data-base-ui-inert",_a={inert:new WeakSet,"aria-hidden":new WeakSet};let fo=new WeakMap,Pa=0;function yw(e){return _a[e]}function Cd(e){return e?Er(e)?e.host:Cd(e.parentNode):null}const Ia=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Cd(n);return e.contains(r)?r:null}).filter(n=>n!=null),xd=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Td=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{St(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function bw(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,c=null;const l=Ia(t,e),u=o?Ia(t,s):[],d=new Set(u),f=o?Td(t,xd(l),new Set(l)).filter(g=>!d.has(g)):[],h=[],m=[];if(i){const g=Oa[i],y=yw(i);c=y,a=g;const v=Ia(t,Array.from(t.querySelectorAll("[aria-live]"))),S=l.concat(v);Td(t,xd(S),new Set(S)).forEach(w=>{const b=w.getAttribute(i),T=b!==null&&b!=="false",E=(g.get(w)||0)+1;g.set(w,E),h.push(w),E===1&&T&&y.add(w),T||w.setAttribute(i,i==="inert"?"":"true")})}return o&&f.forEach(g=>{const y=(fo.get(g)||0)+1;fo.set(g,y),m.push(g),y===1&&g.setAttribute(Sd,"")}),Pa+=1,()=>{a&&h.forEach(g=>{const v=(a.get(g)||0)-1;a.set(g,v),v||(!c?.has(g)&&i&&g.removeAttribute(i),c?.delete(g))}),o&&m.forEach(g=>{const y=(fo.get(g)||0)-1;fo.set(g,y),y||g.removeAttribute(Sd)}),Pa-=1,Pa||(Oa.inert=new WeakMap,Oa["aria-hidden"]=new WeakMap,_a.inert=new WeakSet,_a["aria-hidden"]=new WeakSet,fo=new WeakMap)}}function Od(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=_e(e[0]).body;return bw(e,i,n,r,{mark:o,markerIgnoreElements:s})}const ka=p.createContext(null);process.env.NODE_ENV!=="production"&&(ka.displayName="PortalContext");const _d=()=>p.useContext(ka),ww=fs("portal");function Pd(e={}){const{ref:t,container:n,componentProps:r=st,elementProps:o}=e,s=Xn(),a=_d()?.portalNode,[c,l]=p.useState(null),[u,d]=p.useState(null),f=ae(y=>{y!==null&&d(y)}),h=p.useRef(null);se(()=>{if(n===null){h.current&&(h.current=null,d(null),l(null));return}if(s==null)return;const y=(n&&(Zi(n)?n:n.current))??a??document.body;if(y==null){h.current&&(h.current=null,d(null),l(null));return}h.current!==y&&(h.current=y,d(null),l(y))},[n,a,s]);const m=Ve("div",r,{ref:[t,f],props:[{id:s,[ww]:""},o]});return{portalNode:u,portalSubtree:c&&m?jt.createPortal(m,c):null}}const ms=p.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,style:c,...l}=t,{portalNode:u,portalSubtree:d}=Pd({container:o,ref:n,componentProps:t,elementProps:l}),f=p.useRef(null),h=p.useRef(null),m=p.useRef(null),g=p.useRef(null),[y,v]=p.useState(null),S=p.useRef(!1),C=y?.modal,w=y?.open,b=typeof a=="boolean"?a:!!y&&!y.modal&&y.open&&!!u;p.useEffect(()=>{if(!u||C)return;function E(O){u&&O.relatedTarget&&Tr(O)&&(O.type==="focusin"?S.current&&(Jl(u),S.current=!1):(C0(u),S.current=!0))}return sn(Pe(u,"focusin",E,!0),Pe(u,"focusout",E,!0))},[u,C]),p.useEffect(()=>{!u||w!==!1||(Jl(u),S.current=!1)},[w,u]);const T=p.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:h,beforeInsideRef:m,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return x.jsxs(p.Fragment,{children:[d,x.jsxs(ka.Provider,{value:T,children:[b&&u&&x.jsx(dn,{"data-type":"outside",ref:f,onFocus:E=>{if(Tr(E,u))m.current?.focus();else{const O=y?y.domReference:null;Kl(O)?.focus()}}}),b&&u&&x.jsx("span",{"aria-owns":u.id,style:nw}),u&&jt.createPortal(r,u),b&&u&&x.jsx(dn,{"data-type":"outside",ref:h,onFocus:E=>{if(Tr(E,u))g.current?.focus();else{const O=y?y.domReference:null;ha(O)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Ae(Jn,E.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(ms.displayName="FloatingPortal");function Id(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Ew{nodesRef={current:[]};events=Id();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Ra=p.createContext(null);process.env.NODE_ENV!=="production"&&(Ra.displayName="FloatingNodeContext");const Na=p.createContext(null);process.env.NODE_ENV!=="production"&&(Na.displayName="FloatingTreeContext");const $n=()=>p.useContext(Ra)?.id||null,Qn=e=>{const t=p.useContext(Na);return e??t};function Sw(e){const t=Xn(),n=Qn(e),r=$n();return se(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Cw(e){const{children:t,id:n}=e,r=$n();return x.jsx(Ra.Provider,{value:p.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function xw(e){const{children:t,externalTree:n}=e,r=ft(()=>n??new Ew).current;return x.jsx(Na.Provider,{value:r,children:t})}function Tw(e,t){const n=qe(it(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const kd=20;let zn=[];function Aa(){zn=zn.filter(e=>e.deref()?.isConnected)}function Ow(e){Aa(),e&&St(e)!=="body"&&(zn.push(new WeakRef(e)),zn.length>kd&&(zn=zn.slice(-kd)))}function Da(){return Aa(),zn[zn.length-1]?.deref()}function _w(e){return e?pa(e)?e:io(e)[0]||e:null}function Rd(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=Yl(e).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return pa(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ma(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:c=!0,openInteractionType:l="",nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:h,getInsideElements:m}=e,g="rootStore"in t?t.rootStore:t,y=g.useState("open"),v=g.useState("domReferenceElement"),S=g.useState("floatingElement"),{events:C,dataRef:w}=g.context,b=ae(()=>w.current.floatingContext?.nodeId),T=o===!1,E=ra(v)&&T,O=p.useRef(["content"]),D=ct(o),k=ct(s),L=ct(l),F=Qn(h),N=_d(),R=p.useRef(!1),_=p.useRef(!1),I=p.useRef(!1),P=p.useRef(null),A=p.useRef(""),M=p.useRef(""),$=p.useRef(null),U=p.useRef(null),V=qn($,f,N?.beforeInsideRef),H=qn(U,N?.afterInsideRef),Y=Lt(),G=Lt(),K=es(),J=N!=null,X=ro(S),re=ae((Q=X)=>Q?io(Q):[]),ue=ae(()=>m?.().filter(Q=>Q!=null)??[]);p.useEffect(()=>{if(r||!a)return;function Q(te){te.key==="Tab"&&be(X,Ct(_e(X)))&&re().length===0&&!E&&Ft(te)}const de=_e(X);return Pe(de,"keydown",Q)},[r,v,X,a,O,E,re]),p.useEffect(()=>{if(r||!y)return;const Q=_e(X);function de(){I.current=!1}function te(ce){const le=it(ce),me=ue(),oe=be(S,le)||be(v,le)||be(N?.portalNode,le)||me.some(ye=>ye===le||be(ye,le));I.current=!oe,M.current=ce.pointerType||"keyboard",le?.closest(`[${wa}]`)&&(_.current=!0)}function we(){M.current="keyboard"}return sn(Pe(Q,"pointerdown",te,!0),Pe(Q,"pointerup",de,!0),Pe(Q,"pointercancel",de,!0),Pe(Q,"keydown",we,!0))},[r,S,v,X,y,N,ue]),p.useEffect(()=>{if(r||!c)return;const Q=_e(X);function de(){_.current=!0,G.start(0,()=>{_.current=!1})}function te(me){const oe=it(me);pa(oe)&&(P.current=oe)}function we(me){const oe=me.relatedTarget,ye=me.currentTarget,j=it(me);queueMicrotask(()=>{const Z=b(),B=g.context.triggerElements,W=ue(),ie=oe?.hasAttribute(fs("focus-guard"))&&[$.current,U.current,N?.beforeInsideRef.current,N?.afterInsideRef.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,Sn(d),Sn(u)].includes(oe),ve=!(be(v,oe)||be(S,oe)||be(oe,S)||be(N?.portalNode,oe)||W.some(he=>he===oe||be(he,oe))||oe!=null&&B.hasElement(oe)||B.hasMatchingElement(he=>be(he,oe))||ie||F&&(cn(F.nodesRef.current,Z).find(he=>be(he.context?.elements.floating,oe)||be(he.context?.elements.domReference,oe))||Dl(F.nodesRef.current,Z).find(he=>[he.context?.elements.floating,ro(he.context?.elements.floating)].includes(oe)||he.context?.elements.domReference===oe)));if(ye===v&&X&&Rd(X,O),i&&ye!==v&&!ss(j)&&Ct(Q)===Q.body){if(Ze(X)&&(X.focus(),i==="popup")){K.request(()=>{X.focus()});return}const he=re(),Ce=P.current,$e=(Ce&&he.includes(Ce)?Ce:null)||he[he.length-1]||X;Ze($e)&&$e.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(E||!a)&&oe&&ve&&!_.current&&(E||oe!==Da())&&(R.current=!0,g.setOpen(!1,Ae(Jn,me)))})}function ce(){I.current||(w.current.insideReactTree=!0,Y.start(0,()=>{w.current.insideReactTree=!1}))}const le=Ze(v)?v:null;if(!(!S&&!le))return sn(le&&Pe(le,"focusout",we),le&&Pe(le,"pointerdown",de),S&&Pe(S,"focusin",te),S&&Pe(S,"focusout",we),S&&N&&Pe(S,"focusout",ce,!0))},[r,v,S,X,a,F,N,g,c,i,re,E,b,O,w,Y,G,K,u,d,ue]),p.useEffect(()=>{if(r||!S||!y)return;const Q=Array.from(N?.portalNode?.querySelectorAll(`[${fs("portal")}]`)||[]),te=(F?Dl(F.nodesRef.current,b()):[]).find(ye=>ra(ye.context?.elements.domReference||null))?.context?.elements.domReference,ce=[...[S,...Q,$.current,U.current,N?.beforeOutsideRef.current,N?.afterOutsideRef.current,...ue()],te,Sn(d),Sn(u),E?v:null].filter(ye=>ye!=null),le=Od(ce,{ariaHidden:a||E,mark:!1}),me=[S,...Q].filter(ye=>ye!=null),oe=Od(me);return()=>{oe(),le()}},[y,r,v,S,a,O,N,E,F,b,u,d,ue]),se(()=>{if(!y||r||!Ze(X))return;const Q=_e(X),de=Ct(Q);queueMicrotask(()=>{const te=D.current,we=typeof te=="function"?te(L.current||""):te;if(we===void 0||we===!1||be(X,de))return;let le=null;const me=()=>(le==null&&(le=re(X)),le[0]||X);let oe;we===!0||we===null?oe=me():oe=Sn(we),oe=oe||me(),hs(oe,{preventScroll:oe===X})})},[r,y,X,T,re,D,L]),se(()=>{if(r||!X)return;const Q=_e(X),de=Ct(Q);Ow(de);function te(ce){if(ce.open||(A.current=Tw(ce.nativeEvent,M.current)),ce.reason===Pt&&ce.nativeEvent.type==="mouseleave"&&(R.current=!0),ce.reason===Ca)if(ce.nested)R.current=!1;else if(Ml(ce.nativeEvent)||Ll(ce.nativeEvent))R.current=!1;else{let le=!1;_e(X).createElement("div").focus({get preventScroll(){return le=!0,!1}}),le?R.current=!1:R.current=!0}}C.on("openchange",te);function we(){const ce=k.current;let le=typeof ce=="function"?ce(A.current):ce;if(le===void 0||le===!1)return null;if(le===null&&(le=!0),typeof le=="boolean"){const oe=v||Da();return oe&&oe.isConnected?oe:null}const me=v||Da();return Sn(le)||me||null}return()=>{C.off("openchange",te);const ce=Ct(Q),le=ue(),me=be(S,ce)||le.some(j=>j===ce||be(j,ce))||F&&cn(F.nodesRef.current,b(),!1).some(j=>be(j.context?.elements.floating,ce)),oe=k.current,ye=we();queueMicrotask(()=>{const j=_w(ye),Z=typeof oe!="boolean";oe&&!R.current&&Ze(j)&&(!(!Z&&j!==ce&&ce!==Q.body)||me)&&j.focus({preventScroll:!0}),R.current=!1})}},[r,S,X,k,w,C,F,v,b,ue]),se(()=>{if(!Ji||y||!S)return;const Q=Ct(_e(S));!Ze(Q)||!na(Q)||be(S,Q)&&Q.blur()},[y,S]),se(()=>{if(!(r||!N))return N.setFocusManagerState({modal:a,closeOnFocusOut:c,open:y,onOpenChange:g.setOpen,domReference:v}),()=>{N.setFocusManagerState(null)}},[r,N,a,y,g,c,v]),se(()=>{if(!(r||!X))return Rd(X,O),()=>{queueMicrotask(Aa)}},[r,X,O]);const fe=!r&&(a?!E:!0)&&(J||a);return x.jsxs(p.Fragment,{children:[fe&&x.jsx(dn,{"data-type":"inside",ref:V,onFocus:Q=>{if(a){const de=re();hs(de[de.length-1])}else N?.portalNode&&(R.current=!1,Tr(Q,N.portalNode)?ha(v)?.focus():Sn(d??N.beforeOutsideRef)?.focus())}}),n,fe&&x.jsx(dn,{"data-type":"inside",ref:H,onFocus:Q=>{a?hs(re()[0]):N?.portalNode&&(c&&(R.current=!0),Tr(Q,N.portalNode)?Kl(v)?.focus():Sn(u??N.afterOutsideRef)?.focus())}})]})}function La(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:o=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:c=!0,touchOpenDelay:l=0,reason:u=Ir}=t,d=p.useRef(void 0),f=es(),h=Lt(),m=p.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const y=d.current,v=g.nativeEvent,S=n.select("open");if(g.button!==0||s==="click"||oo(y,!0)&&a)return;const C=r.current.openEvent,w=C?.type,b=n.select("domReferenceElement")!==g.currentTarget,T=S&&b||!(S&&i&&(!(C&&c)||w==="click"||w==="mousedown")),E=it(v);if(na(E)){const D=Ae(u,v,E);T&&y==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,D)}):n.setOpen(T,D);return}const O=g.currentTarget;f.request(()=>{const D=Ae(u,v,O);T&&y==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,D)}):n.setOpen(T,D)})},onClick(g){if(s==="mousedown-only")return;const y=d.current;if(s==="mousedown"&&y){d.current=void 0;return}if(oo(y,!0)&&a)return;const v=n.select("open"),S=r.current.openEvent,C=n.select("domReferenceElement")!==g.currentTarget,w=v&&C||!(v&&i&&(!(S&&c)||Fl(S))),b=Ae(u,g.nativeEvent,g.currentTarget);w&&y==="touch"&&l>0?h.start(l,()=>{n.setOpen(!0,b)}):n.setOpen(w,b)},onKeyDown(){d.current=void 0}}),[r,s,a,n,c,i,f,h,l,u]);return p.useMemo(()=>o?{reference:m}:st,[o,m])}const Pw={intentional:"onClick",sloppy:"onPointerDown"};function Iw(){return!1}function kw(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Fa(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="sloppy",referencePress:u=Iw,referencePressEvent:d="sloppy",bubbles:f,externalTree:h}=t,m=Qn(h),g=ae(typeof c=="function"?c:()=>!1),y=typeof c=="function"?g:c,v=y!==!1,S=ae(()=>l),C=p.useRef(!1),w=p.useRef(!1),b=p.useRef(!1),{escapeKey:T,outsidePress:E}=kw(f),O=p.useRef(null),D=Lt(),k=Lt(),L=ae(()=>{k.clear(),s.current.insideReactTree=!1}),F=p.useRef(!1),N=p.useRef(""),R=ae(u),_=ae(U=>{if(!r||!i||!a||U.key!=="Escape"||F.current)return;const V=s.current.floatingContext?.nodeId,H=m?cn(m.nodesRef.current,V):[];if(!T&&H.length>0){let K=!0;if(H.forEach(J=>{J.context?.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(K=!1)}),!K)return}const Y=t0(U)?U.nativeEvent:U,G=Ae(wd,Y);n.setOpen(!1,G),!T&&!G.isPropagationAllowed&&U.stopPropagation()}),I=ae(()=>{s.current.insideReactTree=!0,k.start(0,L)});p.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=T,s.current.__outsidePressBubbles=E;const U=new Mt,V=new Mt;function H(){U.clear(),F.current=!0}function Y(){U.start(Ko()?5:0,()=>{F.current=!1})}function G(){b.current=!0,V.start(0,()=>{b.current=!1})}function K(){C.current=!1,w.current=!1}function J(){const B=N.current,W=B==="pen"||!B?"mouse":B,ie=S(),ve=typeof ie=="function"?ie():ie;return typeof ve=="string"?ve:ve[W]}function X(B){const W=J();return W==="intentional"&&B.type!=="click"||W==="sloppy"&&B.type==="click"}function re(B){const W=s.current.floatingContext?.nodeId,ie=m&&cn(m.nodesRef.current,W).some(ve=>qt(B,ve.context?.elements.floating));return qt(B,n.select("floatingElement"))||qt(B,n.select("domReferenceElement"))||ie}function ue(B){if(X(B)){L();return}if(s.current.insideReactTree){L();return}const W=it(B),ie=`[${fs("inert")}]`,ve=De(W)?W.getRootNode():null,he=Array.from((Er(ve)?ve:_e(n.select("floatingElement"))).querySelectorAll(ie)),Ce=n.context.triggerElements;if(W&&(Ce.hasElement(W)||Ce.hasMatchingElement(Ie=>be(Ie,W))))return;let $e=De(W)?W:null;for(;$e&&!vn($e);){const Ie=yn($e);if(vn(Ie)||!De(Ie))break;$e=Ie}if(he.length&&De(W)&&!Qb(W)&&!be(W,n.select("floatingElement"))&&he.every(Ie=>!be($e,Ie)))return;if(Ze(W)&&!("touches"in B)){const Ie=vn(W),Fe=Rt(W),je=/auto|scroll/,nt=Ie||je.test(Fe.overflowX),vt=Ie||je.test(Fe.overflowY),rt=nt&&W.clientWidth>0&&W.scrollWidth>W.clientWidth,ke=vt&&W.clientHeight>0&&W.scrollHeight>W.clientHeight,ee=Fe.direction==="rtl",pe=ke&&(ee?B.offsetX<=W.offsetWidth-W.clientWidth:B.offsetX>W.clientWidth),ge=rt&&B.offsetY>W.clientHeight;if(pe||ge)return}if(re(B))return;if(J()==="intentional"&&b.current){V.clear(),b.current=!1;return}if(typeof y=="function"&&!y(B))return;const xe=s.current.floatingContext?.nodeId,Le=m?cn(m.nodesRef.current,xe):[];if(Le.length>0){let Ie=!0;if(Le.forEach(Fe=>{Fe.context?.open&&!Fe.context.dataRef.current.__outsidePressBubbles&&(Ie=!1)}),!Ie)return}n.setOpen(!1,Ae(Ca,B)),L()}function fe(B){J()!=="sloppy"||B.pointerType==="touch"||!n.select("open")||!i||qt(B,n.select("floatingElement"))||qt(B,n.select("domReferenceElement"))||ue(B)}function Q(B){if(J()!=="sloppy"||!n.select("open")||!i||qt(B,n.select("floatingElement"))||qt(B,n.select("domReferenceElement")))return;const W=B.touches[0];W&&(O.current={startTime:Date.now(),startX:W.clientX,startY:W.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}function de(B,W){const ie=it(B);if(!ie)return;const ve=Pe(ie,B.type,()=>{W(B),ve()})}function te(B){N.current="touch",de(B,Q)}function we(B){D.clear(),B.type==="pointerdown"&&(N.current=B.pointerType),!(B.type==="mousedown"&&O.current&&!O.current.dismissOnMouseDown)&&de(B,W=>{W.type==="pointerdown"?fe(W):ue(W)})}function ce(B){if(!C.current)return;const W=w.current;if(K(),J()==="intentional"){if(B.type==="pointercancel"){W&&G();return}if(!re(B)){if(W){G();return}typeof y=="function"&&!y(B)||(V.clear(),b.current=!0,L())}}}function le(B){if(J()!=="sloppy"||!O.current||qt(B,n.select("floatingElement"))||qt(B,n.select("domReferenceElement")))return;const W=B.touches[0];if(!W)return;const ie=Math.abs(W.clientX-O.current.startX),ve=Math.abs(W.clientY-O.current.startY),he=Math.sqrt(ie*ie+ve*ve);he>5&&(O.current.dismissOnTouchEnd=!0),he>10&&(ue(B),D.clear(),O.current=null)}function me(B){de(B,le)}function oe(B){J()!=="sloppy"||!O.current||qt(B,n.select("floatingElement"))||qt(B,n.select("domReferenceElement"))||(O.current.dismissOnTouchEnd&&ue(B),D.clear(),O.current=null)}function ye(B){de(B,oe)}const j=_e(o),Z=sn(a&&sn(Pe(j,"keydown",_),Pe(j,"compositionstart",H),Pe(j,"compositionend",Y)),v&&sn(Pe(j,"click",we,!0),Pe(j,"pointerdown",we,!0),Pe(j,"pointerup",ce,!0),Pe(j,"pointercancel",ce,!0),Pe(j,"mousedown",we,!0),Pe(j,"mouseup",ce,!0),Pe(j,"touchstart",te,!0),Pe(j,"touchmove",me,!0),Pe(j,"touchend",ye,!0)));return()=>{Z(),U.clear(),V.clear(),K(),b.current=!1}},[s,o,a,v,y,r,i,T,E,_,L,S,m,n,D]),p.useEffect(L,[y,L]);const P=p.useMemo(()=>({onKeyDown:_,[Pw[d]]:U=>{R()&&n.setOpen(!1,Ae(Ir,U.nativeEvent))},...d!=="intentional"&&{onClick(U){R()&&n.setOpen(!1,Ae(Ir,U.nativeEvent))}}}),[_,n,d,R]),A=ae(U=>{if(!r||!i||U.button!==0)return;const V=it(U.nativeEvent);be(n.select("floatingElement"),V)&&(C.current||(C.current=!0,w.current=!1))}),M=ae(U=>{!r||!i||(U.defaultPrevented||U.nativeEvent.defaultPrevented)&&C.current&&(w.current=!0)}),$=p.useMemo(()=>({onKeyDown:_,onPointerDown:M,onMouseDown:M,onClickCapture:I,onMouseDownCapture(U){I(),A(U)},onPointerDownCapture(U){I(),A(U)},onMouseUpCapture:I,onTouchEndCapture:I,onTouchMoveCapture:I}),[_,I,A,M]);return p.useMemo(()=>i?{reference:P,floating:$,trigger:P}:{},[i,P,$])}function Nd(e,t,n){let{reference:r,floating:o}=e;const s=Wt(t),i=ca(t),a=aa(i),c=Nt(t),l=s==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(Ln(t)){case"start":h[i]-=f*(n&&l?-1:1);break;case"end":h[i]+=f*(n&&l?-1:1);break}return h}async function Rw(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=bn(t,e),m=Vl(h),y=a[f?d==="floating"?"reference":"floating":d],v=so(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),S=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},b=so(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:C,strategy:c}):S);return{top:(v.top-b.top+m.top)/w.y,bottom:(b.bottom-v.bottom+m.bottom)/w.y,left:(v.left-b.left+m.left)/w.x,right:(b.right-v.right+m.right)/w.x}}const Nw=50,Aw=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Rw},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Nd(l,r,c),f=r,h=0;const m={};for(let g=0;g<s.length;g++){const y=s[g];if(!y)continue;const{name:v,fn:S}=y,{x:C,y:w,data:b,reset:T}=await S({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:m,rects:l,platform:a,elements:{reference:e,floating:t}});u=C??u,d=w??d,m[v]={...m[v],...b},T&&h<Nw&&(h++,typeof T=="object"&&(T.placement&&(f=T.placement),T.rects&&(l=T.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):T.rects),{x:u,y:d}=Nd(l,f,c)),g=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:m}},Dw=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=bn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Nt(o),S=Wt(a),C=Nt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),b=f||(C||!g?[ns(a)]:s0(a)),T=m!=="none";!f&&T&&b.push(...u0(a,g,m,w));const E=[a,...b],O=await c.detectOverflow(t,y),D=[];let k=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&D.push(O[v]),d){const R=o0(o,i,w);D.push(O[R[0]],O[R[1]])}if(k=[...k,{placement:o,overflows:D}],!D.every(R=>R<=0)){var L,F;const R=(((L=s.flip)==null?void 0:L.index)||0)+1,_=E[R];if(_&&(!(d==="alignment"?S!==Wt(_):!1)||k.every(A=>Wt(A.placement)===S?A.overflows[0]>0:!0)))return{data:{index:R,overflows:k},reset:{placement:_}};let I=(F=k.filter(P=>P.overflows[0]<=0).sort((P,A)=>P.overflows[1]-A.overflows[1])[0])==null?void 0:F.placement;if(!I)switch(h){case"bestFit":{var N;const P=(N=k.filter(A=>{if(T){const M=Wt(A.placement);return M===S||M==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(M=>M>0).reduce((M,$)=>M+$,0)]).sort((A,M)=>A[1]-M[1])[0])==null?void 0:N[0];P&&(I=P);break}case"initialPlacement":I=a;break}if(o!==I)return{reset:{placement:I}}}return{}}}};function Ad(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Dd(e){return n0.some(t=>e[t]>=0)}const Mw=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=bn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=Ad(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Dd(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=Ad(i,n.floating);return{data:{escapedOffsets:a,escaped:Dd(a)}}}default:return{}}}}},Md=new Set(["left","top"]);async function Lw(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Nt(n),a=Ln(n),c=Wt(n)==="y",l=Md.has(i)?-1:1,u=s&&c?-1:1,d=bn(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}const Fw=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:a}=t,c=await Lw(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:s+c.y,data:{...c,placement:i}}}}},$w=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:v=>{let{x:S,y:C}=v;return{x:S,y:C}}},...l}=bn(e,t),u={x:n,y:r},d=await s.detectOverflow(t,l),f=Wt(Nt(o)),h=ia(f);let m=u[h],g=u[f];if(i){const v=h==="y"?"top":"left",S=h==="y"?"bottom":"right",C=m+d[v],w=m-d[S];m=sa(C,m,w)}if(a){const v=f==="y"?"top":"left",S=f==="y"?"bottom":"right",C=g+d[v],w=g-d[S];g=sa(C,g,w)}const y=c.fn({...t,[h]:m,[f]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[f]:a}}}}}},zw=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:c=!0,crossAxis:l=!0}=bn(e,t),u={x:n,y:r},d=Wt(o),f=ia(d);let h=u[f],m=u[d];const g=bn(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const C=f==="y"?"height":"width",w=s.reference[f]-s.floating[C]+y.mainAxis,b=s.reference[f]+s.reference[C]-y.mainAxis;h<w?h=w:h>b&&(h=b)}if(l){var v,S;const C=f==="y"?"width":"height",w=Md.has(Nt(o)),b=s.reference[d]-s.floating[C]+(w&&((v=i.offset)==null?void 0:v[d])||0)+(w?0:y.crossAxis),T=s.reference[d]+s.reference[C]+(w?0:((S=i.offset)==null?void 0:S[d])||0)-(w?y.crossAxis:0);m<b?m=b:m>T&&(m=T)}return{[f]:h,[d]:m}}}},Vw=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:i,elements:a}=t,{apply:c=()=>{},...l}=bn(e,t),u=await i.detectOverflow(t,l),d=Nt(o),f=Ln(o),h=Wt(o)==="y",{width:m,height:g}=s.floating;let y,v;d==="top"||d==="bottom"?(y=d,v=f===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,y=f==="end"?"top":"bottom");const S=g-u.top-u.bottom,C=m-u.left-u.right,w=Cr(g-u[y],S),b=Cr(m-u[v],C),T=!t.middlewareData.shift;let E=w,O=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=S),T&&!f){const k=$t(u.left,0),L=$t(u.right,0),F=$t(u.top,0),N=$t(u.bottom,0);h?O=m-2*(k!==0||L!==0?k+L:$t(u.left,u.right)):E=g-2*(F!==0||N!==0?F+N:$t(u.top,u.bottom))}await c({...t,availableWidth:O,availableHeight:E});const D=await i.getDimensions(a.floating);return m!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}};function Ld(e){const t=Rt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ze(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=ts(n)!==s||ts(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function $a(e){return De(e)?e:e.contextElement}function kr(e){const t=$a(e);if(!Ze(t))return un(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Ld(t);let i=(s?ts(n.width):n.width)/r,a=(s?ts(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const jw=un(0);function Fd(e){const t=qe(e);return!Ko()||!t.visualViewport?jw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Bw(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qe(e)?!1:t}function er(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=$a(e);let i=un(1);t&&(r?De(r)&&(i=kr(r)):i=kr(e));const a=Bw(s,n,r)?Fd(s):un(0);let c=(o.left+a.x)/i.x,l=(o.top+a.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(s){const f=qe(s),h=r&&De(r)?qe(r):r;let m=f,g=qi(m);for(;g&&r&&h!==m;){const y=kr(g),v=g.getBoundingClientRect(),S=Rt(g),C=v.left+(g.clientLeft+parseFloat(S.paddingLeft))*y.x,w=v.top+(g.clientTop+parseFloat(S.paddingTop))*y.y;c*=y.x,l*=y.y,u*=y.x,d*=y.y,c+=C,l+=w,m=qe(g),g=qi(m)}}return so({width:u,height:d,x:c,y:l})}function gs(e,t){const n=Xo(e).scrollLeft;return t?t.left+n:er(on(e)).left+n}function $d(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gs(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Uw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=on(r),a=t?qo(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},l=un(1);const u=un(0),d=Ze(r);if((d||!d&&!s)&&((St(r)!=="body"||An(i))&&(c=Xo(r)),d)){const h=er(r);l=kr(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const f=i&&!d&&!s?$d(i,c):un(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Ww(e){return Array.from(e.getClientRects())}function Hw(e){const t=on(e),n=Xo(e),r=e.ownerDocument.body,o=$t(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$t(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+gs(e);const a=-n.scrollTop;return Rt(r).direction==="rtl"&&(i+=$t(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const zd=25;function Zw(e,t){const n=qe(e),r=on(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const u=Ko();(!u||u&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const l=gs(r);if(l<=0){const u=r.ownerDocument,d=u.body,f=getComputedStyle(d),h=u.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=zd&&(s-=m)}else l<=zd&&(s+=l);return{width:s,height:i,x:a,y:c}}function Gw(e,t){const n=er(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Ze(e)?kr(e):un(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,l=r*s.y;return{width:i,height:a,x:c,y:l}}function Vd(e,t,n){let r;if(t==="viewport")r=Zw(e,n);else if(t==="document")r=Hw(on(e));else if(De(t))r=Gw(t,n);else{const o=Fd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return so(r)}function jd(e,t){const n=yn(e);return n===t||!De(n)||vn(n)?!1:Rt(n).position==="fixed"||jd(n,t)}function Yw(e,t){const n=t.get(e);if(n)return n;let r=eo(e,[],!1).filter(a=>De(a)&&St(a)!=="body"),o=null;const s=Rt(e).position==="fixed";let i=s?yn(e):e;for(;De(i)&&!vn(i);){const a=Rt(i),c=Yi(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||An(i)&&!c&&jd(e,i))?r=r.filter(u=>u!==i):o=a,i=yn(i)}return t.set(e,r),r}function qw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?qo(t)?[]:Yw(t,this._c):[].concat(n),r],a=Vd(t,i[0],o);let c=a.top,l=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){const h=Vd(t,i[f],o);c=$t(h.top,c),l=Cr(h.right,l),u=Cr(h.bottom,u),d=$t(h.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function Kw(e){const{width:t,height:n}=Ld(e);return{width:t,height:n}}function Xw(e,t,n){const r=Ze(t),o=on(t),s=n==="fixed",i=er(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=un(0);function l(){c.x=gs(o)}if(r||!r&&!s)if((St(t)!=="body"||An(o))&&(a=Xo(t)),r){const h=er(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&l();s&&!r&&o&&l();const u=o&&!r&&!s?$d(o,a):un(0),d=i.left+a.scrollLeft-c.x-u.x,f=i.top+a.scrollTop-c.y-u.y;return{x:d,y:f,width:i.width,height:i.height}}function za(e){return Rt(e).position==="static"}function Bd(e,t){if(!Ze(e)||Rt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return on(e)===n&&(n=n.ownerDocument.body),n}function Ud(e,t){const n=qe(e);if(qo(e))return n;if(!Ze(e)){let o=yn(e);for(;o&&!vn(o);){if(De(o)&&!za(o))return o;o=yn(o)}return n}let r=Bd(e,t);for(;r&&Ub(r)&&za(r);)r=Bd(r,t);return r&&vn(r)&&za(r)&&!Yi(r)?n:r||Zb(e)||n}const Jw=async function(e){const t=this.getOffsetParent||Ud,n=this.getDimensions,r=await n(e.floating);return{reference:Xw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qw(e){return Rt(e).direction==="rtl"}const Wd={convertOffsetParentRelativeRectToViewportRelativeRect:Uw,getDocumentElement:on,getClippingRect:qw,getOffsetParent:Ud,getElementRects:Jw,getClientRects:Ww,getDimensions:Kw,getScale:kr,isElement:De,isRTL:Qw};function Hd(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eE(e,t){let n=null,r;const o=on(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:h}=l;if(a||t(),!f||!h)return;const m=Yn(d),g=Yn(o.clientWidth-(u+f)),y=Yn(o.clientHeight-(d+h)),v=Yn(u),C={rootMargin:-m+"px "+-g+"px "+-y+"px "+-v+"px",threshold:$t(0,Cr(1,c))||1};let w=!0;function b(T){const E=T[0].intersectionRatio;if(E!==c){if(!w)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Hd(l,e.getBoundingClientRect())&&i(),w=!1}try{n=new IntersectionObserver(b,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,C)}n.observe(e)}return i(!0),s}function Zd(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,l=$a(e),u=o||s?[...l?eo(l):[],...t?eo(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=l&&a?eE(l,n):null;let f=-1,h=null;i&&(h=new ResizeObserver(v=>{let[S]=v;S&&S.target===l&&h&&t&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),l&&!c&&h.observe(l),t&&h.observe(t));let m,g=c?er(e):null;c&&y();function y(){const v=er(e);g&&!Hd(g,v)&&n(),g=v,m=requestAnimationFrame(y)}return n(),()=>{var v;u.forEach(S=>{o&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),d?.(),(v=h)==null||v.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const tE=Fw,nE=$w,rE=Dw,oE=Vw,sE=Mw,iE=zw,aE=(e,t,n)=>{const r=new Map,o={platform:Wd,...n},s={...o.platform,_c:r};return Aw(e,t,{...o,platform:s})};var cE=typeof document<"u",uE=function(){},vs=cE?z.useLayoutEffect:uE;function ys(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(!ys(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!ys(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Gd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yd(e,t){const n=Gd(e);return Math.round(t*n)/n}function Va(e){const t=p.useRef(e);return vs(()=>{t.current=e}),t}function lE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,d]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=p.useState(r);ys(f,r)||h(r);const[m,g]=p.useState(null),[y,v]=p.useState(null),S=p.useCallback(A=>{A!==T.current&&(T.current=A,g(A))},[]),C=p.useCallback(A=>{A!==E.current&&(E.current=A,v(A))},[]),w=s||m,b=i||y,T=p.useRef(null),E=p.useRef(null),O=p.useRef(u),D=c!=null,k=Va(c),L=Va(o),F=Va(l),N=p.useCallback(()=>{if(!T.current||!E.current)return;const A={placement:t,strategy:n,middleware:f};L.current&&(A.platform=L.current),aE(T.current,E.current,A).then(M=>{const $={...M,isPositioned:F.current!==!1};R.current&&!ys(O.current,$)&&(O.current=$,jt.flushSync(()=>{d($)}))})},[f,t,n,L,F]);vs(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(A=>({...A,isPositioned:!1})))},[l]);const R=p.useRef(!1);vs(()=>(R.current=!0,()=>{R.current=!1}),[]),vs(()=>{if(w&&(T.current=w),b&&(E.current=b),w&&b){if(k.current)return k.current(w,b,N);N()}},[w,b,N,k,D]);const _=p.useMemo(()=>({reference:T,floating:E,setReference:S,setFloating:C}),[S,C]),I=p.useMemo(()=>({reference:w,floating:b}),[w,b]),P=p.useMemo(()=>{const A={position:n,left:0,top:0};if(!I.floating)return A;const M=Yd(I.floating,u.x),$=Yd(I.floating,u.y);return a?{...A,transform:"translate("+M+"px, "+$+"px)",...Gd(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:$}},[n,a,I.floating,u.x,u.y]);return p.useMemo(()=>({...u,update:N,refs:_,elements:I,floatingStyles:P}),[u,N,_,I,P])}const dE=(e,t)=>{const n=tE(e);return{name:n.name,fn:n.fn,options:[e,t]}},fE=(e,t)=>{const n=nE(e);return{name:n.name,fn:n.fn,options:[e,t]}},pE=(e,t)=>({fn:iE(e).fn,options:[e,t]}),hE=(e,t)=>{const n=rE(e);return{name:n.name,fn:n.fn,options:[e,t]}},mE=(e,t)=>{const n=oE(e);return{name:n.name,fn:n.fn,options:[e,t]}},gE=(e,t)=>{const n=sE(e);return{name:n.name,fn:n.fn,options:[e,t]}},vE={open:ne(e=>e.open),transitionStatus:ne(e=>e.transitionStatus),domReferenceElement:ne(e=>e.domReferenceElement),referenceElement:ne(e=>e.positionReference??e.referenceElement),floatingElement:ne(e=>e.floatingElement),floatingId:ne(e=>e.floatingId)};class ja extends Go{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Id(),nested:r,triggerElements:s},vE),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Fl(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function po(e,t=!1,n=!1){const[r,o]=p.useState(e&&t?"idle":void 0),[s,i]=p.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),se(()=>{if(!e&&s&&r!=="ending"&&n){const a=an.request(()=>{o("ending")});return()=>{an.cancel(a)}}},[e,s,r,n]),se(()=>{if(!e||t)return;const a=an.request(()=>{o(void 0)});return()=>{an.cancel(a)}},[t,e]),se(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=an.request(()=>{o("idle")});return()=>{an.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}function yE(e,t){const n=p.useRef(null),r=p.useRef(null);return p.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function qd(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=yE(e,n),i=ae(a=>{if(s(a),!a||!n.select("open"))return;const c=n.select("activeTriggerId");if(c===e){n.update({activeTriggerElement:a,...r});return}c==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return se(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function Kd(e){const t=e.useState("open");se(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function Xd(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=po(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=ae(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Cn({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class bs{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);if(r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n),process.env.NODE_ENV!=="production"&&this.elementsSet.size!==this.idMap.size))throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.")}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function bE(){return new ja({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new bs,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function Jd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:bE(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:st,inactiveTriggerProps:st,popupProps:st}}const ws=ne(e=>e.triggerIdProp??e.activeTriggerId),Qd={open:ne(e=>e.openProp??e.open),mounted:ne(e=>e.mounted),transitionStatus:ne(e=>e.transitionStatus),floatingRootContext:ne(e=>e.floatingRootContext),preventUnmountingOnClose:ne(e=>e.preventUnmountingOnClose),payload:ne(e=>e.payload),activeTriggerId:ws,activeTriggerElement:ne(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ne((e,t)=>t!==void 0&&ws(e)===t),isOpenedByTrigger:ne((e,t)=>t!==void 0&&ws(e)===t&&e.open),isMountedByTrigger:ne((e,t)=>t!==void 0&&ws(e)===t&&e.mounted),triggerProps:ne((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ne(e=>e.popupProps),popupElement:ne(e=>e.popupElement),positionerElement:ne(e=>e.positionerElement)};function ef(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Xn(),s=$n()!=null;if(process.env.NODE_ENV!=="production"){const a=r.reference;a&&!De(a)&&console.error("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `context.setPositionReference()`","instead.")}const i=ft(()=>new ja({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new bs,floatingId:o,syncOnly:!1,nested:s})).current;return se(()=>{const a={open:t,floatingId:o};r.reference!==void 0&&(a.referenceElement=r.reference,a.domReferenceElement=De(r.reference)?r.reference:null),r.floating!==void 0&&(a.floatingElement=r.floating),i.update(a)},[t,o,r.reference,r.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i}function wE(e={}){const{nodeId:t,externalTree:n}=e,r=ef(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=p.useState(null),c=p.useRef(null),l=Qn(n);se(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const u=lE({...e,elements:{...s,...i&&{reference:i}}}),d=p.useCallback(O=>{const D=De(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),getClientRects:()=>O.getClientRects(),contextElement:O}:O;a(D),u.refs.setReference(D)},[u.refs]),[f,h]=p.useState(void 0),[m,g]=p.useState(null);o.useSyncedValue("referenceElement",f??null);const y=De(f)?f:null;o.useSyncedValue("domReferenceElement",f===void 0?s.domReference:y),o.useSyncedValue("floatingElement",m);const v=p.useCallback(O=>{(De(O)||O===null)&&(c.current=O,h(O)),(De(u.refs.reference.current)||u.refs.reference.current===null||O!==null&&!De(O))&&u.refs.setReference(O)},[u.refs,h]),S=p.useCallback(O=>{g(O),u.refs.setFloating(O)},[u.refs]),C=p.useMemo(()=>({...u.refs,setReference:v,setFloating:S,setPositionReference:d,domReference:c}),[u.refs,v,S,d]),w=p.useMemo(()=>({...u.elements,domReference:s.domReference}),[u.elements,s.domReference]),b=o.useState("open"),T=o.useState("floatingId"),E=p.useMemo(()=>({...u,dataRef:o.context.dataRef,open:b,onOpenChange:o.setOpen,events:o.context.events,floatingId:T,refs:C,elements:w,nodeId:t,rootStore:o}),[u,C,w,t,o,b,T]);return se(()=>{o.context.dataRef.current.floatingContext=E;const O=l?.nodesRef.current.find(D=>D.id===t);O&&(O.context=E)}),p.useMemo(()=>({...u,context:E,refs:C,elements:w,rootStore:o}),[u,C,w,E,o])}function tf(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,o=Xn(),s=$n()!=null,i=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),l=t.context.triggerElements,u=ft(()=>new ja({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:l,onOpenChange:r,floatingId:o,syncOnly:!0,nested:s})).current;return se(()=>{const d={open:i,floatingId:o,referenceElement:a,floatingElement:c};De(a)&&(d.domReferenceElement=a),u.state.positionReference===u.state.referenceElement&&(d.positionReference=a),u.update(d)},[i,o,a,c,u]),u.context.onOpenChange=r,u.context.nested=s,u}class Ba{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Mt,this.restTimeout=new Mt,this.handleCloseOptions=void 0}static create(){return new Ba}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Es=new WeakMap;function Ss(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Es.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Es.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function nf(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Es.get(n);s&&s!==e&&Ss(s),Ss(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Es.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function rf(e){const t=ft(Ba.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Qr(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function EE(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:c=0,nodeId:l}=t,u=rf(n),d=Qn(),f=$n(),h=ae(()=>bd(i.current.openEvent?.type,u.interactedInside)),m=ae(()=>{const w=i.current.openEvent?.type;return w?.includes("mouse")&&w!=="mousedown"}),g=ae(w=>Al(w,n.context.triggerElements)),y=p.useCallback(w=>{const b=Sa(c,"close",u.pointerType),T=()=>{n.setOpen(!1,Ae(Pt,w)),d?.events.emit("floating.closed",w)};b?u.openChangeTimeout.start(b,T):(u.openChangeTimeout.clear(),T())},[c,n,u,d]),v=ae(()=>{Ss(u)}),S=ae(w=>{const b=it(w);if(!e0(b)){u.interactedInside=!1;return}u.interactedInside=b?.closest("[aria-haspopup]")!=null});se(()=>{r||(u.pointerType=void 0,u.restTimeoutPending=!1,u.interactedInside=!1,v())},[r,u,v]),p.useEffect(()=>v,[v]),se(()=>{if(a&&r&&u.handleCloseOptions?.blockPointerEvents&&m()&&De(s)&&o){const w=s,b=o,T=_e(o),E=d?.nodesRef.current.find(D=>D.id===f)?.context?.elements.floating;E&&(E.style.pointerEvents="");const O=u.handleCloseOptions?.getScope?.()??u.pointerEventsScopeElement??E??w.closest("[data-rootownerid]")??T.body;return nf(u,{scopeElement:O,referenceElement:w,floatingElement:b}),()=>{v()}}},[a,r,s,o,u,m,d,f,v]);const C=Lt();p.useEffect(()=>{if(!a)return;function w(){u.openChangeTimeout.clear(),C.clear(),d?.events.off("floating.closed",T),v()}function b(O){if(d&&f&&cn(d.nodesRef.current,f).length>0){d.events.on("floating.closed",T);return}if(g(O.relatedTarget))return;const D=i.current.floatingContext?.nodeId??l,k=O.relatedTarget;if(!(d&&D&&De(k)&&cn(d.nodesRef.current,D,!1).some(F=>be(F.context?.elements.floating,k)))){if(u.handler){u.handler(O);return}v(),h()||y(O)}}function T(O){!d||!f||cn(d.nodesRef.current,f).length>0||C.start(0,()=>{d.events.off("floating.closed",T),n.setOpen(!1,Ae(Pt,O)),d.events.emit("floating.closed",O)})}const E=o;return sn(E&&Pe(E,"mouseenter",w),E&&Pe(E,"mouseleave",b),E&&Pe(E,"pointerdown",S,!0),()=>{d?.events.off("floating.closed",T)})},[a,o,n,i,l,h,g,y,v,S,u,d,f,C])}const SE={current:null};function CE(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:o}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=SE,externalTree:f,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g}=t,y=Qn(f),v=rf(n),S=p.useRef(!1),C=ct(a),w=ct(i),b=ct(l),T=ct(s),E=ct(g);h&&(v.handleCloseOptions=C.current?.__options);const O=ae(()=>bd(r.current.openEvent?.type,v.interactedInside)),D=ae(R=>Al(R,n.context.triggerElements)),k=ae((R,_,I)=>{const P=n.context.triggerElements;if(P.hasElement(_))return!R||!be(R,_);if(!De(I))return!1;const A=I;return P.hasMatchingElement(M=>be(M,A))&&(!R||!be(R,A))}),L=ae((R,_=!0)=>{const I=Sa(w.current,"close",v.pointerType);I?v.openChangeTimeout.start(I,()=>{n.setOpen(!1,Ae(Pt,R)),y?.events.emit("floating.closed",R)}):_&&(v.openChangeTimeout.clear(),n.setOpen(!1,Ae(Pt,R)),y?.events.emit("floating.closed",R))}),F=ae(()=>{if(!v.handler)return;_e(n.select("domReferenceElement")).removeEventListener("mousemove",v.handler),v.handler=void 0}),N=ae(()=>{Ss(v)});return p.useEffect(()=>F,[F]),p.useEffect(()=>{if(!s)return;function R(_){_.open?S.current=!1:(S.current=_.reason===Pt,F(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return o.on("openchange",R),()=>{o.off("openchange",R)}},[s,o,v,F]),p.useEffect(()=>{if(!s)return;const R=d.current??(h?n.select("domReferenceElement"):null);if(!De(R))return;function _(P){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,c&&!oo(v.pointerType))return;const A=yd(b.current),M=Sa(w.current,"open",v.pointerType),$=it(P),U=P.currentTarget??null,V=n.select("domReferenceElement");let H=U;if(De($)&&!n.context.triggerElements.hasElement($)){for(const Q of n.context.triggerElements.elements())if(be(Q,$)){H=Q;break}}De(U)&&De(V)&&!n.context.triggerElements.hasElement(U)&&be(U,V)&&(H=V);const Y=H==null?!1:k(V,H,$),G=n.select("open"),K=E.current?.()??n.select("transitionStatus")==="ending",J=!G&&K&&S.current,X=!Y&&De(H)&&De(V)&&be(V,H)&&J,re=A>0&&!M,ue=Y&&(G||J)||X,fe=!G||Y;if(ue){n.setOpen(!0,Ae(Pt,P,H));return}re||(M?v.openChangeTimeout.start(M,()=>{fe&&n.setOpen(!0,Ae(Pt,P,H))}):fe&&n.setOpen(!0,Ae(Pt,P,H)))}function I(P){if(O()){N();return}F();const A=n.select("domReferenceElement"),M=_e(A);v.restTimeout.clear(),v.restTimeoutPending=!1;const $=r.current.floatingContext??m?.();if(D(P.relatedTarget))return;if(C.current&&$){n.select("open")||v.openChangeTimeout.clear();const H=d.current;v.handler=C.current({...$,tree:y,x:P.clientX,y:P.clientY,onClose(){N(),F(),T.current&&!O()&&H===n.select("domReferenceElement")&&L(P,!0)}}),M.addEventListener("mousemove",v.handler),v.handler(P);return}(v.pointerType!=="touch"||!be(n.select("floatingElement"),P.relatedTarget))&&L(P)}return u?sn(Pe(R,"mousemove",_,{once:!0}),Pe(R,"mouseenter",_),Pe(R,"mouseleave",I)):sn(Pe(R,"mouseenter",_),Pe(R,"mouseleave",I))},[F,N,r,w,L,n,s,C,v,h,k,O,D,c,u,b,d,y,T,m,E]),p.useMemo(()=>{if(!s)return;function R(_){v.pointerType=_.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(_){const{nativeEvent:I}=_,P=_.currentTarget,A=n.select("domReferenceElement"),M=n.select("open"),$=k(A,P,_.target);if(c&&!oo(v.pointerType))return;if(M&&$&&v.handleCloseOptions?.blockPointerEvents){const H=n.select("floatingElement");if(H){const Y=v.handleCloseOptions?.getScope?.()??P.ownerDocument.body;nf(v,{scopeElement:Y,referenceElement:P,floatingElement:H})}}const U=yd(b.current);if(M&&!$||U===0||!$&&v.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;v.restTimeout.clear();function V(){if(v.restTimeoutPending=!1,O())return;const H=n.select("open");!v.blockMouseMove&&(!H||$)&&n.setOpen(!0,Ae(Pt,I,P))}v.pointerType==="touch"?jt.flushSync(()=>{V()}):$&&M?V():(v.restTimeoutPending=!0,v.restTimeout.start(U,V))}}},[s,v,O,k,c,n,b])}function ho(e=[]){const t=e.map(l=>l?.reference),n=e.map(l=>l?.floating),r=e.map(l=>l?.item),o=e.map(l=>l?.trigger),s=p.useCallback(l=>Cs(l,e,"reference"),t),i=p.useCallback(l=>Cs(l,e,"floating"),n),a=p.useCallback(l=>Cs(l,e,"item"),r),c=p.useCallback(l=>Cs(l,e,"trigger"),o);return p.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function Cs(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[ea]="");for(const i in e)o&&e&&(i===kl||i===Rl)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const c=t[i]?.[n];typeof c=="function"?a=e?c(e):null:a=c,a&&of(s,a,o,r)}return of(s,e,o,r),s}function of(e,t,n,r){for(const o in t){const s=t[o];n&&(o===kl||o===Rl)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const xE="Escape";function xs(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ts(e,t){return xs(t,e===ta||e===no,e===Dn||e===Mn)}function Ua(e,t,n){return xs(t,e===no,n?e===Dn:e===Mn)||e==="Enter"||e===" "||e===""}function TE(e,t,n){return xs(t,n?e===Dn:e===Mn,e===no)}function OE(e,t,n,r){const o=n?e===Mn:e===Dn,s=e===ta;return t==="both"||t==="horizontal"&&r&&r>1?e===xE:xs(t,o,s)}function _E(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:c,onNavigate:l=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:f=!1,loopFocus:h=!1,nested:m=!1,rtl:g=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:S=!0,openOnArrowKeyDown:C=!0,disabledIndices:w=void 0,orientation:b="vertical",parentOrientation:T,cols:E=1,id:O,resetOnPointerLeave:D=!0,externalTree:k}=t;process.env.NODE_ENV!=="production"&&(f&&(h||console.warn("`useListNavigation` looping must be enabled to allow escaping."),y||console.warn("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&E>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const L=ro(o),F=ct(L),N=$n(),R=Qn(k);se(()=>{i.current.orientation=b},[i,b]);const _=ra(s),I=p.useRef(v),P=p.useRef(d??-1),A=p.useRef(null),M=p.useRef(!0),$=ae(j=>{l(P.current===-1?null:P.current,j)}),U=p.useRef($),V=p.useRef(!!o),H=p.useRef(r),Y=p.useRef(!1),G=p.useRef(!1),K=p.useRef(null),J=ct(w),X=ct(r),re=ct(d),ue=ct(D),fe=ae(()=>{function j(ie){y?R?.events.emit("virtualfocus",ie):K.current=hs(ie,{sync:Y.current,preventScroll:!0})}const Z=a.current[P.current],B=G.current;Z&&j(Z),(Y.current?ie=>ie():requestAnimationFrame)(()=>{const ie=a.current[P.current]||Z;if(!ie)return;Z||j(ie),te&&(B||!M.current)&&ie.scrollIntoView?.({block:"nearest",inline:"nearest"})})});se(()=>{u&&(r&&o?(P.current=d??-1,I.current&&d!=null&&(G.current=!0,$())):V.current&&(P.current=-1,U.current()))},[u,r,o,d,$]),se(()=>{if(u){if(!r){Y.current=!1;return}if(o)if(c==null){if(Y.current=!1,re.current!=null)return;if(V.current&&(P.current=-1,fe()),(!H.current||!V.current)&&I.current&&(A.current!=null||I.current===!0&&A.current==null)){let j=0;const Z=()=>{a.current[0]==null?(j<2&&(j?requestAnimationFrame:queueMicrotask)(Z),j+=1):(P.current=A.current==null||Ua(A.current,b,g)||m?la(a):jl(a),A.current=null,$())};Z()}}else os(a.current,c)||(P.current=c,fe(),G.current=!1)}},[u,r,o,c,re,m,a,b,g,$,fe,J]),se(()=>{if(!u||o||!R||y||!V.current)return;const j=R.nodesRef.current,Z=j.find(ie=>ie.id===N)?.context?.elements.floating,B=Ct(_e(o)),W=j.some(ie=>ie.context&&be(ie.context.elements.floating,B));Z&&!W&&M.current&&Z.focus({preventScroll:!0})},[u,o,R,N,y]),se(()=>{U.current=$,H.current=r,V.current=!!o}),se(()=>{r||(A.current=null,I.current=v)},[r,v]);const Q=c!=null,de=ae(j=>{if(!X.current)return;const Z=a.current.indexOf(j.currentTarget);Z!==-1&&(P.current!==Z||c!==Z)&&(P.current=Z,$(j))}),te=p.useMemo(()=>({onFocus(Z){Y.current=!0,de(Z)},onClick:({currentTarget:Z})=>Z.focus({preventScroll:!0}),onMouseMove(Z){Y.current=!0,G.current=!1,S&&de(Z)},onPointerLeave(Z){if(!X.current||!M.current||Z.pointerType==="touch")return;Y.current=!0;const B=Z.relatedTarget;if(!(!S||a.current.includes(B))&&ue.current&&(K.current?.(),K.current=null,P.current=-1,$(Z),!y)){const W=F.current,ie=Ct(_e(W));W&&be(W,ie)&&W.focus({preventScroll:!0})}}}),[de,X,F,S,a,$,ue,y]),we=p.useCallback(()=>T??R?.nodesRef.current.find(j=>j.id===N)?.context?.dataRef?.current.orientation,[N,R,T]),ce=ae(j=>{if(M.current=!1,Y.current=!0,j.which===229||!X.current&&j.currentTarget===F.current)return;if(m&&OE(j.key,b,g,E)){Ts(j.key,we())||Ft(j),n.setOpen(!1,Ae(Ta,j.nativeEvent)),Ze(s)&&(y?R?.events.emit("virtualfocus",s):s.focus());return}const Z=P.current,B=la(a,w),W=jl(a,w);if(_||(j.key==="Home"&&(Ft(j),P.current=B,$(j)),j.key==="End"&&(Ft(j),P.current=W,$(j))),E>1){const ie=Array.from({length:a.current.length},()=>({width:1,height:1})),ve=f0(ie,E),he=ve.findIndex(xe=>xe!=null&&!xr(a.current,xe,w)),Ce=ve.reduce((xe,Le,Ie)=>Le!=null&&!xr(a.current,Le,w)?Ie:xe,-1),$e=ve[d0(ve.map(xe=>xe!=null?a.current[xe]:null),{event:j,orientation:b,loopFocus:h,rtl:g,cols:E,disabledIndices:h0([...(typeof w!="function"?w:null)||a.current.map((xe,Le)=>xr(a.current,Le,w)?Le:void 0),void 0],ve),minIndex:he,maxIndex:Ce,prevIndex:p0(P.current>W?B:P.current,ie,ve,E,j.key===no?"bl":j.key===(g?Dn:Mn)?"tr":"tl"),stopEvent:!0})];if($e!=null&&(P.current=$e,$(j)),b==="both")return}if(Ts(j.key,b)){if(Ft(j),r&&!y&&Ct(j.currentTarget.ownerDocument)===j.currentTarget){P.current=Ua(j.key,b,g)?B:W,$(j);return}Ua(j.key,b,g)?h?Z>=W?f&&Z!==a.current.length?P.current=-1:(Y.current=!1,P.current=B):P.current=_t(a.current,{startingIndex:Z,disabledIndices:w}):P.current=Math.min(W,_t(a.current,{startingIndex:Z,disabledIndices:w})):h?Z<=B?f&&Z!==-1?P.current=a.current.length:(Y.current=!1,P.current=W):P.current=_t(a.current,{startingIndex:Z,decrement:!0,disabledIndices:w}):P.current=Math.max(B,_t(a.current,{startingIndex:Z,decrement:!0,disabledIndices:w})),os(a.current,P.current)&&(P.current=-1),$(j)}}),le=p.useMemo(()=>y&&r&&Q&&{"aria-activedescendant":`${O}-${c}`},[y,r,Q,O,c]),me=p.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,..._?{}:le,onKeyDown(j){if(j.key==="Tab"&&j.shiftKey&&r&&!y){const Z=it(j.nativeEvent);if(Z&&!be(F.current,Z))return;Ft(j),n.setOpen(!1,Ae(Jn,j.nativeEvent)),Ze(s)&&s.focus();return}ce(j)},onPointerMove(){M.current=!0}}),[le,ce,F,b,_,n,r,y,s]),oe=p.useMemo(()=>{function j(B){v==="auto"&&Ml(B.nativeEvent)&&(I.current=!y)}function Z(B){I.current=v,v==="auto"&&Ll(B.nativeEvent)&&(I.current=!0)}return{onKeyDown(B){const W=n.select("open");M.current=!1;const ie=B.key.startsWith("Arrow"),ve=TE(B.key,we(),g),he=Ts(B.key,b),Ce=(m?ve:he)||B.key==="Enter"||B.key.trim()==="";if(y&&W)return ce(B);if(!(!W&&!C&&ie)){if(Ce){const $e=Ts(B.key,we());A.current=m&&$e?null:B.key}if(m){ve&&(Ft(B),W?(P.current=la(a,J.current),$(B)):n.setOpen(!0,Ae(Ta,B.nativeEvent,B.currentTarget)));return}he&&(re.current!=null&&(P.current=re.current),Ft(B),!W&&C?n.setOpen(!0,Ae(Ta,B.nativeEvent,B.currentTarget)):ce(B),W&&$(B))}},onFocus(B){n.select("open")&&!y&&(P.current=-1,$(B))},onPointerDown:Z,onPointerEnter:Z,onMouseDown:j,onClick:j}},[ce,J,v,a,m,$,n,C,b,we,g,re,y]),ye=p.useMemo(()=>({...le,...oe}),[le,oe]);return p.useMemo(()=>u?{reference:ye,floating:me,item:te,trigger:oe}:{},[u,ye,me,oe,te])}const PE=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function sf(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,c=Xn(),l=s?.id||c,u=p.useMemo(()=>ro(i)?.id||o,[i,o]),d=PE.get(a)??a,h=$n()!=null,m=p.useMemo(()=>d==="tooltip"||a==="label"?st:{"aria-haspopup":d==="alertdialog"?"dialog":d,"aria-expanded":"false",...d==="listbox"&&{role:"combobox"},...d==="menu"&&h&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[d,h,a]),g=p.useMemo(()=>d==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?u:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?u:void 0,...d==="menu"&&{id:l}},[d,u,r,l,a,m]),y=p.useMemo(()=>{const S={id:u,...d&&{role:d}};return d==="tooltip"||a==="label"?S:{...S,...d==="menu"&&{"aria-labelledby":l}}},[d,u,l,a]),v=p.useCallback(({active:S,selected:C})=>{const w={role:"option",...S&&{id:`${u}-fui-option`}};switch(a){case"select":case"combobox":return{...w,"aria-selected":C}}return{}},[u,a]);return p.useMemo(()=>({reference:g,floating:y,item:v,trigger:m}),[g,y,m,v])}function IE(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,o=n.useState("open"),{listRef:s,elementsRef:i,activeIndex:a,onMatch:c,onTypingChange:l,enabled:u=!0,resetMs:d=750,selectedIndex:f=null}=t,h=Lt(),m=p.useRef(""),g=p.useRef(f??a??-1),y=p.useRef(null);se(()=>{!o&&f!==null||(h.clear(),y.current=null,m.current!==""&&(m.current=""))},[o,f,h]),se(()=>{o&&m.current===""&&(g.current=f??a??-1)},[o,f,a]);const v=ae(T=>{T?r.current.typing||(r.current.typing=T,l?.(T)):r.current.typing&&(r.current.typing=T,l?.(T))}),S=ae(T=>{function E(_){const I=i?.current[_];return!I||ss(I)}function O(_,I,P=0){if(_.length===0)return-1;const A=(P%_.length+_.length)%_.length,M=I.toLocaleLowerCase();for(let $=0;$<_.length;$+=1){const U=(A+$)%_.length;if(!(!_[U]?.toLocaleLowerCase().startsWith(M)||!E(U)))return U}return-1}const D=s.current;if(m.current.length>0&&T.key===" "&&(Ft(T),v(!0)),m.current.length>0&&m.current[0]!==" "&&O(D,m.current)===-1&&T.key!==" "&&v(!1),D==null||T.key.length!==1||T.ctrlKey||T.metaKey||T.altKey)return;o&&T.key!==" "&&(Ft(T),v(!0));const k=m.current==="";k&&(g.current=f??a??-1),D.every(_=>_?_[0]?.toLocaleLowerCase()!==_[1]?.toLocaleLowerCase():!0)&&m.current===T.key&&(m.current="",g.current=y.current),m.current+=T.key,h.start(d,()=>{m.current="",g.current=y.current,v(!1)});const N=((k?f??a??-1:g.current)??0)+1,R=O(D,m.current,N);R!==-1?(c?.(R),y.current=R):T.key!==" "&&(m.current="",v(!1))}),C=ae(T=>{const E=T.relatedTarget,O=n.select("domReferenceElement"),D=n.select("floatingElement"),k=be(O,E),L=be(D,E);k||L||(h.clear(),m.current="",g.current=y.current,v(!1))}),w=p.useMemo(()=>({onKeyDown:S,onBlur:C}),[S,C]),b=p.useMemo(()=>({onKeyDown:S,onBlur:C}),[S,C]);return p.useMemo(()=>u?{reference:w,floating:b}:{},[u,w,b])}const af=.1,kE=af*af,Be=.5;function Os(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function _s(e,t,n,r,o,s,i,a,c,l){let u=!1;return Os(e,t,n,r,o,s)&&(u=!u),Os(e,t,o,s,i,a)&&(u=!u),Os(e,t,i,a,c,l)&&(u=!u),Os(e,t,c,l,n,r)&&(u=!u),u}function RE(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ps(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),l=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=l}function NE(e={}){const{blockPointerEvents:t=!1}=e,n=new Mt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:l,tree:u})=>{const d=i?.split("-")[0];let f=!1,h=null,m=null,g=typeof performance<"u"?performance.now():0;function y(S,C){const w=performance.now(),b=w-g;if(h===null||m===null||b===0)return h=S,m=C,g=w,!1;const T=S-h,E=C-m,O=T*T+E*E,D=b*b*kE;return h=S,m=C,g=w,O<D}function v(){n.clear(),c()}return function(C){n.clear();const w=a.domReference,b=a.floating;if(!w||!b||d==null||o==null||s==null)return;const{clientX:T,clientY:E}=C,O=it(C),D=C.type==="mouseleave",k=be(b,O),L=be(w,O);if(k&&(f=!0,!D))return;if(L&&(f=!1,!D)){f=!0;return}if(D&&De(C.relatedTarget)&&be(b,C.relatedTarget))return;function F(){return!!(u&&cn(u.nodesRef.current,l).length>0)}function N(){F()||v()}if(F())return;const R=w.getBoundingClientRect(),_=b.getBoundingClientRect(),I=o>_.right-_.width/2,P=s>_.bottom-_.height/2,A=_.width>R.width,M=_.height>R.height,$=(A?R:_).left,U=(A?R:_).right,V=(M?R:_).top,H=(M?R:_).bottom;if(d==="top"&&s>=R.bottom-1||d==="bottom"&&s<=R.top+1||d==="left"&&o>=R.right-1||d==="right"&&o<=R.left+1){N();return}let Y=!1;switch(d){case"top":Y=Ps(T,E,$,R.top+1,U,_.bottom-1);break;case"bottom":Y=Ps(T,E,$,_.top+1,U,R.bottom-1);break;case"left":Y=Ps(T,E,_.right-1,H,R.left+1,V);break;case"right":Y=Ps(T,E,R.right-1,H,_.left+1,V);break}if(Y)return;if(f&&!RE(T,E,R)){N();return}if(!D&&y(T,E)){N();return}let G=!1;switch(d){case"top":{const K=A?Be/2:Be*4,J=A||I?o+K:o-K,X=A?o-K:I?o+K:o-K,re=s+Be+1,ue=I||A?_.bottom-Be:_.top,fe=I?A?_.bottom-Be:_.top:_.bottom-Be;G=_s(T,E,J,re,X,re,_.left,ue,_.right,fe);break}case"bottom":{const K=A?Be/2:Be*4,J=A||I?o+K:o-K,X=A?o-K:I?o+K:o-K,re=s-Be,ue=I||A?_.top+Be:_.bottom,fe=I?A?_.top+Be:_.bottom:_.top+Be;G=_s(T,E,J,re,X,re,_.left,ue,_.right,fe);break}case"left":{const K=M?Be/2:Be*4,J=M||P?s+K:s-K,X=M?s-K:P?s+K:s-K,re=o+Be+1,ue=P||M?_.right-Be:_.left,fe=P?M?_.right-Be:_.left:_.right-Be;G=_s(T,E,ue,_.top,fe,_.bottom,re,J,re,X);break}case"right":{const K=M?Be/2:Be*4,J=M||P?s+K:s-K,X=M?s-K:P?s+K:s-K,re=o-Be,ue=P||M?_.left+Be:_.right,fe=P?M?_.left+Be:_.right:_.left+Be;G=_s(T,E,re,J,re,X,ue,_.top,fe,_.bottom);break}}G?f||n.start(40,N):N()}};return r.__options={...e,blockPointerEvents:t},r}const cf=p.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{portalNode:l,portalSubtree:u}=Pd({container:o,ref:n,componentProps:t,elementProps:c});return!u&&!l?null:x.jsxs(p.Fragment,{children:[u,l&&jt.createPortal(r,l)]})});process.env.NODE_ENV!=="production"&&(cf.displayName="FloatingPortalLite");const AE=cf,uf=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(uf.displayName="DirectionContext");function lf(){return p.useContext(uf)?.direction??"ltr"}const DE=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d="real"}=bn(e,t)||{};if(l==null)return{};const f=Vl(u),h={x:n,y:r},m=ca(o),g=aa(m),y=await i.getDimensions(l),v=m==="y",S=v?"top":"left",C=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[m]-h[m]-s.floating[g],T=h[m]-s.reference[m],E=d==="real"?await i.getOffsetParent?.(l):a.floating;let O=a.floating[w]||s.floating[g];(!O||!await i.isElement?.(E))&&(O=a.floating[w]||s.floating[g]);const D=b/2-T/2,k=O/2-y[g]/2-1,L=Math.min(f[S],k),F=Math.min(f[C],k),N=L,R=O-y[g]-F,_=O/2-y[g]/2+D,I=sa(N,_,R),P=!c.arrow&&Ln(o)!=null&&_!==I&&s.reference[g]/2-(_<N?L:F)-y[g]/2<0,A=P?_<N?_-N:_-R:0;return{[m]:h[m]+A,data:{[m]:I,centerOffset:_-I-A,...P&&{alignmentOffset:A}},reset:P}}}),ME=(e,t)=>({...DE(e),options:[e,t]}),LE={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,s=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await gE().fn(e)).data?.referenceHidden||s}}}},Is={sideX:"left",sideY:"top"},FE={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:a}=e,c=qe(o),l=c.getComputedStyle(o);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Is};const d=await s.getOffsetParent?.(o);let f={width:0,height:0};if(i==="fixed"&&c?.visualViewport)f={width:c.visualViewport.width,height:c.visualViewport.height};else if(d===c){const S=_e(o);f={width:S.documentElement.clientWidth,height:S.documentElement.clientHeight}}else await s.isElement?.(d)&&(f=await s.getDimensions(d));const h=Nt(a);let m=t,g=n;h==="left"&&(m=f.width-(t+r.width)),h==="top"&&(g=f.height-(n+r.height));const y=h==="left"?"right":Is.sideX,v=h==="top"?"bottom":Is.sideY;return{x:m,y:g,data:{sideX:y,sideY:v}}}};function df(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function ff(e,t,n){const{rects:r,placement:o}=e;return{side:df(t,Nt(o),n),align:Ln(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function pf(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:h,mounted:m,collisionAvoidance:g,shiftCrossAxis:y=!1,nodeId:v,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,[b,T]=p.useState(null);!m&&b!==null&&T(null);const E=g.side||"flip",O=g.align||"flip",D=g.fallbackAxisSide||"end",k=typeof t=="function"?t:void 0,L=ae(k),F=k?L:t,N=ct(t),R=ct(m),I=lf()==="rtl",P=b||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":I?"left":"right","inline-start":I?"right":"left"}[r],A=s==="center"?P:`${P}-${s}`;let M=c;const $=1,U=r==="bottom"?$:0,V=r==="top"?$:0,H=r==="right"?$:0,Y=r==="left"?$:0;typeof M=="number"?M={top:M+U,right:M+Y,bottom:M+V,left:M+H}:M&&(M={top:(M.top||0)+U,right:(M.right||0)+Y,bottom:(M.bottom||0)+V,left:(M.left||0)+H});const G={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:M},K=p.useRef(null),J=ct(o),X=ct(i),fe=[dE(ke=>{const ee=ff(ke,r,I),pe=typeof J.current=="function"?J.current(ee):J.current,ge=typeof X.current=="function"?X.current(ee):X.current;return{mainAxis:pe,crossAxis:ge,alignmentAxis:ge}},[typeof o!="function"?o:0,typeof i!="function"?i:0,I,r])],Q=O==="none"&&E!=="shift",de=!Q&&(l||y||E==="shift"),te=E==="none"?null:hE({...G,padding:{top:M.top+$,right:M.right+$,bottom:M.bottom+$,left:M.left+$},mainAxis:!y&&E==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),we=Q?null:fE(ke=>{const ee=_e(ke.elements.floating).documentElement;return{...G,rootBoundary:y?{x:0,y:0,width:ee.clientWidth,height:ee.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:de,limiter:l||y?void 0:pE(pe=>{if(!K.current)return{};const{width:ge,height:Ee}=K.current.getBoundingClientRect(),Oe=Wt(Nt(pe.placement)),Ge=Oe==="y"?ge:Ee,We=Oe==="y"?M.left+M.right:M.top+M.bottom;return{offset:Ge/2+We/2}})}},[G,l,y,M,O]);E==="shift"||O==="shift"||s==="center"?fe.push(we,te):fe.push(te,we),fe.push(mE({...G,apply({elements:{floating:ke},availableWidth:ee,availableHeight:pe,rects:ge}){if(!R.current)return;const Ee=ke.style;Ee.setProperty("--available-width",`${ee}px`),Ee.setProperty("--available-height",`${pe}px`);const Oe=qe(ke).devicePixelRatio||1,{x:Ge,y:We,width:lt,height:dt}=ge.reference,Et=(Math.round((Ge+lt)*Oe)-Math.round(Ge*Oe))/Oe,xt=(Math.round((We+dt)*Oe)-Math.round(We*Oe))/Oe;Ee.setProperty("--anchor-width",`${Et}px`),Ee.setProperty("--anchor-height",`${xt}px`)}}),ME(()=>({element:K.current||_e(K.current).createElement("div"),padding:u,offsetParent:"floating"}),[u]),{name:"transformOrigin",fn(ke){const{elements:ee,middlewareData:pe,placement:ge,rects:Ee,y:Oe}=ke,Ge=Nt(ge),We=Wt(Ge),lt=K.current,dt=pe.arrow?.x||0,Et=pe.arrow?.y||0,xt=lt?.clientWidth||0,ot=lt?.clientHeight||0,kt=dt+xt/2,Qt=Et+ot/2,Ro=Math.abs(pe.shift?.y||0),Me=Ee.reference.height/2,Ke=typeof o=="function"?o(ff(ke,r,I)):o,en=Ro>Ke,hn={top:`${kt}px calc(100% + ${Ke}px)`,bottom:`${kt}px ${-Ke}px`,left:`calc(100% + ${Ke}px) ${Qt}px`,right:`${-Ke}px ${Qt}px`}[Ge],tn=`${kt}px ${Ee.reference.y+Me-Oe}px`;return ee.floating.style.setProperty("--transform-origin",de&&We==="y"&&en?tn:hn),{}}},LE,S),se(()=>{!m&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,h]);const ce=p.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:le,elements:me,x:oe,y:ye,middlewareData:j,update:Z,placement:B,context:W,isPositioned:ie,floatingStyles:ve}=wE({rootContext:h,open:f?m:void 0,placement:A,middleware:fe,strategy:n,whileElementsMounted:f?void 0:(...ke)=>Zd(...ke,ce),nodeId:v,externalTree:w}),{sideX:he,sideY:Ce}=j.adaptiveOrigin||Is,$e=ie?n:"fixed",xe=p.useMemo(()=>{const ke=S?{position:$e,[he]:oe,[Ce]:ye}:{position:$e,...ve};return ie||(ke.opacity=0),ke},[S,$e,he,oe,Ce,ye,ve,ie]),Le=p.useRef(null);se(()=>{if(!m)return;const ke=N.current,ee=typeof ke=="function"?ke():ke,ge=(hf(ee)?ee.current:ee)||null||null;ge!==Le.current&&(le.setPositionReference(ge),Le.current=ge)},[m,le,F,N]),p.useEffect(()=>{if(!m)return;const ke=N.current;typeof ke!="function"&&hf(ke)&&ke.current!==Le.current&&(le.setPositionReference(ke.current),Le.current=ke.current)},[m,le,F,N]),p.useEffect(()=>{if(f&&m&&me.domReference&&me.floating)return Zd(me.domReference,me.floating,Z,ce)},[f,m,me,Z,ce]);const Ie=Nt(B),Fe=df(r,Ie,I),je=Ln(B)||"center",nt=!!j.hide?.referenceHidden;se(()=>{C&&m&&ie&&T(Ie)},[C,m,ie,Ie]);const vt=p.useMemo(()=>({position:"absolute",top:j.arrow?.y,left:j.arrow?.x}),[j.arrow]),rt=j.arrow?.centerOffset!==0;return p.useMemo(()=>({positionerStyles:xe,arrowStyles:vt,arrowRef:K,arrowUncentered:rt,side:Fe,align:je,physicalSide:Ie,anchorHidden:nt,refs:le,context:W,isPositioned:ie,update:Z}),[xe,vt,K,rt,Fe,je,Ie,nt,le,W,ie,Z])}function hf(e){return e!=null&&"current"in e}let tr=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=co.startingStyle]="startingStyle",e[e.endingStyle=co.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Wa=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const $E={[Wa.popupOpen]:""},zE={[Wa.popupOpen]:"",[Wa.pressed]:""},VE={[tr.open]:""},jE={[tr.closed]:""},BE={[tr.anchorHidden]:""},mf={open(e){return e?$E:null}},gf={open(e){return e?zE:null}},nr={open(e){return e?VE:jE},anchorHidden(e){return e?BE:null}};function Ha(e){return e==="starting"?q0:st}function vf(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),Ve("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},Ha(r),o],stateAttributesMapping:nr})}function yf(){const e=p.useContext(jo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Qe(73));const t=e.useState("toasts");return p.useMemo(()=>({toasts:t,add:e.addToast,close:e.closeToast,update:e.updateToast,promise:e.promiseToast}),[t,e])}function rr(...e){return $i(el(e))}const bf={Viewport:"_Viewport_ai81v_1",Toast:"_Toast_ai81v_14"};let Rr=null,mo=3e3;function UE({timeout:e}){const t=yf();return p.useEffect(()=>(Rr=t,mo=e,()=>{Rr=null}),[t,e]),null}const fn={success:(e,t)=>Rr?.add({description:e,timeout:t?.timeout||mo}),error:(e,t)=>Rr?.add({description:e,timeout:t?.timeout||mo}),info:(e,t)=>Rr?.add({description:e,timeout:t?.timeout||mo}),warning:(e,t)=>Rr?.add({description:e,timeout:t?.timeout||mo})};function WE({toastConfigs:e}){const t=e?.timeout??3e3;return x.jsxs(Ql,{timeout:t,children:[x.jsx(UE,{timeout:t}),x.jsx(HE,{configs:e})]})}function HE({configs:e}){const{toasts:t}=yf();return x.jsx(AE,{children:x.jsx(ld,{className:rr(bf.Viewport,e?.viewportClassName),children:t.map(n=>x.jsx(pd,{toast:n,className:rr("pointer-events-none flex items-center justify-center px-6 py-3 min-w-[200px] max-w-[80vw]","text-white text-base rounded-md bg-black/80",bf.Toast,e?.className),style:e?.style,children:x.jsx(gd,{className:"text-xs",children:n.description})},n.id))})})}class ZE{baseUrl;credentials;interceptors;timeout;onError;headers;constructor({baseUrl:t,timeout:n=1/0,responseInterceptor:r=c=>c.data,requestInterceptor:o=c=>c,onError:s=()=>{},headers:i,credentials:a="include"}){this.baseUrl=t,this.timeout=n,this.credentials=a,this.interceptors={request:o,response:r},this.headers=new Headers({"Content-Type":"application/json",...i}),this.onError=s}async request(t){const n=new AbortController;t.url=`${this.baseUrl}${t.url}`,t=this.interceptors.request(t);const r=new Headers(this.headers);Object.entries(t.headers||{}).forEach(([a,c])=>{r.set(a,c)});const o=this.headers.get("content-type");let s=null;if(t.data instanceof FormData)s=t.data,r.delete("Content-Type");else if(t.data!==void 0&&t.method!=="GET")if(o==="application/x-www-form-urlencoded"){const a=new URLSearchParams;for(const c in t.data)t.data[c]!==void 0&&a.append(c,t.data[c]);s=a.toString()}else s=JSON.stringify(t.data);else if(t.method==="GET"){const a=new URLSearchParams;for(const l in t.data)t.data[l]!==void 0&&a.append(l,t.data[l]);const c=a.toString();t.url+=c?`?${c}`:""}const i=fetch(t.url,{method:t.method,headers:r,body:s,signal:t.signal||n.signal,credentials:this.credentials});try{const a=t.timeout||this.timeout,{timeoutId:c,timeoutPromise:l}=this._setTimeout(a,n),u=await Promise.race([i,l].filter(Boolean));if(c&&clearTimeout(c),u.ok){const d=await u.json();return this.interceptors.response(d,u).catch(f=>(this.onError({data:f,response:u}),Promise.reject(d)))}else{const d=await u.json();return this.onError({data:d,response:u}),Promise.reject(d)}}catch(a){return a.name!=="AbortError"&&this.onError({}),Promise.reject(a)}}_setTimeout(t,n){let r=null,o=null;return t!==1/0&&(o=new Promise((s,i)=>{r=setTimeout(()=>{i(new Error("请求超时")),n.abort()},t)})),{timeoutPromise:o,timeoutId:r}}get(t,n,r){return this.request({...r,url:t,method:"GET",data:n})}post(t,n,r){return this.request({...r,url:t,method:"POST",data:n})}put(t,n,r){return this.request({...r,url:t,method:"PUT",data:n})}delete(t,n){return this.request({...n,url:t,method:"DELETE"})}patch(t,n,r){return this.request({...r,url:t,method:"PATCH",data:n})}}const zt=new ZE({baseUrl:"https://apis.sdk.mobileztgame.com",credentials:"omit",headers:{"Content-Type":"application/x-www-form-urlencoded"},async responseInterceptor(e,t){if(["/passport-api/v2/ztgame/auth/login","/passport-api/v2/sms-captchas","/passport-api/v2/ztgame/auth/mobile-register","/passport-api/v2/ztgame/auth/auth","/passport-api/v2/ztgame/auth/re-auth","/idcard"].some(r=>t.url.includes(r))){const r=t.headers.get("set-authentication")||t.headers.get("Set-Authentication")||"";return{...e,_auth:r}}if(e?.code!==0)throw new Error(e.error);return e},onError({response:e,data:t}){if(e&&e?.status!==401){const n=`${t?.message||t?.detail||"未知错误"}`;fn.error(n)}}});function wf(e){zt.headers.set("Authentication",e)}const He={ROLE_ID:"roleid",GIANT:"giant",MOBILE:"mobile"},ks={default:{types:[He.GIANT,He.MOBILE],default:He.GIANT},5327:{types:[He.GIANT,He.MOBILE],default:He.MOBILE},5273:{types:[He.ROLE_ID],default:He.ROLE_ID},5199:{types:[He.ROLE_ID],default:He.ROLE_ID},5012:{types:[He.ROLE_ID],default:He.ROLE_ID},5242:{types:[He.GIANT,He.MOBILE],default:He.MOBILE}};function bt(...e){return $i(el(e))}function GE(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16))))}function YE(e){return e==="5199"||e==="5012"}function qE(e){const{entity:t,gaplaySign:n}=e;return GE(`${JSON.stringify(t)}$$${n}`)}function Rs(e,t){return t||ks[e]?.types||ks.default?.types||[]}function KE(e,t){return t||ks[e]?.default||ks.default?.default}function Ef({loginTypes:e,gameId:t}){return Rs(t,e).includes(He.GIANT)}function Sf({loginTypes:e,gameId:t}){return Rs(t,e).includes(He.ROLE_ID)}function Cf({loginTypes:e,gameId:t}){return Rs(t,e).includes(He.MOBILE)}function xf({gameId:e}){zt.headers.set("X-GAME-ID",e),zt.headers.set("X-Login-H5","1");const t=localStorage.getItem("UNIQUE_ID");t&&zt.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}async function XE({gameId:e}){xf({gameId:e});let t=localStorage.getItem("UNIQUE_ID");t||(t=(await(await Py.load()).get()).visitorId,localStorage.setItem("UNIQUE_ID",t)),zt.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}const Tf=[{code:"86",name:"中国大陆"},{code:"886",name:"台湾地区"},{code:"852",name:"香港特别行政区"},{code:"853",name:"澳门特别行政区"},{code:"1",name:"美国"},{code:"81",name:"日本"},{code:"376",name:"安道尔"},{code:"971",name:"阿拉伯联合酋长国"},{code:"93",name:"阿富汗"},{code:"1268",name:"安提瓜和巴布达"},{code:"1264",name:"安圭拉"},{code:"355",name:"阿尔巴尼亚"},{code:"374",name:"亚美尼亚"},{code:"244",name:"安哥拉"},{code:"54",name:"阿根廷"},{code:"1684",name:"美属萨摩亚"},{code:"43",name:"奥地利"},{code:"61",name:"澳大利亚"},{code:"297",name:"阿鲁巴"},{code:"994",name:"阿塞拜疆"},{code:"387",name:"波斯尼亚和黑塞哥维那"},{code:"1246",name:"巴巴多斯"},{code:"880",name:"孟加拉国"},{code:"32",name:"比利时"},{code:"226",name:"布基纳法索"},{code:"359",name:"保加利亚"},{code:"973",name:"巴林"},{code:"257",name:"布隆迪"},{code:"229",name:"贝宁"},{code:"1441",name:"百慕大群岛"},{code:"673",name:"文莱"},{code:"591",name:"玻利维亚"},{code:"599",name:"荷兰加勒比"},{code:"55",name:"巴西"},{code:"1242",name:"巴哈马"},{code:"975",name:"不丹"},{code:"267",name:"博茨瓦纳"},{code:"375",name:"白俄罗斯"},{code:"501",name:"伯利兹"},{code:"1",name:"加拿大"},{code:"243",name:"刚果民主共和国"},{code:"236",name:"中非共和国"},{code:"242",name:"刚果共和国"},{code:"41",name:"瑞士"},{code:"225",name:"象牙海岸"},{code:"682",name:"库克群岛"},{code:"56",name:"智利"},{code:"237",name:"喀麦隆"},{code:"57",name:"哥伦比亚"},{code:"506",name:"哥斯达黎加"},{code:"53",name:"古巴"},{code:"238",name:"佛得角共和国"},{code:"599",name:"库拉索"},{code:"357",name:"塞浦路斯"},{code:"420",name:"捷克"},{code:"49",name:"德国"},{code:"253",name:"吉布提"},{code:"45",name:"丹麦"},{code:"1767",name:"多米尼加"},{code:"1809",name:"多米尼加共和国"},{code:"213",name:"阿尔及利亚"},{code:"593",name:"厄瓜多尔"},{code:"372",name:"爱沙尼亚"},{code:"20",name:"埃及"},{code:"291",name:"厄立特里亚"},{code:"34",name:"西班牙"},{code:"251",name:"埃塞俄比亚"},{code:"358",name:"芬兰"},{code:"679",name:"斐济"},{code:"691",name:"密克罗尼西亚"},{code:"298",name:"法罗群岛"},{code:"33",name:"法国"},{code:"241",name:"加蓬"},{code:"44",name:"英国"},{code:"1473",name:"格林纳达"},{code:"995",name:"格鲁吉亚"},{code:"594",name:"法属圭亚那"},{code:"233",name:"加纳"},{code:"350",name:"直布罗陀"},{code:"299",name:"格陵兰岛"},{code:"220",name:"冈比亚"},{code:"224",name:"几内亚"},{code:"590",name:"瓜德罗普岛"},{code:"240",name:"赤道几内亚"},{code:"30",name:"希腊"},{code:"502",name:"瓜地马拉"},{code:"1671",name:"关岛"},{code:"245",name:"几内亚比绍共和国"},{code:"592",name:"圭亚那"},{code:"504",name:"洪都拉斯"},{code:"385",name:"克罗地亚"},{code:"509",name:"海地"},{code:"36",name:"匈牙利"},{code:"62",name:"印度尼西亚"},{code:"353",name:"爱尔兰"},{code:"972",name:"以色列"},{code:"91",name:"印度"},{code:"964",name:"伊拉克"},{code:"98",name:"伊朗"},{code:"354",name:"冰岛"},{code:"39",name:"意大利"},{code:"1876",name:"牙买加"},{code:"962",name:"约旦"},{code:"254",name:"肯尼亚"},{code:"996",name:"吉尔吉斯斯坦"},{code:"855",name:"柬埔寨"},{code:"686",name:"基里巴斯"},{code:"269",name:"科摩罗"},{code:"1869",name:"圣基茨和尼维斯"},{code:"850",name:"朝鲜"},{code:"82",name:"韩国"},{code:"965",name:"科威特"},{code:"1345",name:"开曼群岛"},{code:"7",name:"哈萨克斯坦"},{code:"856",name:"老挝"},{code:"961",name:"黎巴嫩"},{code:"1758",name:"圣露西亚"},{code:"423",name:"列支敦士登"},{code:"94",name:"斯里兰卡"},{code:"231",name:"利比里亚"},{code:"266",name:"莱索托"},{code:"370",name:"立陶宛"},{code:"352",name:"卢森堡"},{code:"371",name:"拉脱维亚"},{code:"218",name:"利比亚"},{code:"212",name:"摩洛哥"},{code:"377",name:"摩纳哥"},{code:"373",name:"摩尔多瓦"},{code:"382",name:"黑山"},{code:"261",name:"马达加斯加"},{code:"692",name:"马绍尔群岛"},{code:"389",name:"北马其顿"},{code:"223",name:"马里"},{code:"95",name:"缅甸"},{code:"976",name:"蒙古"},{code:"222",name:"毛里塔尼亚"},{code:"1664",name:"蒙特塞拉特岛"},{code:"356",name:"马耳他"},{code:"230",name:"毛里求斯"},{code:"960",name:"马尔代夫"},{code:"265",name:"马拉维"},{code:"52",name:"墨西哥"},{code:"60",name:"马来西亚"},{code:"258",name:"莫桑比克"},{code:"264",name:"纳米比亚"},{code:"687",name:"新喀里多尼亚"},{code:"227",name:"尼日尔"},{code:"234",name:"尼日利亚"},{code:"505",name:"尼加拉瓜"},{code:"31",name:"荷兰"},{code:"47",name:"挪威"},{code:"977",name:"尼泊尔"},{code:"674",name:"拿鲁岛"},{code:"64",name:"新西兰"},{code:"968",name:"阿曼"},{code:"507",name:"巴拿马"},{code:"51",name:"秘鲁"},{code:"689",name:"法属波利尼西亚"},{code:"675",name:"巴布亚新几内亚"},{code:"63",name:"菲律宾"},{code:"92",name:"巴基斯坦"},{code:"48",name:"波兰"},{code:"508",name:"圣彼埃尔和密克隆岛"},{code:"1787",name:"波多黎各"},{code:"351",name:"葡萄牙"},{code:"680",name:"帕劳"},{code:"595",name:"巴拉圭"},{code:"974",name:"卡塔尔"},{code:"262",name:"留尼汪"},{code:"40",name:"罗马尼亚"},{code:"381",name:"塞尔维亚"},{code:"7",name:"俄罗斯"},{code:"250",name:"卢旺达"},{code:"966",name:"沙特阿拉伯"},{code:"677",name:"所罗门群岛"},{code:"248",name:"塞舌尔"},{code:"249",name:"苏丹"},{code:"46",name:"瑞典"},{code:"65",name:"新加坡"},{code:"386",name:"斯洛文尼亚"},{code:"421",name:"斯洛伐克"},{code:"232",name:"塞拉利昂"},{code:"378",name:"圣马力诺"},{code:"221",name:"塞内加尔"},{code:"252",name:"索马里"},{code:"597",name:"苏里南"},{code:"239",name:"圣多美和普林西比"},{code:"503",name:"萨尔瓦多"},{code:"963",name:"叙利亚"},{code:"268",name:"埃斯瓦蒂尼"},{code:"1649",name:"特克斯和凯科斯群岛"},{code:"235",name:"乍得"},{code:"228",name:"多哥"},{code:"66",name:"泰国"},{code:"992",name:"塔吉克斯坦"},{code:"670",name:"东帝汶"},{code:"993",name:"土库曼斯坦"},{code:"216",name:"突尼斯"},{code:"676",name:"汤加"},{code:"90",name:"土耳其"},{code:"1868",name:"特立尼达和多巴哥"},{code:"255",name:"坦桑尼亚"},{code:"380",name:"乌克兰"},{code:"256",name:"乌干达"},{code:"598",name:"乌拉圭"},{code:"998",name:"乌兹别克斯坦"},{code:"1784",name:"圣文森特和格林纳丁斯"},{code:"58",name:"委内瑞拉"},{code:"1284",name:"英属处女群岛"},{code:"84",name:"越南"},{code:"678",name:"瓦努阿图"},{code:"685",name:"萨摩亚"},{code:"967",name:"也门"},{code:"269",name:"马约特"},{code:"27",name:"南非"},{code:"260",name:"赞比亚"},{code:"263",name:"津巴布韦"}].map(e=>({label:e.name,value:e.code,id:`${e.code}-${e.name}`}));function JE(e){if(e==="5327"){const t=["1","34","39","44","49","60","61","63","65","66","7","81","82","852","853","86","886"];return Tf.filter(n=>t.includes(n.value))}return Tf}function QE(e){return"account"in e}function eS({gameId:e,serverUserInfo:t,extraState:n}){const r={game_id:e,xToken:qE(t),saveTime:t.entity.time,$version:"v2",extraState:n};if(QE(t))r.openid=t.entity.openid,r.gaplaySign=t.gaplaySign,r.account=t.account,r.username=t.account.view_name,r.loginByRoleMail=!1,r.channelId=t.channel||6;else if(t.gaplaySign){const{ZONEID:o,openid:s,CHARID:i,NAME:a,REALZONEID:c,ZONENAME:l}=t.entity;r.openid=s,r.zone={zoneid:c||o,zonename:l,area:o},r.char={...t.entity,CHARID:i,NAME:a,GAMEPOINT:t.entity.GAMEPOINT,VIPLEVEL:t.entity.VIPLEVEL},r.loginByRoleMail=!0,r.gaplaySign=t.gaplaySign}else{const{ZONEID:o,CHARID:s,NAME:i,REALZONEID:a,ZONENAME:c,OPENID:l,CHANNELID:u,GAMEPOINT:d,VIPLEVEL:f}=t.entity;r.openid=l,r.channelId=u,r.char={CHARID:s,NAME:i,GAMEPOINT:d,VIPLEVEL:f},r.loginByRoleMail=!1,r.username=i,r.zone={zoneid:a||o,zonename:c,area:o},r.xToken=void 0}return r}function Of(){try{const e=localStorage.getItem("userInfo")||"[]";return JSON.parse(e)}catch{return[]}}function Za(e){return Of().find(n=>n.game_id===e)}function tS(e){const t=localStorage.getItem("userInfo")||"[]",n=JSON.parse(t),r=n.find(s=>s.game_id===e);r?.openid&&_f(r.openid,e);const o=n.filter(s=>s.game_id!==e);localStorage.setItem("userInfo",JSON.stringify(o))}function nS(e){const t=Of(),n=Za(e.game_id),r=t.findIndex(o=>o.game_id===e.game_id);n?t[r]=e:t.push(e),localStorage.setItem("userInfo",JSON.stringify(t))}const go="LOGIN_SDK_ACCOUNTS";function Nr(e){try{const t=JSON.parse(localStorage.getItem(go)||"[]");return e?t.filter(n=>n.gameId===e):t}catch{return[]}}function Ns(e,t,n){if(!n)return;const r=JSON.parse(localStorage.getItem(go)||"[]");let o=1;const s=r.filter(c=>c.openid===e.accid&&c.gameId===n?(o=(c.loginCnt||1)+1,!1):!0),a=[{openid:e.accid,username:e.account?.view_name||"",uid:e.account?.uid||"",mobile:e.account?.mobile||"",accountType:e.account?.account_type||0,authorization:t,loginAt:Date.now(),loginCnt:o,gameId:n},...s].slice(0,20);localStorage.setItem(go,JSON.stringify(a))}function _f(e,t){if(!t)return;const r=JSON.parse(localStorage.getItem(go)||"[]").filter(o=>!(o.openid===e&&o.gameId===t));localStorage.setItem(go,JSON.stringify(r))}let Pf={};function If(e){Pf=e}function or(e){const t=e||Pf.gameId;if(!t)throw new Error("gameId is required. Call init({ gameId }) first or pass it as an argument.");return t}const kf=z.createContext(void 0),rS={enabled:!0,days:7},Rf={"--primary-color":"#787bf4","--icon-color":"#a9aad1","--input-border-color":"#cad0e0","--input-label-color":"var(--jssdk-primary-color)","--input-bg-color":"#fff"};function xn(){const e=z.use(kf);if(!e)throw new Error("useConfig 必须在 ConfigProvider 中使用");return e}function Nf({children:e,value:t}){const n=or(t.gameId),r=Rs(n,t.loginTypes),o=KE(n,t.defaultLoginType),s=z.useRef(null);xf({gameId:n});const i=z.useMemo(()=>!t.defaultLoginType&&Nr(n).length>0?"quick":o,[t.defaultLoginType,n,o]),[a,c]=z.useState(i),[l,u]=z.useState(!0),[d,f]=z.useState(!1),[h,m]=z.useState(!1),[g,y]=z.useState(""),v=()=>{f(!0)};z.useEffect(()=>{XE({gameId:n})},[n]);const S={...t,gameId:n,loginTypes:r,defaultLoginType:o,autoLoginConfig:{...rS,...t.autoLoginConfig}};z.useEffect(()=>{document.body.classList.add(`game-${n}`)},[n]);function C(w){Object.entries(w).forEach(([b,T])=>{const E=`--jssdk-${b.replace(/^--/,"")}`;document.documentElement.style.setProperty(E,T)})}return z.useEffect(()=>{const w=s.current;if(w){const b={...Rf,...t.styleVars};C(b)}return()=>{w&&C(Rf)}},[t.styleVars]),x.jsx("div",{ref:s,children:x.jsx(kf,{value:{...S,currentLoginType:a,setCurrentLoginType:c,isShowGiantLogo:l,setIsShowGiantLogo:u,showRealNameModal:d,setShowRealNameModal:f,triggerRealNameAuth:v,isAutoLoggingIn:h,setIsAutoLoggingIn:m,autoLoginAccountName:g,setAutoLoginAccountName:y,onClose:t.onClose},children:e})})}function As({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=p.useRef(e!==void 0),[s,i]=p.useState(t),a=o?e:s;if(process.env.NODE_ENV!=="production"){p.useEffect(()=>{o!==(e!==void 0)&&Or([`A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
17
+ `))},[r,n,e]);const{current:l}=p.useRef(t);p.useEffect(()=>{!o&&Af(l)!==Af(t)&&Or([`A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
18
+ `))},[t])}const c=p.useCallback(l=>{o||i(l)},[]);return[a,c]}function Af(e){let t=0;const n=new WeakMap;try{return JSON.stringify(e,function(s,i){if(!(s==="_owner"&&this!=null&&typeof this=="object"&&"$$typeof"in this)){if(typeof i=="bigint")return`__bigint__:${i}`;if(i!==null&&typeof i=="object"){const a=n.get(i);if(a!==void 0)return`__object__:${a}`;n.set(i,t),t+=1}return i}})??`__top__:${typeof e}`}catch{return"__unserializable__"}}const Ga=p.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&(Ga.displayName="CompositeListContext");function oS(){return p.useContext(Ga)}function sS(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ae(o),i=p.useRef(0),a=ft(aS).current,c=ft(iS).current,[l,u]=p.useState(0),d=p.useRef(l),f=ae((v,S)=>{c.set(v,S??null),d.current+=1,u(d.current)}),h=ae(v=>{c.delete(v),d.current+=1,u(d.current)}),m=p.useMemo(()=>{const v=new Map;return Array.from(c.keys()).filter(C=>C.isConnected).sort(cS).forEach((C,w)=>{const b=c.get(C)??{};v.set(C,{...b,index:w})}),v},[c,l]);se(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const v=new MutationObserver(S=>{const C=new Set,w=b=>C.has(b)?C.delete(b):C.add(b);S.forEach(b=>{b.removedNodes.forEach(w),b.addedNodes.forEach(w)}),C.size===0&&(d.current+=1,u(d.current))});return m.forEach((S,C)=>{C.parentElement&&v.observe(C.parentElement,{childList:!0})}),()=>{v.disconnect()}},[m]),se(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),i.current=m.size),s(m)},[s,m,n,r,l]),se(()=>()=>{n.current=[]},[n]),se(()=>()=>{r&&(r.current=[])},[r]);const g=ae(v=>(a.add(v),()=>{a.delete(v)}));se(()=>{a.forEach(v=>v(m))},[a,m]);const y=p.useMemo(()=>({register:f,unregister:h,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:i}),[f,h,g,n,r,i]);return x.jsx(Ga.Provider,{value:y,children:t})}function iS(){return new Map}function aS(){return new Set}function cS(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function Vt(e){return Xn(e,"base-ui")}let Df=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function uS(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=oS(),f=p.useRef(-1),[h,m]=p.useState(s??(o===Df.GuessFromOrder?()=>{if(f.current===-1){const v=d.current;d.current+=1,f.current=v}return f.current}:-1)),g=p.useRef(null),y=p.useCallback(v=>{if(g.current=v,h!==-1&&v!==null&&(l.current[h]=v,u)){const S=t!==void 0;u.current[h]=S?t:r?.current?.textContent??v.textContent}},[h,l,u,t,r]);return se(()=>{if(s!=null)return;const v=g.current;if(v)return i(v,n),()=>{a(v)}},[s,i,a,n]),se(()=>{if(s==null)return c(v=>{const S=g.current?v.get(g.current)?.index:null;S!=null&&m(S)})},[s,c,m]),p.useMemo(()=>({ref:y,index:h}),[h,y])}const Mf="ArrowUp",Lf="ArrowDown",Ff="ArrowLeft",$f="ArrowRight",zf="Home",Vf="End",lS=new Set([Ff,$f]),dS=new Set([Mf,Lf]),fS=new Set([...lS,...dS]);[...fS];const Ya=new Set([Mf,Lf,Ff,$f,zf,Vf]);function qa(e){const t=p.useRef(!0);t.current&&(t.current=!1,e())}let jf={},Bf={},Uf="";function pS(e){if(typeof document>"u")return!1;const t=_e(e);return qe(t).innerWidth-t.documentElement.clientWidth>0}function hS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=_e(e),r=n.documentElement,o=n.body,s=An(r)?r:o,i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const c=s.offsetWidth;s.style.overflowY="hidden";const l=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===l}function mS(e){const t=_e(e),n=t.documentElement,r=t.body,o=An(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function gS(e){const t=_e(e),n=t.documentElement,r=t.body,o=qe(n);let s=0,i=0,a=!1;const c=an.create();if(Ji&&(o.visualViewport?.scale??1)!==1)return()=>{};function l(){const h=o.getComputedStyle(n),m=o.getComputedStyle(r),v=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,jf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Uf=n.style.scrollBehavior,Bf={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const S=n.scrollHeight>n.clientHeight,C=n.scrollWidth>n.clientWidth,w=h.overflowY==="scroll"||m.overflowY==="scroll",b=h.overflowX==="scroll"||m.overflowX==="scroll",T=Math.max(0,o.innerWidth-r.clientWidth),E=Math.max(0,o.innerHeight-r.clientHeight),O=parseFloat(m.marginTop)+parseFloat(m.marginBottom),D=parseFloat(m.marginLeft)+parseFloat(m.marginRight),k=An(n)?n:r;if(a=hS(e),a){n.style.scrollbarGutter=v,k.style.overflowY="hidden",k.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:v,overflowY:"hidden",overflowX:"hidden"}),(S||w)&&(n.style.overflowY="scroll"),(C||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:O||E?`calc(100dvh - ${O+E}px)`:"100dvh",width:D||T?`calc(100vw - ${D+T}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function u(){Object.assign(n.style,jf),Object.assign(r.style,Bf),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Uf)}function d(){u(),c.request(l)}l();const f=Pe(o,"resize",d);return()=>{c.cancel(),u(),typeof o.removeEventListener=="function"&&f()}}class vS{lockCount=0;restore=null;timeoutLock=Mt.create();timeoutUnlock=Mt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=_e(t).documentElement,o=qe(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=gt;return}const s=Pl||!pS(t);this.restore=s?mS(t):gS(t)}}const yS=new vS;function Wf(e=!0,t=null){se(()=>{if(e)return yS.acquire(t)},[e,t])}function bS(e){const t=p.useRef(""),n=p.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:p.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function Ds(e,t){const n=p.useRef(e),r=ae(t);se(()=>{n.current!==e&&r(n.current)},[e,r]),se(()=>{n.current=e},[e])}function Ka(e){const[t,n]=p.useState(null),r=ae((i,a)=>{e||n(a||(Pl?"touch":""))});Ds(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=bS(r);return p.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function wS(e){const{store:t,parentContext:n,actionsRef:r,isDrawer:o}=e,s=t.useState("open"),i=t.useState("disablePointerDismissal"),a=t.useState("modal"),c=t.useState("popupElement"),{openMethod:l,triggerProps:u}=Ka(s);Kd(t);const{forceUnmount:d}=Xd(s,t),f=p.useCallback(()=>{t.setOpen(!1,Ae(Ed))},[t]);p.useImperativeHandle(r,()=>({unmount:d,close:f}),[d,f]);const h=tf({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,g]=p.useState(0),[y,v]=p.useState(0),S=m===0,C=sf(h),w=Fa(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if(!t.context.outsidePressEnabledRef.current||"button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const F=it(L);if(S&&!i){const N=F;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===N||t.context.backdropRef.current===N||be(N,c)&&!N?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:S});Wf(s&&a===!0,c);const{getReferenceProps:b,getFloatingProps:T,getTriggerProps:E}=ho([C,w]);t.useContextCallback("onNestedDialogOpen",(L,F)=>{g(L),v(F)}),t.useContextCallback("onNestedDialogClose",()=>{g(0),v(0)}),p.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(m+1,y+(o?1:0)),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[o,s,m,y,n]);const O=p.useMemo(()=>b(u),[b,u]),D=p.useMemo(()=>E(u),[E,u]),k=p.useMemo(()=>T(),[T]);t.useSyncedValues({openMethod:l,activeTriggerProps:O,inactiveTriggerProps:D,popupProps:k,floatingRootContext:h,nestedOpenDialogCount:m,nestedOpenDrawerCount:y})}const Xa=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Xa.displayName="DialogRootContext");function Vn(e){const t=p.useContext(Xa);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>.":Qe(27));return t}const ES={...Qd,modal:ne(e=>e.modal),nested:ne(e=>e.nested),nestedOpenDialogCount:ne(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:ne(e=>e.nestedOpenDrawerCount),disablePointerDismissal:ne(e=>e.disablePointerDismissal),openMethod:ne(e=>e.openMethod),descriptionElementId:ne(e=>e.descriptionElementId),titleElementId:ne(e=>e.titleElementId),viewportElement:ne(e=>e.viewportElement),role:ne(e=>e.role)};class Ja extends Go{constructor(t){super(SS(t),{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new bs,onOpenChange:void 0,onOpenChangeComplete:void 0},ES)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t},o=n.trigger?.id??null;(o||t)&&(r.activeTriggerId=o,r.activeTriggerElement=n.trigger??null),this.update(r)};static useStore(t,n){const r=ft(()=>new Ja(n)).current;return t??r}}function SS(e={}){return{...Jd(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}const Qa=p.createContext(!1);process.env.NODE_ENV!=="production"&&(Qa.displayName="IsDrawerContext");function Hf(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=Vn(!0),h=p.useContext(Qa),m=!!f,g=Ja.useStore(l?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:a,disablePointerDismissal:i,nested:m});qa(()=>{n===void 0&&g.state.open===!1&&r===!0&&g.update({open:!0,activeTriggerId:d})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",u),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",s);const y=g.useState("payload");wS({store:g,actionsRef:c,parentContext:f?.store.context,isDrawer:h});const v=p.useMemo(()=>({store:g}),[g]);return x.jsx(Qa.Provider,{value:!1,children:x.jsx(Xa.Provider,{value:v,children:typeof t=="function"?t({payload:y}):t})})}const CS={...nr,...En},ec=p.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Vn(),l=c.useState("open"),u=c.useState("nested"),d=c.useState("mounted"),f=c.useState("transitionStatus");return Ve("div",t,{state:{open:l,transitionStatus:f},ref:[c.context.backdropRef,n],stateAttributesMapping:CS,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!u})});process.env.NODE_ENV!=="production"&&(ec.displayName="DialogBackdrop");const tc=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,style:a,...c}=t,{store:l}=Vn(),u=l.useState("open");function d(g){u&&l.setOpen(!1,Ae(pw,g.nativeEvent))}const{getButtonProps:f,buttonRef:h}=_r({disabled:s,native:i});return Ve("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:d},c,f]})});process.env.NODE_ENV!=="production"&&(tc.displayName="DialogClose");const nc=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vn(),l=Vt(i);return c.useSyncedValueWithCleanup("descriptionElementId",l),Ve("p",t,{ref:n,props:[{id:l},a]})});process.env.NODE_ENV!=="production"&&(nc.displayName="DialogDescription");let xS=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),TS=(function(e){return e[e.open=tr.open]="open",e[e.closed=tr.closed]="closed",e[e.startingStyle=tr.startingStyle]="startingStyle",e[e.endingStyle=tr.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const rc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(rc.displayName="DialogPortalContext");function OS(){const e=p.useContext(rc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":Qe(26));return e}const _S={...nr,...En,nestedDialogOpen(e){return e?{[TS.nestedDialogOpen]:""}:null}},oc=p.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:l}=Vn(),u=l.useState("descriptionElementId"),d=l.useState("disablePointerDismissal"),f=l.useState("floatingRootContext"),h=l.useState("popupProps"),m=l.useState("modal"),g=l.useState("mounted"),y=l.useState("nested"),v=l.useState("nestedOpenDialogCount"),S=l.useState("open"),C=l.useState("openMethod"),w=l.useState("titleElementId"),b=l.useState("transitionStatus"),T=l.useState("role");OS(),Cn({open:S,ref:l.context.popupRef,onComplete(){S&&l.context.onOpenChangeComplete?.(!0)}});function E(F){return F==="touch"?l.context.popupRef.current:!0}const O=s===void 0?E:s,D=v>0,L=Ve("div",t,{state:{open:S,nested:y,transitionStatus:b,nestedDialogOpen:D},props:[h,{"aria-labelledby":w??void 0,"aria-describedby":u??void 0,role:T,tabIndex:-1,hidden:!g,onKeyDown(F){Ya.has(F.key)&&F.stopPropagation()},style:{[xS.nestedDialogs]:v}},c],ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],stateAttributesMapping:_S});return x.jsx(Ma,{context:f,openInteractionType:C,disabled:!g,closeOnFocusOut:!d,initialFocus:O,returnFocus:o,modal:m!==!1,restoreFocus:"popup",children:L})});process.env.NODE_ENV!=="production"&&(oc.displayName="DialogPopup");const Ms=p.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${i.left}px ${i.top}px,${i.left}px ${i.bottom}px,${i.right}px ${i.bottom}px,${i.right}px ${i.top}px,${i.left}px ${i.top}px)`}return x.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Ms.displayName="InternalBackdrop");const sc=p.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vn(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?x.jsx(rc.Provider,{value:r,children:x.jsxs(ms,{ref:n,...o,children:[i&&a===!0&&x.jsx(Ms,{ref:s.context.internalBackdropRef,inert:ls(!c)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(sc.displayName="DialogPortal");const ic=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vn(),l=Vt(i);return c.useSyncedValueWithCleanup("titleElementId",l),Ve("h2",t,{ref:n,props:[{id:l},a]})});process.env.NODE_ENV!=="production"&&(ic.displayName="DialogTitle");const ac=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:a,payload:c,handle:l,style:u,...d}=t,f=Vn(!0),h=l?.store??f?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":Qe(79));const m=Vt(a),g=h.useState("floatingRootContext"),y=h.useState("isOpenedByTrigger",m),v=p.useRef(null),{registerTrigger:S,isMountedByThisTrigger:C}=qd(m,v,h,{payload:c}),{getButtonProps:w,buttonRef:b}=_r({disabled:s,native:i}),T=La(g,{enabled:g!=null}),E=ho([T]),O={disabled:s,open:y},D=h.useState("triggerProps",C);return Ve("button",t,{state:O,ref:[b,n,S,v],props:[E.getReferenceProps(),D,{[wa]:"",id:m},d,w],stateAttributesMapping:mf})});process.env.NODE_ENV!=="production"&&(ac.displayName="DialogTrigger");const PS=(e,t)=>Object.is(e,t);function Ar(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function IS(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:Ar(t,r,n))}function vo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:Ar(r,t,n))}function kS(e,t,n){return e.filter(r=>!Ar(t,r,n))}function cc(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function RS(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function NS(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(RS(t)){for(const n of t)for(const r of n.items)if(r&&r.value==null&&r.label!=null)return!0;return!1}for(const n of t)if(n&&n.value==null&&n.label!=null)return!0;return!1}function AS(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return cc(e)}function Dr(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?cc(e.value):cc(e)}let Zf=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const Ls={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},yo={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},DS={disabled:!1,...yo},sr={valid(e){return e===null?null:e?{[Zf.valid]:""}:{[Zf.invalid]:""}}},uc=p.createContext({invalid:void 0,name:void 0,validityData:{state:Ls,errors:[],error:"",value:"",initialValue:null},setValidityData:gt,disabled:void 0,touched:yo.touched,setTouched:gt,dirty:yo.dirty,setDirty:gt,filled:yo.filled,setFilled:gt,focused:yo.focused,setFocused:gt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:DS,markedDirtyRef:{current:!1},registerFieldControl:gt,validation:{getValidationProps:(e=st)=>e,getInputValidationProps:(e=st)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(uc.displayName="FieldRootContext");function ir(e=!0){const t=p.useContext(uc);if(t.setValidityData===gt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Qe(28));return t}function lc(e,t){const{enabled:n=!0,getValue:r,id:o,value:s}=t,{registerFieldControl:i}=ir(),a=p.useRef(null);a.current||(a.current=Symbol()),se(()=>{const c=a.current;if(!(!c||!n))return i(c,{controlRef:e,getValue:r,id:o,value:s}),()=>{i(c,void 0)}},[e,n,r,o,i,s])}const dc=p.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:gt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(dc.displayName="FormContext");function Mr(){return p.useContext(dc)}const fc=p.createContext({controlId:void 0,registerControlId:gt,labelId:void 0,setLabelId:gt,messageIds:[],setMessageIds:gt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(fc.displayName="LabelableContext");function Tn(){return p.useContext(fc)}function pc(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Tn(),i=Vt(t),a=n?o:void 0,c=ft(()=>Symbol("labelable-control")),l=p.useRef(!1),u=p.useRef(t!=null),d=ae(()=>{!l.current||s===gt||(l.current=!1,s(c.current,void 0))});return se(()=>{if(s===gt)return;let f;if(n){const h=r?.current;De(h)&&h.closest("label")!=null?f=t??null:f=a??i}else if(t!=null)u.current=!0,f=t;else if(u.current)f=i;else{d();return}if(f===void 0){d();return}l.current=!0,s(c.current,f)},[t,r,a,s,n,i,c,d]),p.useEffect(()=>d,[d]),o??i}function MS(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=qe(e),r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||o.content!=="none"))return t;const i=parseFloat(r.width)||0,a=parseFloat(r.height)||0,c=parseFloat(o.width)||0,l=parseFloat(o.height)||0,u=Math.max(t.width,i,c),d=Math.max(t.height,a,l),f=u-t.width,h=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-h/2,bottom:t.bottom+h/2}}function LS(e,t){return e??t}const FS=20;function Gf(e,t,n,r){const[o,s]=p.useState(!1);se(()=>{if(!e||!t||n==null){s(!1);return}const i=_e(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-FS)},[e,t,n]),Wf(e&&(!t||o),r)}let Yf=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function qf(e){return p.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[Yf.checked]:""}:{[Yf.unchecked]:""}},...sr}),[e.indeterminate])}const Kf=p.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(Kf.displayName="FieldItemContext");function $S(){return p.useContext(Kf)}function zS(e,t,n,r=!0,o){const[s,i]=p.useState(),a=Vt(o?`${o}-label`:void 0),c=e??t??s;return se(()=>{const l=e||t||!r?void 0:VS(n.current,a);s!==l&&i(l)}),c}function VS(e,t){const n=jS(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function jS(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const o=e.nextElementSibling;if(o&&o.htmlFor===n)return o}const r=e.labels;return r&&r[0]}const Xf=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Xf.displayName="CheckboxGroupContext");function BS(e=!0){const t=p.useContext(Xf);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxGroupContext is missing. CheckboxGroup parts must be placed within <CheckboxGroup>.":Qe(3));return t}const hc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(hc.displayName="CheckboxRootContext");function US(){const e=p.useContext(hc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.":Qe(14));return e}const WS="data-parent",mc=p.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:l,indeterminate:u=!1,inputRef:d,name:f,onCheckedChange:h,parent:m=!1,readOnly:g=!1,render:y,required:v=!1,uncheckedValue:S,value:C,nativeButton:w=!1,style:b,...T}=t,{clearErrors:E}=Mr(),{disabled:O,name:D,setDirty:k,setFilled:L,setFocused:F,setTouched:N,state:R,validationMode:_,validityData:I,shouldValidateOnChange:P,validation:A}=ir(),M=$S(),{labelId:$,controlId:U,registerControlId:V,getDescriptionProps:H}=Tn(),Y=BS(),G=Y?.parent,K=G&&Y.allValues,J=O||M.disabled||Y?.disabled||a,X=D??f,re=C??X,ue=Vt(),fe=Vt();let Q=U;K?Q=m?fe:`${G.id}-${re}`:l&&(Q=l);let de={};K&&(m?de=Y.parent.getParentProps():re&&(de=Y.parent.getChildProps(re)));const te=ae(h),{checked:we=r,indeterminate:ce=u,onCheckedChange:le,...me}=de,oe=Y?.value,ye=Y?.setValue,j=Y?.defaultValue,Z=p.useRef(null),B=ft(()=>Symbol("checkbox-control")),W=p.useRef(!1),{getButtonProps:ie,buttonRef:ve}=_r({disabled:J,native:w}),he=Y?.validation??A,[Ce,$e]=As({controlled:re&&oe&&!m?oe.includes(re):we,default:re&&j&&!m?j.includes(re):s,name:"Checkbox",state:"checked"});se(()=>{V!==gt&&(W.current=!0,V(B.current,Q))},[Q,Y,V,m,B]),p.useEffect(()=>{const ee=B.current;return()=>{!W.current||V===gt||(W.current=!1,V(ee,void 0))}},[V,B]),lc(Z,{enabled:!Y,id:ue,value:Ce});const xe=p.useRef(null),Le=qn(d,xe,he.inputRef),Ie=zS(i,$,xe,!w,Q??void 0);se(()=>{xe.current&&(xe.current.indeterminate=ce,Ce&&L(!0))},[Ce,ce,L]),Ds(Ce,()=>{Y&&!m||(E(X),L(Ce),k(Ce!==I.initialValue),P()?he.commit(Ce):he.commit(Ce,!0))});const Fe=wn({checked:Ce,disabled:J,form:c,name:m?void 0:X,id:w?void 0:Q??void 0,required:v,ref:Le,style:X?td:as,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ee){if(ee.nativeEvent.defaultPrevented)return;if(g){ee.preventDefault();return}const pe=ee.currentTarget.checked,ge=Ae(Pr,ee.nativeEvent);if(le?.(pe,ge),te(pe,ge),!ge.isCanceled&&($e(pe),re&&oe&&ye&&!m&&!K)){const Ee=pe?[...oe,re]:oe.filter(Oe=>Oe!==re);ye(Ee,ge)}},onFocus(){Z.current?.focus()}},C!==void 0?{value:(Y?Ce&&C:C)||""}:st,H,Y?he.getValidationProps:he.getInputValidationProps),je=K?!!we:Ce,nt=K&&ce||u;p.useEffect(()=>{if(!G||!re)return;const ee=G.disabledStatesRef.current;return ee.set(re,J),()=>{ee.delete(re)}},[G,J,re]);const vt=p.useMemo(()=>({...R,checked:je,disabled:J,readOnly:g,required:v,indeterminate:nt}),[R,je,J,g,v,nt]),rt=qf(vt),ke=Ve("span",t,{state:vt,ref:[ve,Z,n,Y?.registerControlRef],props:[{id:w?Q??void 0:ue,role:"checkbox","aria-checked":ce?"mixed":Ce,"aria-readonly":g||void 0,"aria-required":v||void 0,"aria-labelledby":Ie,[WS]:m?"":void 0,onFocus(){F(!0)},onBlur(){const ee=xe.current;ee&&(N(!0),F(!1),_==="onBlur"&&he.commit(Y?oe:ee.checked))},onClick(ee){g||J||(ee.preventDefault(),xe.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ee.shiftKey,ctrlKey:ee.ctrlKey,altKey:ee.altKey,metaKey:ee.metaKey})))}},H,he.getValidationProps,T,me,ie],stateAttributesMapping:rt});return x.jsxs(hc.Provider,{value:vt,children:[ke,!Ce&&!Y&&X&&!m&&S!==void 0&&x.jsx("input",{type:"hidden",form:c,name:X,value:S}),x.jsx("input",{...Fe,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(mc.displayName="CheckboxRoot");const gc=p.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=US(),l=c.checked||c.indeterminate,{mounted:u,transitionStatus:d,setMounted:f}=po(l),h=p.useRef(null),m={...c,transitionStatus:d};Cn({open:l,ref:h,onComplete(){l||f(!1)}});const g=qf(c),y=p.useMemo(()=>({...g,...En,...sr}),[g]),v=i||u,S=Ve("span",t,{ref:[n,h],state:m,stateAttributesMapping:y,props:a});return v?S:null});process.env.NODE_ENV!=="production"&&(gc.displayName="CheckboxIndicator");function HS(e,t){const n=Vt(e);return se(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function ZS(e={}){const{id:t,fallbackControlId:n,native:r=!1,setLabelId:o,focusControl:s}=e,{controlId:i,setLabelId:a}=Tn(),c=ae(h=>{a(h),o?.(h)}),l=HS(t,c),u=i??n;function d(h){if(s){s(h,u);return}if(!u)return;const m=_e(h.currentTarget).getElementById(u);Ze(m)&&GS(m)}function f(h){it(h.nativeEvent)?.closest("button,input,select,textarea")||(!h.defaultPrevented&&h.detail>1&&h.preventDefault(),!r&&d(h))}return r?{id:l,htmlFor:u??void 0,onMouseDown:f}:{id:l,onClick:f,onPointerDown(h){h.preventDefault()}}}function GS(e){e.focus({focusVisible:!0})}const Jf=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jf.displayName="ToolbarRootContext");function Qf(e){return p.useContext(Jf)}function YS(e,t){const n=p.useRef(null),r=ae(s=>{jt.flushSync(()=>{e.setOpen(!1,Ae(Jn,s.nativeEvent,s.currentTarget))}),S0(n.current)?.focus()}),o=ae(s=>{const i=e.select("positionerElement");if(i&&Tr(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{jt.flushSync(()=>{e.setOpen(!1,Ae(Jn,s.nativeEvent,s.currentTarget))});let a=E0(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&be(i,a);){const c=a;if(a=ha(a),a===c)break}a?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function qS(e){const[t,n]=p.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}const ep=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(ep.displayName="CSPContext");const KS={disableStyleElements:!1};function XS(){return p.useContext(ep)??KS}function bo(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const tp=p.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});process.env.NODE_ENV!=="production"&&(tp.displayName="FieldsetRootContext");function JS(e=!1){const t=p.useContext(tp);if(!t&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.":Qe(86));return t}const np=function(t){const n=Vt(),r=t.controlId===void 0?n:t.controlId,[o,s]=p.useState(r),[i,a]=p.useState(t.labelId),[c,l]=p.useState([]),u=ft(()=>new Map),{messageIds:d}=Tn(),f=ae((g,y)=>{const v=u.current;if(y===void 0){v.delete(g);return}v.set(g,y),s(S=>{if(v.size===0)return;let C;for(const w of v.values()){if(S!==void 0&&w===S)return S;C===void 0&&(C=w)}return C})}),h=p.useCallback(g=>wn({"aria-describedby":d.concat(c).join(" ")||void 0},g),[d,c]),m=p.useMemo(()=>({controlId:o,registerControlId:f,labelId:i,setLabelId:a,messageIds:c,setMessageIds:l,getDescriptionProps:h}),[o,f,i,a,c,l,h]);return x.jsx(fc.Provider,{value:m,children:t.children})};process.env.NODE_ENV!=="production"&&(np.displayName="LabelableProvider");function Fs(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const $s=Object.keys(Ls);function QS(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of $s)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function e1(e){const{formRef:t,clearErrors:n}=Mr(),{setValidityData:r,validate:o,validityData:s,validationDebounceTime:i,invalid:a,markedDirtyRef:c,state:l,name:u,shouldValidateOnChange:d}=e,{controlId:f,getDescriptionProps:h}=Tn(),m=Lt(),g=p.useRef(null),y=ae(async(C,w=!1)=>{const b=g.current;if(!b)return;if(w){if(l.valid!==!1)return;const N=b.validity;if(!N.valueMissing){const _={value:C,state:{...Ls,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(b.setCustomValidity(""),f){const I=t.current.fields.get(f);I&&t.current.fields.set(f,{...I,...Fs(_,!1)})}r(_);return}const R=$s.reduce((_,I)=>(_[I]=N[I],_),{});if(!R.valid&&!QS(R))return}function T(N){const R=$s.reduce((I,P)=>(I[P]=N.validity[P],I),{});let _=!1;for(const I of $s)if(I!=="valid"){if(I==="valueMissing"&&R[I])_=!0;else if(R[I])return R}return _&&!c.current&&(R.valid=!0,R.valueMissing=!1),R}m.clear();let E=null,O=[];const D=T(b);let k;const L=d();if(b.validationMessage&&!L)k=b.validationMessage,O=[b.validationMessage];else{const N=Array.from(t.current.fields.values()).reduce((_,I)=>(I.name&&(_[I.name]=I.getValue()),_),{}),R=o(C,N);typeof R=="object"&&R!==null&&"then"in R?E=await R:E=R,E!==null?(D.valid=!1,D.customError=!0,Array.isArray(E)?(O=E,b.setCustomValidity(E.join(`
19
+ `))):E&&(O=[E],b.setCustomValidity(E))):L&&(b.setCustomValidity(""),D.customError=!1,b.validationMessage?(k=b.validationMessage,O=[b.validationMessage]):b.validity.valid&&!D.valid&&(D.valid=!0))}const F={value:C,state:D,error:k??(Array.isArray(E)?E[0]:E??""),errors:O,initialValue:s.initialValue};if(f){const N=t.current.fields.get(f);N&&t.current.fields.set(f,{...N,...Fs(F,a)})}r(F)}),v=p.useCallback((C={})=>wn(h,l.valid===!1?{"aria-invalid":!0}:st,C),[h,l.valid]),S=p.useCallback((C={})=>wn({onChange(w){if(w.nativeEvent.defaultPrevented)return;if(n(u),!d()){y(w.currentTarget.value,!0);return}const b=w.currentTarget;if(b.value===""){y(b.value);return}m.clear(),i?m.start(i,()=>{y(b.value)}):y(b.value)}},v(C)),[v,n,u,m,y,i,d]);return p.useMemo(()=>({getValidationProps:v,getInputValidationProps:S,inputRef:g,commit:y}),[v,S,y])}function t1(e){const{commit:t,invalid:n,markedDirtyRef:r,name:o,setValidityData:s,validityData:i}=e,{formRef:a}=Mr(),c=p.useRef(null),l=p.useRef(null),u=p.useRef(null),d=ae(()=>{const y=l.current;if(y)return y.getValue?y.getValue():y.value}),f=ae((y=!0)=>{const v=l.current;if(!v)return;let S=v.value;S===void 0&&(S=d()),r.current=!0,y?jt.flushSync(()=>t(S)):t(S)});function h(){const y=l.current;!y||!y.id||a.current.fields.set(y.id,{getValue:d,name:o,controlRef:y.controlRef??u,validityData:Fs(i,n),validate:f})}function m(y=l.current?.id){y&&a.current.fields.delete(y)}function g(){const y=l.current;if(!y)return;let v=y.value;v===void 0&&(v=d()),i.initialValue===null&&v!==null&&s(S=>({...S,initialValue:v}))}return se(()=>{const y=l.current;!y||!y.id||a.current.fields.set(y.id,{getValue:d,name:o,controlRef:y.controlRef??u,validityData:Fs(i,n),validate:f})},[a,d,n,o,f,i]),se(()=>{const y=a.current.fields;return()=>{const v=l.current?.id;v&&y.delete(v)}},[a]),ae((y,v)=>{if(!v){c.current===y&&(c.current=null,m(),l.current=null);return}const S=l.current?.id;c.current=y,l.current=v,S&&S!==v.id&&m(S),g(),h()})}const rp=p.forwardRef(function(t,n){const{errors:r,validationMode:o,submitAttemptedRef:s}=Mr(),{render:i,className:a,validate:c,validationDebounceTime:l=0,validationMode:u=o,name:d,disabled:f=!1,invalid:h,dirty:m,touched:g,actionsRef:y,style:v,...S}=t,{disabled:C}=JS(),w=ae(c||(()=>null)),b=C||f,[T,E]=p.useState(!1),[O,D]=p.useState(!1),[k,L]=p.useState(!1),[F,N]=p.useState(!1),R=m??O,_=g??T,I=p.useRef(!1),P=ae(fe=>{m===void 0&&(fe&&(I.current=!0),D(fe))}),A=ae(fe=>{g===void 0&&E(fe)}),M=ae(()=>u==="onChange"||u==="onSubmit"&&s.current),$=!!d&&Object.hasOwn(r,d)&&r[d]!==void 0,U=h===!0||$,[V,H]=p.useState({state:Ls,error:"",errors:[],value:null,initialValue:null}),Y=!U&&V.state.valid,G=p.useMemo(()=>({disabled:b,touched:_,dirty:R,valid:Y,filled:k,focused:F}),[b,_,R,Y,k,F]),K=e1({setValidityData:H,validate:w,validityData:V,validationDebounceTime:l,invalid:U,markedDirtyRef:I,state:G,name:d,shouldValidateOnChange:M}),J=p.useCallback(()=>{I.current=!0,K.commit(V.value)},[K,V]),X=t1({commit:K.commit,invalid:U,markedDirtyRef:I,name:d,setValidityData:H,validityData:V});p.useImperativeHandle(y,()=>({validate:J}),[J]);const re=p.useMemo(()=>({invalid:U,name:d,validityData:V,setValidityData:H,disabled:b,touched:_,setTouched:A,dirty:R,setDirty:P,filled:k,setFilled:L,focused:F,setFocused:N,validate:w,validationMode:u,validationDebounceTime:l,shouldValidateOnChange:M,state:G,markedDirtyRef:I,registerFieldControl:X,validation:K}),[U,d,V,b,_,A,R,P,k,L,F,N,w,u,l,M,G,X,K]),ue=Ve("div",t,{ref:n,state:G,props:S,stateAttributesMapping:sr});return x.jsx(uc.Provider,{value:re,children:ue})});process.env.NODE_ENV!=="production"&&(rp.displayName="FieldRootInner");const Kt=p.forwardRef(function(t,n){return x.jsx(np,{children:x.jsx(rp,{...t,ref:n})})});process.env.NODE_ENV!=="production"&&(Kt.displayName="FieldRoot");const vc=p.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,nativeLabel:a=!0,...c}=t,l=ir(!1),{labelId:u}=Tn(),d=p.useRef(null),f=ZS({id:u??i,native:a});return process.env.NODE_ENV!=="production"&&p.useEffect(()=>{if(!d.current)return;const m=d.current.tagName==="LABEL";if(a){if(!m){const g=lo.captureOwnerStack?.()||"";Or(`<Field.Label> expected a <label> element because the \`nativeLabel\` prop is true. Rendering a non-<label> disables native label association, so \`htmlFor\` will not work. Use a real <label> in the \`render\` prop, or set \`nativeLabel\` to \`false\`.${g}`)}}else if(m){const g=lo.captureOwnerStack?.()||"";Or(`<Field.Label> expected a non-<label> element because the \`nativeLabel\` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the \`render\` prop, or set \`nativeLabel\` to \`true\`.${g}`)}},[a]),Ve("label",t,{ref:[n,d],state:l.state,props:[f,c],stateAttributesMapping:sr})});process.env.NODE_ENV!=="production"&&(vc.displayName="FieldLabel");const n1={...sr,...En},wo=p.forwardRef(function(t,n){const{render:r,id:o,className:s,match:i,style:a,...c}=t,l=Vt(o),{validityData:u,state:d,name:f}=ir(!1),{setMessageIds:h}=Tn(),{errors:m}=Mr(),g=f?m[f]:null,y=typeof i=="string";let v=!1;i===!0?v=!0:y?v=!!u.state[i]:v=!!g||u.state.valid===!1;const{mounted:S,transitionStatus:C,setMounted:w}=po(v);se(()=>{if(!(!v||!l))return h(_=>_.concat(l)),()=>{h(_=>_.filter(I=>I!==l))}},[v,l,h]);const b=p.useRef(null),[T,E]=p.useState(null),[O,D]=p.useState(null),k=u.errors.length>1?x.jsx("ul",{children:u.errors.map(_=>x.jsx("li",{children:_},_))}):u.error,L=y?k:g||k;let F=u.error;g!=null?F=Array.isArray(g)?JSON.stringify(g):g:u.errors.length>1&&(F=JSON.stringify(u.errors)),v&&F!==O&&(D(F),E(L)),Cn({open:v,ref:b,onComplete(){v||w(!1)}});const N={...d,transitionStatus:C},R=Ve("div",t,{ref:[n,b],state:N,props:[{id:l,children:v?L:T},c],stateAttributesMapping:n1,enabled:S});return S?R:null});process.env.NODE_ENV!=="production"&&(wo.displayName="FieldError");const On=p.forwardRef(function(t,n){const{render:r,className:o,id:s,name:i,value:a,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...h}=t,{state:m,name:g,disabled:y,setTouched:v,setDirty:S,validityData:C,setFocused:w,setFilled:b,validationMode:T,validation:E}=ir(),O=y||c,D=g??i,k={...m,disabled:O},{labelId:L}=Tn(),F=pc({id:s});se(()=>{const M=a!=null;E.inputRef.current?.value||M&&a!==""?b(!0):M&&a===""&&b(!1)},[E.inputRef,b,a]);const N=p.useRef(null);se(()=>{d&&N.current===Ct(_e(N.current))&&w(!0)},[d,w]);const[R]=As({controlled:a,default:u,name:"FieldControl",state:"value"}),_=a!==void 0,I=_?R:void 0,P=ae(()=>E.inputRef.current?.value);return lc(E.inputRef,{id:F,value:I,getValue:P}),Ve("input",t,{ref:[n,N],state:k,props:[{id:F,disabled:O,name:D,ref:E.inputRef,"aria-labelledby":L,autoFocus:d,..._?{value:I}:{defaultValue:u},onChange(M){const $=M.currentTarget.value;l?.($,Ae(Pr,M.nativeEvent)),S($!==C.initialValue),b($!=="")},onFocus(){w(!0)},onBlur(M){v(!0),w(!1),T==="onBlur"&&E.commit(M.currentTarget.value)},onKeyDown(M){M.currentTarget.tagName==="INPUT"&&M.key==="Enter"&&(v(!0),E.commit(M.currentTarget.value))}},E.getInputValidationProps(),h],stateAttributesMapping:sr})});process.env.NODE_ENV!=="production"&&(On.displayName="FieldControl");const Eo=p.forwardRef(function(t,n){const{render:r,className:o,validationMode:s="onSubmit",errors:i,onSubmit:a,onFormSubmit:c,actionsRef:l,style:u,...d}=t,f=p.useRef({fields:new Map}),h=p.useRef(!1),m=p.useRef(!1),g=ae(T=>{T&&(T.focus(),T.tagName==="INPUT"&&T.select())}),[y,v]=p.useState(i);Ds(i,()=>{v(i)}),p.useEffect(()=>{if(!h.current)return;h.current=!1;const T=Array.from(f.current.fields.values()).filter(E=>E.validityData.state.valid===!1);T.length&&g(T[0].controlRef.current)},[y,g]);const S=p.useCallback(T=>{const E=Array.from(f.current.fields.values());if(T){const O=E.find(D=>D.name===T);O&&O.validate(!1)}else E.forEach(O=>{O.validate(!1)})},[]);p.useImperativeHandle(l,()=>({validate:S}),[S]);const C=Ve("form",t,{ref:n,props:[{noValidate:!0,onSubmit(T){m.current=!0;let E=Array.from(f.current.fields.values());E.forEach(D=>{D.validate()}),E=Array.from(f.current.fields.values());const O=E.filter(D=>!D.validityData.state.valid);if(O.length)T.preventDefault(),g(O[0].controlRef.current);else if(h.current=!0,a?.(T),c){T.preventDefault();const D=E.reduce((k,L)=>(L.name&&(k[L.name]=L.getValue()),k),{});c(D,gw(Pr,T.nativeEvent))}}},d]}),w=ae(T=>{if(T&&y&&st.hasOwnProperty.call(y,T)){const E={...y};delete E[T],v(E)}}),b=p.useMemo(()=>({formRef:f,validationMode:s,errors:y??st,clearErrors:w,submitAttemptedRef:m}),[f,s,y,w]);return x.jsx(dc.Provider,{value:b,children:C})});process.env.NODE_ENV!=="production"&&(Eo.displayName="Form");const yc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(yc.displayName="PopoverRootContext");function _n(e){const t=p.useContext(yc);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":Qe(47));return t}function r1(){return{...Jd(),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1}}const o1={...Qd,disabled:ne(e=>e.disabled),instantType:ne(e=>e.instantType),openMethod:ne(e=>e.openMethod),openChangeReason:ne(e=>e.openChangeReason),modal:ne(e=>e.modal),focusManagerModal:ne(e=>e.focusManagerModal),stickIfOpen:ne(e=>e.stickIfOpen),titleElementId:ne(e=>e.titleElementId),descriptionElementId:ne(e=>e.descriptionElementId),openOnHover:ne(e=>e.openOnHover),closeDelay:ne(e=>e.closeDelay),hasViewport:ne(e=>e.hasViewport)};class bc extends Go{constructor(t){const n={...r1(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:p.createRef(),backdropRef:p.createRef(),internalBackdropRef:p.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:p.createRef(),beforeContentFocusGuardRef:p.createRef(),stickIfOpenTimeout:new Mt,triggerElements:new bs},o1)}setOpen=(t,n)=>{const r=n.reason===Pt,o=n.reason===Ir&&n.event.detail===0,s=!t&&(n.reason===wd||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const a={open:t,openChangeReason:n.reason},c=n.trigger?.id??null;(c||t)&&(a.activeTriggerId=c,a.activeTriggerElement=n.trigger??null),this.update(a)};r?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(Y0,()=>{this.set("stickIfOpen",!1)}),jt.flushSync(i)):i(),o||s?this.set("instantType",o?"click":"dismiss"):n.reason===Jn?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const r=ft(()=>new bc(n)).current,o=t??r;return Qr(r.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function op({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:c,defaultTriggerId:l=null}=e,u=bc.useStore(a?.store,{modal:i,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});qa(()=>{n===void 0&&u.state.open===!1&&r===!0&&u.update({open:!0,activeTriggerId:l})}),u.useControlledProp("openProp",n),u.useControlledProp("triggerIdProp",c);const d=u.useState("open"),f=u.useState("payload");u.useContextCallback("onOpenChange",o),u.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:m}=Ka(d);Kd(u);const{forceUnmount:g}=Xd(d,u,()=>{u.update({stickIfOpen:!0,openChangeReason:null})});p.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]);const y=p.useCallback(()=>{u.setOpen(!1,Ae(Ed))},[u]);p.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:y}),[g,y]);const v=tf({popupStore:u,onOpenChange:u.setOpen}),S=Fa(v,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),C=sf(v),{getReferenceProps:w,getFloatingProps:b,getTriggerProps:T}=ho([S,C]),E=p.useMemo(()=>w(m),[w,m]),O=p.useMemo(()=>T(m),[T,m]),D=p.useMemo(()=>b(),[b]);u.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:E,inactiveTriggerProps:O,popupProps:D,floatingRootContext:v,nested:$n()!=null});const k=p.useMemo(()=>({store:u}),[u]);return x.jsx(yc.Provider,{value:k,children:typeof t=="function"?t({payload:f}):t})}function s1(e){return _n(!0)?x.jsx(op,{props:e}):x.jsx(xw,{children:x.jsx(op,{props:e})})}const i1=300,sp=p.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:a,payload:c,openOnHover:l=!1,delay:u=i1,closeDelay:d=0,id:f,style:h,...m}=t,g=_n(!0),y=a?.store??g?.store;if(!y)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":Qe(74));const v=Vt(f),S=y.useState("isTriggerActive",v),C=y.useState("floatingRootContext"),w=y.useState("isOpenedByTrigger",v),b=p.useRef(null),{registerTrigger:T,isMountedByThisTrigger:E}=qd(v,b,y,{payload:c,disabled:s,openOnHover:l,closeDelay:d}),O=y.useState("openChangeReason"),D=y.useState("stickIfOpen"),k=y.useState("openMethod"),L=y.useState("focusManagerModal"),F=CE(C,{enabled:C!=null&&l&&(k!=="touch"||O!==Ir),mouseOnly:!0,move:!1,handleClose:NE(),restMs:u,delay:{close:d},triggerElementRef:b,isActiveTrigger:S,isClosing:()=>y.select("transitionStatus")==="ending"}),N=La(C,{enabled:C!=null,stickIfOpen:D}),R=ho([N]),_=y.useState("triggerProps",E),I={disabled:s,open:w},{getButtonProps:P,buttonRef:A}=_r({disabled:s,native:i}),M=p.useMemo(()=>({open(Y){return Y&&O===Ir?gf.open(Y):mf.open(Y)}}),[O]),$=Ve("button",t,{state:I,ref:[A,n,T,b],props:[R.getReferenceProps(),F,_,{[wa]:"",id:v},m,P],stateAttributesMapping:M}),{preFocusGuardRef:U,handlePreFocusGuardFocus:V,handleFocusTargetFocus:H}=YS(y,b);return S&&!L?x.jsxs(p.Fragment,{children:[x.jsx(dn,{ref:U,onFocus:V}),x.jsx(p.Fragment,{children:$},v),x.jsx(dn,{ref:y.context.triggerFocusTargetRef,onFocus:H})]}):x.jsx(p.Fragment,{children:$},v)});process.env.NODE_ENV!=="production"&&(sp.displayName="PopoverTrigger");const wc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(wc.displayName="PopoverPortalContext");function a1(){const e=p.useContext(wc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":Qe(45));return e}const ip=p.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=_n();return s.useState("mounted")||r?x.jsx(wc.Provider,{value:r,children:x.jsx(ms,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(ip.displayName="PopoverPortal");const Ec=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ec.displayName="PopoverPositionerContext");function ap(){const e=p.useContext(Ec);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":Qe(46));return e}const cp=p.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:y=tw,style:v,...S}=t,{store:C}=_n(),w=a1(),b=Sw(),T=C.useState("floatingRootContext"),E=C.useState("mounted"),O=C.useState("open"),D=C.useState("openChangeReason"),k=C.useState("activeTriggerElement"),L=C.useState("modal"),F=C.useState("openMethod"),N=C.useState("positionerElement"),R=C.useState("instantType"),_=C.useState("transitionStatus"),I=C.useState("hasViewport"),P=p.useRef(null),A=dd(N,!1,!1),M=pf({anchor:s,floatingRootContext:T,positionMethod:i,mounted:E,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:g,keepMounted:w,nodeId:b,collisionAvoidance:y,adaptiveOrigin:I?FE:void 0}),$=T.useState("domReferenceElement");se(()=>{const Y=$,G=P.current;if(Y&&(P.current=Y),G&&Y&&Y!==G){C.set("instantType",void 0);const K=new AbortController;return A(()=>{C.set("instantType","trigger-change")},K.signal),()=>{K.abort()}}},[$,A,C]);const U={open:O,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:R};Gf(O&&L===!0&&D!==Pt,F==="touch",N,k);const V=p.useCallback(Y=>{C.set("positionerElement",Y)},[C]),H=vf(t,U,{styles:M.positionerStyles,transitionStatus:_,props:S,refs:[n,V],hidden:!E,inert:!O});return x.jsxs(Ec.Provider,{value:M,children:[E&&L===!0&&D!==Pt&&x.jsx(Ms,{ref:C.context.internalBackdropRef,inert:ls(!O),cutout:k}),x.jsx(Cw,{id:b,children:H})]})});process.env.NODE_ENV!=="production"&&(cp.displayName="PopoverPositioner");const up=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(up.displayName="ClosePartContext");function c1(){const[e,t]=p.useState(0),n=ae(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:p.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function u1(e){const{value:t,children:n}=e;return x.jsx(up.Provider,{value:t,children:n})}const l1={...nr,...En},lp=p.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,style:a,...c}=t,{store:l}=_n(),u=ap(),d=Qf()!=null,{context:f,hasClosePart:h}=c1(),m=l.useState("open"),g=l.useState("openMethod"),y=l.useState("instantType"),v=l.useState("transitionStatus"),S=l.useState("popupProps"),C=l.useState("titleElementId"),w=l.useState("descriptionElementId"),b=l.useState("modal"),T=l.useState("mounted"),E=l.useState("openChangeReason"),O=l.useState("activeTriggerElement"),D=l.useState("floatingRootContext");Cn({open:m,ref:l.context.popupRef,onComplete(){m&&l.context.onOpenChangeComplete?.(!0)}});const k=l.useState("disabled"),L=l.useState("openOnHover"),F=l.useState("closeDelay");EE(D,{enabled:L&&!k,closeDelay:F});function N(M){return M==="touch"?l.context.popupRef.current:!0}const R=s===void 0?N:s,_={open:m,side:u.side,align:u.align,instant:y,transitionStatus:v},I=b!==!1&&h;l.useSyncedValue("focusManagerModal",I);const P=p.useCallback(M=>{l.set("popupElement",M)},[l]),A=Ve("div",t,{state:_,ref:[n,l.context.popupRef,P],props:[S,{"aria-labelledby":C,"aria-describedby":w,onKeyDown(M){d&&Ya.has(M.key)&&M.stopPropagation()}},Ha(v),c],stateAttributesMapping:l1});return x.jsx(Ma,{context:D,openInteractionType:g,modal:I,disabled:!T||E===Pt,initialFocus:R,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Ze(O)?O:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:x.jsx(u1,{value:f,children:A})})});process.env.NODE_ENV!=="production"&&(lp.displayName="PopoverPopup");const dp=p.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=_n(),c=a.useState("open"),{arrowRef:l,side:u,align:d,arrowUncentered:f,arrowStyles:h}=ap();return Ve("div",t,{state:{open:c,side:u,align:d,uncentered:f},ref:[n,l],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:nr})});process.env.NODE_ENV!=="production"&&(dp.displayName="PopoverArrow");const d1={...nr,...En},fp=p.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=_n(),c=a.useState("open"),l=a.useState("mounted"),u=a.useState("transitionStatus"),d=a.useState("openChangeReason");return Ve("div",t,{state:{open:c,transitionStatus:u},ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!l,style:{pointerEvents:d===Pt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:d1})});process.env.NODE_ENV!=="production"&&(fp.displayName="PopoverBackdrop");const pp=p.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=_n(),c=Vt(i.id);return se(()=>(a.set("titleElementId",c),()=>{a.set("titleElementId",void 0)}),[a,c]),Ve("h2",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(pp.displayName="PopoverTitle");const hp=p.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=_n(),c=Vt(i.id);return se(()=>(a.set("descriptionElementId",c),()=>{a.set("descriptionElementId",void 0)}),[a,c]),Ve("p",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(hp.displayName="PopoverDescription");const zs="base-ui-disable-scrollbar",Sc={className:zs,getElement(e){return x.jsx("style",{nonce:e,href:zs,precedence:"base-ui:low",children:`.${zs}{scrollbar-width:none}.${zs}::-webkit-scrollbar{display:none}`})}};process.env.NODE_ENV!=="production"&&(Sc.getElement.displayName="styleDisableScrollbar.getElement");const Pn=1;function mp(e,t){return Math.max(0,e-t)}function f1(e,t){if(t<=0)return 0;const n=bo(e,0,t),r=n,o=t-n,s=r<=Pn,i=o<=Pn;return s&&i?r<=o?0:t:s?0:i?t:n}const Cc=p.createContext(null);process.env.NODE_ENV!=="production"&&(Cc.displayName="SelectRootContext");const xc=p.createContext(null);process.env.NODE_ENV!=="production"&&(xc.displayName="SelectFloatingContext");function Lr(){const e=p.useContext(Cc);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":Qe(60));return e}function gp(){const e=p.useContext(xc);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.":Qe(61));return e}const Ne={id:ne(e=>e.id),labelId:ne(e=>e.labelId),modal:ne(e=>e.modal),multiple:ne(e=>e.multiple),items:ne(e=>e.items),itemToStringLabel:ne(e=>e.itemToStringLabel),itemToStringValue:ne(e=>e.itemToStringValue),isItemEqualToValue:ne(e=>e.isItemEqualToValue),value:ne(e=>e.value),hasSelectedValue:ne(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Dr(t,r)!==""}),hasNullItemLabel:ne((e,t)=>t?NS(e.items):!1),open:ne(e=>e.open),mounted:ne(e=>e.mounted),forceMount:ne(e=>e.forceMount),transitionStatus:ne(e=>e.transitionStatus),openMethod:ne(e=>e.openMethod),activeIndex:ne(e=>e.activeIndex),selectedIndex:ne(e=>e.selectedIndex),isActive:ne((e,t)=>e.activeIndex===t),isSelected:ne((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>Ar(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ar(n,o,r)}),isSelectedByFocus:ne((e,t)=>e.selectedIndex===t),popupProps:ne(e=>e.popupProps),triggerProps:ne(e=>e.triggerProps),triggerElement:ne(e=>e.triggerElement),positionerElement:ne(e=>e.positionerElement),listElement:ne(e=>e.listElement),scrollUpArrowVisible:ne(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ne(e=>e.scrollDownArrowVisible),hasScrollArrows:ne(e=>e.hasScrollArrows)};function p1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:h=!1,modal:m=!0,actionsRef:g,inputRef:y,onOpenChangeComplete:v,items:S,multiple:C=!1,itemToStringLabel:w,itemToStringValue:b,isItemEqualToValue:T=PS,highlightItemOnHover:E=!0,children:O}=e,{clearErrors:D}=Mr(),{setDirty:k,setTouched:L,setFocused:F,shouldValidateOnChange:N,validityData:R,setFilled:_,name:I,disabled:P,validation:A,validationMode:M}=ir(),$=pc({id:t}),U=P||d,V=I??c,[H,Y]=As({controlled:n,default:C?r??Sl:r,name:"Select",state:"value"}),[G,K]=As({controlled:s,default:i,name:"Select",state:"open"}),J=p.useRef([]),X=p.useRef([]),re=p.useRef(null),ue=p.useRef(null),fe=p.useRef(0),Q=p.useRef(null),de=p.useRef([]),te=p.useRef(!1),we=p.useRef(!1),ce=p.useRef(null),le=p.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),me=p.useRef(!1),{mounted:oe,setMounted:ye,transitionStatus:j}=po(G),{openMethod:Z,triggerProps:B}=Ka(G),W=ft(()=>new El({id:$,labelId:void 0,modal:m,multiple:C,itemToStringLabel:w,itemToStringValue:b,isItemEqualToValue:T,value:H,open:G,mounted:oe,transitionStatus:j,items:S,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ie=Re(W,Ne.activeIndex),ve=Re(W,Ne.selectedIndex),he=Re(W,Ne.triggerElement),Ce=Re(W,Ne.positionerElement),$e=qS(Z),xe=Z??$e,Le=p.useMemo(()=>C&&Array.isArray(H)&&H.length===0?"":Dr(H,b),[C,H,b]),Ie=p.useMemo(()=>C&&Array.isArray(H)?H.map(Me=>Dr(Me,b)):Dr(H,b),[C,H,b]),Fe=ct(W.state.triggerElement),je=ae(()=>Ie);lc(Fe,{id:$,value:H,getValue:je});const nt=p.useRef(H);se(()=>{H!==nt.current&&W.set("forceMount",!0)},[W,H]),se(()=>{_(C?Array.isArray(H)&&H.length>0:H!=null)},[C,H,_]),se(function(){if(G)return;const Ke=de.current;if(C){const hn=Array.isArray(H)?H:[];if(hn.length===0){W.set("selectedIndex",null);return}const tn=hn[hn.length-1],No=vo(Ke,tn,T);W.set("selectedIndex",No===-1?null:No);return}const en=vo(Ke,H,T);W.set("selectedIndex",en===-1?null:en)},[C,G,H,de,T,W]),Ds(H,()=>{D(V),k(H!==R.initialValue),N()?A.commit(H):A.commit(H,!0)});const vt=ae((Me,Ke)=>{if(a?.(Me,Ke),!Ke.isCanceled&&(K(Me),!Me&&(Ke.reason===Jn||Ke.reason===Ca)&&(L(!0),F(!1),M==="onBlur"&&A.commit(H)),!Me&&W.state.activeIndex!==null)){const en=J.current[W.state.activeIndex];queueMicrotask(()=>{en?.setAttribute("tabindex","-1")})}}),rt=ae(()=>{ye(!1),W.update({activeIndex:null,openMethod:null}),v?.(!1)});Cn({enabled:!g,open:G,ref:re,onComplete(){G||rt()}}),p.useImperativeHandle(g,()=>({unmount:rt}),[rt]);const ke=ae((Me,Ke)=>{o?.(Me,Ke),!Ke.isCanceled&&Y(Me)}),ee=ae(()=>{const Me=W.state.listElement||re.current;if(!Me)return;const Ke=mp(Me.scrollHeight,Me.clientHeight),en=f1(Me.scrollTop,Ke),hn=en>0,tn=en<Ke;W.state.scrollUpArrowVisible!==hn&&W.set("scrollUpArrowVisible",hn),W.state.scrollDownArrowVisible!==tn&&W.set("scrollDownArrowVisible",tn)}),pe=ef({open:G,onOpenChange:vt,elements:{reference:he,floating:Ce}}),ge=La(pe,{enabled:!f&&!U,event:"mousedown"}),Ee=Fa(pe,{bubbles:!1}),Oe=_E(pe,{enabled:!f&&!U,listRef:J,activeIndex:ie,selectedIndex:ve,disabledIndices:Sl,onNavigate(Me){Me===null&&!G||W.set("activeIndex",Me)},focusItemOnHover:E}),Ge=IE(pe,{enabled:!f&&!U&&(G||!C),listRef:X,activeIndex:ie,selectedIndex:ve,onMatch(Me){G?W.set("activeIndex",Me):ke(de.current[Me],Ae("none"))},onTypingChange(Me){te.current=Me}}),{getReferenceProps:We,getFloatingProps:lt,getItemProps:dt}=ho([ge,Ee,Oe,Ge]),Et=p.useMemo(()=>wn(We(),B,$?{id:$}:st),[We,B,$]);qa(()=>{W.update({popupProps:lt(),triggerProps:Et})}),se(()=>{W.update({id:$,modal:m,multiple:C,value:H,open:G,mounted:oe,transitionStatus:j,popupProps:lt(),triggerProps:Et,items:S,itemToStringLabel:w,itemToStringValue:b,isItemEqualToValue:T,openMethod:xe})},[W,$,m,C,H,G,oe,j,lt,Et,S,w,b,T,xe]);const xt=p.useMemo(()=>({store:W,name:V,required:h,disabled:U,readOnly:f,multiple:C,highlightItemOnHover:E,setValue:ke,setOpen:vt,listRef:J,popupRef:re,scrollHandlerRef:ue,handleScrollArrowVisibility:ee,scrollArrowsMountedCountRef:fe,getItemProps:dt,events:pe.context.events,valueRef:Q,valuesRef:de,labelsRef:X,typingRef:te,selectionRef:le,selectedItemTextRef:ce,validation:A,onOpenChangeComplete:v,keyboardActiveRef:we,alignItemWithTriggerActiveRef:me,initialValueRef:nt}),[W,V,h,U,f,C,E,ke,vt,dt,pe.context.events,A,v,ee]),ot=qn(y,A.inputRef),kt=C&&Array.isArray(H)&&H.length>0,Qt=C?void 0:V,Ro=p.useMemo(()=>!C||!Array.isArray(H)||!V?null:H.map(Me=>{const Ke=Dr(Me,b);return x.jsx("input",{type:"hidden",form:l,name:V,value:Ke},Ke)}),[C,H,l,V,b]);return x.jsx(Cc.Provider,{value:xt,children:x.jsxs(xc.Provider,{value:pe,children:[O,x.jsx("input",{...A.getInputValidationProps({onFocus(){W.state.triggerElement?.focus({focusVisible:!0})},onChange(Me){if(Me.nativeEvent.defaultPrevented)return;const Ke=Me.currentTarget.value,en=Ae(Pr,Me.nativeEvent);function hn(){if(C)return;const tn=de.current.find(No=>Dr(No,b).toLowerCase()===Ke.toLowerCase()||AS(No,w).toLowerCase()===Ke.toLowerCase());tn!=null&&(k(tn!==R.initialValue),ke(tn,en),N()&&A.commit(tn))}W.set("forceMount",!0),queueMicrotask(hn)}}),id:$&&Qt==null?`${$}-hidden-input`:void 0,form:l,name:Qt,autoComplete:u,value:Le,disabled:U,required:h&&!kt,readOnly:f,ref:ot,style:V?td:as,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Ro]})})}const Vs=2,h1=400,vp=200,m1={...gf,...sr,value:()=>null},yp=p.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...l}=t,{setTouched:u,setFocused:d,validationMode:f,state:h,disabled:m}=ir(),{labelId:g}=Tn(),{store:y,setOpen:v,selectionRef:S,validation:C,readOnly:w,required:b,alignItemWithTriggerActiveRef:T,disabled:E,keyboardActiveRef:O}=Lr(),D=m||E||i,k=Re(y,Ne.open),L=Re(y,Ne.value),F=Re(y,Ne.triggerProps),N=Re(y,Ne.positionerElement),R=Re(y,Ne.listElement),_=Re(y,Ne.id),I=Re(y,Ne.labelId),P=Re(y,Ne.hasSelectedValue),A=!P&&k,M=Re(y,Ne.hasNullItemLabel,A),$=s??_,U=LS(g,I);pc({id:$});const V=ct(N),H=p.useRef(null),{getButtonProps:Y,buttonRef:G}=_r({disabled:D,native:a}),K=ae(we=>{y.set("triggerElement",we)}),J=qn(n,H,G,K),X=Lt(),re=Lt(),ue=Lt(),fe=Lt();p.useEffect(()=>{if(k)return!(P||M)?ue.start(h1,()=>{S.current.allowUnselectedMouseUp=!0,S.current.allowSelectedMouseUp=!0}):fe.start(vp,()=>{S.current.allowUnselectedMouseUp=!0,ue.start(vp,()=>{S.current.allowSelectedMouseUp=!0})}),()=>{ue.clear(),fe.clear()};S.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},re.clear()},[k,P,M,S,re,ue,fe]);const Q=p.useMemo(()=>R?.id??ro(N)?.id,[R,N]),de=wn(F,{id:$,role:"combobox","aria-expanded":k?"true":"false","aria-haspopup":"listbox","aria-controls":k?Q:void 0,"aria-labelledby":U,"aria-readonly":w||void 0,"aria-required":b||void 0,tabIndex:D?-1:0,ref:J,onFocus(we){d(!0),k&&T.current&&v(!1,Ae(Pr,we.nativeEvent)),X.start(0,()=>{y.set("forceMount",!0)})},onBlur(we){be(N,we.relatedTarget)||(u(!0),d(!1),f==="onBlur"&&C.commit(L))},onPointerMove(){O.current=!1},onKeyDown(){O.current=!0},onMouseDown(we){if(k)return;const ce=_e(we.currentTarget);function le(me){if(!H.current)return;const oe=me.target;if(be(H.current,oe)||be(V.current,oe)||oe===H.current)return;const ye=MS(H.current);me.clientX>=ye.left-Vs&&me.clientX<=ye.right+Vs&&me.clientY>=ye.top-Vs&&me.clientY<=ye.bottom+Vs||v(!1,Ae(hw,me))}re.start(0,()=>{ce.addEventListener("mouseup",le,{once:!0})})}},C.getValidationProps,l,Y);de.role="combobox";const te={...h,open:k,disabled:D,value:L,readOnly:w,placeholder:!P};return Ve("button",t,{ref:[n,H],state:te,stateAttributesMapping:m1,props:de})});process.env.NODE_ENV!=="production"&&(yp.displayName="SelectTrigger");const bp=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(bp.displayName="SelectPortalContext");const wp=p.forwardRef(function(t,n){const{store:r}=Lr(),o=Re(r,Ne.mounted),s=Re(r,Ne.forceMount);return o||s?x.jsx(bp.Provider,{value:!0,children:x.jsx(ms,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(wp.displayName="SelectPortal");const Tc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Tc.displayName="SelectPositionerContext");function g1(){const e=p.useContext(Tc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":Qe(59));return e}function js(e,t){e&&Object.assign(e.style,t)}const v1={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},y1={position:"fixed"},Ep=p.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a="bottom",align:c="center",sideOffset:l=0,alignOffset:u=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g,alignItemWithTrigger:y=!0,collisionAvoidance:v=ew,style:S,...C}=t,{store:w,listRef:b,labelsRef:T,alignItemWithTriggerActiveRef:E,selectedItemTextRef:O,valuesRef:D,initialValueRef:k,popupRef:L,setValue:F}=Lr(),N=gp(),R=Re(w,Ne.open),_=Re(w,Ne.mounted),I=Re(w,Ne.modal),P=Re(w,Ne.value),A=Re(w,Ne.openMethod),M=Re(w,Ne.positionerElement),$=Re(w,Ne.triggerElement),U=Re(w,Ne.isItemEqualToValue),V=Re(w,Ne.transitionStatus),H=p.useRef(null),Y=p.useRef(null),[G,K]=p.useState(y),J=_&&G&&A!=="touch";!_&&G!==y&&K(y),se(()=>{_||(Ne.scrollUpArrowVisible(w.state)&&w.set("scrollUpArrowVisible",!1),Ne.scrollDownArrowVisible(w.state)&&w.set("scrollDownArrowVisible",!1))},[w,_]),p.useImperativeHandle(E,()=>J),Gf((J||I)&&R,A==="touch",M,$);const X=pf({anchor:r,floatingRootContext:N,positionMethod:o,mounted:_,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:h,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:g??J,collisionAvoidance:v,keepMounted:!0}),re=J?"none":X.side,ue=J?y1:X.positionerStyles,fe={open:R,side:re,align:X.align,anchorHidden:X.anchorHidden},Q=ae(le=>{w.set("positionerElement",le)}),de=vf(t,fe,{styles:ue,transitionStatus:V,props:C,refs:[n,Q],hidden:!_,inert:!R}),te=p.useRef(0),we=ae(le=>{if(le.size===0&&te.current===0||D.current.length===0)return;const me=te.current;if(te.current=le.size,le.size===me)return;const oe=Ae(Pr);if(me!==0&&!w.state.multiple&&P!==null&&vo(D.current,P,U)===-1){const j=k.current,B=j!=null&&vo(D.current,j,U)!==-1?j:null;F(B,oe),B===null&&(w.set("selectedIndex",null),O.current=null)}if(me!==0&&w.state.multiple&&Array.isArray(P)){const ye=Z=>vo(D.current,Z,U)!==-1,j=P.filter(Z=>ye(Z));(j.length!==P.length||j.some(Z=>!IS(P,Z,U)))&&(F(j,oe),j.length===0&&(w.set("selectedIndex",null),O.current=null))}if(R&&J){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ye={height:""};js(M,ye),js(L.current,ye)}}),ce=p.useMemo(()=>({...X,side:re,alignItemWithTriggerActive:J,setControlledAlignItemWithTrigger:K,scrollUpArrowRef:H,scrollDownArrowRef:Y}),[X,re,J,K]);return x.jsx(sS,{elementsRef:b,labelsRef:T,onMapChange:we,children:x.jsxs(Tc.Provider,{value:ce,children:[_&&I&&x.jsx(Ms,{inert:ls(!R),cutout:$}),de]})})});process.env.NODE_ENV!=="production"&&(Ep.displayName="SelectPositioner");const b1={...nr,...En},Sp=p.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:l,onOpenChangeComplete:u,setOpen:d,valueRef:f,selectedItemTextRef:h,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:y,scrollHandlerRef:v,listRef:S,highlightItemOnHover:C}=Lr(),{side:w,align:b,alignItemWithTriggerActive:T,isPositioned:E,setControlledAlignItemWithTrigger:O,scrollDownArrowRef:D,scrollUpArrowRef:k}=g1(),L=Qf()!=null,F=gp(),N=lf(),{nonce:R,disableStyleElements:_}=XS(),I=Re(c,Ne.id),P=Re(c,Ne.open),A=Re(c,Ne.mounted),M=Re(c,Ne.popupProps),$=Re(c,Ne.transitionStatus),U=Re(c,Ne.triggerElement),V=Re(c,Ne.positionerElement),H=Re(c,Ne.listElement),Y=p.useRef(!1),G=p.useRef(!1),K=p.useRef({}),J=es(),X=ae(Q=>{if(!V||!l.current||!G.current)return;if(Y.current||!T){y();return}const de=V.style.top==="0px",te=V.style.bottom==="0px";if(!de&&!te){y();return}const we=xp(V),ce=So(V.getBoundingClientRect().height,"y",we),le=_e(V),me=getComputedStyle(V),oe=parseFloat(me.marginTop),ye=parseFloat(me.marginBottom),j=Cp(getComputedStyle(l.current)),Z=Math.min(le.documentElement.clientHeight-oe-ye,j),B=Q.scrollTop,W=Bs(Q);let ie=0,ve=null,he=!1,Ce=!1;const $e=Fe=>{V.style.height=`${Fe}px`},xe=(Fe,je)=>{const nt=bo(Fe,0,Z-ce);nt>0&&$e(ce+nt),Q.scrollTop=je,Z-(ce+nt)<=Pn&&(Y.current=!0),y()},Le=de?W-B:B,Ie=Math.min(ce+Le,Z);if(ie=Ie,Le<=Pn){xe(Le,de?W:0);return}if(Z-Ie>Pn)de?Ce=!0:ve=0;else if(he=!0,te&&B<W){const Fe=ce+Le-Z;ve=B-(Le-Fe)}if(ie=Math.ceil(ie),ie!==0&&$e(ie),Ce||ve!=null){const Fe=Bs(Q),je=Ce?Fe:bo(ve,0,Fe);Math.abs(Q.scrollTop-je)>Pn&&(Q.scrollTop=je)}(he||ie>=Z-Pn)&&(Y.current=!0),y()});p.useImperativeHandle(v,()=>X,[X]),Cn({open:P,ref:l,onComplete(){P&&u?.(!0)}});const re={open:P,transitionStatus:$,side:w,align:b};se(()=>{!V||!l.current||Object.keys(K.current).length||(K.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[l,V]),se(()=>{P||T||(G.current=!1,Y.current=!1,js(V,K.current))},[P,T,V,l]),se(()=>{const Q=l.current;if(!P||!U||!V||!Q||T&&!E||c.state.transitionStatus==="ending")return;if(!T){G.current=!0,J.request(y),Q.style.removeProperty("--transform-origin");return}const de=w1(Q);Q.style.removeProperty("--transform-origin");try{const te=h.current,we=f.current,ce=getComputedStyle(V),le=getComputedStyle(Q),me=_e(U),oe=qe(V),ye=xp(U),j=Us(U.getBoundingClientRect(),ye),Z=Us(V.getBoundingClientRect(),ye),B=j.height,W=H||Q,ie=W.scrollHeight,ve=parseFloat(le.borderBottomWidth),he=parseFloat(ce.marginTop)||10,Ce=parseFloat(ce.marginBottom)||10,$e=parseFloat(ce.minHeight)||100,xe=Cp(le),Le=5,Ie=5,Fe=20,je=me.documentElement.clientHeight-he-Ce,nt=me.documentElement.clientWidth,vt=je-j.bottom+B;let rt,ke=N==="rtl"?j.right-Z.width:j.left,ee=0;if(te&&we){const ot=Us(we.getBoundingClientRect(),ye);rt=Us(te.getBoundingClientRect(),ye),ke=Z.left+(N==="rtl"?ot.right-rt.right:ot.left-rt.left);const kt=ot.top-j.top+ot.height/2;ee=rt.top-Z.top+rt.height/2-kt}const pe=vt+ee+Ce+ve;let ge=Math.min(je,pe);const Ee=je-he-Ce,Oe=pe-ge,Ge=nt-Ie;V.style.left=`${bo(ke,Le,Ge-Z.width)}px`,V.style.height=`${ge}px`,V.style.maxHeight="auto",V.style.marginTop=`${he}px`,V.style.marginBottom=`${Ce}px`,Q.style.height="100%";const We=Bs(W),lt=Oe>=We-Pn;lt&&(ge=Math.min(je,Z.height)-(Oe-We));const dt=j.top<Fe||j.bottom>je-Fe||Math.ceil(ge)+Pn<Math.min(ie,$e),Et=(oe.visualViewport?.scale??1)!==1&&Ji;if(dt||Et){G.current=!0,js(V,K.current),O(!1);return}const xt=Math.max($e,ge);if(lt){const ot=Math.max(0,je-pe);V.style.top=Z.height>=Ee?"0":`${ot}px`,V.style.height=`${ge}px`,W.scrollTop=Bs(W)}else V.style.bottom="0",W.scrollTop=Oe;if(rt){const ot=Z.top,kt=Z.height,Qt=rt.top+rt.height/2,Ro=kt>0?(Qt-ot)/kt*100:50,Me=bo(Ro,0,100);Q.style.setProperty("--transform-origin",`50% ${Me}%`)}(xt===je||ge>=xe)&&(Y.current=!0),y(),C&&c.state.selectedIndex===null&&c.state.activeIndex===null&&S.current[0]!=null&&c.set("activeIndex",0),G.current=!0}finally{de()}},[c,P,V,U,f,h,l,y,T,O,J,D,k,H,S,C,N,E]),p.useEffect(()=>{if(!T||!V||!P)return;const Q=qe(V);function de(te){d(!1,Ae(mw,te))}return Pe(Q,"resize",de)},[d,T,V,P]);const ue={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${I}-list`},onKeyDown(Q){m.current=!0,L&&Ya.has(Q.key)&&Q.stopPropagation()},onMouseMove(){m.current=!1},onScroll(Q){H||X(Q.currentTarget)},...T&&{style:H?{height:"100%"}:v1}},fe=Ve("div",t,{ref:[n,l],state:re,stateAttributesMapping:b1,props:[M,ue,Ha($),{className:!H&&T?Sc.className:void 0},a]});return x.jsxs(p.Fragment,{children:[!_&&Sc.getElement(R),x.jsx(Ma,{context:F,modal:!1,disabled:!A,returnFocus:i,restoreFocus:!0,children:fe})]})});process.env.NODE_ENV!=="production"&&(Sp.displayName="SelectPopup");function Cp(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Bs(e){return mp(e.scrollHeight,e.clientHeight)}function xp(e){return Wd.getScale(e)}function So(e,t,n){return e/n[t]}function Us(e,t){return so({x:So(e.x,"x",t),y:So(e.y,"y",t),width:So(e.width,"x",t),height:So(e.height,"y",t)})}const Tp=[["transform","none"],["scale","1"],["translate","0 0"]];function w1(e){const{style:t}=e,n={};for(const[r,o]of Tp)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Tp){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const Oc=p.createContext(void 0);process.env.NODE_ENV!=="production"&&(Oc.displayName="SelectItemContext");function _c(){const e=p.useContext(Oc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":Qe(57));return e}const Op=p.memo(p.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:a=!1,nativeButton:c=!1,style:l,...u}=t,d=p.useRef(null),f=uS({label:i,textRef:d,indexGuessBehavior:Df.GuessFromOrder}),{store:h,getItemProps:m,setOpen:g,setValue:y,selectionRef:v,typingRef:S,valuesRef:C,multiple:w,selectedItemTextRef:b}=Lr(),T=Re(h,Ne.isActive,f.index),E=Re(h,Ne.isSelected,f.index,s),O=Re(h,Ne.isSelectedByFocus,f.index),D=Re(h,Ne.isItemEqualToValue),k=f.index,L=k!==-1,F=p.useRef(null),N=ct(k);se(()=>{if(!L)return;const G=C.current;return G[k]=s,()=>{delete G[k]}},[L,k,s,C]),se(()=>{if(!L)return;const G=h.state.value;let K=G;w&&Array.isArray(G)&&G.length>0&&(K=G[G.length-1]),K!==void 0&&Ar(s,K,D)&&(h.set("selectedIndex",k),d.current&&(b.current=d.current))},[L,k,w,D,h,s,b]);const R={disabled:a,selected:E,highlighted:T},_=m({active:T,selected:E});_.id=void 0;const I=p.useRef(null),P=p.useRef("mouse"),A=p.useRef(!1),{getButtonProps:M,buttonRef:$}=_r({disabled:a,focusableWhenDisabled:!0,native:c,composite:!0});function U(G){const K=h.state.value;if(w){const J=Array.isArray(K)?K:[],X=E?kS(J,s,D):[...J,s];y(X,Ae(xa,G))}else y(s,Ae(xa,G)),g(!1,Ae(xa,G))}const V={role:"option","aria-selected":E,tabIndex:T?0:-1,onTouchStart(){v.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(G){I.current=G.key,h.set("activeIndex",k),G.key===" "&&S.current&&G.preventDefault()},onClick(G){A.current=!1,!(G.type==="keydown"&&I.current===null)&&(a||G.type==="keydown"&&I.current===" "&&S.current||P.current!=="touch"&&!T||(I.current=null,U(G.nativeEvent)))},onPointerEnter(G){P.current=G.pointerType},onPointerDown(G){P.current=G.pointerType,A.current=!0},onMouseUp(){if(a)return;if(A.current){A.current=!1;return}const G=!v.current.allowSelectedMouseUp&&E,K=!v.current.allowUnselectedMouseUp&&!E;G||K||P.current!=="touch"&&!T||F.current?.click()}},H=Ve("div",t,{ref:[$,n,f.ref,F],state:R,props:[_,V,u,M]}),Y=p.useMemo(()=>({selected:E,indexRef:N,textRef:d,selectedByFocus:O,hasRegistered:L}),[E,N,d,O,L]);return x.jsx(Oc.Provider,{value:Y,children:H})}));process.env.NODE_ENV!=="production"&&(Op.displayName="SelectItem");const _p=p.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=_c();return r||o?x.jsx(Pp,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(_p.displayName="SelectItemIndicator");const Pp=p.memo(p.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=_c(),c=p.useRef(null),{transitionStatus:l,setMounted:u}=po(a),f=Ve("span",e,{ref:[t,c],state:{selected:a,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:En});return Cn({open:a,ref:c,onComplete(){a||u(!1)}}),f}));process.env.NODE_ENV!=="production"&&(Pp.displayName="Inner");const Ip=p.memo(p.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=_c(),{selectedItemTextRef:a}=Lr(),{className:c,render:l,style:u,...d}=t,f=p.useCallback(m=>{if(!m||!i)return;const g=a.current===null||!a.current.isConnected;(s||g&&r.current===0)&&(a.current=m)},[a,r,s,i]);return Ve("div",t,{ref:[f,n,o],props:d})}));process.env.NODE_ENV!=="production"&&(Ip.displayName="SelectItemText");function Xt({as:e,children:t,className:n,disabled:r,...o}){const s=e||"button",i=s==="button";return x.jsx(s,{className:$i("align-middle inline-flex items-center justify-center transition-all cursor-pointer hover:brightness-110 active:brightness-90 active:scale-90 disabled:cursor-not-allowed disabled:grayscale",n),...i?{disabled:r}:{"aria-disabled":r},...r&&!i?{onClick:a=>{a.preventDefault(),a.stopPropagation()}}:{},...o,children:t})}const E1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),S1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),kp=e=>{const t=S1(e);return t.charAt(0).toUpperCase()+t.slice(1)},Rp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),C1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var x1={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"};const T1=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>z.createElement("svg",{ref:c,...x1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Rp("lucide",o),...!s&&!C1(a)&&{"aria-hidden":"true"},...a},[...i.map(([l,u])=>z.createElement(l,u)),...Array.isArray(s)?s:[s]]));const jn=(e,t)=>{const n=z.forwardRef(({className:r,...o},s)=>z.createElement(T1,{ref:s,iconNode:t,className:Rp(`lucide-${E1(kp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=kp(e),n};const Pc=jn("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Np=jn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const O1=jn("eye-closed",[["path",{d:"m15 18-.722-3.25",key:"1j64jw"}],["path",{d:"M2 8a10.645 10.645 0 0 0 20 0",key:"1e7gxb"}],["path",{d:"m20 15-1.726-2.05",key:"1cnuld"}],["path",{d:"m4 15 1.726-2.05",key:"1dsqqd"}],["path",{d:"m9 18 .722-3.25",key:"ypw2yx"}]]);const _1=jn("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"}]]);const P1=jn("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const I1=jn("trash-2",[["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"}]]);const k1=jn("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"}]]);const Ap=jn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function R1(e){return zt.get("/channel/game/role/mail-captcha",e)}function N1(e){return zt.get("/channel/game/role/auth",e)}function A1(e){return zt.post("/passport-api/v2/ztgame/auth/login",{account:e.account,password:e.password,channel_login:1,channel_id:6})}function D1(e){return zt.post("/passport-api/v2/sms-captchas",{mobile:e.mobile,type:e.type||"register",is_voice:0,nationcode:e.countryCode})}function M1(e){return zt.post("/passport-api/v2/ztgame/auth/mobile-register",{mobile:e.mobile,captcha:e.captcha,channel_login:1,channel_id:6,nationcode:e.countryCode,ad_id:""})}function Dp(){return zt.post("/passport-api/v2/ztgame/auth/auth",{channel_login:1,channel_id:6})}function L1(e){return zt.post(`/passport-api/v2/ztgame/users/${e.uid}/idcard`,{name:e.name,idcard:e.idcard},{headers:{Authentication:e.authorization}})}function F1(e){return zt.post("/passport-api/v2/ztgame/auth/re-auth",{type:"auth",channel_id:6,ad_id:"",channel_login:1},{headers:{Authentication:e}})}const $1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAXCAYAAADk3wSdAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFJ0lEQVQ4jW2VW4ydVRXHf2tfvu87Z+5znEtnxnLR0pYJatEHWxhBEZUSCE8YESImRnzwQTEEY6KJGrQJXiFGXzAxaowkSkyoIgjYlEqEIIrSS6KmpTPDdJgz55w5t++29/bhjDQFVrKf9lq/rGSt/3/J+v2XExRQgNsKuJbH9QLFKaE4BWqUu6TCvXhGQsajOD6D4BJfQBCuvvaLLE/uhLTN/8PwVlGCxIJZCJ9XYzwYBEIGdLkztBE8d1rvSJWlbSLw/oJy9UZe8AOAGglfNbt4UE2CSkBikASwfKpE6blOncdndtOauAjy3gWM8516wCGiuFGPyT2Mhw+EQvC9wZ+UEAw4UfXZtBU6cZX7Fm+C4IDwBmgAPHdguEGPy1VqSO0MObhewHc9UgC5gAKXKmpbW3fV8i1/8JovsDyzG5ortxK4DpFzwP1A2yAcUpHciwURCLngOgFVBkIOOPBd/qrWir/MrTV/k6nk2N3v/Rx/uHgJmqvfrqb5l3sioBVofTsi18hrDywGqQ46IQBFwHcCRT1QrrmfDjXaP/TrvNRerrIiM/xq98d4bH6ROK3fV3XlV0QU60azajTOGND6R4YIpAqiAsEDVnB1UM30lonQ/t0/G3t4uXkZqxM1TkztpDmUXP7uzVcO2SA3FVrR0hoEOkrRCAFCGDMScUJX3V6lPCEIrqexsb82quVHnji6xJ9PH8Bbtc9G2f4dW42PznbDzc5qerGlnURURMidEPT2sIw5bFTMYVMp94rxEASfyananu6RI0/t49G/f4gdMxu/jExxm/QF1fMURtEdshRKMSo5GZa1OKJlDVSSc1STx4wedi/paomKPMELSfAv9NKY5569jNGk89nIFLeFIAQFISiMC9jCMZzlHJ+cfPn5uem9G6AQBdXkReKoacxw0TDDHhWX4BQqLjY3z4zTaVapVLODIch5YchAHNa7rJ4k1//pit3LRRT9h9a2RCvJJtai7JgbN1ObqOlzqJlzMJxPjF7cZnSkT78V/1Hk/GJLgKBlKyqLfUcX33m0mJu9lLIU4giSGOJ4gjhG2Zn6uxhvk+kqfRvDWPdKc8UrfPgTz+E2R34cUvMwKhAEvOL0Rcud95+pLZw4eeB94N2VGAtRNHjW7qOajBlG+gcb3QXq3XHaZUzFdvfOmY2r5JNnjw39+2/Iz3Z9vGbCDyTORyr94ul/LEbFr+8YhWoLmvJpbDSQqggYPUsSf0TSjYmw0p6nnlnqmWUji8Frp4bzm1eS7PfHf3sJ5eMLjHQtJ/eUPH39GAzNvI2txUdIZ66mtzVwKQGshaHqz00ImsxruqWmkRleS4W1VOvQqBz2OvnJ2aW1B55cXD1BfQqG50fpRbdTn/oG0UQNayC24MIAGllQqiO+FX13pXnp3Sebk5zuaZZ7hvVU86+e5vlMcIWjwDxJmG3i3/5B9PwkageoKWAanAKXDUzCmrMovWRE5V+aH//vcaS8oe+n97/at3ObheLFAtK+h7wCevo6dA10ddsjuxASEAW6UqLNMSR6BpHv4GkaPIjJH1oYXn+onY1E3UJuXE3VPb0tvZ9Cg66A0oNz4FNQMfg20Gkj5lvI+C9Qc8vI1GCJX3d+D6mzlEHy2PhH3lF1B95T8d9ECYQAFBByCH3wLXBnnsWd2QP9Q6CXt+X2Fs6/7Xy5F4oAOyxfQ/sGRfa919NCAX75GVBLmF1AzGBCF8abDp8ARuDVnoJMvo/JSrz/OpIaKJ7CN25Batul4U1AgP8BRjZPP9WeeTQAAAAASUVORK5CYII=";function z1(e){return x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 500 500",...e,children:[x.jsx("path",{fill:"url(#a)",d:"M0 250C0 111.929 111.929 0 250 0s250 111.929 250 250-111.929 250-250 250S0 388.071 0 250Z"}),x.jsx("path",{fill:"#fff",d:"M159.432 341h-33.008V158.949h33.008V341Zm220.263-76.172c0 11.087-1.946 21.286-5.84 30.596-3.808 9.31-9.098 17.35-15.869 24.121-6.771 6.686-14.811 11.934-24.121 15.742-9.31 3.809-19.424 5.713-30.342 5.713h-89.121c-2.369 0-4.57-.423-6.601-1.27-2.031-.846-3.809-1.988-5.332-3.427-1.439-1.524-2.582-3.301-3.428-5.332-.846-2.032-1.27-4.232-1.27-6.602V175.58c0-2.285.424-4.443 1.27-6.475.846-2.031 1.989-3.808 3.428-5.332a16.354 16.354 0 0 1 5.332-3.554c2.031-.847 4.232-1.27 6.601-1.27h89.121c10.918 0 21.032 1.905 30.342 5.713 9.31 3.809 17.35 9.098 24.121 15.869 6.771 6.686 12.061 14.727 15.869 24.121 3.894 9.31 5.84 19.466 5.84 30.469v29.707Zm-33.007-29.707c0-6.432-1.058-12.314-3.174-17.646-2.032-5.332-4.952-9.86-8.76-13.584-3.809-3.809-8.379-6.729-13.711-8.76-5.247-2.116-11.087-3.174-17.52-3.174h-72.744v116.035h72.744c6.433 0 12.273-1.015 17.52-3.047 5.332-2.116 9.902-5.035 13.711-8.759 3.808-3.809 6.728-8.337 8.76-13.584 2.116-5.332 3.174-11.257 3.174-17.774v-29.707Z"}),x.jsx("defs",{children:x.jsxs("linearGradient",{id:"a",x1:250,x2:250,y1:0,y2:500,gradientUnits:"userSpaceOnUse",children:[x.jsx("stop",{stopColor:"#497EFE"}),x.jsx("stop",{offset:1,stopColor:"#947AFA"})]})})]})}function Ws(){const{gameId:e,loginTypes:t,currentLoginType:n,setCurrentLoginType:r}=xn(),o=Sf({loginTypes:t,gameId:e}),s=Cf({loginTypes:t,gameId:e}),i=Ef({loginTypes:t,gameId:e}),a=[];return i&&n!==He.GIANT&&a.push({type:He.GIANT,label:e==="5327"?"账号密码登录":"巨人账号",icon:x.jsx("img",{className:"size-4",src:$1})}),s&&n!==He.MOBILE&&a.push({type:He.MOBILE,label:"手机号登录",icon:x.jsx(P1,{className:"size-4"})}),o&&n!==He.ROLE_ID&&a.push({type:He.ROLE_ID,label:"ID 登录",icon:x.jsx(z1,{className:"size-4"})}),n!=="quick"&&Nr(e).length>0&&a.push({type:"quick",label:"快捷登录",icon:x.jsx(k1,{className:"size-4"})}),a.length?x.jsx("div",{className:"text-gray-500 text-xs flex justify-center items-center gap-2 mb-4",children:a.map((c,l)=>x.jsxs(Xt,{className:"h-7 px-3 border rounded-full border-gray-300 gap-1.5",onClick:()=>r(c.type),children:[c.icon,x.jsx("span",{children:c.label})]},c.type))}):null}function V1(e){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 90 90",fill:"currentColor",...e,children:x.jsx("path",{d:"M41.415 1.601c6.427-2.244 13.363 2.04 14.18 8.773.611 5.508-2.959 10.609-8.365 11.833-.408.102-.918.203-1.326.305-.918.204-1.735.409-2.653.613-.306.102-.714.204-1.122.306h-.101c-.816.306-1.633.51-2.448.816-.306.102-.715.306-1.021.408l-2.754 1.223c-.408.103-.714.307-1.02.511-1.224.612-2.346 1.326-3.468 2.142l-.307.306c-.612.409-1.122.919-1.632 1.327-.51.408-1.02.816-1.53 1.326-.408.306-.714.713-1.122 1.02-.408.407-.816.918-1.326 1.428-.306.612-.409 1.224-.612 1.836-.204 1.122-.51 2.143-.714 3.265-.204 1.02-.408 2.04-.51 3.06 0 .611-.103 1.122-.103 1.734v1.632c0 1.02 0 1.938.103 2.958.102 1.02.306 2.143.51 3.163.204.816.408 1.733.612 2.55.204.816.408 1.53.612 2.346.102.306.204.51.408.714.51.612 1.122 1.122 1.632 1.734 1.02.918 2.04 1.836 3.162 2.754.816.612 1.734 1.224 2.55 1.836.51.306.919.612 1.429.918.102 0 .204 0 .204.103.204 0 .306.102.51.204.408.204.714.408 1.122.612.918.408 1.734.714 2.652 1.122.714.204 1.326.51 2.04.714 1.122.306 2.143.612 3.265.918.51.204 1.122.204 1.632 0 .306-.102.51-.102.816-.204.816-.204 1.53-.51 2.346-.714 1.53-.408 2.958-1.02 4.386-1.633h.102c.816-.408 1.735-.815 2.55-1.325.307-.204.714-.408 1.02-.612 1.02-.714 2.04-1.428 3.06-2.244.613-.51 1.123-1.02 1.735-1.53l2.142-2.143c.408-.408.714-.816.816-1.428 0-.102.103-.102.103-.204.306-1.02.611-2.142.815-3.162.306-1.326.612-2.755.714-4.183v-.204c.102-1.224.103-2.448.103-3.672-.102-.816-.102-1.53-.204-2.346 0-.102 0-.204-.102-.205-.918.408-1.735.715-2.55 1.225-1.633.918-3.061 1.938-4.489 3.06-.102.101-.204.102-.306.204-1.02.918-1.938 1.734-2.856 2.652-1.02 1.02-2.041 2.04-2.96 3.162-1.937 2.244-4.487 3.469-7.445 3.673-5.713.306-10.61-3.673-11.324-9.283-.816-5.61 2.959-10.813 8.467-11.935a52.639 52.639 0 0 0 7.856-2.142h.101c.816-.408 1.734-.715 2.55-1.122 3.264-1.53 6.121-3.672 8.773-6.12 1.327-1.327 2.652-2.653 3.876-4.082 2.347-2.55 5.305-3.774 8.773-3.57 5.1.306 9.283 4.285 9.895 9.283.204 1.53.102 3.06-.408 4.489-.612 1.938-1.224 3.876-1.734 5.916-.102 1.02-.408 1.939-.51 2.958-.408 2.449-.51 4.795-.306 7.141v.306c.102.816.204 1.53.306 2.347a46.28 46.28 0 0 0 1.224 5.406c.102 0 .102.102.102.204.51 1.632 1.224 3.264 1.224 4.794.306 3.162-.51 5.917-2.55 8.365-1.632 1.938-3.774 3.06-6.223 3.57-1.734.408-3.57.817-5.304 1.326-.102.102-.204.102-.306.102-1.836.612-3.775 1.326-5.509 2.244h-.101c-.918.408-1.735.919-2.551 1.429-.306.204-.714.51-1.02.714a30.738 30.738 0 0 0-2.856 2.244c-.816.714-1.633 1.53-2.347 2.244a.22.22 0 0 1-.204.204c-.918.918-1.734 1.836-2.55 2.754-2.346 2.55-5.202 3.877-8.67 3.775-3.06-.102-5.61-1.428-7.651-3.672-1.428-1.633-2.958-3.163-4.488-4.591v-.102c-.51-.408-1.02-.918-1.53-1.326-.715-.612-1.53-1.122-2.245-1.734l-1.53-.918c-.612-.306-1.122-.612-1.734-.918l-2.754-1.225c-1.326-.612-2.653-1.02-4.081-1.428-1.326-.407-2.652-.714-3.978-1.02a11.146 11.146 0 0 1-3.673-1.224c-3.264-1.734-5.1-4.489-5.61-8.16-.204-1.633 0-3.265.51-4.795.816-2.244 1.428-4.59 1.938-6.936.102-.102.102-.103.102-.204.102-.715.204-1.531.306-2.347.102-.714.205-1.428.205-2.142V43.63l-.087-.956a39.328 39.328 0 0 0-1.24-6.695c-.102-.102-.102-.205-.102-.306-.51-1.734-1.224-3.469-1.53-5.203-1.122-5.712 2.55-11.22 8.263-12.445.714-.204 1.53-.306 2.244-.51 1.224-.306 2.55-.612 3.775-1.02 1.224-.408 2.448-.816 3.672-1.326l1.223-.612c.918-.408 1.837-.918 2.755-1.428 1.122-.714 2.244-1.53 3.366-2.346.408-.306.715-.612 1.122-.918.408-.408.918-.918 1.428-1.326a40.49 40.49 0 0 0 2.96-2.96c1.53-1.835 3.161-3.16 5.405-3.977Z"})})}function j1(e){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",fill:"currentColor",...e,children:x.jsx("path",{d:"M842.667 384H768V277.333a234.667 234.667 0 1 0-469.333 0V384H224a53.393 53.393 0 0 0-53.333 53.333V928A53.393 53.393 0 0 0 224 981.333h618.667A53.393 53.393 0 0 0 896 928V437.333A53.393 53.393 0 0 0 842.667 384zm-288 295.007v110.326a21.333 21.333 0 0 1-42.667 0V679.007a64 64 0 1 1 42.667 0zM725.333 384h-384V277.333c0-105.866 86.134-192 192-192s192 86.134 192 192z"})})}var Ic,Mp;function B1(){if(Mp)return Ic;Mp=1;var e="Expected a function",t=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,i=/^0o[0-7]+$/i,a=parseInt,c=typeof Wo=="object"&&Wo&&Wo.Object===Object&&Wo,l=typeof self=="object"&&self&&self.Object===Object&&self,u=c||l||Function("return this")(),d=Object.prototype,f=d.toString,h=Math.max,m=Math.min,g=function(){return u.Date.now()};function y(b,T,E){var O,D,k,L,F,N,R=0,_=!1,I=!1,P=!0;if(typeof b!="function")throw new TypeError(e);T=w(T)||0,v(E)&&(_=!!E.leading,I="maxWait"in E,k=I?h(w(E.maxWait)||0,T):k,P="trailing"in E?!!E.trailing:P);function A(J){var X=O,re=D;return O=D=void 0,R=J,L=b.apply(re,X),L}function M(J){return R=J,F=setTimeout(V,T),_?A(J):L}function $(J){var X=J-N,re=J-R,ue=T-X;return I?m(ue,k-re):ue}function U(J){var X=J-N,re=J-R;return N===void 0||X>=T||X<0||I&&re>=k}function V(){var J=g();if(U(J))return H(J);F=setTimeout(V,$(J))}function H(J){return F=void 0,P&&O?A(J):(O=D=void 0,L)}function Y(){F!==void 0&&clearTimeout(F),R=0,O=N=D=F=void 0}function G(){return F===void 0?L:H(g())}function K(){var J=g(),X=U(J);if(O=arguments,D=this,N=J,X){if(F===void 0)return M(N);if(I)return F=setTimeout(V,T),A(N)}return F===void 0&&(F=setTimeout(V,T)),L}return K.cancel=Y,K.flush=G,K}function v(b){var T=typeof b;return!!b&&(T=="object"||T=="function")}function S(b){return!!b&&typeof b=="object"}function C(b){return typeof b=="symbol"||S(b)&&f.call(b)==n}function w(b){if(typeof b=="number")return b;if(C(b))return t;if(v(b)){var T=typeof b.valueOf=="function"?b.valueOf():b;b=v(T)?T+"":T}if(typeof b!="string")return b===0?b:+b;b=b.replace(r,"");var E=s.test(b);return E||i.test(b)?a(b.slice(2),E?2:8):o.test(b)?t:+b}return Ic=y,Ic}B1();function U1(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[t,n]=z.useState(e),r=z.useCallback(()=>{n(!0)},[]),o=z.useCallback(()=>{n(!1)},[]),s=z.useCallback(()=>{n(i=>!i)},[]);return{value:t,setValue:n,setTrue:r,setFalse:o,toggle:s}}var Lp=typeof window<"u"?z.useLayoutEffect:z.useEffect;function W1(e){const[t,n]=z.useState(e),r=z.useCallback(()=>{n(i=>i+1)},[]),o=z.useCallback(()=>{n(i=>i-1)},[]),s=z.useCallback(()=>{n(e)},[e]);return{count:t,increment:r,decrement:o,reset:s,setCount:n}}function H1(e,t){const n=z.useRef(e);Lp(()=>{n.current=e},[e]),z.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function Z1({countStart:e,countStop:t=0,intervalMs:n=1e3,isIncrement:r=!1}){const{count:o,increment:s,decrement:i,reset:a}=W1(e),{value:c,setTrue:l,setFalse:u}=U1(!1),d=z.useCallback(()=>{u(),a()},[u,a]),f=z.useCallback(()=>{if(o===t){u();return}r?s():i()},[o,t,i,s,r,u]);return H1(f,c?n:null),[o,{startCountdown:l,stopCountdown:u,resetCountdown:d}]}var G1=typeof window>"u";function Y1(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=a=>G1?t:window.matchMedia(a).matches,[o,s]=z.useState(()=>n?r(e):t);function i(){s(r(e))}return Lp(()=>{const a=window.matchMedia(e);return i(),a.addListener?a.addListener(i):a.addEventListener("change",i),()=>{a.removeListener?a.removeListener(i):a.removeEventListener("change",i)}},[e]),o}function Bn(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}function Fp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function $p(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Fp(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;o<r.length;o++){const s=r[o];typeof s=="function"?s():Fp(e[o],null)}}}}function ar(...e){return p.useCallback($p(...e),e)}function q1(e,t){const n=p.createContext(t),r=s=>{const{children:i,...a}=s,c=p.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:c,children:i})};r.displayName=e+"Provider";function o(s){const i=p.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,o]}function K1(e,t=[]){let n=[];function r(s,i){const a=p.createContext(i),c=n.length;n=[...n,i];const l=d=>{const{scope:f,children:h,...m}=d,g=f?.[e]?.[c]||a,y=p.useMemo(()=>m,Object.values(m));return x.jsx(g.Provider,{value:y,children:h})};l.displayName=s+"Provider";function u(d,f){const h=f?.[e]?.[c]||a,m=p.useContext(h);if(m)return m;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[l,u]}const o=()=>{const s=n.map(i=>p.createContext(i));return function(a){const c=a?.[e]||s;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:c}}),[a,c])}};return o.scopeName=e,[r,X1(o,...t)]}function X1(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(s){const i=r.reduce((a,{useScope:c,scopeName:l})=>{const d=c(s)[`__scope${l}`];return{...a,...d}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Co=globalThis?.document?p.useLayoutEffect:()=>{},J1=p[" useId ".trim().toString()]||(()=>{}),Q1=0;function kc(e){const[t,n]=p.useState(J1());return Co(()=>{n(r=>r??String(Q1++))},[e]),e||(t?`radix-${t}`:"")}var eC=p[" useInsertionEffect ".trim().toString()]||Co;function tC({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,i]=nC({defaultProp:t,onChange:n}),a=e!==void 0,c=a?e:o;{const u=p.useRef(e!==void 0);p.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=a},[a,r])}const l=p.useCallback(u=>{if(a){const d=rC(u)?u(e):u;d!==e&&i.current?.(d)}else s(u)},[a,e,s,i]);return[c,l]}function nC({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),o=p.useRef(n),s=p.useRef(t);return eC(()=>{s.current=t},[t]),p.useEffect(()=>{o.current!==n&&(s.current?.(n),o.current=n)},[n,o]),[n,r,s]}function rC(e){return typeof e=="function"}function zp(e){const t=oC(e),n=p.forwardRef((r,o)=>{const{children:s,...i}=r,a=p.Children.toArray(s),c=a.find(iC);if(c){const l=c.props.children,u=a.map(d=>d===c?p.Children.count(l)>1?p.Children.only(null):p.isValidElement(l)?l.props.children:null:d);return x.jsx(t,{...i,ref:o,children:p.isValidElement(l)?p.cloneElement(l,void 0,u):null})}return x.jsx(t,{...i,ref:o,children:s})});return n.displayName=`${e}.Slot`,n}function oC(e){const t=p.forwardRef((n,r)=>{const{children:o,...s}=n;if(p.isValidElement(o)){const i=cC(o),a=aC(s,o.props);return o.type!==p.Fragment&&(a.ref=r?$p(r,i):i),p.cloneElement(o,a)}return p.Children.count(o)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var sC=Symbol("radix.slottable");function iC(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===sC}function aC(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...a)=>{const c=s(...a);return o(...a),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}function cC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],In=uC.reduce((e,t)=>{const n=zp(`Primitive.${t}`),r=p.forwardRef((o,s)=>{const{asChild:i,...a}=o,c=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function lC(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}function xo(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>t.current?.(...n),[])}function dC(e,t=globalThis?.document){const n=xo(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 fC="DismissableLayer",Rc="dismissableLayer.update",pC="dismissableLayer.pointerDownOutside",hC="dismissableLayer.focusOutside",Vp,jp=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bp=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:s,onInteractOutside:i,onDismiss:a,...c}=e,l=p.useContext(jp),[u,d]=p.useState(null),f=u?.ownerDocument??globalThis?.document,[,h]=p.useState({}),m=ar(t,E=>d(E)),g=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),S=u?g.indexOf(u):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,w=S>=v,b=vC(E=>{const O=E.target,D=[...l.branches].some(k=>k.contains(O));!w||D||(o?.(E),i?.(E),E.defaultPrevented||a?.())},f),T=yC(E=>{const O=E.target;[...l.branches].some(k=>k.contains(O))||(s?.(E),i?.(E),E.defaultPrevented||a?.())},f);return dC(E=>{S===l.layers.size-1&&(r?.(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},f),p.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Vp=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),Up(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Vp)}},[u,f,n,l]),p.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),Up())},[u,l]),p.useEffect(()=>{const E=()=>h({});return document.addEventListener(Rc,E),()=>document.removeEventListener(Rc,E)},[]),x.jsx(In.div,{...c,ref:m,style:{pointerEvents:C?w?"auto":"none":void 0,...e.style},onFocusCapture:Bn(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Bn(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Bn(e.onPointerDownCapture,b.onPointerDownCapture)})});Bp.displayName=fC;var mC="DismissableLayerBranch",gC=p.forwardRef((e,t)=>{const n=p.useContext(jp),r=p.useRef(null),o=ar(t,r);return p.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),x.jsx(In.div,{...e,ref:o})});gC.displayName=mC;function vC(e,t=globalThis?.document){const n=xo(e),r=p.useRef(!1),o=p.useRef(()=>{});return p.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Wp(pC,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",s),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yC(e,t=globalThis?.document){const n=xo(e),r=p.useRef(!1);return p.useEffect(()=>{const o=s=>{s.target&&!r.current&&Wp(hC,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Up(){const e=new CustomEvent(Rc);document.dispatchEvent(e)}function Wp(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?lC(o,s):o.dispatchEvent(s)}var Nc="focusScope.autoFocusOnMount",Ac="focusScope.autoFocusOnUnmount",Hp={bubbles:!1,cancelable:!0},bC="FocusScope",Zp=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:s,...i}=e,[a,c]=p.useState(null),l=xo(o),u=xo(s),d=p.useRef(null),f=ar(t,g=>c(g)),h=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let g=function(C){if(h.paused||!a)return;const w=C.target;a.contains(w)?d.current=w:Un(d.current,{select:!0})},y=function(C){if(h.paused||!a)return;const w=C.relatedTarget;w!==null&&(a.contains(w)||Un(d.current,{select:!0}))},v=function(C){if(document.activeElement===document.body)for(const b of C)b.removedNodes.length>0&&Un(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const S=new MutationObserver(v);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),S.disconnect()}}},[r,a,h.paused]),p.useEffect(()=>{if(a){qp.add(h);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(Nc,Hp);a.addEventListener(Nc,l),a.dispatchEvent(v),v.defaultPrevented||(wC(TC(Gp(a)),{select:!0}),document.activeElement===g&&Un(a))}return()=>{a.removeEventListener(Nc,l),setTimeout(()=>{const v=new CustomEvent(Ac,Hp);a.addEventListener(Ac,u),a.dispatchEvent(v),v.defaultPrevented||Un(g??document.body,{select:!0}),a.removeEventListener(Ac,u),qp.remove(h)},0)}}},[a,l,u,h]);const m=p.useCallback(g=>{if(!n&&!r||h.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const S=g.currentTarget,[C,w]=EC(S);C&&w?!g.shiftKey&&v===w?(g.preventDefault(),n&&Un(C,{select:!0})):g.shiftKey&&v===C&&(g.preventDefault(),n&&Un(w,{select:!0})):v===S&&g.preventDefault()}},[n,r,h.paused]);return x.jsx(In.div,{tabIndex:-1,...i,ref:f,onKeyDown:m})});Zp.displayName=bC;function wC(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Un(r,{select:t}),document.activeElement!==n)return}function EC(e){const t=Gp(e),n=Yp(t,e),r=Yp(t.reverse(),e);return[n,r]}function Gp(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 Yp(e,t){for(const n of e)if(!SC(n,{upTo:t}))return n}function SC(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 CC(e){return e instanceof HTMLInputElement&&"select"in e}function Un(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&CC(e)&&t&&e.select()}}var qp=xC();function xC(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Kp(e,t),e.unshift(t)},remove(t){e=Kp(e,t),e[0]?.resume()}}}function Kp(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function TC(e){return e.filter(t=>t.tagName!=="A")}var OC="Portal",Xp=p.forwardRef((e,t)=>{const{container:n,...r}=e,[o,s]=p.useState(!1);Co(()=>s(!0),[]);const i=n||o&&globalThis?.document?.body;return i?uu.createPortal(x.jsx(In.div,{...r,ref:t}),i):null});Xp.displayName=OC;function _C(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Hs=e=>{const{present:t,children:n}=e,r=PC(t),o=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),s=ar(r.ref,IC(o));return typeof n=="function"||r.isPresent?p.cloneElement(o,{ref:s}):null};Hs.displayName="Presence";function PC(e){const[t,n]=p.useState(),r=p.useRef(null),o=p.useRef(e),s=p.useRef("none"),i=e?"mounted":"unmounted",[a,c]=_C(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const l=Zs(r.current);s.current=a==="mounted"?l:"none"},[a]),Co(()=>{const l=r.current,u=o.current;if(u!==e){const f=s.current,h=Zs(l);e?c("MOUNT"):h==="none"||l?.display==="none"?c("UNMOUNT"):c(u&&f!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Co(()=>{if(t){let l;const u=t.ownerDocument.defaultView??window,d=h=>{const g=Zs(r.current).includes(h.animationName);if(h.target===t&&g&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=h=>{h.target===t&&(s.current=Zs(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(l),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Zs(e){return e?.animationName||"none"}function IC(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dc=0;function kC(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Jp()),document.body.insertAdjacentElement("beforeend",e[1]??Jp()),Dc++,()=>{Dc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dc--}},[])}function Jp(){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 Gs="right-scroll-bar-position",Ys="width-before-scroll-bar",RC="with-scroll-bars-hidden",NC="--removed-body-scroll-bar-size";function Mc(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function AC(e,t){var n=z.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var DC=typeof window<"u"?p.useLayoutEffect:p.useEffect,Qp=new WeakMap;function MC(e,t){var n=AC(null,function(r){return e.forEach(function(o){return Mc(o,r)})});return DC(function(){var r=Qp.get(n);if(r){var o=new Set(r),s=new Set(e),i=n.current;o.forEach(function(a){s.has(a)||Mc(a,null)}),s.forEach(function(a){o.has(a)||Mc(a,i)})}Qp.set(n,e)},[e]),n}function LC(e){return e}function FC(e,t){t===void 0&&(t=LC);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(s),i=n}var c=function(){var u=i;i=[],u.forEach(s)},l=function(){return Promise.resolve().then(c)};l(),n={push:function(u){i.push(u),l()},filter:function(u){return i=i.filter(u),n}}}};return o}function $C(e){e===void 0&&(e={});var t=FC(null);return t.options=Zt({async:!0,ssr:!1},e),t}var eh=function(e){var t=e.sideCar,n=Tu(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,Zt({},n))};eh.isSideCarExport=!0;function zC(e,t){return e.useMedium(t),eh}var th=$C(),Lc=function(){},qs=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Lc,onWheelCapture:Lc,onTouchMoveCapture:Lc}),o=r[0],s=r[1],i=e.forwardProps,a=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,h=e.noRelative,m=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,S=v===void 0?"div":v,C=e.gapMode,w=Tu(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=f,T=MC([n,t]),E=Zt(Zt({},w),o);return p.createElement(p.Fragment,null,u&&p.createElement(b,{sideCar:th,removeScrollBar:l,shards:d,noRelative:h,noIsolation:m,inert:g,setCallbacks:s,allowPinchZoom:!!y,lockRef:n,gapMode:C}),i?p.cloneElement(p.Children.only(a),Zt(Zt({},E),{ref:T})):p.createElement(S,Zt({},E,{className:c,ref:T}),a))});qs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},qs.classNames={fullWidth:Ys,zeroRight:Gs};var VC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VC();return t&&e.setAttribute("nonce",t),e}function BC(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function UC(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=jC())&&(BC(t,n),UC(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},HC=function(){var e=WC();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nh=function(){var e=HC(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},ZC={left:0,top:0,right:0,gap:0},Fc=function(e){return parseInt(e||"",10)||0},GC=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Fc(n),Fc(r),Fc(o)]},YC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return ZC;var t=GC(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])}},qC=nh(),Fr="data-scroll-locked",KC=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
20
+ .`.concat(RC,` {
45
21
  overflow: hidden `).concat(r,`;
46
22
  padding-right: `).concat(a,"px ").concat(r,`;
47
23
  }
48
- body[`).concat(qr,`] {
24
+ body[`).concat(Fr,`] {
49
25
  overflow: hidden `).concat(r,`;
50
26
  overscroll-behavior: contain;
51
27
  `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
@@ -58,32 +34,95 @@ Avoid returning a new reference inside your input selector, e.g.
58
34
  `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
59
35
  }
60
36
 
61
- .`).concat(Ii,` {
37
+ .`).concat(Gs,` {
62
38
  right: `).concat(a,"px ").concat(r,`;
63
39
  }
64
40
 
65
- .`).concat(_i,` {
41
+ .`).concat(Ys,` {
66
42
  margin-right: `).concat(a,"px ").concat(r,`;
67
43
  }
68
44
 
69
- .`).concat(Ii," .").concat(Ii,` {
45
+ .`).concat(Gs," .").concat(Gs,` {
70
46
  right: 0 `).concat(r,`;
71
47
  }
72
48
 
73
- .`).concat(_i," .").concat(_i,` {
49
+ .`).concat(Ys," .").concat(Ys,` {
74
50
  margin-right: 0 `).concat(r,`;
75
51
  }
76
52
 
77
- body[`).concat(qr,`] {
78
- `).concat(fR,": ").concat(a,`px;
53
+ body[`).concat(Fr,`] {
54
+ `).concat(NC,": ").concat(a,`px;
79
55
  }
80
- `)},wg=function(){var e=parseInt(document.body.getAttribute(qr)||"0",10);return isFinite(e)?e:0},_R=function(){f.useEffect(function(){return document.body.setAttribute(qr,(wg()+1).toString()),function(){var e=wg()-1;e<=0?document.body.removeAttribute(qr):document.body.setAttribute(qr,e.toString())}},[])},NR=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;_R();var s=f.useMemo(function(){return RR(o)},[o]);return f.createElement(PR,{styles:IR(s,!t,o,n?"":"!important")})},Ol=!1;if(typeof window<"u")try{var Ai=Object.defineProperty({},"passive",{get:function(){return Ol=!0,!0}});window.addEventListener("test",Ai,Ai),window.removeEventListener("test",Ai,Ai)}catch{Ol=!1}var Xr=Ol?{passive:!1}:!1,AR=function(e){return e.tagName==="TEXTAREA"},Eg=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!AR(e)&&n[t]==="visible")},DR=function(e){return Eg(e,"overflowY")},MR=function(e){return Eg(e,"overflowX")},xg=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Sg(e,r);if(o){var s=Cg(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},LR=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$R=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Sg=function(e,t){return e==="v"?DR(t):MR(t)},Cg=function(e,t){return e==="v"?LR(t):$R(t)},FR=function(e,t){return e==="h"&&t==="rtl"?-1:1},VR=function(e,t,n,r,o){var s=FR(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,l=t.contains(a),c=!1,u=i>0,d=0,h=0;do{if(!a)break;var p=Cg(e,a),g=p[0],m=p[1],v=p[2],y=m-v-s*g;(g||y)&&Sg(e,a)&&(d+=y,h+=g);var b=a.parentNode;a=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(h)<1)&&(c=!0),c},Di=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Tg=function(e){return[e.deltaX,e.deltaY]},Og=function(e){return e&&"current"in e?e.current:e},BR=function(e,t){return e[0]===t[0]&&e[1]===t[1]},WR=function(e){return`
56
+ `)},rh=function(){var e=parseInt(document.body.getAttribute(Fr)||"0",10);return isFinite(e)?e:0},XC=function(){p.useEffect(function(){return document.body.setAttribute(Fr,(rh()+1).toString()),function(){var e=rh()-1;e<=0?document.body.removeAttribute(Fr):document.body.setAttribute(Fr,e.toString())}},[])},JC=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;XC();var s=p.useMemo(function(){return YC(o)},[o]);return p.createElement(qC,{styles:KC(s,!t,o,n?"":"!important")})},$c=!1;if(typeof window<"u")try{var Ks=Object.defineProperty({},"passive",{get:function(){return $c=!0,!0}});window.addEventListener("test",Ks,Ks),window.removeEventListener("test",Ks,Ks)}catch{$c=!1}var $r=$c?{passive:!1}:!1,QC=function(e){return e.tagName==="TEXTAREA"},oh=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!QC(e)&&n[t]==="visible")},ex=function(e){return oh(e,"overflowY")},tx=function(e){return oh(e,"overflowX")},sh=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ih(e,r);if(o){var s=ah(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nx=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},rx=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ih=function(e,t){return e==="v"?ex(t):tx(t)},ah=function(e,t){return e==="v"?nx(t):rx(t)},ox=function(e,t){return e==="h"&&t==="rtl"?-1:1},sx=function(e,t,n,r,o){var s=ox(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),l=!1,u=i>0,d=0,f=0;do{if(!a)break;var h=ah(e,a),m=h[0],g=h[1],y=h[2],v=g-y-s*m;(m||v)&&ih(e,a)&&(d+=v,f+=m);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(l=!0),l},Xs=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ch=function(e){return[e.deltaX,e.deltaY]},uh=function(e){return e&&"current"in e?e.current:e},ix=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ax=function(e){return`
81
57
  .block-interactivity-`.concat(e,` {pointer-events: none;}
82
58
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
83
- `)},jR=0,Kr=[];function HR(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(jR++)[0],s=f.useState(bg)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var m=Qi([e.lockRef.current],(e.shards||[]).map(Og),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=f.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var y=Di(m),b=n.current,E="deltaX"in m?m.deltaX:b[0]-y[0],x="deltaY"in m?m.deltaY:b[1]-y[1],w,T=m.target,S=Math.abs(E)>Math.abs(x)?"h":"v";if("touches"in m&&S==="h"&&T.type==="range")return!1;var I=xg(S,T);if(!I)return!0;if(I?w=S:(w=S==="v"?"h":"v",I=xg(S,T)),!I)return!1;if(!r.current&&"changedTouches"in m&&(E||x)&&(r.current=w),!w)return!0;var A=r.current||w;return VR(A,v,m,A==="h"?E:x)},[]),l=f.useCallback(function(m){var v=m;if(!(!Kr.length||Kr[Kr.length-1]!==s)){var y="deltaY"in v?Tg(v):Di(v),b=t.current.filter(function(w){return w.name===v.type&&(w.target===v.target||v.target===w.shadowParent)&&BR(w.delta,y)})[0];if(b&&b.should){v.cancelable&&v.preventDefault();return}if(!b){var E=(i.current.shards||[]).map(Og).filter(Boolean).filter(function(w){return w.contains(v.target)}),x=E.length>0?a(v,E[0]):!i.current.noIsolation;x&&v.cancelable&&v.preventDefault()}}},[]),c=f.useCallback(function(m,v,y,b){var E={name:m,delta:v,target:y,should:b,shadowParent:UR(y)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(x){return x!==E})},1)},[]),u=f.useCallback(function(m){n.current=Di(m),r.current=void 0},[]),d=f.useCallback(function(m){c(m.type,Tg(m),m.target,a(m,e.lockRef.current))},[]),h=f.useCallback(function(m){c(m.type,Di(m),m.target,a(m,e.lockRef.current))},[]);f.useEffect(function(){return Kr.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Xr),document.addEventListener("touchmove",l,Xr),document.addEventListener("touchstart",u,Xr),function(){Kr=Kr.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,Xr),document.removeEventListener("touchmove",l,Xr),document.removeEventListener("touchstart",u,Xr)}},[]);var p=e.removeScrollBar,g=e.inert;return f.createElement(f.Fragment,null,g?f.createElement(s,{styles:WR(o)}):null,p?f.createElement(NR,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function UR(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const GR=bR(yg,HR);var kg=f.forwardRef(function(e,t){return f.createElement(Ni,Ht({},e,{ref:t,sideCar:GR}))});kg.classNames=Ni.classNames;var zR=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Jr=new WeakMap,Mi=new WeakMap,Li={},kl=0,Rg=function(e){return e&&(e.host||Rg(e.parentNode))},YR=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Rg(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})},ZR=function(e,t,n,r){var o=YR(t,Array.isArray(e)?e:[e]);Li[n]||(Li[n]=new WeakMap);var s=Li[n],i=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var p=h.getAttribute(r),g=p!==null&&p!=="false",m=(Jr.get(h)||0)+1,v=(s.get(h)||0)+1;Jr.set(h,m),s.set(h,v),i.push(h),m===1&&g&&Mi.set(h,!0),v===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return u(t),a.clear(),kl++,function(){i.forEach(function(d){var h=Jr.get(d)-1,p=s.get(d)-1;Jr.set(d,h),s.set(d,p),h||(Mi.has(d)||d.removeAttribute(r),Mi.delete(d)),p||d.removeAttribute(n)}),kl--,kl||(Jr=new WeakMap,Jr=new WeakMap,Mi=new WeakMap,Li={})}},qR=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=zR(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),ZR(r,o,n,"aria-hidden")):function(){return null}},$i="Dialog",[Pg,z2]=Ik($i),[XR,Xt]=Pg($i),Ig=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=f.useRef(null),l=f.useRef(null),[c,u]=Mk({prop:r,defaultProp:o??!1,onChange:s,caller:$i});return O.jsx(XR,{scope:t,triggerRef:a,contentRef:l,contentId:yl(),titleId:yl(),descriptionId:yl(),open:c,onOpenChange:u,onOpenToggle:f.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};Ig.displayName=$i;var _g="DialogTrigger",Ng=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xt(_g,n),s=gr(t,o.triggerRef);return O.jsx(On.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Il(o.open),...r,ref:s,onClick:zn(e.onClick,o.onOpenToggle)})});Ng.displayName=_g;var Rl="DialogPortal",[KR,Ag]=Pg(Rl,{forceMount:void 0}),Dg=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Xt(Rl,t);return O.jsx(KR,{scope:t,forceMount:n,children:f.Children.map(r,i=>O.jsx(Ri,{present:n||s.open,children:O.jsx(hg,{asChild:!0,container:o,children:i})}))})};Dg.displayName=Rl;var Fi="DialogOverlay",Mg=f.forwardRef((e,t)=>{const n=Ag(Fi,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Xt(Fi,e.__scopeDialog);return s.modal?O.jsx(Ri,{present:r||s.open,children:O.jsx(QR,{...o,ref:t})}):null});Mg.displayName=Fi;var JR=ng("DialogOverlay.RemoveScroll"),QR=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xt(Fi,n);return O.jsx(kg,{as:JR,allowPinchZoom:!0,shards:[o.contentRef],children:O.jsx(On.div,{"data-state":Il(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vr="DialogContent",Lg=f.forwardRef((e,t)=>{const n=Ag(vr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Xt(vr,e.__scopeDialog);return O.jsx(Ri,{present:r||s.open,children:s.modal?O.jsx(eP,{...o,ref:t}):O.jsx(tP,{...o,ref:t})})});Lg.displayName=vr;var eP=f.forwardRef((e,t)=>{const n=Xt(vr,e.__scopeDialog),r=f.useRef(null),o=gr(t,n.contentRef,r);return f.useEffect(()=>{const s=r.current;if(s)return qR(s)},[]),O.jsx($g,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zn(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:zn(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:zn(e.onFocusOutside,s=>s.preventDefault())})}),tP=f.forwardRef((e,t)=>{const n=Xt(vr,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return O.jsx($g,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),$g=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Xt(vr,n),l=f.useRef(null),c=gr(t,l);return uR(),O.jsxs(O.Fragment,{children:[O.jsx(lg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:O.jsx(sg,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Il(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),O.jsxs(O.Fragment,{children:[O.jsx(oP,{titleId:a.titleId}),O.jsx(iP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Pl="DialogTitle",Fg=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xt(Pl,n);return O.jsx(On.h2,{id:o.titleId,...r,ref:t})});Fg.displayName=Pl;var Vg="DialogDescription",nP=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xt(Vg,n);return O.jsx(On.p,{id:o.descriptionId,...r,ref:t})});nP.displayName=Vg;var Bg="DialogClose",rP=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Xt(Bg,n);return O.jsx(On.button,{type:"button",...r,ref:t,onClick:zn(e.onClick,()=>o.onOpenChange(!1))})});rP.displayName=Bg;function Il(e){return e?"open":"closed"}var Wg="DialogTitleWarning",[Y2,jg]=Pk(Wg,{contentName:vr,titleName:Pl,docsSlug:"dialog"}),oP=({titleId:e})=>{const t=jg(Wg),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
59
+ `)},cx=0,zr=[];function ux(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(cx++)[0],s=p.useState(nh)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Oi([e.lockRef.current],(e.shards||[]).map(uh),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=Xs(g),S=n.current,C="deltaX"in g?g.deltaX:S[0]-v[0],w="deltaY"in g?g.deltaY:S[1]-v[1],b,T=g.target,E=Math.abs(C)>Math.abs(w)?"h":"v";if("touches"in g&&E==="h"&&T.type==="range")return!1;var O=sh(E,T);if(!O)return!0;if(O?b=E:(b=E==="v"?"h":"v",O=sh(E,T)),!O)return!1;if(!r.current&&"changedTouches"in g&&(C||w)&&(r.current=b),!b)return!0;var D=r.current||b;return sx(D,y,g,D==="h"?C:w)},[]),c=p.useCallback(function(g){var y=g;if(!(!zr.length||zr[zr.length-1]!==s)){var v="deltaY"in y?ch(y):Xs(y),S=t.current.filter(function(b){return b.name===y.type&&(b.target===y.target||y.target===b.shadowParent)&&ix(b.delta,v)})[0];if(S&&S.should){y.cancelable&&y.preventDefault();return}if(!S){var C=(i.current.shards||[]).map(uh).filter(Boolean).filter(function(b){return b.contains(y.target)}),w=C.length>0?a(y,C[0]):!i.current.noIsolation;w&&y.cancelable&&y.preventDefault()}}},[]),l=p.useCallback(function(g,y,v,S){var C={name:g,delta:y,target:v,should:S,shadowParent:lx(v)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(w){return w!==C})},1)},[]),u=p.useCallback(function(g){n.current=Xs(g),r.current=void 0},[]),d=p.useCallback(function(g){l(g.type,ch(g),g.target,a(g,e.lockRef.current))},[]),f=p.useCallback(function(g){l(g.type,Xs(g),g.target,a(g,e.lockRef.current))},[]);p.useEffect(function(){return zr.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",c,$r),document.addEventListener("touchmove",c,$r),document.addEventListener("touchstart",u,$r),function(){zr=zr.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,$r),document.removeEventListener("touchmove",c,$r),document.removeEventListener("touchstart",u,$r)}},[]);var h=e.removeScrollBar,m=e.inert;return p.createElement(p.Fragment,null,m?p.createElement(s,{styles:ax(o)}):null,h?p.createElement(JC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function lx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dx=zC(th,ux);var lh=p.forwardRef(function(e,t){return p.createElement(qs,Zt({},e,{ref:t,sideCar:dx}))});lh.classNames=qs.classNames;var fx=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vr=new WeakMap,Js=new WeakMap,Qs={},zc=0,dh=function(e){return e&&(e.host||dh(e.parentNode))},px=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=dh(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})},hx=function(e,t,n,r){var o=px(t,Array.isArray(e)?e:[e]);Qs[n]||(Qs[n]=new WeakMap);var s=Qs[n],i=[],a=new Set,c=new Set(o),l=function(d){!d||a.has(d)||(a.add(d),l(d.parentNode))};o.forEach(l);var u=function(d){!d||c.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else try{var h=f.getAttribute(r),m=h!==null&&h!=="false",g=(Vr.get(f)||0)+1,y=(s.get(f)||0)+1;Vr.set(f,g),s.set(f,y),i.push(f),g===1&&m&&Js.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",f,v)}})};return u(t),a.clear(),zc++,function(){i.forEach(function(d){var f=Vr.get(d)-1,h=s.get(d)-1;Vr.set(d,f),s.set(d,h),f||(Js.has(d)||d.removeAttribute(r),Js.delete(d)),h||d.removeAttribute(n)}),zc--,zc||(Vr=new WeakMap,Vr=new WeakMap,Js=new WeakMap,Qs={})}},mx=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=fx(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),hx(r,o,n,"aria-hidden")):function(){return null}},ei="Dialog",[fh,n2]=K1(ei),[gx,Jt]=fh(ei),ph=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=p.useRef(null),c=p.useRef(null),[l,u]=tC({prop:r,defaultProp:o??!1,onChange:s,caller:ei});return x.jsx(gx,{scope:t,triggerRef:a,contentRef:c,contentId:kc(),titleId:kc(),descriptionId:kc(),open:l,onOpenChange:u,onOpenToggle:p.useCallback(()=>u(d=>!d),[u]),modal:i,children:n})};ph.displayName=ei;var hh="DialogTrigger",mh=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jt(hh,n),s=ar(t,o.triggerRef);return x.jsx(In.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Bc(o.open),...r,ref:s,onClick:Bn(e.onClick,o.onOpenToggle)})});mh.displayName=hh;var Vc="DialogPortal",[vx,gh]=fh(Vc,{forceMount:void 0}),vh=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=Jt(Vc,t);return x.jsx(vx,{scope:t,forceMount:n,children:p.Children.map(r,i=>x.jsx(Hs,{present:n||s.open,children:x.jsx(Xp,{asChild:!0,container:o,children:i})}))})};vh.displayName=Vc;var ti="DialogOverlay",yh=p.forwardRef((e,t)=>{const n=gh(ti,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Jt(ti,e.__scopeDialog);return s.modal?x.jsx(Hs,{present:r||s.open,children:x.jsx(bx,{...o,ref:t})}):null});yh.displayName=ti;var yx=zp("DialogOverlay.RemoveScroll"),bx=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jt(ti,n);return x.jsx(lh,{as:yx,allowPinchZoom:!0,shards:[o.contentRef],children:x.jsx(In.div,{"data-state":Bc(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cr="DialogContent",bh=p.forwardRef((e,t)=>{const n=gh(cr,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,s=Jt(cr,e.__scopeDialog);return x.jsx(Hs,{present:r||s.open,children:s.modal?x.jsx(wx,{...o,ref:t}):x.jsx(Ex,{...o,ref:t})})});bh.displayName=cr;var wx=p.forwardRef((e,t)=>{const n=Jt(cr,e.__scopeDialog),r=p.useRef(null),o=ar(t,n.contentRef,r);return p.useEffect(()=>{const s=r.current;if(s)return mx(s)},[]),x.jsx(wh,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Bn(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Bn(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&s.preventDefault()}),onFocusOutside:Bn(e.onFocusOutside,s=>s.preventDefault())})}),Ex=p.forwardRef((e,t)=>{const n=Jt(cr,e.__scopeDialog),r=p.useRef(!1),o=p.useRef(!1);return x.jsx(wh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=s.target;n.triggerRef.current?.contains(i)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&o.current&&s.preventDefault()}})}),wh=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:s,...i}=e,a=Jt(cr,n),c=p.useRef(null),l=ar(t,c);return kC(),x.jsxs(x.Fragment,{children:[x.jsx(Zp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:s,children:x.jsx(Bp,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Bc(a.open),...i,ref:l,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(xx,{titleId:a.titleId}),x.jsx(Ox,{contentRef:c,descriptionId:a.descriptionId})]})]})}),jc="DialogTitle",Eh=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jt(jc,n);return x.jsx(In.h2,{id:o.titleId,...r,ref:t})});Eh.displayName=jc;var Sh="DialogDescription",Sx=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jt(Sh,n);return x.jsx(In.p,{id:o.descriptionId,...r,ref:t})});Sx.displayName=Sh;var Ch="DialogClose",Cx=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Jt(Ch,n);return x.jsx(In.button,{type:"button",...r,ref:t,onClick:Bn(e.onClick,()=>o.onOpenChange(!1))})});Cx.displayName=Ch;function Bc(e){return e?"open":"closed"}var xh="DialogTitleWarning",[r2,Th]=q1(xh,{contentName:cr,titleName:jc,docsSlug:"dialog"}),xx=({titleId:e})=>{const t=Th(xh),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
84
60
 
85
61
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
86
62
 
87
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},sP="DialogDescriptionWarning",iP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jg(sP).contentName}}.`;return f.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},aP=Ig,cP=Ng,lP=Dg,uP=Mg,dP=Lg,fP=Fg;function pP(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Hg=W.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),qo=()=>{const e=W.useContext(Hg);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};pP(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
63
+ 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},Tx="DialogDescriptionWarning",Ox=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Th(Tx).contentName}}.`;return p.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},_x=ph,Px=mh,Ix=vh,kx=yh,Rx=bh,Nx=Eh;function Ax(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Oh=z.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),To=()=>{const e=z.useContext(Oh);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};Ax(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
88
64
  [data-state=closed]
89
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function hP(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function mP(){return _l(/^Mac/)}function gP(){return _l(/^iPhone/)}function Ug(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function vP(){return _l(/^iPad/)||mP()&&navigator.maxTouchPoints>1}function Gg(){return gP()||vP()}function _l(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const yP=24,bP=typeof window<"u"?W.useLayoutEffect:W.useEffect;function zg(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Nl=typeof document<"u"&&window.visualViewport;function Yg(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Zg(e){for(Yg(e)&&(e=e.parentElement);e&&!Yg(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const wP=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Vi=0,Al;function EP(e={}){let{isDisabled:t}=e;bP(()=>{if(!t)return Vi++,Vi===1&&Gg()&&(Al=xP()),()=>{Vi--,Vi===0&&Al?.()}},[t])}function xP(){let e,t=0,n=d=>{e=Zg(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let h=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&h>t||p>=g&&h<t)&&d.preventDefault(),t=h)},o=d=>{let h=d.target;Dl(h)&&h!==document.activeElement&&(d.preventDefault(),h.style.transform="translateY(-2000px)",h.focus(),requestAnimationFrame(()=>{h.style.transform=""}))},s=d=>{let h=d.target;Dl(h)&&(h.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{h.style.transform="",Nl&&(Nl.height<window.innerHeight?requestAnimationFrame(()=>{qg(h)}):Nl.addEventListener("resize",()=>qg(h),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,c=zg(SP(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=zg(Xo(document,"touchstart",n,{passive:!1,capture:!0}),Xo(document,"touchmove",r,{passive:!1,capture:!0}),Xo(document,"touchend",o,{passive:!1,capture:!0}),Xo(document,"focus",s,!0),Xo(window,"scroll",i));return()=>{c(),u(),window.scrollTo(a,l)}}function SP(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Xo(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function qg(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Zg(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+yP;s>i&&(n.scrollTop+=o-r)}e=n.parentElement}}function Dl(e){return e instanceof HTMLInputElement&&!wP.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function CP(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function TP(...e){return t=>e.forEach(n=>CP(n,t))}function Xg(...e){return f.useCallback(TP(...e),e)}const Kg=new WeakMap;function at(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,s])=>{if(o.startsWith("--")){e.style.setProperty(o,s);return}r[o]=e.style[o],e.style[o]=s}),!n&&Kg.set(e,r)}function OP(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Kg.get(e);n&&(e.style[t]=n[t])}const ot=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function Bi(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ot(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ot(t)?5:4]):null)}function kP(e){return 8*(Math.log(e+1)-2)}function Ml(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function RP(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const Xe={DURATION:.5,EASE:[.32,.72,0,1]},Jg=.4,PP=.25,IP=100,Qg=8,yr=16,Ll=26,$l="vaul-dragging";function ev(e){const t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function _P({defaultProp:e,onChange:t}){const n=W.useState(e),[r]=n,o=W.useRef(r),s=ev(t);return W.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function tv({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_P({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=ev(n),l=W.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[s,e,o,a]);return[i,l]}function NP({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:s,onSnapPointChange:i,direction:a="bottom",container:l,snapToSequentialPoint:c}){const[u,d]=tv({prop:e,defaultProp:n?.[0],onChange:t}),[h,p]=W.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);W.useEffect(()=>{function S(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const g=W.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),m=W.useMemo(()=>{var S;return(S=n?.findIndex(I=>I===u))!=null?S:null},[n,u]),v=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===u||!n,y=W.useMemo(()=>{const S=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var I;return(I=n?.map(A=>{const L=typeof A=="string";let M=0;if(L&&(M=parseInt(A,10)),ot(a)){const R=L?M:h?A*S.height:0;return h?a==="bottom"?S.height-R:-S.height+R:R}const N=L?M:h?A*S.width:0;return h?a==="right"?S.width-N:-S.width+N:N}))!=null?I:[]},[n,h,l]),b=W.useMemo(()=>m!==null?y?.[m]:null,[y,m]),E=W.useCallback(S=>{var I;const A=(I=y?.findIndex(L=>L===S))!=null?I:null;i(A),at(r.current,{transition:`transform ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,transform:ot(a)?`translate3d(0, ${S}px, 0)`:`translate3d(${S}px, 0, 0)`}),y&&A!==y.length-1&&s!==void 0&&A!==s&&A<s?at(o.current,{transition:`opacity ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,opacity:"0"}):at(o.current,{transition:`opacity ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(A,0)])},[r.current,n,y,s,o,d]);W.useEffect(()=>{if(u||e){var S;const I=(S=n?.findIndex(A=>A===e||A===u))!=null?S:-1;y&&I!==-1&&typeof y[I]=="number"&&E(y[I])}},[u,e,n,y,E]);function x({draggedDistance:S,closeDrawer:I,velocity:A,dismissible:L}){if(s===void 0)return;const M=a==="bottom"||a==="right"?(b??0)-S:(b??0)+S,N=m===s-1,R=m===0,P=S>0;if(N&&at(o.current,{transition:`opacity ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`}),!c&&A>2&&!P){L?I():E(y[0]);return}if(!c&&A>2&&P&&y&&n){E(y[n.length-1]);return}const C=y?.reduce((D,k)=>typeof D!="number"||typeof k!="number"?D:Math.abs(k-M)<Math.abs(D-M)?k:D),_=ot(a)?window.innerHeight:window.innerWidth;if(A>Jg&&Math.abs(S)<_*.4){const D=P?1:-1;if(D>0&&g&&n){E(y[n.length-1]);return}if(R&&D<0&&L&&I(),m===null)return;E(y[m+D]);return}E(C)}function w({draggedDistance:S}){if(b===null)return;const I=a==="bottom"||a==="right"?b-S:b+S;(a==="bottom"||a==="right")&&I<y[y.length-1]||(a==="top"||a==="left")&&I>y[y.length-1]||at(r.current,{transform:ot(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`})}function T(S,I){if(!n||typeof m!="number"||!y||s===void 0)return null;const A=m===s-1;if(m>=s&&I)return 0;if(A&&!I)return 1;if(!v&&!A)return null;const M=A?m+1:m-1,N=A?y[M]-y[M-1]:y[M+1]-y[M],R=S/Math.abs(N);return A?1-R:R}return{isLastSnapPoint:g,activeSnapPoint:u,shouldFade:v,getPercentageDragged:T,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:x,onDrag:w,snapPointsOffset:y}}const AP=()=>()=>{};function DP(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=qo(),s=W.useRef(null),i=W.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Ll)/window.innerWidth}W.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;RP(r&&!o?Ml(document.body,{background:"black"}):AP,Ml(l,{transformOrigin:ot(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Xe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Xe.EASE.join(",")})`}));const c=Ml(l,{borderRadius:`${Qg}px`,overflow:"hidden",...ot(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{c(),s.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},Xe.DURATION*1e3)}}},[t,n,i])}let Ko=null;function MP({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:s}){const[i,a]=W.useState(()=>typeof window<"u"?window.location.href:""),l=W.useRef(0),c=W.useCallback(()=>{if(Ug()&&Ko===null&&e&&!s){Ko={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:h}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=h-window.innerHeight;p&&l.current>=h&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),u=W.useCallback(()=>{if(Ug()&&Ko!==null&&!s){const d=-parseInt(document.body.style.top,10),h=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ko),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){a(window.location.href);return}window.scrollTo(h,d)}),Ko=null}},[i]);return W.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),W.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),W.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&c(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,i,t,n,c,u]),{restorePositionSetting:u}}function LP({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:s,shouldScaleBackground:i=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=PP,scrollLockTimeout:c=IP,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:h=s&&s.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:b,noBodyStyles:E=!1,direction:x="bottom",defaultOpen:w=!1,disablePreventScroll:T=!0,snapToSequentialPoint:S=!1,preventScrollRestoration:I=!1,repositionInputs:A=!0,onAnimationEnd:L,container:M,autoFocus:N=!1}){var R,P;const[C=!1,_]=tv({defaultProp:w,prop:e,onChange:ie=>{t?.(ie),!ie&&!b&&Ie(),setTimeout(()=>{L?.(ie)},Xe.DURATION*1e3),ie&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ie||(document.body.style.pointerEvents="auto")}}),[D,k]=W.useState(!1),[$,F]=W.useState(!1),[j,V]=W.useState(!1),Y=W.useRef(null),q=W.useRef(null),X=W.useRef(null),U=W.useRef(null),H=W.useRef(null),Z=W.useRef(!1),re=W.useRef(null),ne=W.useRef(0),ee=W.useRef(!1),le=W.useRef(!w),K=W.useRef(0),G=W.useRef(null),de=W.useRef(((R=G.current)==null?void 0:R.getBoundingClientRect().height)||0),fe=W.useRef(((P=G.current)==null?void 0:P.getBoundingClientRect().width)||0),oe=W.useRef(0),ue=W.useCallback(ie=>{s&&ie===pe.length-1&&(q.current=new Date)},[]),{activeSnapPoint:te,activeSnapPointIndex:z,setActiveSnapPoint:B,onRelease:J,snapPointsOffset:pe,onDrag:Se,shouldFade:_e,getPercentageDragged:Fe}=NP({snapPoints:s,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:G,fadeFromIndex:h,overlayRef:Y,onSnapPointChange:ue,direction:x,container:M,snapToSequentialPoint:S});EP({isDisabled:!C||$||!v||j||!D||!A||!T});const{restorePositionSetting:Ie}=MP({isOpen:C,modal:v,nested:b??!1,hasBeenOpened:D,preventScrollRestoration:I,noBodyStyles:E});function be(){return(window.innerWidth-Ll)/window.innerWidth}function Re(ie){var ge,Oe;!u&&!s||G.current&&!G.current.contains(ie.target)||(de.current=((ge=G.current)==null?void 0:ge.getBoundingClientRect().height)||0,fe.current=((Oe=G.current)==null?void 0:Oe.getBoundingClientRect().width)||0,F(!0),X.current=new Date,Gg()&&window.addEventListener("touchend",()=>Z.current=!1,{once:!0}),ie.target.setPointerCapture(ie.pointerId),ne.current=ot(x)?ie.pageY:ie.pageX)}function Ce(ie,ge){var Oe;let we=ie;const Me=(Oe=window.getSelection())==null?void 0:Oe.toString(),Ke=G.current?Bi(G.current,x):null,et=new Date;if(we.tagName==="SELECT"||we.hasAttribute("data-vaul-no-drag")||we.closest("[data-vaul-no-drag]"))return!1;if(x==="right"||x==="left")return!0;if(q.current&&et.getTime()-q.current.getTime()<500)return!1;if(Ke!==null&&(x==="bottom"?Ke>0:Ke<0))return!0;if(Me&&Me.length>0)return!1;if(H.current&&et.getTime()-H.current.getTime()<c&&Ke===0||ge)return H.current=et,!1;for(;we;){if(we.scrollHeight>we.clientHeight){if(we.scrollTop!==0)return H.current=new Date,!1;if(we.getAttribute("role")==="dialog")return!0}we=we.parentNode}return!0}function Be(ie){if(G.current&&$){const ge=x==="bottom"||x==="right"?1:-1,Oe=(ne.current-(ot(x)?ie.pageY:ie.pageX))*ge,we=Oe>0,Me=s&&!u&&!we;if(Me&&z===0)return;const Ke=Math.abs(Oe),et=document.querySelector("[data-vaul-drawer-wrapper]"),Tt=x==="bottom"||x==="top"?de.current:fe.current;let Et=Ke/Tt;const Kt=Fe(Ke,we);if(Kt!==null&&(Et=Kt),Me&&Et>=1||!Z.current&&!Ce(ie.target,we))return;if(G.current.classList.add($l),Z.current=!0,at(G.current,{transition:"none"}),at(Y.current,{transition:"none"}),s&&Se({draggedDistance:Oe}),we&&!s){const Ot=kP(Oe),Er=Math.min(Ot*-1,0)*ge;at(G.current,{transform:ot(x)?`translate3d(0, ${Er}px, 0)`:`translate3d(${Er}px, 0, 0)`});return}const dn=1-Et;if((_e||h&&z===h-1)&&(r?.(ie,Et),at(Y.current,{opacity:`${dn}`,transition:"none"},!0)),et&&Y.current&&i){const Ot=Math.min(be()+Et*(1-be()),1),Er=8-Et*8,Yi=Math.max(0,14-Et*14);at(et,{borderRadius:`${Er}px`,transform:ot(x)?`scale(${Ot}) translate3d(0, ${Yi}px, 0)`:`scale(${Ot}) translate3d(${Yi}px, 0, 0)`,transition:"none"},!0)}if(!s){const Ot=Ke*ge;at(G.current,{transform:ot(x)?`translate3d(0, ${Ot}px, 0)`:`translate3d(${Ot}px, 0, 0)`})}}}W.useEffect(()=>{window.requestAnimationFrame(()=>{le.current=!0})},[]),W.useEffect(()=>{var ie;function ge(){if(!G.current||!A)return;const Oe=document.activeElement;if(Dl(Oe)||ee.current){var we;const Me=((we=window.visualViewport)==null?void 0:we.height)||0,Ke=window.innerHeight;let et=Ke-Me;const Tt=G.current.getBoundingClientRect().height||0,Et=Tt>Ke*.8;oe.current||(oe.current=Tt);const Kt=G.current.getBoundingClientRect().top;if(Math.abs(K.current-et)>60&&(ee.current=!ee.current),s&&s.length>0&&pe&&z){const dn=pe[z]||0;et+=dn}if(K.current=et,Tt>Me||ee.current){const dn=G.current.getBoundingClientRect().height;let Ot=dn;dn>Me&&(Ot=Me-(Et?Kt:Ll)),m?G.current.style.height=`${dn-Math.max(et,0)}px`:G.current.style.height=`${Math.max(Ot,Me-Kt)}px`}else hP()||(G.current.style.height=`${oe.current}px`);s&&s.length>0&&!ee.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(et,0)}px`}}return(ie=window.visualViewport)==null||ie.addEventListener("resize",ge),()=>{var Oe;return(Oe=window.visualViewport)==null?void 0:Oe.removeEventListener("resize",ge)}},[z,s,pe]);function Qe(ie){Ct(),y?.(),ie||_(!1),setTimeout(()=>{s&&B(s[0])},Xe.DURATION*1e3)}function ct(){if(!G.current)return;const ie=document.querySelector("[data-vaul-drawer-wrapper]"),ge=Bi(G.current,x);at(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`}),at(Y.current,{transition:`opacity ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,opacity:"1"}),i&&ge&&ge>0&&C&&at(ie,{borderRadius:`${Qg}px`,overflow:"hidden",...ot(x)?{transform:`scale(${be()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${be()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Xe.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Xe.EASE.join(",")})`},!0)}function Ct(){!$||!G.current||(G.current.classList.remove($l),Z.current=!1,F(!1),U.current=new Date)}function Dt(ie){if(!$||!G.current)return;G.current.classList.remove($l),Z.current=!1,F(!1),U.current=new Date;const ge=Bi(G.current,x);if(!ie||!Ce(ie.target,!1)||!ge||Number.isNaN(ge)||X.current===null)return;const Oe=U.current.getTime()-X.current.getTime(),we=ne.current-(ot(x)?ie.pageY:ie.pageX),Me=Math.abs(we)/Oe;if(Me>.05&&(V(!0),setTimeout(()=>{V(!1)},200)),s){J({draggedDistance:we*(x==="bottom"||x==="right"?1:-1),closeDrawer:Qe,velocity:Me,dismissible:u}),o?.(ie,!0);return}if(x==="bottom"||x==="right"?we>0:we<0){ct(),o?.(ie,!0);return}if(Me>Jg){Qe(),o?.(ie,!1);return}var Ke;const et=Math.min((Ke=G.current.getBoundingClientRect().height)!=null?Ke:0,window.innerHeight);var Tt;const Et=Math.min((Tt=G.current.getBoundingClientRect().width)!=null?Tt:0,window.innerWidth),Kt=x==="left"||x==="right";if(Math.abs(ge)>=(Kt?Et:et)*l){Qe(),o?.(ie,!1);return}o?.(ie,!0),ct()}W.useEffect(()=>(C&&(at(document.documentElement,{scrollBehavior:"auto"}),q.current=new Date),()=>{OP(document.documentElement,"scrollBehavior")}),[C]);function jt(ie){const ge=ie?(window.innerWidth-yr)/window.innerWidth:1,Oe=ie?-yr:0;re.current&&window.clearTimeout(re.current),at(G.current,{transition:`transform ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,transform:ot(x)?`scale(${ge}) translate3d(0, ${Oe}px, 0)`:`scale(${ge}) translate3d(${Oe}px, 0, 0)`}),!ie&&G.current&&(re.current=setTimeout(()=>{const we=Bi(G.current,x);at(G.current,{transition:"none",transform:ot(x)?`translate3d(0, ${we}px, 0)`:`translate3d(${we}px, 0, 0)`})},500))}function ye(ie,ge){if(ge<0)return;const Oe=(window.innerWidth-yr)/window.innerWidth,we=Oe+ge*(1-Oe),Me=-yr+ge*yr;at(G.current,{transform:ot(x)?`scale(${we}) translate3d(0, ${Me}px, 0)`:`scale(${we}) translate3d(${Me}px, 0, 0)`,transition:"none"})}function Ze(ie,ge){const Oe=ot(x)?window.innerHeight:window.innerWidth,we=ge?(Oe-yr)/Oe:1,Me=ge?-yr:0;ge&&at(G.current,{transition:`transform ${Xe.DURATION}s cubic-bezier(${Xe.EASE.join(",")})`,transform:ot(x)?`scale(${we}) translate3d(0, ${Me}px, 0)`:`scale(${we}) translate3d(${Me}px, 0, 0)`})}return W.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),W.createElement(aP,{defaultOpen:w,onOpenChange:ie=>{!u&&!ie||(ie?k(!0):Qe(!0),_(ie))},open:C},W.createElement(Hg.Provider,{value:{activeSnapPoint:te,snapPoints:s,setActiveSnapPoint:B,drawerRef:G,overlayRef:Y,onOpenChange:t,onPress:Re,onRelease:Dt,onDrag:Be,dismissible:u,shouldAnimate:le,handleOnly:d,isOpen:C,isDragging:$,shouldFade:_e,closeDrawer:Qe,onNestedDrag:ye,onNestedOpenChange:jt,onNestedRelease:Ze,keyboardIsOpen:ee,modal:v,snapPointsOffset:pe,activeSnapPointIndex:z,direction:x,shouldScaleBackground:i,setBackgroundColorOnScale:a,noBodyStyles:E,container:M,autoFocus:N}},n))}const nv=W.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:s,isOpen:i,modal:a,shouldAnimate:l}=qo(),c=Xg(t,n),u=r&&r.length>0;if(!a)return null;const d=W.useCallback(h=>o(h),[o]);return W.createElement(uP,{onMouseUp:d,ref:c,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&s?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});nv.displayName="Drawer.Overlay";const rv=W.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:s,onPress:i,onRelease:a,onDrag:l,keyboardIsOpen:c,snapPointsOffset:u,activeSnapPointIndex:d,modal:h,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:b,autoFocus:E}=qo(),[x,w]=W.useState(!1),T=Xg(o,s),S=W.useRef(null),I=W.useRef(null),A=W.useRef(!1),L=m&&m.length>0;DP();const M=(R,P,C=0)=>{if(A.current)return!0;const _=Math.abs(R.y),D=Math.abs(R.x),k=D>_,$=["bottom","right"].includes(P)?1:-1;if(P==="left"||P==="right"){if(!(R.x*$<0)&&D>=0&&D<=C)return k}else if(!(R.y*$<0)&&_>=0&&_<=C)return!k;return A.current=!0,!0};W.useEffect(()=>{L&&window.requestAnimationFrame(()=>{w(!0)})},[]);function N(R){S.current=null,A.current=!1,a(R)}return W.createElement(dP,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":x?"true":"false","data-vaul-snap-points":p&&L?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":b?.current?"true":"false",...r,ref:T,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:R=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,R),S.current={x:R.pageX,y:R.pageY},i(R))},onOpenAutoFocus:R=>{n?.(R),E||R.preventDefault()},onPointerDownOutside:R=>{if(e?.(R),!h||R.defaultPrevented){R.preventDefault();return}c.current&&(c.current=!1)},onFocusOutside:R=>{if(!h){R.preventDefault();return}},onPointerMove:R=>{if(I.current=R,y||(r.onPointerMove==null||r.onPointerMove.call(r,R),!S.current))return;const P=R.pageY-S.current.y,C=R.pageX-S.current.x,_=R.pointerType==="touch"?10:2;M({x:C,y:P},g,_)?l(R):(Math.abs(C)>_||Math.abs(P)>_)&&(S.current=null)},onPointerUp:R=>{r.onPointerUp==null||r.onPointerUp.call(r,R),S.current=null,A.current=!1,a(R)},onPointerOut:R=>{r.onPointerOut==null||r.onPointerOut.call(r,R),N(I.current)},onContextMenu:R=>{r.onContextMenu==null||r.onContextMenu.call(r,R),I.current&&N(I.current)}})});rv.displayName="Drawer.Content";const $P=250,FP=120,VP=W.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:s,snapPoints:i,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:c,handleOnly:u,isOpen:d,onPress:h,onDrag:p}=qo(),g=W.useRef(null),m=W.useRef(!1);function v(){if(m.current){E();return}window.setTimeout(()=>{y()},FP)}function y(){if(s||e||m.current){E();return}if(E(),!i||i.length===0){c||o();return}if(a===i[i.length-1]&&c){o();return}const w=i.findIndex(S=>S===a);if(w===-1)return;const T=i[w+1];l(T)}function b(){g.current=window.setTimeout(()=>{m.current=!0},$P)}function E(){g.current&&window.clearTimeout(g.current),m.current=!1}return W.createElement("div",{onClick:v,onPointerCancel:E,onPointerDown:x=>{u&&h(x),b()},onPointerMove:x=>{u&&p(x)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},W.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});VP.displayName="Drawer.Handle";function BP(e){const t=qo(),{container:n=t.container,...r}=e;return W.createElement(lP,{container:n,...r})}const Qr={Root:LP,Content:rv,Overlay:nv,Trigger:cP,Portal:BP,Title:fP};function ov({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,zIndex:a,classNames:l}){return Rk("(min-width: 1024px)")?O.jsxs(Bm,{open:o,onOpenChange:i,dismissible:!1,children:[e&&O.jsx(jm,{className:l?.trigger,children:e}),O.jsxs(pk,{children:[O.jsx(Lm,{style:{zIndex:a},className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm"}),O.jsxs(Vm,{style:{zIndex:a},className:on("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[991]",l?.desktopPopup),children:[t&&O.jsx(Wm,{className:on("-mt-1.5 mb-1 text-lg font-medium",l?.title),children:t}),n&&O.jsx(Fm,{className:on("mb-6 text-base text-gray-600",l?.description),children:n}),s&&O.jsx($m,{className:"absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",children:O.jsx(Zp,{})}),O.jsx("div",{children:r})]})]})]}):O.jsxs(Qr.Root,{open:o,onOpenChange:i,children:[e&&O.jsx(Qr.Trigger,{className:l?.trigger,children:e}),O.jsxs(Qr.Portal,{children:[O.jsx(Qr.Overlay,{style:{zIndex:a},className:on("fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",l?.backdrop)}),O.jsxs(Qr.Content,{style:{zIndex:a},className:on("h-fit fixed bottom-0 left-0 right-0 outline-none z-[991]",l?.mobilePopup),children:[O.jsx(Qr.Title,{className:"hidden"}),O.jsxs("div",{className:"p-4 bg-white rounded-t-xl",children:[O.jsx("div",{"aria-hidden":!0,className:"mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-4"}),O.jsx("div",{children:r})]})]})]})]})}function sv({checked:e,onChange:t}){const[n,r]=W.useState(!1),[o,s]=W.useState(!1);return O.jsxs("div",{children:[O.jsx(ov,{title:"用户协议",open:n,onOpenChange:r,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:O.jsx("iframe",{src:"https://help.gamm.ztgame.com/license-light.html",className:"w-full h-[70vh]"})}),O.jsx(ov,{title:"隐私政策",open:o,onOpenChange:s,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:O.jsx("iframe",{src:"https://help.gamm.ztgame.com/privacy-light.html",className:"w-full h-[70vh]"})}),O.jsx(wn,{name:"rememberLogin",children:O.jsxs(Tc,{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[O.jsx(Sc,{checked:e,className:"size-4 md:size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-[var(--jssdk-input-border-color)]",onCheckedChange:i=>t(!!i),children:O.jsx(Cc,{children:O.jsx(_c,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),O.jsx("span",{className:"ml-2",children:"我已详细阅读并同意"}),O.jsx(lr,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>r(!0),type:"button",children:"《用户协议》"}),O.jsx("span",{children:"及"}),O.jsx(lr,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>s(!0),type:"button",children:"《隐私政策》"})]})})]})}function WP(){const{gameId:e,onAccountLoginSuccess:t,onLoginSuccess:n,onLoginError:r}=Po(),o=W.useRef(null),[s,i]=W.useState(""),[a,l]=W.useState(""),[c,u]=W.useState(!1),[d,h]=W.useState(!0),{mutate:p,isPending:g}=ao({mutationFn:()=>nC({account:s,password:a}),onSuccess:v=>{const y={account:v.account,entity:v.channel_info.entity,token:v.channel_info.token,sign:v.channel_info.sign,accid:v.channel_info.entity.openid,extra_data:v.channel_info.extra_data,gaplaySign:v.channel_info.gaplaySign,realname:v.channel_info.realname};t?.(y),n?.(y)},onError:v=>{r?.(v)}});async function m(v){if(v.preventDefault(),!d){ar.warning("请先阅读并同意用户协议和隐私政策");return}if(!s||!a){ar.warning("请输入账号和密码");return}p()}return O.jsxs(ei,{ref:o,onSubmit:m,className:"space-y-5",children:[O.jsxs(wn,{name:"account",className:"flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-white px-3 gap-2 h-12",children:[O.jsx(aC,{className:"size-5 text-gray-400"}),O.jsx(cr,{className:"flex-1 outline-none rounded-full h-full pl-1",placeholder:"请输入巨人通行证账号",autoFocus:!0,onChange:v=>i(v.currentTarget.value)})]}),O.jsxs(wn,{name:"password",className:"flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-white px-3 gap-2 h-12",children:[O.jsx(cC,{className:"size-5 text-gray-400"}),O.jsx(cr,{type:c?"text":"password",autoComplete:"off",className:"flex-1 w-0 outline-none rounded-full h-full pl-1",placeholder:"请输入密码",value:a,onValueChange:v=>l(v)}),O.jsx(lr,{onClick:()=>u(!c),type:"button",children:c?O.jsx(JS,{className:"size-5 text-gray-400"}):O.jsx(KS,{className:"size-5 text-gray-400"})})]}),O.jsxs("section",{children:[O.jsx("div",{className:"flex justify-end mb-1",children:O.jsx(lr,{className:"text-[var(--jssdk-primary-color)]",as:"a",href:"https://my.ztgame.com/plugin/pwd",children:"忘记密码"})}),O.jsx(lr,{className:"h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",type:"submit",disabled:g,children:"登录"})]}),O.jsx(Nc,{}),O.jsx(sv,{checked:d,onChange:h})]})}var jP=function(e){return typeof e=="number"};function HP(e){var t=W.useRef(e);return t.current=e,t}var Wi={exports:{}},UP=Wi.exports,iv;function GP(){return iv||(iv=1,(function(e,t){(function(n,r){e.exports=r()})(UP,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",p="year",g="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(P){var C=["th","st","nd","rd"],_=P%100;return"["+P+(C[(_-20)%10]||C[_]||C[0])+"]"}},E=function(P,C,_){var D=String(P);return!D||D.length>=C?P:""+Array(C+1-D.length).join(_)+P},x={s:E,z:function(P){var C=-P.utcOffset(),_=Math.abs(C),D=Math.floor(_/60),k=_%60;return(C<=0?"+":"-")+E(D,2,"0")+":"+E(k,2,"0")},m:function P(C,_){if(C.date()<_.date())return-P(_,C);var D=12*(_.year()-C.year())+(_.month()-C.month()),k=C.clone().add(D,d),$=_-k<0,F=C.clone().add(D+($?-1:1),d);return+(-(D+(_-k)/($?k-F:F-k))||0)},a:function(P){return P<0?Math.ceil(P)||0:Math.floor(P)},p:function(P){return{M:d,y:p,w:u,d:c,D:g,h:l,m:a,s:i,ms:s,Q:h}[P]||String(P||"").toLowerCase().replace(/s$/,"")},u:function(P){return P===void 0}},w="en",T={};T[w]=b;var S="$isDayjsObject",I=function(P){return P instanceof N||!(!P||!P[S])},A=function P(C,_,D){var k;if(!C)return w;if(typeof C=="string"){var $=C.toLowerCase();T[$]&&(k=$),_&&(T[$]=_,k=$);var F=C.split("-");if(!k&&F.length>1)return P(F[0])}else{var j=C.name;T[j]=C,k=j}return!D&&k&&(w=k),k||!D&&w},L=function(P,C){if(I(P))return P.clone();var _=typeof C=="object"?C:{};return _.date=P,_.args=arguments,new N(_)},M=x;M.l=A,M.i=I,M.w=function(P,C){return L(P,{locale:C.$L,utc:C.$u,x:C.$x,$offset:C.$offset})};var N=(function(){function P(_){this.$L=A(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[S]=!0}var C=P.prototype;return C.parse=function(_){this.$d=(function(D){var k=D.date,$=D.utc;if(k===null)return new Date(NaN);if(M.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var F=k.match(v);if(F){var j=F[2]-1||0,V=(F[7]||"0").substring(0,3);return $?new Date(Date.UTC(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,V)):new Date(F[1],j,F[3]||1,F[4]||0,F[5]||0,F[6]||0,V)}}return new Date(k)})(_),this.init()},C.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},C.$utils=function(){return M},C.isValid=function(){return this.$d.toString()!==m},C.isSame=function(_,D){var k=L(_);return this.startOf(D)<=k&&k<=this.endOf(D)},C.isAfter=function(_,D){return L(_)<this.startOf(D)},C.isBefore=function(_,D){return this.endOf(D)<L(_)},C.$g=function(_,D,k){return M.u(_)?this[D]:this.set(k,_)},C.unix=function(){return Math.floor(this.valueOf()/1e3)},C.valueOf=function(){return this.$d.getTime()},C.startOf=function(_,D){var k=this,$=!!M.u(D)||D,F=M.p(_),j=function(re,ne){var ee=M.w(k.$u?Date.UTC(k.$y,ne,re):new Date(k.$y,ne,re),k);return $?ee:ee.endOf(c)},V=function(re,ne){return M.w(k.toDate()[re].apply(k.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(ne)),k)},Y=this.$W,q=this.$M,X=this.$D,U="set"+(this.$u?"UTC":"");switch(F){case p:return $?j(1,0):j(31,11);case d:return $?j(1,q):j(0,q+1);case u:var H=this.$locale().weekStart||0,Z=(Y<H?Y+7:Y)-H;return j($?X-Z:X+(6-Z),q);case c:case g:return V(U+"Hours",0);case l:return V(U+"Minutes",1);case a:return V(U+"Seconds",2);case i:return V(U+"Milliseconds",3);default:return this.clone()}},C.endOf=function(_){return this.startOf(_,!1)},C.$set=function(_,D){var k,$=M.p(_),F="set"+(this.$u?"UTC":""),j=(k={},k[c]=F+"Date",k[g]=F+"Date",k[d]=F+"Month",k[p]=F+"FullYear",k[l]=F+"Hours",k[a]=F+"Minutes",k[i]=F+"Seconds",k[s]=F+"Milliseconds",k)[$],V=$===c?this.$D+(D-this.$W):D;if($===d||$===p){var Y=this.clone().set(g,1);Y.$d[j](V),Y.init(),this.$d=Y.set(g,Math.min(this.$D,Y.daysInMonth())).$d}else j&&this.$d[j](V);return this.init(),this},C.set=function(_,D){return this.clone().$set(_,D)},C.get=function(_){return this[M.p(_)]()},C.add=function(_,D){var k,$=this;_=Number(_);var F=M.p(D),j=function(q){var X=L($);return M.w(X.date(X.date()+Math.round(q*_)),$)};if(F===d)return this.set(d,this.$M+_);if(F===p)return this.set(p,this.$y+_);if(F===c)return j(1);if(F===u)return j(7);var V=(k={},k[a]=r,k[l]=o,k[i]=n,k)[F]||1,Y=this.$d.getTime()+_*V;return M.w(Y,this)},C.subtract=function(_,D){return this.add(-1*_,D)},C.format=function(_){var D=this,k=this.$locale();if(!this.isValid())return k.invalidDate||m;var $=_||"YYYY-MM-DDTHH:mm:ssZ",F=M.z(this),j=this.$H,V=this.$m,Y=this.$M,q=k.weekdays,X=k.months,U=k.meridiem,H=function(ne,ee,le,K){return ne&&(ne[ee]||ne(D,$))||le[ee].slice(0,K)},Z=function(ne){return M.s(j%12||12,ne,"0")},re=U||function(ne,ee,le){var K=ne<12?"AM":"PM";return le?K.toLowerCase():K};return $.replace(y,(function(ne,ee){return ee||(function(le){switch(le){case"YY":return String(D.$y).slice(-2);case"YYYY":return M.s(D.$y,4,"0");case"M":return Y+1;case"MM":return M.s(Y+1,2,"0");case"MMM":return H(k.monthsShort,Y,X,3);case"MMMM":return H(X,Y);case"D":return D.$D;case"DD":return M.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return H(k.weekdaysMin,D.$W,q,2);case"ddd":return H(k.weekdaysShort,D.$W,q,3);case"dddd":return q[D.$W];case"H":return String(j);case"HH":return M.s(j,2,"0");case"h":return Z(1);case"hh":return Z(2);case"a":return re(j,V,!0);case"A":return re(j,V,!1);case"m":return String(V);case"mm":return M.s(V,2,"0");case"s":return String(D.$s);case"ss":return M.s(D.$s,2,"0");case"SSS":return M.s(D.$ms,3,"0");case"Z":return F}return null})(ne)||F.replace(":","")}))},C.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},C.diff=function(_,D,k){var $,F=this,j=M.p(D),V=L(_),Y=(V.utcOffset()-this.utcOffset())*r,q=this-V,X=function(){return M.m(F,V)};switch(j){case p:$=X()/12;break;case d:$=X();break;case h:$=X()/3;break;case u:$=(q-Y)/6048e5;break;case c:$=(q-Y)/864e5;break;case l:$=q/o;break;case a:$=q/r;break;case i:$=q/n;break;default:$=q}return k?$:M.a($)},C.daysInMonth=function(){return this.endOf(d).$D},C.$locale=function(){return T[this.$L]},C.locale=function(_,D){if(!_)return this.$L;var k=this.clone(),$=A(_,D,!0);return $&&(k.$L=$),k},C.clone=function(){return M.w(this.$d,this)},C.toDate=function(){return new Date(this.valueOf())},C.toJSON=function(){return this.isValid()?this.toISOString():null},C.toISOString=function(){return this.$d.toISOString()},C.toString=function(){return this.$d.toUTCString()},P})(),R=N.prototype;return L.prototype=R,[["$ms",s],["$s",i],["$m",a],["$H",l],["$W",c],["$M",d],["$y",p],["$D",g]].forEach((function(P){R[P[1]]=function(C){return this.$g(C,P[0],P[1])}})),L.extend=function(P,C){return P.$i||(P(C,N,L),P.$i=!0),L},L.locale=A,L.isDayjs=I,L.unix=function(P){return L(1e3*P)},L.en=T[w],L.Ls=T,L.p={},L}))})(Wi)),Wi.exports}var zP=GP();const YP=bw(zP);var Fl=function(e){if(!e)return 0;var t=YP(e).valueOf()-Date.now();return t<0?0:t},ZP=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},qP=function(e){e===void 0&&(e={});var t=e||{},n=t.leftTime,r=t.targetDate,o=t.interval,s=o===void 0?1e3:o,i=t.onEnd,a=W.useMemo(function(){return jP(n)&&n>0?Date.now()+n:void 0},[n]),l="leftTime"in e?a:r,c=ly(W.useState(function(){return Fl(l)}),2),u=c[0],d=c[1],h=HP(i);W.useEffect(function(){if(!l){d(0);return}d(Fl(l));var g=setInterval(function(){var m,v=Fl(l);d(v),v===0&&(clearInterval(g),(m=h.current)===null||m===void 0||m.call(h))},s);return function(){return clearInterval(g)}},[l,s]);var p=W.useMemo(function(){return ZP(u)},[u]);return[u,p]},De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const s={};for(const i of o)s[i]=i;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(const a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(const i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(De||(De={}));var av;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(av||(av={}));const ae=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Zn=e=>{switch(typeof e){case"undefined":return ae.undefined;case"string":return ae.string;case"number":return Number.isNaN(e)?ae.nan:ae.number;case"boolean":return ae.boolean;case"function":return ae.function;case"bigint":return ae.bigint;case"symbol":return ae.symbol;case"object":return Array.isArray(e)?ae.array:e===null?ae.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?ae.promise:typeof Map<"u"&&e instanceof Map?ae.map:typeof Set<"u"&&e instanceof Set?ae.set:typeof Date<"u"&&e instanceof Date?ae.date:ae.object;default:return ae.unknown}},Q=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class kn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},o=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return o(this),r}static assert(t){if(!(t instanceof kn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];n[s]=n[s]||[],n[s].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}kn.create=e=>new kn(e);const Vl=(e,t)=>{let n;switch(e.code){case Q.invalid_type:e.received===ae.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case Q.unrecognized_keys:n=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case Q.invalid_union:n="Invalid input";break;case Q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case Q.invalid_enum_value:n=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case Q.invalid_arguments:n="Invalid function arguments";break;case Q.invalid_return_type:n="Invalid function return type";break;case Q.invalid_date:n="Invalid date";break;case Q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Q.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Q.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Q.custom:n="Invalid input";break;case Q.invalid_intersection_types:n="Intersection results could not be merged";break;case Q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Q.not_finite:n="Number must be finite";break;default:n=t.defaultError,De.assertNever(e)}return{message:n}};let XP=Vl;function KP(){return XP}const JP=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}};function se(e,t){const n=KP(),r=JP({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Vl?void 0:Vl].filter(o=>!!o)});e.common.issues.push(r)}class At{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const o of n){if(o.status==="aborted")return Ee;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const s=await o.key,i=await o.value;r.push({key:s,value:i})}return At.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Ee;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:t.value,value:r}}}const Ee=Object.freeze({status:"aborted"}),Jo=e=>({status:"dirty",value:e}),Wt=e=>({status:"valid",value:e}),cv=e=>e.status==="aborted",lv=e=>e.status==="dirty",eo=e=>e.status==="valid",ji=e=>typeof Promise<"u"&&e instanceof Promise;var ce;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ce||(ce={}));class qn{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uv=(e,t)=>{if(eo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new kn(e.common.issues);return this._error=n,this._error}}};function Pe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{const{message:l}=e;return i.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:o}}class Ne{get description(){return this._def.description}_getType(t){return Zn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Zn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new At,ctx:{common:t.parent.common,data:t.data,parsedType:Zn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ji(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zn(t)},o=this._parseSync({data:t,path:r.path,parent:r});return uv(r,o)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zn(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return eo(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>eo(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Zn(t)},o=this._parse({data:t,path:r.path,parent:r}),s=await(ji(o)?o:Promise.resolve(o));return uv(r,s)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{const i=t(o),a=()=>s.addIssue({code:Q.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new ro({schema:this,typeName:xe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Jn.create(this,this._def)}nullable(){return oo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return un.create(this)}promise(){return zi.create(this,this._def)}or(t){return Ui.create([this,t],this._def)}and(t){return Gi.create(this,t,this._def)}transform(t){return new ro({...Pe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new jl({...Pe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new E2({typeName:xe.ZodBranded,type:this,...Pe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Hl({...Pe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Ul.create(this,t)}readonly(){return Gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const QP=/^c[^\s-]{8,}$/i,e2=/^[0-9a-z]+$/,t2=/^[0-9A-HJKMNP-TV-Z]{26}$/i,n2=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,r2=/^[a-z0-9_-]{21}$/i,o2=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,s2=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,i2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,a2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Bl;const c2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,l2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,u2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,d2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,f2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,p2=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dv="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",h2=new RegExp(`^${dv}$`);function fv(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function m2(e){return new RegExp(`^${fv(e)}$`)}function g2(e){let t=`${dv}T${fv(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function v2(e,t){return!!((t==="v4"||!t)&&c2.test(e)||(t==="v6"||!t)&&u2.test(e))}function y2(e,t){if(!o2.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function b2(e,t){return!!((t==="v4"||!t)&&l2.test(e)||(t==="v6"||!t)&&d2.test(e))}class Xn extends Ne{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==ae.string){const s=this._getOrReturnCtx(t);return se(s,{code:Q.invalid_type,expected:ae.string,received:s.parsedType}),Ee}const r=new At;let o;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?se(o,{code:Q.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&se(o,{code:Q.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")i2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"email",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")Bl||(Bl=new RegExp(a2,"u")),Bl.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"emoji",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")n2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"uuid",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")r2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"nanoid",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")QP.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")e2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cuid2",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")t2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ulid",code:Q.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),se(o,{validation:"url",code:Q.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"regex",code:Q.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?g2(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?h2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?m2(s).test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{code:Q.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?s2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"duration",code:Q.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?v2(t.data,s.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"ip",code:Q.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?y2(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"jwt",code:Q.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?b2(t.data,s.version)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"cidr",code:Q.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?f2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64",code:Q.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?p2.test(t.data)||(o=this._getOrReturnCtx(t,o),se(o,{validation:"base64url",code:Q.invalid_string,message:s.message}),r.dirty()):De.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:Q.invalid_string,...ce.errToObj(r)})}_addCheck(t){return new Xn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ce.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ce.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ce.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ce.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ce.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ce.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ce.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ce.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ce.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ce.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ce.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ce.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ce.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ce.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ce.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ce.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ce.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...ce.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ce.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ce.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ce.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ce.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ce.errToObj(n)})}nonempty(t){return this.min(1,ce.errToObj(t))}trim(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Xn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xn.create=e=>new Xn({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Pe(e)});function w2(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}class Qo extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==ae.number){const s=this._getOrReturnCtx(t);return se(s,{code:Q.invalid_type,expected:ae.number,received:s.parsedType}),Ee}let r;const o=new At;for(const s of this._def.checks)s.kind==="int"?De.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:Q.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?w2(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),se(r,{code:Q.not_finite,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new Qo({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new Qo({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ce.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ce.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ce.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ce.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Qo.create=e=>new Qo({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Pe(e)});class es extends Ne{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==ae.bigint)return this._getInvalidInput(t);let r;const o=new At;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),se(r,{code:Q.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):De.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:ae.bigint,received:n.parsedType}),Ee}gte(t,n){return this.setLimit("min",t,!0,ce.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ce.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ce.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ce.toString(n))}setLimit(t,n,r,o){return new es({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ce.toString(o)}]})}_addCheck(t){return new es({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ce.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ce.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ce.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}es.create=e=>new es({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Pe(e)});class pv extends Ne{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==ae.boolean){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.boolean,received:r.parsedType}),Ee}return Wt(t.data)}}pv.create=e=>new pv({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Pe(e)});class Hi extends Ne{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==ae.date){const s=this._getOrReturnCtx(t);return se(s,{code:Q.invalid_type,expected:ae.date,received:s.parsedType}),Ee}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return se(s,{code:Q.invalid_date}),Ee}const r=new At;let o;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:Q.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),se(o,{code:Q.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):De.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Hi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ce.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ce.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Hi.create=e=>new Hi({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Pe(e)});class hv extends Ne{_parse(t){if(this._getType(t)!==ae.symbol){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.symbol,received:r.parsedType}),Ee}return Wt(t.data)}}hv.create=e=>new hv({typeName:xe.ZodSymbol,...Pe(e)});class mv extends Ne{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.undefined,received:r.parsedType}),Ee}return Wt(t.data)}}mv.create=e=>new mv({typeName:xe.ZodUndefined,...Pe(e)});class gv extends Ne{_parse(t){if(this._getType(t)!==ae.null){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.null,received:r.parsedType}),Ee}return Wt(t.data)}}gv.create=e=>new gv({typeName:xe.ZodNull,...Pe(e)});class vv extends Ne{constructor(){super(...arguments),this._any=!0}_parse(t){return Wt(t.data)}}vv.create=e=>new vv({typeName:xe.ZodAny,...Pe(e)});class yv extends Ne{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Wt(t.data)}}yv.create=e=>new yv({typeName:xe.ZodUnknown,...Pe(e)});class Kn extends Ne{_parse(t){const n=this._getOrReturnCtx(t);return se(n,{code:Q.invalid_type,expected:ae.never,received:n.parsedType}),Ee}}Kn.create=e=>new Kn({typeName:xe.ZodNever,...Pe(e)});class bv extends Ne{_parse(t){if(this._getType(t)!==ae.undefined){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.void,received:r.parsedType}),Ee}return Wt(t.data)}}bv.create=e=>new bv({typeName:xe.ZodVoid,...Pe(e)});class un extends Ne{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==ae.array)return se(n,{code:Q.invalid_type,expected:ae.array,received:n.parsedType}),Ee;if(o.exactLength!==null){const i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(se(n,{code:i?Q.too_big:Q.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(se(n,{code:Q.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(se(n,{code:Q.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new qn(n,i,n.path,a)))).then(i=>At.mergeArray(r,i));const s=[...n.data].map((i,a)=>o.type._parseSync(new qn(n,i,n.path,a)));return At.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new un({...this._def,minLength:{value:t,message:ce.toString(n)}})}max(t,n){return new un({...this._def,maxLength:{value:t,message:ce.toString(n)}})}length(t,n){return new un({...this._def,exactLength:{value:t,message:ce.toString(n)}})}nonempty(t){return this.min(1,t)}}un.create=(e,t)=>new un({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Pe(t)});function to(e){if(e instanceof st){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Jn.create(to(r))}return new st({...e._def,shape:()=>t})}else return e instanceof un?new un({...e._def,type:to(e.element)}):e instanceof Jn?Jn.create(to(e.unwrap())):e instanceof oo?oo.create(to(e.unwrap())):e instanceof br?br.create(e.items.map(t=>to(t))):e}class st extends Ne{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=De.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==ae.object){const c=this._getOrReturnCtx(t);return se(c,{code:Q.invalid_type,expected:ae.object,received:c.parsedType}),Ee}const{status:r,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const c in o.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=s[c],d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new qn(o,d,o.path,c)),alwaysSet:c in o.data})}if(this._def.catchall instanceof Kn){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(c==="strict")a.length>0&&(se(o,{code:Q.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new qn(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key,h=await u.value;c.push({key:d,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>At.mergeObjectSync(r,c)):At.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return ce.errToObj,new st({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:ce.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new st({...this._def,unknownKeys:"strip"})}passthrough(){return new st({...this._def,unknownKeys:"passthrough"})}extend(t){return new st({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new st({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:xe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new st({...this._def,catchall:t})}pick(t){const n={};for(const r of De.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new st({...this._def,shape:()=>n})}omit(t){const n={};for(const r of De.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new st({...this._def,shape:()=>n})}deepPartial(){return to(this)}partial(t){const n={};for(const r of De.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}return new st({...this._def,shape:()=>n})}required(t){const n={};for(const r of De.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Jn;)s=s._def.innerType;n[r]=s}return new st({...this._def,shape:()=>n})}keyof(){return Sv(De.objectKeys(this.shape))}}st.create=(e,t)=>new st({shape:()=>e,unknownKeys:"strip",catchall:Kn.create(),typeName:xe.ZodObject,...Pe(t)}),st.strictCreate=(e,t)=>new st({shape:()=>e,unknownKeys:"strict",catchall:Kn.create(),typeName:xe.ZodObject,...Pe(t)}),st.lazycreate=(e,t)=>new st({shape:e,unknownKeys:"strip",catchall:Kn.create(),typeName:xe.ZodObject,...Pe(t)});class Ui extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=s.map(a=>new kn(a.ctx.common.issues));return se(n,{code:Q.invalid_union,unionErrors:i}),Ee}if(n.common.async)return Promise.all(r.map(async s=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(l=>new kn(l));return se(n,{code:Q.invalid_union,unionErrors:a}),Ee}}get options(){return this._def.options}}Ui.create=(e,t)=>new Ui({options:e,typeName:xe.ZodUnion,...Pe(t)});function Wl(e,t){const n=Zn(e),r=Zn(t);if(e===t)return{valid:!0,data:e};if(n===ae.object&&r===ae.object){const o=De.objectKeys(t),s=De.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(const a of s){const l=Wl(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===ae.array&&r===ae.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],l=Wl(i,a);if(!l.valid)return{valid:!1};o.push(l.data)}return{valid:!0,data:o}}else return n===ae.date&&r===ae.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Gi extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(s,i)=>{if(cv(s)||cv(i))return Ee;const a=Wl(s.value,i.value);return a.valid?((lv(s)||lv(i))&&n.dirty(),{status:n.value,value:a.data}):(se(r,{code:Q.invalid_intersection_types}),Ee)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Gi.create=(e,t,n)=>new Gi({left:e,right:t,typeName:xe.ZodIntersection,...Pe(n)});class br extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.array)return se(r,{code:Q.invalid_type,expected:ae.array,received:r.parsedType}),Ee;if(r.data.length<this._def.items.length)return se(r,{code:Q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ee;!this._def.rest&&r.data.length>this._def.items.length&&(se(r,{code:Q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new qn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>At.mergeArray(n,i)):At.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new br({...this._def,rest:t})}}br.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new br({items:e,typeName:xe.ZodTuple,rest:null,...Pe(t)})};class wv extends Ne{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.map)return se(r,{code:Q.invalid_type,expected:ae.map,received:r.parsedType}),Ee;const o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:o._parse(new qn(r,a,r.path,[c,"key"])),value:s._parse(new qn(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ee;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ee;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}wv.create=(e,t,n)=>new wv({valueType:t,keyType:e,typeName:xe.ZodMap,...Pe(n)});class ts extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==ae.set)return se(r,{code:Q.invalid_type,expected:ae.set,received:r.parsedType}),Ee;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(se(r,{code:Q.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(se(r,{code:Q.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const s=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ee;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new qn(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new ts({...this._def,minSize:{value:t,message:ce.toString(n)}})}max(t,n){return new ts({...this._def,maxSize:{value:t,message:ce.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ts.create=(e,t)=>new ts({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Pe(t)});class Ev extends Ne{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Ev.create=(e,t)=>new Ev({getter:e,typeName:xe.ZodLazy,...Pe(t)});class xv extends Ne{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return se(n,{received:n.data,code:Q.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}}xv.create=(e,t)=>new xv({value:e,typeName:xe.ZodLiteral,...Pe(t)});function Sv(e,t){return new no({values:e,typeName:xe.ZodEnum,...Pe(t)})}class no extends Ne{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{expected:De.joinValues(r),received:n.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return se(n,{received:n.data,code:Q.invalid_enum_value,options:r}),Ee}return Wt(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return no.create(t,{...this._def,...n})}exclude(t,n=this._def){return no.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}no.create=Sv;class Cv extends Ne{_parse(t){const n=De.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==ae.string&&r.parsedType!==ae.number){const o=De.objectValues(n);return se(r,{expected:De.joinValues(o),received:r.parsedType,code:Q.invalid_type}),Ee}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=De.objectValues(n);return se(r,{received:r.data,code:Q.invalid_enum_value,options:o}),Ee}return Wt(t.data)}get enum(){return this._def.values}}Cv.create=(e,t)=>new Cv({values:e,typeName:xe.ZodNativeEnum,...Pe(t)});class zi extends Ne{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==ae.promise&&n.common.async===!1)return se(n,{code:Q.invalid_type,expected:ae.promise,received:n.parsedType}),Ee;const r=n.parsedType===ae.promise?n.data:Promise.resolve(n.data);return Wt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}zi.create=(e,t)=>new zi({type:e,typeName:xe.ZodPromise,...Pe(t)});class ro extends Ne{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{se(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){const i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Ee;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Ee:l.status==="dirty"||n.value==="dirty"?Jo(l.value):l});{if(n.value==="aborted")return Ee;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Ee:a.status==="dirty"||n.value==="dirty"?Jo(a.value):a}}if(o.type==="refinement"){const i=a=>{const l=o.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ee:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ee:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!eo(i))return Ee;const a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>eo(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Ee);De.assertNever(o)}}ro.create=(e,t,n)=>new ro({schema:e,typeName:xe.ZodEffects,effect:t,...Pe(n)}),ro.createWithPreprocess=(e,t,n)=>new ro({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Pe(n)});class Jn extends Ne{_parse(t){return this._getType(t)===ae.undefined?Wt(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Jn.create=(e,t)=>new Jn({innerType:e,typeName:xe.ZodOptional,...Pe(t)});class oo extends Ne{_parse(t){return this._getType(t)===ae.null?Wt(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oo.create=(e,t)=>new oo({innerType:e,typeName:xe.ZodNullable,...Pe(t)});class jl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===ae.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}jl.create=(e,t)=>new jl({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Pe(t)});class Hl extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ji(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new kn(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new kn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Hl.create=(e,t)=>new Hl({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Pe(t)});class Tv extends Ne{_parse(t){if(this._getType(t)!==ae.nan){const r=this._getOrReturnCtx(t);return se(r,{code:Q.invalid_type,expected:ae.nan,received:r.parsedType}),Ee}return{status:"valid",value:t.data}}}Tv.create=e=>new Tv({typeName:xe.ZodNaN,...Pe(e)});class E2 extends Ne{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Ul extends Ne{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ee:s.status==="dirty"?(n.dirty(),Jo(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ee:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Ul({in:t,out:n,typeName:xe.ZodPipeline})}}class Gl extends Ne{_parse(t){const n=this._def.innerType._parse(t),r=o=>(eo(o)&&(o.value=Object.freeze(o.value)),o);return ji(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Gl.create=(e,t)=>new Gl({innerType:e,typeName:xe.ZodReadonly,...Pe(t)});var xe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(xe||(xe={}));const Ov=Xn.create;Kn.create,un.create;const x2=st.create;Ui.create,Gi.create,br.create,no.create,zi.create,Jn.create,oo.create;const S2={item:"_item_1ddxp_1"};function C2({value:e,onValueChange:t}){const[n,r]=W.useState(!1);return O.jsx(Ek,{rootProps:{open:n,onOpenChange:r},zIndex:999,classNames:{popup:"w-80 text-gray-500 border border-gray-300 bg-white rounded-2xl"},content:O.jsx("ul",{className:"max-h-[60vh] overflow-y-auto ",children:Kx.map(({label:o,value:s})=>O.jsxs("li",{...s===e?{"data-selected":!0}:{},className:on(S2.item),onClick:()=>{t?.(s),r(!1)},children:[s===e&&O.jsx(_c,{className:"size-3"}),O.jsxs("div",{className:"col-start-2 flex justify-between",children:[O.jsx("span",{children:s}),O.jsx("span",{children:o})]})]},s+o))}),children:O.jsxs("div",{className:"flex items-center justify-center w-16 border-r border-gray-300 cursor-pointer",children:[O.jsx("span",{children:e}),O.jsx(XS,{className:"size-4"})]})})}const kv=x2({phoneNumber:Ov().regex(/^[1-9]\d{10}$/,"请输入正确的手机号"),verificationCode:Ov().length(4,"请输入 6 位验证码")});function Rv(){const{mobileLoginConfig:e={},gameId:t,onPhoneLoginSuccess:n,onLoginSuccess:r,onLoginError:o}=Po(),[s,i]=W.useState("86"),[a,l]=W.useState(""),c=W.useRef(null),[u,d]=W.useState(""),[h,p]=W.useState(),[g,m]=W.useState(!0),[v,y]=W.useState({}),[b]=qP({leftTime:h?h*1e3:void 0,interval:1e3,onEnd(){p(void 0)}}),{mutate:E,isPending:x}=ao({mutationFn:()=>rC({mobile:a,countryCode:s,type:e.smsType}),onSuccess:A=>{p(A.lock_time),ar.success("验证码已发送,请注意查收")}}),{mutate:w,isPending:T}=ao({mutationFn:async()=>{const A=await oC({mobile:a,countryCode:s,captcha:u});p(void 0);const L={account:A.account,entity:A.channel_info.entity,token:A.channel_info.token,sign:A.channel_info.sign,accid:A.channel_info.entity.openid,extra_data:A.channel_info.extra_data,gaplaySign:A.channel_info.gaplaySign};return n&&await n(L),r?.(L),A},onError:A=>{o?.(A)}});function S(){if(!g){ar.warning("请先阅读并同意用户协议和隐私政策");return}const A=new FormData(c.current),L=kv.pick({phoneNumber:!0}).safeParse(Object.fromEntries(A));if(!L.success){y(L.error.flatten().fieldErrors);return}E()}async function I(A){if(A.preventDefault(),!g)return ar.warning("请先阅读并同意用户协议和隐私政策"),{errors:{}};const L=new FormData(A.currentTarget),M=kv.safeParse(Object.fromEntries(L));return M.success?(w(),{errors:{}}):{errors:M.error.flatten().fieldErrors}}return O.jsxs(ei,{ref:c,errors:v,onSubmit:async A=>{const L=await I(A);y(L.errors)},className:"space-y-5",children:[O.jsxs(wn,{name:"phoneNumber",children:[O.jsxs("div",{className:"flex items-center border border-[var(--jssdk-input-border-color)] data-[focused]:border-[var(--jssdk-primary-color)] rounded-full bg-white px-3 gap-2 h-12",children:[O.jsx(C2,{value:s,onValueChange:i}),O.jsx(cr,{className:"flex-1 outline-none rounded-full h-full pl-1",placeholder:"请输入手机号码",autoFocus:!0,type:"tel",onChange:A=>l(A.currentTarget.value)})]}),O.jsx(Oc,{className:"mt-1 text-sm text-red-800"})]}),O.jsxs(wn,{name:"verificationCode",children:[O.jsxs("div",{className:"flex items-center border border-[var(--jssdk-input-border-color)] data-[focused]:border-[var(--jssdk-primary-color)] rounded-full bg-white px-3 gap-2 h-12",children:[O.jsx(cr,{className:"flex-1 w-0 outline-none rounded-full h-full pl-1",placeholder:"请输入验证码",value:u,type:"number",onValueChange:A=>d(A)}),O.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>S(),disabled:!!h||x,children:x?"发送中...":h?`${Math.round(b/1e3)}s 后重新获取`:"获取验证码"})]}),O.jsx(Oc,{className:"mt-1 text-sm text-red-800"})]}),O.jsx(lr,{className:wt("my-5 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",e.buttonClassName),disabled:T,type:"submit",children:T?"登录中...":e.buttonText||"登录"}),O.jsx(Nc,{}),O.jsx(sv,{checked:g,onChange:m})]})}function Pv({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,classNames:a}){return O.jsxs(_S,{open:o,onOpenChange:i,disablePointerDismissal:!1,children:[e&&O.jsx(Sp,{className:a?.trigger,children:e}),O.jsxs(Ep,{children:[O.jsx(vp,{className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm"}),O.jsxs(wp,{className:wt("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[991]",a?.popup),children:[t&&O.jsx(xp,{className:wt("-mt-1.5 mb-1 text-lg font-medium",a?.title),children:t}),n&&O.jsx(bp,{className:wt("mb-6 text-base text-gray-600",a?.description),children:n}),s&&O.jsx(yp,{className:wt("absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",a?.close),children:O.jsx(Zp,{})}),O.jsx("div",{children:r})]})]})]})}function T2(e){return O.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[O.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-current"}),O.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-current"})]})}function O2({children:e,title:t,description:n,content:r,classNames:o={}}){return O.jsxs(FS,{children:[O.jsx(Lp,{className:o.trigger,delay:0,children:e}),O.jsxs($p,{children:[O.jsx(Hp,{className:wt("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",o.backdrop)}),O.jsx(Vp,{sideOffset:8,className:o.positioner,children:O.jsxs(Wp,{className:wt("origin-[var(--transform-origin)] bg-white p-1 rounded shadow-sm text-gray-900 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",o.popup),children:[O.jsx(jp,{className:wt("data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",o.arrow),children:O.jsx(T2,{})}),t&&O.jsx(Up,{className:"text-base font-medium",children:t}),n&&O.jsx(Gp,{className:"text-base text-gray-600",children:n}),r]})})]})]})}const wr={uidGet:"_uidGet_os9yc_1",mailCodeGet:"_mailCodeGet_os9yc_5",uidGetPopup:"_uidGetPopup_os9yc_79",uidGetArrow:"_uidGetArrow_os9yc_83",inputControl:"_inputControl_os9yc_86",form:"_form_os9yc_89"};function Iv({onUidLoginSuccess:e,customSendUidMailCaptcha:t,customValidateUidMailCaptcha:n}={}){const{gameId:r,autoLoginConfig:o,sceneId:s,onUidLoginSuccess:i,onLoginSuccess:a,onLoginError:l,uidLoginConfig:c={}}=Po(),u=W.useRef(null),[d,h]=W.useState(""),[p,g]=W.useState(""),[m,v]=W.useState(!0),[y,b]=W.useState(!1),[E,{startCountdown:x,resetCountdown:w}]=Ok({countStart:120,intervalMs:1e3}),{mutate:T}=ao({mutationFn:()=>{const L=o.enabled?o.days:void 0;return n?n({gameId:r,captcha:p,expireInDays:m?L:void 0,accountId:d,sceneId:s}):tC({game_id:r,charid:d,captcha_type:"login",captcha:p,expires_day:m?L:void 0,scene_id:s,...c.uidMailExtraParams})},onSuccess:L=>{i?.(L),e?.(L),a?.(L)},onError:L=>{l?.(L)}}),{mutate:S,isPending:I}=ao({mutationFn:()=>t?t({gameId:r,accountId:d}):eC({game_id:r,captcha_type:"login",charid:d,scene_id:s,...c.uidMailExtraParams}),onSuccess:L=>{x(),ar.success(L.error)}});async function A(L){L.preventDefault(),T()}return W.useEffect(()=>{p.length===6&&d&&setTimeout(()=>{u.current?.requestSubmit()},0)},[p,d]),W.useEffect(()=>{E===0&&w(),b(E!==120)},[E,w]),O.jsxs(ei,{ref:u,onSubmit:A,className:wt("space-y-6",wr.form),autoComplete:"off",children:[["5199","5012"].includes(r)?O.jsx("p",{className:"text-center text-xs text-white/80",children:"请点击游戏右上角“设置”查看账号ID"}):null,O.jsxs(wn,{name:"accountId",className:wt("flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-[var(--jssdk-input-bg-color)] px-3 gap-2 h-12",wr.inputControl),children:[O.jsx(O2,{content:O.jsx("div",{className:wt(wr.uidGet,c.uidGetterImageClassName)}),classNames:{backdrop:"z-[992]",positioner:"z-[992]",popup:wt("rounded-2xl shadow-lg",wr.uidGetPopup),arrow:wr.uidGetArrow,trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2"},children:O.jsx("span",{children:"!"})}),O.jsx(cr,{className:"flex-1 outline-none rounded-full h-full pl-1 bg-inherit",placeholder:"请输入账号 ID",autoFocus:!0,type:"tel",onChange:L=>h(L.currentTarget.value)})]}),O.jsxs(wn,{name:"verificationCode",className:wt("flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-[var(--jssdk-input-bg-color)] px-3 gap-2 h-12",wr.inputControl),children:[O.jsx(Pv,{trigger:O.jsx("span",{children:"!"}),classNames:{trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2",popup:"w-full lg:w-4/5 lg:max-w-5xl p-0 bg-transparent"},children:O.jsx("div",{className:wt(wr.mailCodeGet,c.mailCodeGetterImageClassName)})}),O.jsx(cr,{className:"flex-1 w-0 outline-none rounded-full h-full pl-1 bg-inherit",placeholder:"请输入口令码",value:p,type:"tel",onValueChange:L=>g(L)}),O.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-[var(--jssdk-primary-foregroud-color)] inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onMouseDown:L=>{L.preventDefault()},onClick:()=>S(),disabled:y||I||!d,children:y?`${E}s`:I?"发送中...":"发送口令码"})]}),o.enabled?O.jsx(wn,{name:"rememberLogin",children:O.jsxs(Tc,{className:"flex items-center gap-2 text-gray-500",onMouseDown:L=>{L.preventDefault()},children:[O.jsx(Sc,{checked:m,className:"size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-gray-300",onCheckedChange:L=>v(!!L),children:O.jsx(Cc,{children:O.jsx(_c,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),O.jsxs("div",{children:[O.jsx("span",{className:"mr-0.5",children:o.days}),O.jsx("span",{children:"天内自动登录"})]})]})}):null,["5199","5012"].includes(r)?O.jsx("div",{className:"text-[#f59e9e] text-center text-[11px]",children:"请点击游戏内“邮件”查收口令码,未收到请重启游戏再次查看"}):null,O.jsx(Nc,{})]})}const _v={modal:"_modal_1pbx2_2",close:"_close_1pbx2_8"};function k2({open:e,onOpenChange:t}){const{gameId:n,loginTypes:r,currentLoginType:o,closeable:s,isShowGiantLogo:i}=Po(),a=Qf({loginTypes:r,gameId:n}),l=ep({loginTypes:r,gameId:n}),c=Jf({loginTypes:r,gameId:n});return O.jsxs(Pv,{open:e,onOpenChange:t,classNames:{popup:wt("w-[400px] p-5",_v.modal),close:_v.close},showCloseIcon:s,children:[i&&!Zx(n)&&O.jsx("section",{className:"flex items-center justify-center mb-6",children:O.jsx("img",{src:"https://h5.sdk.mobileztgame.com/dist/bg_logo.png",className:"aspect-[240/85] w-32"})}),O.jsxs("section",{children:[o===He.MOBILE&&l&&O.jsx(Rv,{}),o===He.ROLE_ID&&a&&O.jsx(Iv,{}),o===He.GIANT&&c&&O.jsx(WP,{})]})]})}const R2=new sy;function zl({open:e,onOpenChange:t,sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:l=!0,mountToaster:c=!0,toastConfigs:u,...d}){return O.jsxs(W.StrictMode,{children:[O.jsx(cy,{client:R2,children:O.jsx(rp,{value:{sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:l,...d},children:O.jsx(k2,{open:e,onOpenChange:t})})}),c&&O.jsx(Gx,{toastConfigs:u})]})}function Nv({loginTypes:e,defaultLoginType:t,gameId:n,onLoginSuccess:r,onLoginError:o}){if(document.querySelector(".login-sdk-container"))return console.warn("Login component is already active. Multiple instances are not allowed."),{close:()=>{}};const s=document.createElement("div");s.className="login-sdk-container",document.body.appendChild(s);const i=Mv.createRoot(s),a=()=>{setTimeout(()=>{i.unmount(),s.remove()},200)},l=()=>{i.render(O.jsx(zl,{gameId:n,loginTypes:e,defaultLoginType:t,open:!1,onOpenChange:c,onLoginSuccess:r,onLoginError:o})),a()},c=u=>{u||l()};return i.render(O.jsx(zl,{gameId:n,loginTypes:e,defaultLoginType:t,open:!0,onOpenChange:c,onLoginSuccess:r,onLoginError:o})),{close:l}}const P2={login:Nv};pt.ConfigProvider=rp,pt.LOGIN_TYPES=He,pt.Login=zl,pt.MobileLogin=Rv,pt.SDK=P2,pt.UidLogin=Iv,pt.login=Nv,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})}));
65
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function Dx(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function Mx(){return Uc(/^Mac/)}function Lx(){return Uc(/^iPhone/)}function _h(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Fx(){return Uc(/^iPad/)||Mx()&&navigator.maxTouchPoints>1}function Ph(){return Lx()||Fx()}function Uc(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const $x=24,zx=typeof window<"u"?z.useLayoutEffect:z.useEffect;function Ih(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const Wc=typeof document<"u"&&window.visualViewport;function kh(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Rh(e){for(kh(e)&&(e=e.parentElement);e&&!kh(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Vx=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let ni=0,Hc;function jx(e={}){let{isDisabled:t}=e;zx(()=>{if(!t)return ni++,ni===1&&Ph()&&(Hc=Bx()),()=>{ni--,ni===0&&Hc?.()}},[t])}function Bx(){let e,t=0,n=d=>{e=Rh(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,h=e.scrollTop,m=e.scrollHeight-e.clientHeight;m!==0&&((h<=0&&f>t||h>=m&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;Zc(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},s=d=>{let f=d.target;Zc(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",Wc&&(Wc.height<window.innerHeight?requestAnimationFrame(()=>{Nh(f)}):Wc.addEventListener("resize",()=>Nh(f),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},a=window.pageXOffset,c=window.pageYOffset,l=Ih(Ux(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=Ih(Oo(document,"touchstart",n,{passive:!1,capture:!0}),Oo(document,"touchmove",r,{passive:!1,capture:!0}),Oo(document,"touchend",o,{passive:!1,capture:!0}),Oo(document,"focus",s,!0),Oo(window,"scroll",i));return()=>{l(),u(),window.scrollTo(a,c)}}function Ux(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Oo(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Nh(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Rh(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,s=e.getBoundingClientRect().bottom;const i=n.getBoundingClientRect().bottom+$x;s>i&&(n.scrollTop+=o-r)}e=n.parentElement}}function Zc(e){return e instanceof HTMLInputElement&&!Vx.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Wx(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hx(...e){return t=>e.forEach(n=>Wx(n,t))}function Ah(...e){return p.useCallback(Hx(...e),e)}const Dh=new WeakMap;function pt(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,s])=>{if(o.startsWith("--")){e.style.setProperty(o,s);return}r[o]=e.style[o],e.style[o]=s}),!n&&Dh.set(e,r)}function Zx(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Dh.get(e);n&&(e.style[t]=n[t])}const ut=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ri(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ut(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ut(t)?5:4]):null)}function Gx(e){return 8*(Math.log(e+1)-2)}function Gc(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function Yx(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const et={DURATION:.5,EASE:[.32,.72,0,1]},Mh=.4,qx=.25,Kx=100,Lh=8,ur=16,Yc=26,qc="vaul-dragging";function Fh(e){const t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function Xx({defaultProp:e,onChange:t}){const n=z.useState(e),[r]=n,o=z.useRef(r),s=Fh(t);return z.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}function $h({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Xx({defaultProp:t,onChange:n}),s=e!==void 0,i=s?e:r,a=Fh(n),c=z.useCallback(l=>{if(s){const d=typeof l=="function"?l(e):l;d!==e&&a(d)}else o(l)},[s,e,o,a]);return[i,c]}function Jx({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:s,onSnapPointChange:i,direction:a="bottom",container:c,snapToSequentialPoint:l}){const[u,d]=$h({prop:e,defaultProp:n?.[0],onChange:t}),[f,h]=z.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);z.useEffect(()=>{function E(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",E),()=>window.removeEventListener("resize",E)},[]);const m=z.useMemo(()=>u===n?.[n.length-1]||null,[n,u]),g=z.useMemo(()=>{var E;return(E=n?.findIndex(O=>O===u))!=null?E:null},[n,u]),y=n&&n.length>0&&(s||s===0)&&!Number.isNaN(s)&&n[s]===u||!n,v=z.useMemo(()=>{const E=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var O;return(O=n?.map(D=>{const k=typeof D=="string";let L=0;if(k&&(L=parseInt(D,10)),ut(a)){const N=k?L:f?D*E.height:0;return f?a==="bottom"?E.height-N:-E.height+N:N}const F=k?L:f?D*E.width:0;return f?a==="right"?E.width-F:-E.width+F:F}))!=null?O:[]},[n,f,c]),S=z.useMemo(()=>g!==null?v?.[g]:null,[v,g]),C=z.useCallback(E=>{var O;const D=(O=v?.findIndex(k=>k===E))!=null?O:null;i(D),pt(r.current,{transition:`transform ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,transform:ut(a)?`translate3d(0, ${E}px, 0)`:`translate3d(${E}px, 0, 0)`}),v&&D!==v.length-1&&s!==void 0&&D!==s&&D<s?pt(o.current,{transition:`opacity ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,opacity:"0"}):pt(o.current,{transition:`opacity ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(D,0)])},[r.current,n,v,s,o,d]);z.useEffect(()=>{if(u||e){var E;const O=(E=n?.findIndex(D=>D===e||D===u))!=null?E:-1;v&&O!==-1&&typeof v[O]=="number"&&C(v[O])}},[u,e,n,v,C]);function w({draggedDistance:E,closeDrawer:O,velocity:D,dismissible:k}){if(s===void 0)return;const L=a==="bottom"||a==="right"?(S??0)-E:(S??0)+E,F=g===s-1,N=g===0,R=E>0;if(F&&pt(o.current,{transition:`opacity ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`}),!l&&D>2&&!R){k?O():C(v[0]);return}if(!l&&D>2&&R&&v&&n){C(v[n.length-1]);return}const _=v?.reduce((P,A)=>typeof P!="number"||typeof A!="number"?P:Math.abs(A-L)<Math.abs(P-L)?A:P),I=ut(a)?window.innerHeight:window.innerWidth;if(D>Mh&&Math.abs(E)<I*.4){const P=R?1:-1;if(P>0&&m&&n){C(v[n.length-1]);return}if(N&&P<0&&k&&O(),g===null)return;C(v[g+P]);return}C(_)}function b({draggedDistance:E}){if(S===null)return;const O=a==="bottom"||a==="right"?S-E:S+E;(a==="bottom"||a==="right")&&O<v[v.length-1]||(a==="top"||a==="left")&&O>v[v.length-1]||pt(r.current,{transform:ut(a)?`translate3d(0, ${O}px, 0)`:`translate3d(${O}px, 0, 0)`})}function T(E,O){if(!n||typeof g!="number"||!v||s===void 0)return null;const D=g===s-1;if(g>=s&&O)return 0;if(D&&!O)return 1;if(!y&&!D)return null;const L=D?g+1:g-1,F=D?v[L]-v[L-1]:v[L+1]-v[L],N=E/Math.abs(F);return D?1-N:N}return{isLastSnapPoint:m,activeSnapPoint:u,shouldFade:y,getPercentageDragged:T,setActiveSnapPoint:d,activeSnapPointIndex:g,onRelease:w,onDrag:b,snapPointsOffset:v}}const Qx=()=>()=>{};function eT(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=To(),s=z.useRef(null),i=z.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-Yc)/window.innerWidth}z.useEffect(()=>{if(t&&n){s.current&&clearTimeout(s.current);const c=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!c)return;Yx(r&&!o?Gc(document.body,{background:"black"}):Qx,Gc(c,{transformOrigin:ut(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${et.DURATION}s`,transitionTimingFunction:`cubic-bezier(${et.EASE.join(",")})`}));const l=Gc(c,{borderRadius:`${Lh}px`,overflow:"hidden",...ut(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{l(),s.current=window.setTimeout(()=>{i?document.body.style.background=i:document.body.style.removeProperty("background")},et.DURATION*1e3)}}},[t,n,i])}let _o=null;function tT({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:s}){const[i,a]=z.useState(()=>typeof window<"u"?window.location.href:""),c=z.useRef(0),l=z.useCallback(()=>{if(_h()&&_o===null&&e&&!s){_o={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const h=f-window.innerHeight;h&&c.current>=f&&(document.body.style.top=`${-(c.current+h)}px`)}),300)}},[e]),u=z.useCallback(()=>{if(_h()&&_o!==null&&!s){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,_o),window.requestAnimationFrame(()=>{if(o&&i!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),_o=null}},[i]);return z.useEffect(()=>{function d(){c.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),z.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||u()}},[t,u]),z.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&l(),t||window.setTimeout(()=>{u()},500)):u())},[e,r,i,t,n,l,u]),{restorePositionSetting:u}}function nT({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:s,shouldScaleBackground:i=!1,setBackgroundColorOnScale:a=!0,closeThreshold:c=qx,scrollLockTimeout:l=Kx,dismissible:u=!0,handleOnly:d=!1,fadeFromIndex:f=s&&s.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:S,noBodyStyles:C=!1,direction:w="bottom",defaultOpen:b=!1,disablePreventScroll:T=!0,snapToSequentialPoint:E=!1,preventScrollRestoration:O=!1,repositionInputs:D=!0,onAnimationEnd:k,container:L,autoFocus:F=!1}){var N,R;const[_=!1,I]=$h({defaultProp:b,prop:e,onChange:ee=>{t?.(ee),!ee&&!S&&he(),setTimeout(()=>{k?.(ee)},et.DURATION*1e3),ee&&!y&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[P,A]=z.useState(!1),[M,$]=z.useState(!1),[U,V]=z.useState(!1),H=z.useRef(null),Y=z.useRef(null),G=z.useRef(null),K=z.useRef(null),J=z.useRef(null),X=z.useRef(!1),re=z.useRef(null),ue=z.useRef(0),fe=z.useRef(!1),Q=z.useRef(!b),de=z.useRef(0),te=z.useRef(null),we=z.useRef(((N=te.current)==null?void 0:N.getBoundingClientRect().height)||0),ce=z.useRef(((R=te.current)==null?void 0:R.getBoundingClientRect().width)||0),le=z.useRef(0),me=z.useCallback(ee=>{s&&ee===B.length-1&&(Y.current=new Date)},[]),{activeSnapPoint:oe,activeSnapPointIndex:ye,setActiveSnapPoint:j,onRelease:Z,snapPointsOffset:B,onDrag:W,shouldFade:ie,getPercentageDragged:ve}=Jx({snapPoints:s,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:te,fadeFromIndex:f,overlayRef:H,onSnapPointChange:me,direction:w,container:L,snapToSequentialPoint:E});jx({isDisabled:!_||M||!y||U||!P||!D||!T});const{restorePositionSetting:he}=tT({isOpen:_,modal:y,nested:S??!1,hasBeenOpened:P,preventScrollRestoration:O,noBodyStyles:C});function Ce(){return(window.innerWidth-Yc)/window.innerWidth}function $e(ee){var pe,ge;!u&&!s||te.current&&!te.current.contains(ee.target)||(we.current=((pe=te.current)==null?void 0:pe.getBoundingClientRect().height)||0,ce.current=((ge=te.current)==null?void 0:ge.getBoundingClientRect().width)||0,$(!0),G.current=new Date,Ph()&&window.addEventListener("touchend",()=>X.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),ue.current=ut(w)?ee.pageY:ee.pageX)}function xe(ee,pe){var ge;let Ee=ee;const Oe=(ge=window.getSelection())==null?void 0:ge.toString(),Ge=te.current?ri(te.current,w):null,We=new Date;if(Ee.tagName==="SELECT"||Ee.hasAttribute("data-vaul-no-drag")||Ee.closest("[data-vaul-no-drag]"))return!1;if(w==="right"||w==="left")return!0;if(Y.current&&We.getTime()-Y.current.getTime()<500)return!1;if(Ge!==null&&(w==="bottom"?Ge>0:Ge<0))return!0;if(Oe&&Oe.length>0)return!1;if(J.current&&We.getTime()-J.current.getTime()<l&&Ge===0||pe)return J.current=We,!1;for(;Ee;){if(Ee.scrollHeight>Ee.clientHeight){if(Ee.scrollTop!==0)return J.current=new Date,!1;if(Ee.getAttribute("role")==="dialog")return!0}Ee=Ee.parentNode}return!0}function Le(ee){if(te.current&&M){const pe=w==="bottom"||w==="right"?1:-1,ge=(ue.current-(ut(w)?ee.pageY:ee.pageX))*pe,Ee=ge>0,Oe=s&&!u&&!Ee;if(Oe&&ye===0)return;const Ge=Math.abs(ge),We=document.querySelector("[data-vaul-drawer-wrapper]"),lt=w==="bottom"||w==="top"?we.current:ce.current;let dt=Ge/lt;const Et=ve(Ge,Ee);if(Et!==null&&(dt=Et),Oe&&dt>=1||!X.current&&!xe(ee.target,Ee))return;if(te.current.classList.add(qc),X.current=!0,pt(te.current,{transition:"none"}),pt(H.current,{transition:"none"}),s&&W({draggedDistance:ge}),Ee&&!s){const ot=Gx(ge),kt=Math.min(ot*-1,0)*pe;pt(te.current,{transform:ut(w)?`translate3d(0, ${kt}px, 0)`:`translate3d(${kt}px, 0, 0)`});return}const xt=1-dt;if((ie||f&&ye===f-1)&&(r?.(ee,dt),pt(H.current,{opacity:`${xt}`,transition:"none"},!0)),We&&H.current&&i){const ot=Math.min(Ce()+dt*(1-Ce()),1),kt=8-dt*8,Qt=Math.max(0,14-dt*14);pt(We,{borderRadius:`${kt}px`,transform:ut(w)?`scale(${ot}) translate3d(0, ${Qt}px, 0)`:`scale(${ot}) translate3d(${Qt}px, 0, 0)`,transition:"none"},!0)}if(!s){const ot=Ge*pe;pt(te.current,{transform:ut(w)?`translate3d(0, ${ot}px, 0)`:`translate3d(${ot}px, 0, 0)`})}}}z.useEffect(()=>{window.requestAnimationFrame(()=>{Q.current=!0})},[]),z.useEffect(()=>{var ee;function pe(){if(!te.current||!D)return;const ge=document.activeElement;if(Zc(ge)||fe.current){var Ee;const Oe=((Ee=window.visualViewport)==null?void 0:Ee.height)||0,Ge=window.innerHeight;let We=Ge-Oe;const lt=te.current.getBoundingClientRect().height||0,dt=lt>Ge*.8;le.current||(le.current=lt);const Et=te.current.getBoundingClientRect().top;if(Math.abs(de.current-We)>60&&(fe.current=!fe.current),s&&s.length>0&&B&&ye){const xt=B[ye]||0;We+=xt}if(de.current=We,lt>Oe||fe.current){const xt=te.current.getBoundingClientRect().height;let ot=xt;xt>Oe&&(ot=Oe-(dt?Et:Yc)),g?te.current.style.height=`${xt-Math.max(We,0)}px`:te.current.style.height=`${Math.max(ot,Oe-Et)}px`}else Dx()||(te.current.style.height=`${le.current}px`);s&&s.length>0&&!fe.current?te.current.style.bottom="0px":te.current.style.bottom=`${Math.max(We,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",pe),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",pe)}},[ye,s,B]);function Ie(ee){je(),v?.(),ee||I(!1),setTimeout(()=>{s&&j(s[0])},et.DURATION*1e3)}function Fe(){if(!te.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),pe=ri(te.current,w);pt(te.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`}),pt(H.current,{transition:`opacity ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,opacity:"1"}),i&&pe&&pe>0&&_&&pt(ee,{borderRadius:`${Lh}px`,overflow:"hidden",...ut(w)?{transform:`scale(${Ce()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ce()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${et.DURATION}s`,transitionTimingFunction:`cubic-bezier(${et.EASE.join(",")})`},!0)}function je(){!M||!te.current||(te.current.classList.remove(qc),X.current=!1,$(!1),K.current=new Date)}function nt(ee){if(!M||!te.current)return;te.current.classList.remove(qc),X.current=!1,$(!1),K.current=new Date;const pe=ri(te.current,w);if(!ee||!xe(ee.target,!1)||!pe||Number.isNaN(pe)||G.current===null)return;const ge=K.current.getTime()-G.current.getTime(),Ee=ue.current-(ut(w)?ee.pageY:ee.pageX),Oe=Math.abs(Ee)/ge;if(Oe>.05&&(V(!0),setTimeout(()=>{V(!1)},200)),s){Z({draggedDistance:Ee*(w==="bottom"||w==="right"?1:-1),closeDrawer:Ie,velocity:Oe,dismissible:u}),o?.(ee,!0);return}if(w==="bottom"||w==="right"?Ee>0:Ee<0){Fe(),o?.(ee,!0);return}if(Oe>Mh){Ie(),o?.(ee,!1);return}var Ge;const We=Math.min((Ge=te.current.getBoundingClientRect().height)!=null?Ge:0,window.innerHeight);var lt;const dt=Math.min((lt=te.current.getBoundingClientRect().width)!=null?lt:0,window.innerWidth),Et=w==="left"||w==="right";if(Math.abs(pe)>=(Et?dt:We)*c){Ie(),o?.(ee,!1);return}o?.(ee,!0),Fe()}z.useEffect(()=>(_&&(pt(document.documentElement,{scrollBehavior:"auto"}),Y.current=new Date),()=>{Zx(document.documentElement,"scrollBehavior")}),[_]);function vt(ee){const pe=ee?(window.innerWidth-ur)/window.innerWidth:1,ge=ee?-ur:0;re.current&&window.clearTimeout(re.current),pt(te.current,{transition:`transform ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,transform:ut(w)?`scale(${pe}) translate3d(0, ${ge}px, 0)`:`scale(${pe}) translate3d(${ge}px, 0, 0)`}),!ee&&te.current&&(re.current=setTimeout(()=>{const Ee=ri(te.current,w);pt(te.current,{transition:"none",transform:ut(w)?`translate3d(0, ${Ee}px, 0)`:`translate3d(${Ee}px, 0, 0)`})},500))}function rt(ee,pe){if(pe<0)return;const ge=(window.innerWidth-ur)/window.innerWidth,Ee=ge+pe*(1-ge),Oe=-ur+pe*ur;pt(te.current,{transform:ut(w)?`scale(${Ee}) translate3d(0, ${Oe}px, 0)`:`scale(${Ee}) translate3d(${Oe}px, 0, 0)`,transition:"none"})}function ke(ee,pe){const ge=ut(w)?window.innerHeight:window.innerWidth,Ee=pe?(ge-ur)/ge:1,Oe=pe?-ur:0;pe&&pt(te.current,{transition:`transform ${et.DURATION}s cubic-bezier(${et.EASE.join(",")})`,transform:ut(w)?`scale(${Ee}) translate3d(0, ${Oe}px, 0)`:`scale(${Ee}) translate3d(${Oe}px, 0, 0)`})}return z.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),z.createElement(_x,{defaultOpen:b,onOpenChange:ee=>{!u&&!ee||(ee?A(!0):Ie(!0),I(ee))},open:_},z.createElement(Oh.Provider,{value:{activeSnapPoint:oe,snapPoints:s,setActiveSnapPoint:j,drawerRef:te,overlayRef:H,onOpenChange:t,onPress:$e,onRelease:nt,onDrag:Le,dismissible:u,shouldAnimate:Q,handleOnly:d,isOpen:_,isDragging:M,shouldFade:ie,closeDrawer:Ie,onNestedDrag:rt,onNestedOpenChange:vt,onNestedRelease:ke,keyboardIsOpen:fe,modal:y,snapPointsOffset:B,activeSnapPointIndex:ye,direction:w,shouldScaleBackground:i,setBackgroundColorOnScale:a,noBodyStyles:C,container:L,autoFocus:F}},n))}const zh=z.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:s,isOpen:i,modal:a,shouldAnimate:c}=To(),l=Ah(t,n),u=r&&r.length>0;if(!a)return null;const d=z.useCallback(f=>o(f),[o]);return z.createElement(kx,{onMouseUp:d,ref:l,"data-vaul-overlay":"","data-vaul-snap-points":i&&u?"true":"false","data-vaul-snap-points-overlay":i&&s?"true":"false","data-vaul-animate":c?.current?"true":"false",...e})});zh.displayName="Drawer.Overlay";const Vh=z.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:s,onPress:i,onRelease:a,onDrag:c,keyboardIsOpen:l,snapPointsOffset:u,activeSnapPointIndex:d,modal:f,isOpen:h,direction:m,snapPoints:g,container:y,handleOnly:v,shouldAnimate:S,autoFocus:C}=To(),[w,b]=z.useState(!1),T=Ah(o,s),E=z.useRef(null),O=z.useRef(null),D=z.useRef(!1),k=g&&g.length>0;eT();const L=(N,R,_=0)=>{if(D.current)return!0;const I=Math.abs(N.y),P=Math.abs(N.x),A=P>I,M=["bottom","right"].includes(R)?1:-1;if(R==="left"||R==="right"){if(!(N.x*M<0)&&P>=0&&P<=_)return A}else if(!(N.y*M<0)&&I>=0&&I<=_)return!A;return D.current=!0,!0};z.useEffect(()=>{k&&window.requestAnimationFrame(()=>{b(!0)})},[]);function F(N){E.current=null,D.current=!1,a(N)}return z.createElement(Rx,{"data-vaul-drawer-direction":m,"data-vaul-drawer":"","data-vaul-delayed-snap-points":w?"true":"false","data-vaul-snap-points":h&&k?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":S?.current?"true":"false",...r,ref:T,style:u&&u.length>0?{"--snap-point-height":`${u[d??0]}px`,...t}:t,onPointerDown:N=>{v||(r.onPointerDown==null||r.onPointerDown.call(r,N),E.current={x:N.pageX,y:N.pageY},i(N))},onOpenAutoFocus:N=>{n?.(N),C||N.preventDefault()},onPointerDownOutside:N=>{if(e?.(N),!f||N.defaultPrevented){N.preventDefault();return}l.current&&(l.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(O.current=N,v||(r.onPointerMove==null||r.onPointerMove.call(r,N),!E.current))return;const R=N.pageY-E.current.y,_=N.pageX-E.current.x,I=N.pointerType==="touch"?10:2;L({x:_,y:R},m,I)?c(N):(Math.abs(_)>I||Math.abs(R)>I)&&(E.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),E.current=null,D.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),F(O.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),O.current&&F(O.current)}})});Vh.displayName="Drawer.Content";const rT=250,oT=120,sT=z.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:s,snapPoints:i,activeSnapPoint:a,setActiveSnapPoint:c,dismissible:l,handleOnly:u,isOpen:d,onPress:f,onDrag:h}=To(),m=z.useRef(null),g=z.useRef(!1);function y(){if(g.current){C();return}window.setTimeout(()=>{v()},oT)}function v(){if(s||e||g.current){C();return}if(C(),!i||i.length===0){l||o();return}if(a===i[i.length-1]&&l){o();return}const b=i.findIndex(E=>E===a);if(b===-1)return;const T=i[b+1];c(T)}function S(){m.current=window.setTimeout(()=>{g.current=!0},rT)}function C(){m.current&&window.clearTimeout(m.current),g.current=!1}return z.createElement("div",{onClick:y,onPointerCancel:C,onPointerDown:w=>{u&&f(w),S()},onPointerMove:w=>{u&&h(w)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},z.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});sT.displayName="Drawer.Handle";function iT(e){const t=To(),{container:n=t.container,...r}=e;return z.createElement(Ix,{container:n,...r})}const jr={Root:nT,Content:Vh,Overlay:zh,Trigger:Px,Portal:iT,Title:Nx};function jh({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,zIndex:a,classNames:c}){return Y1("(min-width: 1024px)")?x.jsxs(Hf,{open:o,onOpenChange:i,disablePointerDismissal:!0,children:[e&&x.jsx(ac,{className:c?.trigger,children:e}),x.jsxs(sc,{children:[x.jsx(ec,{style:{zIndex:a},className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm"}),x.jsxs(oc,{style:{zIndex:a},className:rr("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[991]",c?.desktopPopup),children:[t&&x.jsx(ic,{className:rr("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&x.jsx(nc,{className:rr("mb-6 text-base text-gray-600",c?.description),children:n}),s&&x.jsx(tc,{className:"absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",children:x.jsx(Ap,{})}),x.jsx("div",{children:r})]})]})]}):x.jsxs(jr.Root,{open:o,onOpenChange:i,children:[e&&x.jsx(jr.Trigger,{className:c?.trigger,children:e}),x.jsxs(jr.Portal,{children:[x.jsx(jr.Overlay,{style:{zIndex:a},className:rr("fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",c?.backdrop)}),x.jsxs(jr.Content,{style:{zIndex:a},className:rr("h-fit fixed bottom-0 left-0 right-0 outline-none z-[991]",c?.mobilePopup),children:[x.jsx(jr.Title,{className:"hidden"}),x.jsxs("div",{className:"p-4 bg-white rounded-t-xl",children:[x.jsx("div",{"aria-hidden":!0,className:"mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-4"}),x.jsx("div",{children:r})]})]})]})]})}function Bh({checked:e,onChange:t}){const[n,r]=z.useState(!1),[o,s]=z.useState(!1);return x.jsxs("div",{children:[x.jsx(jh,{title:"用户协议",open:n,onOpenChange:r,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:x.jsx("iframe",{src:"https://www.gatribe.com/license-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),x.jsx(jh,{title:"隐私政策",open:o,onOpenChange:s,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:x.jsx("iframe",{src:"https://www.gatribe.com/privacy-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),x.jsx(Kt,{name:"rememberLogin",children:x.jsxs(vc,{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[x.jsx(mc,{checked:e,className:"size-4 md:size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-[var(--jssdk-input-border-color)]",onCheckedChange:i=>t(!!i),children:x.jsx(gc,{children:x.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),x.jsx("span",{className:"ml-2",children:"我已详细阅读并同意"}),x.jsx(Xt,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>r(!0),type:"button",children:"《用户协议》"}),x.jsx("span",{children:"及"}),x.jsx(Xt,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>s(!0),type:"button",children:"《隐私政策》"})]})})]})}function aT(){const{gameId:e,onAccountLoginSuccess:t,onLoginSuccess:n,onLoginError:r,triggerRealNameAuth:o}=xn(),s=z.useRef(null),[i,a]=z.useState(""),[c,l]=z.useState(""),[u,d]=z.useState(!1),[f,h]=z.useState(!0),{mutate:m,isPending:g}=mr({mutationFn:()=>A1({account:i,password:c}),onSuccess:v=>{const S={account:v.account,entity:v.channel_info.entity,token:v.channel_info.token,sign:v.channel_info.sign,accid:v.channel_info.entity.openid,extra_data:v.channel_info.extra_data,gaplaySign:v.channel_info.gaplaySign,realname:v.channel_info.realname};if(Ns(S,v._auth,e),S.realname&&S.realname.reject>=2){o();return}t?.(S),n?.(S)},onError:v=>{r?.(v)}});async function y(v){if(v.preventDefault(),!f){fn.warning("请先阅读并同意用户协议和隐私政策");return}if(!i||!c){fn.warning("请输入账号和密码");return}m()}return x.jsx(x.Fragment,{children:x.jsxs(Eo,{ref:s,onSubmit:y,className:"space-y-5",children:[x.jsxs(Kt,{name:"account",className:"flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-white px-3 gap-2 h-12",children:[x.jsx(V1,{className:"size-5 text-gray-400"}),x.jsx(On,{className:"flex-1 outline-none rounded-full h-full pl-1",placeholder:"请输入巨人通行证账号",autoFocus:!0,onChange:v=>a(v.currentTarget.value)})]}),x.jsxs(Kt,{name:"password",className:"flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-white px-3 gap-2 h-12",children:[x.jsx(j1,{className:"size-5 text-gray-400"}),x.jsx(On,{type:u?"text":"password",autoComplete:"off",className:"flex-1 w-0 outline-none rounded-full h-full pl-1",placeholder:"请输入密码",value:c,onValueChange:v=>l(v)}),x.jsx(Xt,{onClick:()=>d(!u),type:"button",children:u?x.jsx(_1,{className:"size-5 text-gray-400"}):x.jsx(O1,{className:"size-5 text-gray-400"})})]}),x.jsxs("section",{children:[x.jsx("div",{className:"flex justify-end mb-1",children:x.jsx(Xt,{className:"text-[var(--jssdk-primary-color)]",as:"a",href:"https://my.ztgame.com/plugin/pwd",children:"忘记密码"})}),x.jsx(Xt,{className:"h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",type:"submit",disabled:g,children:"登录"})]}),x.jsx(Ws,{}),x.jsx(Bh,{checked:f,onChange:h})]})})}var cT=function(e){return typeof e=="number"};function uT(e){var t=z.useRef(e);return t.current=e,t}var oi={exports:{}},lT=oi.exports,Uh;function dT(){return Uh||(Uh=1,(function(e,t){(function(n,r){e.exports=r()})(lT,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",l="day",u="week",d="month",f="quarter",h="year",m="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,S={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var _=["th","st","nd","rd"],I=R%100;return"["+R+(_[(I-20)%10]||_[I]||_[0])+"]"}},C=function(R,_,I){var P=String(R);return!P||P.length>=_?R:""+Array(_+1-P.length).join(I)+R},w={s:C,z:function(R){var _=-R.utcOffset(),I=Math.abs(_),P=Math.floor(I/60),A=I%60;return(_<=0?"+":"-")+C(P,2,"0")+":"+C(A,2,"0")},m:function R(_,I){if(_.date()<I.date())return-R(I,_);var P=12*(I.year()-_.year())+(I.month()-_.month()),A=_.clone().add(P,d),M=I-A<0,$=_.clone().add(P+(M?-1:1),d);return+(-(P+(I-A)/(M?A-$:$-A))||0)},a:function(R){return R<0?Math.ceil(R)||0:Math.floor(R)},p:function(R){return{M:d,y:h,w:u,d:l,D:m,h:c,m:a,s:i,ms:s,Q:f}[R]||String(R||"").toLowerCase().replace(/s$/,"")},u:function(R){return R===void 0}},b="en",T={};T[b]=S;var E="$isDayjsObject",O=function(R){return R instanceof F||!(!R||!R[E])},D=function R(_,I,P){var A;if(!_)return b;if(typeof _=="string"){var M=_.toLowerCase();T[M]&&(A=M),I&&(T[M]=I,A=M);var $=_.split("-");if(!A&&$.length>1)return R($[0])}else{var U=_.name;T[U]=_,A=U}return!P&&A&&(b=A),A||!P&&b},k=function(R,_){if(O(R))return R.clone();var I=typeof _=="object"?_:{};return I.date=R,I.args=arguments,new F(I)},L=w;L.l=D,L.i=O,L.w=function(R,_){return k(R,{locale:_.$L,utc:_.$u,x:_.$x,$offset:_.$offset})};var F=(function(){function R(I){this.$L=D(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[E]=!0}var _=R.prototype;return _.parse=function(I){this.$d=(function(P){var A=P.date,M=P.utc;if(A===null)return new Date(NaN);if(L.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var $=A.match(y);if($){var U=$[2]-1||0,V=($[7]||"0").substring(0,3);return M?new Date(Date.UTC($[1],U,$[3]||1,$[4]||0,$[5]||0,$[6]||0,V)):new Date($[1],U,$[3]||1,$[4]||0,$[5]||0,$[6]||0,V)}}return new Date(A)})(I),this.init()},_.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},_.$utils=function(){return L},_.isValid=function(){return this.$d.toString()!==g},_.isSame=function(I,P){var A=k(I);return this.startOf(P)<=A&&A<=this.endOf(P)},_.isAfter=function(I,P){return k(I)<this.startOf(P)},_.isBefore=function(I,P){return this.endOf(P)<k(I)},_.$g=function(I,P,A){return L.u(I)?this[P]:this.set(A,I)},_.unix=function(){return Math.floor(this.valueOf()/1e3)},_.valueOf=function(){return this.$d.getTime()},_.startOf=function(I,P){var A=this,M=!!L.u(P)||P,$=L.p(I),U=function(re,ue){var fe=L.w(A.$u?Date.UTC(A.$y,ue,re):new Date(A.$y,ue,re),A);return M?fe:fe.endOf(l)},V=function(re,ue){return L.w(A.toDate()[re].apply(A.toDate("s"),(M?[0,0,0,0]:[23,59,59,999]).slice(ue)),A)},H=this.$W,Y=this.$M,G=this.$D,K="set"+(this.$u?"UTC":"");switch($){case h:return M?U(1,0):U(31,11);case d:return M?U(1,Y):U(0,Y+1);case u:var J=this.$locale().weekStart||0,X=(H<J?H+7:H)-J;return U(M?G-X:G+(6-X),Y);case l:case m:return V(K+"Hours",0);case c:return V(K+"Minutes",1);case a:return V(K+"Seconds",2);case i:return V(K+"Milliseconds",3);default:return this.clone()}},_.endOf=function(I){return this.startOf(I,!1)},_.$set=function(I,P){var A,M=L.p(I),$="set"+(this.$u?"UTC":""),U=(A={},A[l]=$+"Date",A[m]=$+"Date",A[d]=$+"Month",A[h]=$+"FullYear",A[c]=$+"Hours",A[a]=$+"Minutes",A[i]=$+"Seconds",A[s]=$+"Milliseconds",A)[M],V=M===l?this.$D+(P-this.$W):P;if(M===d||M===h){var H=this.clone().set(m,1);H.$d[U](V),H.init(),this.$d=H.set(m,Math.min(this.$D,H.daysInMonth())).$d}else U&&this.$d[U](V);return this.init(),this},_.set=function(I,P){return this.clone().$set(I,P)},_.get=function(I){return this[L.p(I)]()},_.add=function(I,P){var A,M=this;I=Number(I);var $=L.p(P),U=function(Y){var G=k(M);return L.w(G.date(G.date()+Math.round(Y*I)),M)};if($===d)return this.set(d,this.$M+I);if($===h)return this.set(h,this.$y+I);if($===l)return U(1);if($===u)return U(7);var V=(A={},A[a]=r,A[c]=o,A[i]=n,A)[$]||1,H=this.$d.getTime()+I*V;return L.w(H,this)},_.subtract=function(I,P){return this.add(-1*I,P)},_.format=function(I){var P=this,A=this.$locale();if(!this.isValid())return A.invalidDate||g;var M=I||"YYYY-MM-DDTHH:mm:ssZ",$=L.z(this),U=this.$H,V=this.$m,H=this.$M,Y=A.weekdays,G=A.months,K=A.meridiem,J=function(ue,fe,Q,de){return ue&&(ue[fe]||ue(P,M))||Q[fe].slice(0,de)},X=function(ue){return L.s(U%12||12,ue,"0")},re=K||function(ue,fe,Q){var de=ue<12?"AM":"PM";return Q?de.toLowerCase():de};return M.replace(v,(function(ue,fe){return fe||(function(Q){switch(Q){case"YY":return String(P.$y).slice(-2);case"YYYY":return L.s(P.$y,4,"0");case"M":return H+1;case"MM":return L.s(H+1,2,"0");case"MMM":return J(A.monthsShort,H,G,3);case"MMMM":return J(G,H);case"D":return P.$D;case"DD":return L.s(P.$D,2,"0");case"d":return String(P.$W);case"dd":return J(A.weekdaysMin,P.$W,Y,2);case"ddd":return J(A.weekdaysShort,P.$W,Y,3);case"dddd":return Y[P.$W];case"H":return String(U);case"HH":return L.s(U,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return re(U,V,!0);case"A":return re(U,V,!1);case"m":return String(V);case"mm":return L.s(V,2,"0");case"s":return String(P.$s);case"ss":return L.s(P.$s,2,"0");case"SSS":return L.s(P.$ms,3,"0");case"Z":return $}return null})(ue)||$.replace(":","")}))},_.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},_.diff=function(I,P,A){var M,$=this,U=L.p(P),V=k(I),H=(V.utcOffset()-this.utcOffset())*r,Y=this-V,G=function(){return L.m($,V)};switch(U){case h:M=G()/12;break;case d:M=G();break;case f:M=G()/3;break;case u:M=(Y-H)/6048e5;break;case l:M=(Y-H)/864e5;break;case c:M=Y/o;break;case a:M=Y/r;break;case i:M=Y/n;break;default:M=Y}return A?M:L.a(M)},_.daysInMonth=function(){return this.endOf(d).$D},_.$locale=function(){return T[this.$L]},_.locale=function(I,P){if(!I)return this.$L;var A=this.clone(),M=D(I,P,!0);return M&&(A.$L=M),A},_.clone=function(){return L.w(this.$d,this)},_.toDate=function(){return new Date(this.valueOf())},_.toJSON=function(){return this.isValid()?this.toISOString():null},_.toISOString=function(){return this.$d.toISOString()},_.toString=function(){return this.$d.toUTCString()},R})(),N=F.prototype;return k.prototype=N,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",l],["$M",d],["$y",h],["$D",m]].forEach((function(R){N[R[1]]=function(_){return this.$g(_,R[0],R[1])}})),k.extend=function(R,_){return R.$i||(R(_,F,k),R.$i=!0),k},k.locale=D,k.isDayjs=O,k.unix=function(R){return k(1e3*R)},k.en=T[b],k.Ls=T,k.p={},k}))})(oi)),oi.exports}var fT=dT();const pT=_b(fT);var Kc=function(e){if(!e)return 0;var t=pT(e).valueOf()-Date.now();return t<0?0:t},hT=function(e){return{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3}},mT=function(e){e===void 0&&(e={});var t=e||{},n=t.leftTime,r=t.targetDate,o=t.interval,s=o===void 0?1e3:o,i=t.onEnd,a=z.useMemo(function(){return cT(n)&&n>0?Date.now()+n:void 0},[n]),c="leftTime"in e?a:r,l=vg(z.useState(function(){return Kc(c)}),2),u=l[0],d=l[1],f=uT(i);z.useEffect(function(){if(!c){d(0);return}d(Kc(c));var m=setInterval(function(){var g,y=Kc(c);d(y),y===0&&(clearInterval(m),(g=f.current)===null||g===void 0||g.call(f))},s);return function(){return clearInterval(m)}},[c,s]);var h=z.useMemo(function(){return hT(u)},[u]);return[u,h]},Wh;function q(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=i.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const f=u[d];f in a||(a[f]=l[f].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const l=n?.Parent?new s:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Br extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Hh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Wh=globalThis).__zod_globalConfig??(Wh.__zod_globalConfig={});const Xc=globalThis.__zod_globalConfig;function lr(e){return Xc}function Zh(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Jc(e,t){return typeof t=="bigint"?t.toString():t}function Qc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eu(e){return e==null}function tu(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Gh=Symbol("evaluating");function Ue(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Gh)return r===void 0&&(r=Gh,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function dr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Wn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Yh(e){return JSON.stringify(e)}function gT(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const qh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function si(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const vT=Qc(()=>{if(Xc.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Po(e){if(si(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(si(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Kh(e){return Po(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const yT=new Set(["string","number","symbol"]);function ii(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Se(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function wT(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=Wn(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return dr(this,"shape",i),i},checks:[]});return Hn(e,s)}function ET(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=Wn(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return dr(this,"shape",i),i},checks:[]});return Hn(e,s)}function ST(e,t){if(!Po(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Wn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return dr(this,"shape",s),s}});return Hn(e,o)}function CT(e,t){if(!Po(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Wn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return dr(this,"shape",r),r}});return Hn(e,n)}function xT(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Wn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return dr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Hn(e,n)}function TT(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Wn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return dr(this,"shape",c),c},checks:[]});return Hn(t,i)}function OT(e,t,n){const r=Wn(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(n)for(const i in n){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return dr(this,"shape",s),s}});return Hn(t,r)}function Ur(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function _T(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Xh(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ai(e){return typeof e=="string"?e:e?.message}function fr(e,t,n){const r=e.message?e.message:ai(e.inst?._zod.def?.error?.(e))??ai(t?.error?.(e))??ai(n.customError?.(e))??ai(n.localeError?.(e))??"Invalid input",{inst:o,continue:s,input:i,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=i),a}function nu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Io(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Jh=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Jc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Qh=q("$ZodError",Jh),em=q("$ZodError",Jh,{Parent:Error});function ci(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function PT(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,l=0;for(;l<a.length;){const u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(t(i))):c[u]=c[u]||{_errors:[]},c=c[u],l++}}}};return r(e),n}const ru=e=>(t,n,r,o)=>{const s=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new Br;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>fr(c,s,lr())));throw qh(a,o?.callee),a}return i.value},ou=e=>async(t,n,r,o)=>{const s=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>fr(c,s,lr())));throw qh(a,o?.callee),a}return i.value},ui=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Br;return s.issues.length?{success:!1,error:new(e??Qh)(s.issues.map(i=>fr(i,o,lr())))}:{success:!0,data:s.value}},IT=ui(em),li=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>fr(i,o,lr())))}:{success:!0,data:s.value}},kT=li(em),RT=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ru(e)(t,n,o)},NT=e=>(t,n,r)=>ru(e)(t,n,r),AT=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ou(e)(t,n,o)},DT=e=>async(t,n,r)=>ou(e)(t,n,r),MT=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ui(e)(t,n,o)},LT=e=>(t,n,r)=>ui(e)(t,n,r),FT=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return li(e)(t,n,o)},$T=e=>async(t,n,r)=>li(e)(t,n,r),zT=/^[cC][0-9a-z]{6,}$/,VT=/^[0-9a-z]+$/,jT=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,BT=/^[0-9a-vA-V]{20}$/,UT=/^[A-Za-z0-9]{27}$/,WT=/^[a-zA-Z0-9_-]{21}$/,HT=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ZT=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tm=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,GT=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,YT="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qT(){return new RegExp(YT,"u")}const KT=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,XT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,JT=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,QT=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eO=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nm=/^[A-Za-z0-9_-]*$/,tO=/^https?$/,nO=/^\+[1-9]\d{6,14}$/,rm="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",rO=new RegExp(`^${rm}$`);function om(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function oO(e){return new RegExp(`^${om(e)}$`)}function sO(e){const t=om({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${rm}T(?:${r})$`)}const iO=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},aO=/^[^A-Z]*$/,cO=/^[^a-z]*$/,pn=q("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),uO=q("$ZodCheckMaxLength",(e,t)=>{var n;pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!eu(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=nu(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),lO=q("$ZodCheckMinLength",(e,t)=>{var n;pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!eu(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=nu(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),dO=q("$ZodCheckLengthEquals",(e,t)=>{var n;pn.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!eu(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,s=o.length;if(s===t.length)return;const i=nu(o),a=s>t.length;r.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),di=q("$ZodCheckStringFormat",(e,t)=>{var n,r;pn.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),fO=q("$ZodCheckRegex",(e,t)=>{di.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),pO=q("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=aO),di.init(e,t)}),hO=q("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=cO),di.init(e,t)}),mO=q("$ZodCheckIncludes",(e,t)=>{pn.init(e,t);const n=ii(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),gO=q("$ZodCheckStartsWith",(e,t)=>{pn.init(e,t);const n=new RegExp(`^${ii(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),vO=q("$ZodCheckEndsWith",(e,t)=>{pn.init(e,t);const n=new RegExp(`.*${ii(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),yO=q("$ZodCheckOverwrite",(e,t)=>{pn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class bO{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
66
+ `).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,o.join(`
67
+ `))}}const wO={major:4,minor:4,patch:3},ht=q("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wO;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,a,c)=>{let l=Ur(i),u;for(const d of a){if(d._zod.def.when){if(_T(i)||!d._zod.def.when(i))continue}else if(l)continue;const f=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new Br;if(u||h instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await h,i.issues.length!==f&&(l||(l=Ur(i,f)))});else{if(i.issues.length===f)continue;l||(l=Ur(i,f))}}return u?u.then(()=>i):i},s=(i,a,c)=>{if(Ur(i))return i.aborted=!0,i;const l=o(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new Br;return l.then(u=>e._zod.parse(u,c))}return e._zod.parse(l,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(u=>s(u,i,a)):s(l,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Br;return c.then(l=>o(l,r,a))}return o(c,r,a)}}Ue(e,"~standard",()=>({validate:o=>{try{const s=IT(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return kT(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),su=q("$ZodString",(e,t)=>{ht.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iO(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Je=q("$ZodStringFormat",(e,t)=>{di.init(e,t),su.init(e,t)}),EO=q("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ZT),Je.init(e,t)}),SO=q("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tm(r))}else t.pattern??(t.pattern=tm());Je.init(e,t)}),CO=q("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=GT),Je.init(e,t)}),xO=q("$ZodURL",(e,t)=>{Je.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===tO.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),TO=q("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=qT()),Je.init(e,t)}),OO=q("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=WT),Je.init(e,t)}),_O=q("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=zT),Je.init(e,t)}),PO=q("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=VT),Je.init(e,t)}),IO=q("$ZodULID",(e,t)=>{t.pattern??(t.pattern=jT),Je.init(e,t)}),kO=q("$ZodXID",(e,t)=>{t.pattern??(t.pattern=BT),Je.init(e,t)}),RO=q("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=UT),Je.init(e,t)}),NO=q("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=sO(t)),Je.init(e,t)}),AO=q("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=rO),Je.init(e,t)}),DO=q("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=oO(t)),Je.init(e,t)}),MO=q("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=HT),Je.init(e,t)}),LO=q("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=KT),Je.init(e,t),e._zod.bag.format="ipv4"}),FO=q("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=XT),Je.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$O=q("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=JT),Je.init(e,t)}),zO=q("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=QT),Je.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,s]=r;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function sm(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VO=q("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=eO),Je.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{sm(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function jO(e){if(!nm.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return sm(n)}const BO=q("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=nm),Je.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{jO(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),UO=q("$ZodE164",(e,t)=>{t.pattern??(t.pattern=nO),Je.init(e,t)});function WO(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const HO=q("$ZodJWT",(e,t)=>{Je.init(e,t),e._zod.check=n=>{WO(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ZO=q("$ZodUnknown",(e,t)=>{ht.init(e,t),e._zod.parse=n=>n}),GO=q("$ZodNever",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function im(e,t,n){e.issues.length&&t.issues.push(...Xh(n,e.issues)),t.value[n]=e.value}const YO=q("$ZodArray",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const s=[];for(let i=0;i<o.length;i++){const a=o[i],c=t.element._zod.run({value:a,issues:[]},r);c instanceof Promise?s.push(c.then(l=>im(l,n,i))):im(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function fi(e,t,n,r,o,s){const i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...Xh(n,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?i&&(t.value[n]=void 0):t.value[n]=e.value}function am(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=bT(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function cm(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(const f in t){if(f==="__proto__"||a.has(f))continue;if(l==="never"){i.push(f);continue}const h=c.run({value:t[f],issues:[]},r);h instanceof Promise?e.push(h.then(m=>fi(m,n,f,t,u,d))):fi(h,n,f,t,u,d)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const qO=q("$ZodObject",(e,t)=>{if(ht.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Qc(()=>am(t));Ue(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const d of u.values)c[l].add(d)}}return c});const o=si,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const l=a.value;if(!o(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],d=i.shape;for(const f of i.keys){const h=d[f],m=h._zod.optin==="optional",g=h._zod.optout==="optional",y=h._zod.run({value:l[f],issues:[]},c);y instanceof Promise?u.push(y.then(v=>fi(v,a,f,l,m,g))):fi(y,a,f,l,m,g)}return s?cm(u,l,a,c,r.value,e):u.length?Promise.all(u).then(()=>a):a}}),KO=q("$ZodObjectJIT",(e,t)=>{qO.init(e,t);const n=e._zod.parse,r=Qc(()=>am(t)),o=f=>{const h=new bO(["shape","payload","ctx"]),m=r.value,g=C=>{const w=Yh(C);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};h.write("const input = payload.value;");const y=Object.create(null);let v=0;for(const C of m.keys)y[C]=`key_${v++}`;h.write("const newResult = {};");for(const C of m.keys){const w=y[C],b=Yh(C),T=f[C],E=T?._zod?.optin==="optional",O=T?._zod?.optout==="optional";h.write(`const ${w} = ${g(C)};`),E&&O?h.write(`
68
+ if (${w}.issues.length) {
69
+ if (${b} in input) {
70
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
71
+ ...iss,
72
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
73
+ })));
74
+ }
75
+ }
76
+
77
+ if (${w}.value === undefined) {
78
+ if (${b} in input) {
79
+ newResult[${b}] = undefined;
80
+ }
81
+ } else {
82
+ newResult[${b}] = ${w}.value;
83
+ }
84
+
85
+ `):E?h.write(`
86
+ if (${w}.issues.length) {
87
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
88
+ ...iss,
89
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
90
+ })));
91
+ }
92
+
93
+ if (${w}.value === undefined) {
94
+ if (${b} in input) {
95
+ newResult[${b}] = undefined;
96
+ }
97
+ } else {
98
+ newResult[${b}] = ${w}.value;
99
+ }
100
+
101
+ `):h.write(`
102
+ const ${w}_present = ${b} in input;
103
+ if (${w}.issues.length) {
104
+ payload.issues = payload.issues.concat(${w}.issues.map(iss => ({
105
+ ...iss,
106
+ path: iss.path ? [${b}, ...iss.path] : [${b}]
107
+ })));
108
+ }
109
+ if (!${w}_present && !${w}.issues.length) {
110
+ payload.issues.push({
111
+ code: "invalid_type",
112
+ expected: "nonoptional",
113
+ input: undefined,
114
+ path: [${b}]
115
+ });
116
+ }
117
+
118
+ if (${w}_present) {
119
+ if (${w}.value === undefined) {
120
+ newResult[${b}] = undefined;
121
+ } else {
122
+ newResult[${b}] = ${w}.value;
123
+ }
124
+ }
125
+
126
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const S=h.compile();return(C,w)=>S(f,C,w)};let s;const i=si,a=!Xc.jitless,l=a&&vT.value,u=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const m=f.value;return i(m)?a&&l&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),f=s(f,h),u?cm([],m,f,h,d,e):f):n(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function um(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Ur(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>fr(i,r,lr())))}),t)}const XO=q("$ZodUnion",(e,t)=>{ht.init(e,t),Ue(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Ue(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ue(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Ue(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>tu(o.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>um(a,r,e,o)):um(i,r,e,o)}}),JO=q("$ZodIntersection",(e,t)=>{ht.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,l])=>lm(n,c,l)):lm(n,s,i)}});function iu(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Po(e)&&Po(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};for(const s of r){const i=iu(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=iu(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function lm(e,t,n){const r=new Map;let o;for(const a of t.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&e.issues.push({...o,keys:s}),Ur(e))return e;const i=iu(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const QO=q("$ZodEnum",(e,t)=>{ht.init(e,t);const n=Zh(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>yT.has(typeof o)).map(o=>typeof o=="string"?ii(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),e_=q("$ZodTransform",(e,t)=>{ht.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Hh(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n.fallback=!0,n));if(o instanceof Promise)throw new Br;return n.value=o,n.fallback=!0,n}});function dm(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const fm=q("$ZodOptional",(e,t)=>{ht.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ue(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ue(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${tu(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>dm(i,o)):dm(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),t_=q("$ZodExactOptional",(e,t)=>{fm.init(e,t),Ue(e._zod,"values",()=>t.innerType._zod.values),Ue(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),n_=q("$ZodNullable",(e,t)=>{ht.init(e,t),Ue(e._zod,"optin",()=>t.innerType._zod.optin),Ue(e._zod,"optout",()=>t.innerType._zod.optout),Ue(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${tu(n.source)}|null)$`):void 0}),Ue(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),r_=q("$ZodDefault",(e,t)=>{ht.init(e,t),e._zod.optin="optional",Ue(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>pm(s,t)):pm(o,t)}});function pm(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const o_=q("$ZodPrefault",(e,t)=>{ht.init(e,t),e._zod.optin="optional",Ue(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),s_=q("$ZodNonOptional",(e,t)=>{ht.init(e,t),Ue(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>hm(s,e)):hm(o,e)}});function hm(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const i_=q("$ZodCatch",(e,t)=>{ht.init(e,t),e._zod.optin="optional",Ue(e._zod,"optout",()=>t.innerType._zod.optout),Ue(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>fr(i,r,lr()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(s=>fr(s,r,lr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),a_=q("$ZodPipe",(e,t)=>{ht.init(e,t),Ue(e._zod,"values",()=>t.in._zod.values),Ue(e._zod,"optin",()=>t.in._zod.optin),Ue(e._zod,"optout",()=>t.out._zod.optout),Ue(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>pi(i,t.in,r)):pi(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>pi(s,t.out,r)):pi(o,t.out,r)}});function pi(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const c_=q("$ZodReadonly",(e,t)=>{ht.init(e,t),Ue(e._zod,"propValues",()=>t.innerType._zod.propValues),Ue(e._zod,"values",()=>t.innerType._zod.values),Ue(e._zod,"optin",()=>t.innerType?._zod?.optin),Ue(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(mm):mm(o)}});function mm(e){return e.value=Object.freeze(e.value),e}const u_=q("$ZodCustom",(e,t)=>{pn.init(e,t),ht.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>gm(s,n,r,e));gm(o,n,r,e)}});function gm(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Io(o))}}var vm;class l_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function d_(){return new l_}(vm=globalThis).__zod_globalRegistry??(vm.__zod_globalRegistry=d_());const ko=globalThis.__zod_globalRegistry;function f_(e,t){return new e({type:"string",...Se(t)})}function p_(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Se(t)})}function ym(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Se(t)})}function h_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Se(t)})}function m_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Se(t)})}function g_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Se(t)})}function v_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Se(t)})}function y_(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Se(t)})}function b_(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Se(t)})}function w_(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Se(t)})}function E_(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Se(t)})}function S_(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Se(t)})}function C_(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Se(t)})}function x_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Se(t)})}function T_(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Se(t)})}function O_(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Se(t)})}function __(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Se(t)})}function P_(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Se(t)})}function I_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Se(t)})}function k_(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Se(t)})}function R_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Se(t)})}function N_(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Se(t)})}function A_(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Se(t)})}function D_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Se(t)})}function M_(e,t){return new e({type:"string",format:"date",check:"string_format",...Se(t)})}function L_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Se(t)})}function F_(e,t){return new e({type:"string",format:"duration",check:"string_format",...Se(t)})}function $_(e){return new e({type:"unknown"})}function z_(e,t){return new e({type:"never",...Se(t)})}function bm(e,t){return new uO({check:"max_length",...Se(t),maximum:e})}function hi(e,t){return new lO({check:"min_length",...Se(t),minimum:e})}function wm(e,t){return new dO({check:"length_equals",...Se(t),length:e})}function V_(e,t){return new fO({check:"string_format",format:"regex",...Se(t),pattern:e})}function j_(e){return new pO({check:"string_format",format:"lowercase",...Se(e)})}function B_(e){return new hO({check:"string_format",format:"uppercase",...Se(e)})}function U_(e,t){return new mO({check:"string_format",format:"includes",...Se(t),includes:e})}function W_(e,t){return new gO({check:"string_format",format:"starts_with",...Se(t),prefix:e})}function H_(e,t){return new vO({check:"string_format",format:"ends_with",...Se(t),suffix:e})}function Wr(e){return new yO({check:"overwrite",tx:e})}function Z_(e){return Wr(t=>t.normalize(e))}function G_(){return Wr(e=>e.trim())}function Y_(){return Wr(e=>e.toLowerCase())}function q_(){return Wr(e=>e.toUpperCase())}function K_(){return Wr(e=>gT(e))}function X_(e,t,n){return new e({type:"array",element:t,...Se(n)})}function J_(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Se(n)})}function Q_(e,t){const n=eP(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Io(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Io(s))}},e(r.value,r)),t);return n}function eP(e,t){const n=new pn({check:"custom",...Se(t)});return n._zod.check=e,n}function Em(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ko,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function wt(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{const u={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,u);else{const f=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,f,u)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),wt(d,t,u),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&It(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Sm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const a=e.metadataRegistry.get(i[0])?.id;if(a){const c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}const o=i=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(i[0])?.id,f=e.external.uri??(m=>m);if(d)return{ref:f(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${f("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const l=`#/${a}/`,u=i[1].schema.id??`__schema${e.counter++}`;return{defId:u,ref:l+u}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:l}=o(i);a.def={...a.schema},l&&(a.defId=l);const u=a.schema;for(const d in u)delete u[d];u.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
127
+
128
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const a=i[1];if(t===i[0]){s(i);continue}if(e.external){const l=e.external.registry.get(i[0])?.id;if(t!==i[0]&&l){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&e.reused==="ref"){s(i);continue}}}function Cm(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){r(d);const h=e.seen.get(d),m=h.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(m)):Object.assign(l,m),Object.assign(l,u),a._zod.parent===d)for(const y in l)y==="$ref"||y==="allOf"||y in u||delete l[y];if(m.$ref&&h.def)for(const y in l)y==="$ref"||y==="allOf"||y in h.def&&JSON.stringify(l[y])===JSON.stringify(h.def[y])&&delete l[y]}const f=a._zod.parent;if(f&&f!==d){r(f);const h=e.seen.get(f);if(h?.schema.$ref&&(l.$ref=h.schema.$ref,h.def))for(const m in l)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(l[m])===JSON.stringify(h.def[m])&&delete l[m]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}Object.assign(o,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;const i=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:mi(t,"input",e.processors),output:mi(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function It(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return It(r.element,n);if(r.type==="set")return It(r.valueType,n);if(r.type==="lazy")return It(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return It(r.innerType,n);if(r.type==="intersection")return It(r.left,n)||It(r.right,n);if(r.type==="record"||r.type==="map")return It(r.keyType,n)||It(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:It(r.in,n)||It(r.out,n);if(r.type==="object"){for(const o in r.shape)if(It(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(It(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(It(o,n))return!0;return!!(r.rest&&It(r.rest,n))}return!1}const tP=(e,t={})=>n=>{const r=Em({...n,processors:t});return wt(e,r),Sm(r,e),Cm(r,e)},mi=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=Em({...o??{},target:s,io:t,processors:n});return wt(e,i),Sm(i,e),Cm(i,e)},nP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},rP=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=nP[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),l&&(o.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?o.pattern=u[0].source:u.length>1&&(o.allOf=[...u.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},oP=(e,t,n,r)=>{n.not={}},sP=(e,t,n,r)=>{},iP=(e,t,n,r)=>{const o=e._zod.def,s=Zh(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},aP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},cP=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},uP=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=wt(s.element,t,{...r,path:[...r.path,"items"]})},lP=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const l in i)o.properties[l]=wt(i[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(l=>{const u=s.shape[l]._zod;return t.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=wt(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},dP=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>wt(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},fP=(e,t,n,r)=>{const o=e._zod.def,s=wt(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=wt(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},pP=(e,t,n,r)=>{const o=e._zod.def,s=wt(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},hP=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},mP=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},gP=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},vP=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},yP=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;wt(i,t,r);const a=t.seen.get(e);a.ref=i},bP=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},xm=(e,t,n,r)=>{const o=e._zod.def;wt(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},wP=q("ZodISODateTime",(e,t)=>{NO.init(e,t),tt.init(e,t)});function EP(e){return D_(wP,e)}const SP=q("ZodISODate",(e,t)=>{AO.init(e,t),tt.init(e,t)});function CP(e){return M_(SP,e)}const xP=q("ZodISOTime",(e,t)=>{DO.init(e,t),tt.init(e,t)});function TP(e){return L_(xP,e)}const OP=q("ZodISODuration",(e,t)=>{MO.init(e,t),tt.init(e,t)});function _P(e){return F_(OP,e)}const Ht=q("ZodError",(e,t)=>{Qh.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>PT(e,n)},flatten:{value:n=>ci(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Jc,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Jc,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),PP=ru(Ht),IP=ou(Ht),kP=ui(Ht),RP=li(Ht),NP=RT(Ht),AP=NT(Ht),DP=AT(Ht),MP=DT(Ht),LP=MT(Ht),FP=LT(Ht),$P=FT(Ht),zP=$T(Ht),Tm=new WeakMap;function gi(e,t,n){const r=Object.getPrototypeOf(e);let o=Tm.get(r);if(o||(o=new Set,Tm.set(r,o)),!o.has(t)){o.add(t);for(const s in n){const i=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const mt=q("ZodType",(e,t)=>(ht.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:mi(e,"input"),output:mi(e,"output")}}),e.toJSONSchema=tP(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>PP(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>kP(e,n,r),e.parseAsync=async(n,r)=>IP(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>RP(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>NP(e,n,r),e.decode=(n,r)=>AP(e,n,r),e.encodeAsync=async(n,r)=>DP(e,n,r),e.decodeAsync=async(n,r)=>MP(e,n,r),e.safeEncode=(n,r)=>LP(e,n,r),e.safeDecode=(n,r)=>FP(e,n,r),e.safeEncodeAsync=async(n,r)=>$P(e,n,r),e.safeDecodeAsync=async(n,r)=>zP(e,n,r),gi(e,"ZodType",{check(...n){const r=this.def;return this.clone(Wn(r,{checks:[...r.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return Hn(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(RI(n,r))},superRefine(n,r){return this.check(NI(n,r))},overwrite(n){return this.check(Wr(n))},optional(){return Rm(this)},exactOptional(){return yI(this)},nullable(){return Nm(this)},nullish(){return Rm(Nm(this))},nonoptional(n){return xI(this,n)},array(){return cI(this)},or(n){return dI([this,n])},and(n){return pI(this,n)},transform(n){return Dm(this,gI(n))},default(n){return EI(this,n)},prefault(n){return CI(this,n)},catch(n){return OI(this,n)},pipe(n){return Dm(this,n)},readonly(){return II(this)},describe(n){const r=this.clone();return ko.add(r,{description:n}),r},meta(...n){if(n.length===0)return ko.get(this);const r=this.clone();return ko.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return ko.get(e)?.description},configurable:!0}),e)),Om=q("_ZodString",(e,t)=>{su.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>rP(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,gi(e,"_ZodString",{regex(...r){return this.check(V_(...r))},includes(...r){return this.check(U_(...r))},startsWith(...r){return this.check(W_(...r))},endsWith(...r){return this.check(H_(...r))},min(...r){return this.check(hi(...r))},max(...r){return this.check(bm(...r))},length(...r){return this.check(wm(...r))},nonempty(...r){return this.check(hi(1,...r))},lowercase(r){return this.check(j_(r))},uppercase(r){return this.check(B_(r))},trim(){return this.check(G_())},normalize(...r){return this.check(Z_(...r))},toLowerCase(){return this.check(Y_())},toUpperCase(){return this.check(q_())},slugify(){return this.check(K_())}})}),VP=q("ZodString",(e,t)=>{su.init(e,t),Om.init(e,t),e.email=n=>e.check(p_(jP,n)),e.url=n=>e.check(y_(BP,n)),e.jwt=n=>e.check(A_(rI,n)),e.emoji=n=>e.check(b_(UP,n)),e.guid=n=>e.check(ym(_m,n)),e.uuid=n=>e.check(h_(yi,n)),e.uuidv4=n=>e.check(m_(yi,n)),e.uuidv6=n=>e.check(g_(yi,n)),e.uuidv7=n=>e.check(v_(yi,n)),e.nanoid=n=>e.check(w_(WP,n)),e.guid=n=>e.check(ym(_m,n)),e.cuid=n=>e.check(E_(HP,n)),e.cuid2=n=>e.check(S_(ZP,n)),e.ulid=n=>e.check(C_(GP,n)),e.base64=n=>e.check(k_(eI,n)),e.base64url=n=>e.check(R_(tI,n)),e.xid=n=>e.check(x_(YP,n)),e.ksuid=n=>e.check(T_(qP,n)),e.ipv4=n=>e.check(O_(KP,n)),e.ipv6=n=>e.check(__(XP,n)),e.cidrv4=n=>e.check(P_(JP,n)),e.cidrv6=n=>e.check(I_(QP,n)),e.e164=n=>e.check(N_(nI,n)),e.datetime=n=>e.check(EP(n)),e.date=n=>e.check(CP(n)),e.time=n=>e.check(TP(n)),e.duration=n=>e.check(_P(n))});function vi(e){return f_(VP,e)}const tt=q("ZodStringFormat",(e,t)=>{Je.init(e,t),Om.init(e,t)}),jP=q("ZodEmail",(e,t)=>{CO.init(e,t),tt.init(e,t)}),_m=q("ZodGUID",(e,t)=>{EO.init(e,t),tt.init(e,t)}),yi=q("ZodUUID",(e,t)=>{SO.init(e,t),tt.init(e,t)}),BP=q("ZodURL",(e,t)=>{xO.init(e,t),tt.init(e,t)}),UP=q("ZodEmoji",(e,t)=>{TO.init(e,t),tt.init(e,t)}),WP=q("ZodNanoID",(e,t)=>{OO.init(e,t),tt.init(e,t)}),HP=q("ZodCUID",(e,t)=>{_O.init(e,t),tt.init(e,t)}),ZP=q("ZodCUID2",(e,t)=>{PO.init(e,t),tt.init(e,t)}),GP=q("ZodULID",(e,t)=>{IO.init(e,t),tt.init(e,t)}),YP=q("ZodXID",(e,t)=>{kO.init(e,t),tt.init(e,t)}),qP=q("ZodKSUID",(e,t)=>{RO.init(e,t),tt.init(e,t)}),KP=q("ZodIPv4",(e,t)=>{LO.init(e,t),tt.init(e,t)}),XP=q("ZodIPv6",(e,t)=>{FO.init(e,t),tt.init(e,t)}),JP=q("ZodCIDRv4",(e,t)=>{$O.init(e,t),tt.init(e,t)}),QP=q("ZodCIDRv6",(e,t)=>{zO.init(e,t),tt.init(e,t)}),eI=q("ZodBase64",(e,t)=>{VO.init(e,t),tt.init(e,t)}),tI=q("ZodBase64URL",(e,t)=>{BO.init(e,t),tt.init(e,t)}),nI=q("ZodE164",(e,t)=>{UO.init(e,t),tt.init(e,t)}),rI=q("ZodJWT",(e,t)=>{HO.init(e,t),tt.init(e,t)}),oI=q("ZodUnknown",(e,t)=>{ZO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>sP()});function Pm(){return $_(oI)}const sI=q("ZodNever",(e,t)=>{GO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>oP(e,n,r)});function iI(e){return z_(sI,e)}const aI=q("ZodArray",(e,t)=>{YO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>uP(e,n,r,o),e.element=t.element,gi(e,"ZodArray",{min(n,r){return this.check(hi(n,r))},nonempty(n){return this.check(hi(1,n))},max(n,r){return this.check(bm(n,r))},length(n,r){return this.check(wm(n,r))},unwrap(){return this.element}})});function cI(e,t){return X_(aI,e,t)}const uI=q("ZodObject",(e,t)=>{KO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>lP(e,n,r,o),Ue(e,"shape",()=>t.shape),gi(e,"ZodObject",{keyof(){return hI(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Pm()})},loose(){return this.clone({...this._zod.def,catchall:Pm()})},strict(){return this.clone({...this._zod.def,catchall:iI()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ST(this,n)},safeExtend(n){return CT(this,n)},merge(n){return xT(this,n)},pick(n){return wT(this,n)},omit(n){return ET(this,n)},partial(...n){return TT(km,this,n[0])},required(...n){return OT(Am,this,n[0])}})});function Im(e,t){const n={type:"object",shape:e??{},...Se(t)};return new uI(n)}const lI=q("ZodUnion",(e,t)=>{XO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dP(e,n,r,o),e.options=t.options});function dI(e,t){return new lI({type:"union",options:e,...Se(t)})}const fI=q("ZodIntersection",(e,t)=>{JO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fP(e,n,r,o)});function pI(e,t){return new fI({type:"intersection",left:e,right:t})}const au=q("ZodEnum",(e,t)=>{QO.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>iP(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new au({...t,checks:[],...Se(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new au({...t,checks:[],...Se(o),entries:s})}});function hI(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new au({type:"enum",entries:n,...Se(t)})}const mI=q("ZodTransform",(e,t)=>{e_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>cP(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Hh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Io(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Io(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});function gI(e){return new mI({type:"transform",transform:e})}const km=q("ZodOptional",(e,t)=>{fm.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xm(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Rm(e){return new km({type:"optional",innerType:e})}const vI=q("ZodExactOptional",(e,t)=>{t_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xm(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function yI(e){return new vI({type:"optional",innerType:e})}const bI=q("ZodNullable",(e,t)=>{n_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Nm(e){return new bI({type:"nullable",innerType:e})}const wI=q("ZodDefault",(e,t)=>{r_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function EI(e,t){return new wI({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Kh(t)}})}const SI=q("ZodPrefault",(e,t)=>{o_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function CI(e,t){return new SI({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Kh(t)}})}const Am=q("ZodNonOptional",(e,t)=>{s_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function xI(e,t){return new Am({type:"nonoptional",innerType:e,...Se(t)})}const TI=q("ZodCatch",(e,t)=>{i_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function OI(e,t){return new TI({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const _I=q("ZodPipe",(e,t)=>{a_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yP(e,n,r,o),e.in=t.in,e.out=t.out});function Dm(e,t){return new _I({type:"pipe",in:e,out:t})}const PI=q("ZodReadonly",(e,t)=>{c_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bP(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function II(e){return new PI({type:"readonly",innerType:e})}const kI=q("ZodCustom",(e,t)=>{u_.init(e,t),mt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>aP(e,n)});function RI(e,t={}){return J_(kI,e,t)}function NI(e,t){return Q_(e,t)}const pr={trigger:"_trigger_ltbvo_1",popup:"_popup_ltbvo_5",item:"_item_ltbvo_24",indicator:"_indicator_ltbvo_40",itemText:"_itemText_ltbvo_44",itemCode:"_itemCode_ltbvo_48",itemLabel:"_itemLabel_ltbvo_52"};function AI({value:e,onValueChange:t}){const{gameId:n}=xn(),r=JE(n),o=p.useMemo(()=>r.find(i=>i.id===e||i.value===e)?.id||e,[r,e]);return x.jsxs(p1,{value:o,onValueChange:s=>{const i=r.find(a=>a.id===s);i&&t?.(i.value)},children:[x.jsxs(yp,{className:pr.trigger,children:[x.jsx("span",{children:r.find(s=>s.id===o)?.value}),x.jsx(Np,{className:"size-4"})]}),x.jsx(wp,{children:x.jsx(Ep,{className:"outline-none z-[999]",sideOffset:-4,align:"start",children:x.jsx(Sp,{className:pr.popup,children:r.map(({label:s,value:i,id:a})=>x.jsxs(Op,{value:a,className:pr.item,children:[x.jsx(_p,{className:pr.indicator,children:x.jsx(Pc,{className:"size-3"})}),x.jsxs(Ip,{className:pr.itemText,children:[x.jsx("span",{className:pr.itemCode,children:i}),x.jsx("span",{className:pr.itemLabel,children:s})]})]},a))})})})]})}const Mm=Im({phoneNumber:vi().regex(/^[1-9]\d{10}$/,"请输入正确的手机号"),verificationCode:vi().length(4,"请输入 6 位验证码")});function Lm(){const{mobileLoginConfig:e={},gameId:t,onPhoneLoginSuccess:n,onLoginSuccess:r,onLoginError:o,triggerRealNameAuth:s}=xn(),[i,a]=z.useState("86"),[c,l]=z.useState(""),u=z.useRef(null),[d,f]=z.useState(""),[h,m]=z.useState(),[g,y]=z.useState(!0),[v,S]=z.useState({}),[C]=mT({leftTime:h?h*1e3:void 0,interval:1e3,onEnd(){m(void 0)}}),{mutate:w,isPending:b}=mr({mutationFn:()=>D1({mobile:c,countryCode:i,type:e.smsType}),onSuccess:k=>{m(k.lock_time),fn.success("验证码已发送,请注意查收")}}),{mutate:T,isPending:E}=mr({mutationFn:async()=>{const k=await M1({mobile:c,countryCode:i,captcha:d});m(void 0);const L={account:k.account,entity:k.channel_info.entity,token:k.channel_info.token,sign:k.channel_info.sign,accid:k.channel_info.entity.openid,extra_data:k.channel_info.extra_data,gaplaySign:k.channel_info.gaplaySign,realname:k.channel_info.realname};if(Ns(L,k._auth,t),L.realname&&L.realname.reject>=2){s();return}return n&&await n(L),r?.(L),k},onError:k=>{o?.(k)}});function O(){if(!g){fn.warning("请先阅读并同意用户协议和隐私政策");return}const k=new FormData(u.current),L=Mm.pick({phoneNumber:!0}).safeParse(Object.fromEntries(k));if(!L.success){S(ci(L.error).fieldErrors);return}w()}async function D(k){if(k.preventDefault(),!g)return fn.warning("请先阅读并同意用户协议和隐私政策"),{errors:{}};const L=new FormData(k.currentTarget),F=Mm.safeParse(Object.fromEntries(L));return F.success?(T(),{errors:{}}):{errors:ci(F.error).fieldErrors}}return x.jsx(x.Fragment,{children:x.jsxs(Eo,{ref:u,errors:v,onSubmit:async k=>{const L=await D(k);S(L.errors)},className:"space-y-5",children:[x.jsxs(Kt,{name:"phoneNumber",children:[x.jsxs("div",{className:"flex items-center border border-[var(--jssdk-input-border-color)] data-[focused]:border-[var(--jssdk-primary-color)] rounded-full bg-white gap-2 h-12",children:[x.jsx(AI,{value:i,onValueChange:a}),x.jsx(On,{className:"flex-1 outline-none rounded-full h-full pl-1",placeholder:"请输入手机号码",autoFocus:!0,type:"tel",onChange:k=>l(k.currentTarget.value)})]}),x.jsx(wo,{className:"mt-1 text-sm text-red-800"})]}),x.jsxs(Kt,{name:"verificationCode",children:[x.jsxs("div",{className:"flex items-center border border-[var(--jssdk-input-border-color)] data-[focused]:border-[var(--jssdk-primary-color)] rounded-full bg-white px-3 gap-2 h-12",children:[x.jsx(On,{className:"flex-1 w-0 outline-none rounded-full h-full pl-1",placeholder:"请输入验证码",value:d,type:"number",onValueChange:k=>f(k)}),x.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-white inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onClick:()=>O(),disabled:!!h||b,children:b?"发送中...":h?`${Math.round(C/1e3)}s 后重新获取`:"获取验证码"})]}),x.jsx(wo,{className:"mt-1 text-sm text-red-800"})]}),x.jsx(Xt,{className:bt("my-5 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",e.buttonClassName),disabled:E,type:"submit",children:E?"登录中...":e.buttonText||"登录"}),x.jsx(Ws,{}),x.jsx(Bh,{checked:g,onChange:y})]})})}function bi({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,disablePointerDismissal:a=!1,classNames:c}){return x.jsxs(Hf,{open:o,onOpenChange:i,disablePointerDismissal:a,children:[e&&x.jsx(ac,{className:c?.trigger,children:e}),x.jsxs(sc,{children:[x.jsx(ec,{className:"fixed inset-0 bg-black/70 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",forceRender:!0}),x.jsxs(oc,{className:bt("fixed top-1/2 left-1/2 w-96 max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-lg bg-gray-50 p-4 text-gray-900 transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 z-[990]",c?.popup),children:[t&&x.jsx(ic,{className:bt("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&x.jsx(nc,{className:bt("mb-6 text-base text-gray-600",c?.description),children:n}),s&&x.jsx(tc,{className:bt("absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",c?.close),children:x.jsx(Ap,{})}),x.jsx("div",{children:r})]})]})]})}function DI(e){return x.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[x.jsx("path",{d:"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z",className:"fill-current"}),x.jsx("path",{d:"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z",className:"fill-current"})]})}function MI({children:e,title:t,description:n,content:r,classNames:o={}}){return x.jsxs(s1,{children:[x.jsx(sp,{className:o.trigger,delay:0,children:e}),x.jsxs(ip,{children:[x.jsx(fp,{className:bt("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",o.backdrop)}),x.jsx(cp,{sideOffset:8,className:o.positioner,children:x.jsxs(lp,{className:bt("origin-[var(--transform-origin)] bg-white p-1 rounded shadow-sm text-gray-900 transition-[transform,scale,opacity] data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 dark:shadow-none dark:-outline-offset-1 dark:outline-gray-300",o.popup),children:[x.jsx(dp,{className:bt("data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180",o.arrow),children:x.jsx(DI,{})}),t&&x.jsx(pp,{className:"text-base font-medium",children:t}),n&&x.jsx(hp,{className:"text-base text-gray-600",children:n}),r]})})]})]})}const hr={uidGet:"_uidGet_os9yc_1",mailCodeGet:"_mailCodeGet_os9yc_5",uidGetPopup:"_uidGetPopup_os9yc_79",uidGetArrow:"_uidGetArrow_os9yc_83",inputControl:"_inputControl_os9yc_86",form:"_form_os9yc_89"};function Fm({onUidLoginSuccess:e,customSendUidMailCaptcha:t,customValidateUidMailCaptcha:n}={}){const{gameId:r,autoLoginConfig:o,sceneId:s,onUidLoginSuccess:i,onLoginSuccess:a,onLoginError:c,uidLoginConfig:l={}}=xn(),u=z.useRef(null),[d,f]=z.useState(""),[h,m]=z.useState(""),[g,y]=z.useState(!0),[v,S]=z.useState(!1),[C,{startCountdown:w,resetCountdown:b}]=Z1({countStart:120,intervalMs:1e3}),{mutate:T}=mr({mutationFn:()=>{const k=o.enabled?o.days:void 0;return n?n({gameId:r,captcha:h,expireInDays:g?k:void 0,accountId:d,sceneId:s}):N1({game_id:r,charid:d,captcha_type:"login",captcha:h,expires_day:g?k:void 0,scene_id:s,...l.uidMailExtraParams})},onSuccess:k=>{i?.(k),e?.(k),a?.(k)},onError:k=>{c?.(k)}}),{mutate:E,isPending:O}=mr({mutationFn:()=>t?t({gameId:r,accountId:d}):R1({game_id:r,captcha_type:"login",charid:d,scene_id:s,...l.uidMailExtraParams}),onSuccess:k=>{w(),fn.success(k.error)}});async function D(k){k.preventDefault(),T()}return z.useEffect(()=>{h.length===6&&d&&setTimeout(()=>{u.current?.requestSubmit()},0)},[h,d]),z.useEffect(()=>{C===0&&b(),S(C!==120)},[C,b]),x.jsxs(Eo,{ref:u,onSubmit:D,className:bt("space-y-6",hr.form),autoComplete:"off",children:[["5199","5012"].includes(r)?x.jsx("p",{className:"text-center text-xs text-white/80",children:"请点击游戏右上角“设置”查看账号ID"}):null,x.jsxs(Kt,{name:"accountId",className:bt("flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-[var(--jssdk-input-bg-color)] px-3 gap-2 h-12",hr.inputControl),children:[x.jsx(MI,{content:x.jsx("div",{className:bt(hr.uidGet,l.uidGetterImageClassName)}),classNames:{backdrop:"z-[992]",positioner:"z-[992]",popup:bt("rounded-2xl shadow-lg",hr.uidGetPopup),arrow:hr.uidGetArrow,trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2"},children:x.jsx("span",{children:"!"})}),x.jsx(On,{className:"flex-1 outline-none rounded-full h-full pl-1 bg-inherit",placeholder:"请输入账号 ID",autoFocus:!0,type:"tel",onChange:k=>f(k.currentTarget.value)})]}),x.jsxs(Kt,{name:"verificationCode",className:bt("flex items-center border border-[var(--jssdk-input-border-color)] rounded-full bg-[var(--jssdk-input-bg-color)] px-3 gap-2 h-12",hr.inputControl),children:[x.jsx(bi,{trigger:x.jsx("span",{children:"!"}),classNames:{trigger:"size-5 lg:size-6 lg:text-2xl rounded-full bg-[var(--jssdk-icon-color)] inline-flex items-center justify-center text-white focus:outline focus:outline-2",popup:"w-full lg:w-4/5 lg:max-w-5xl p-0 bg-transparent"},children:x.jsx("div",{className:bt(hr.mailCodeGet,l.mailCodeGetterImageClassName)})}),x.jsx(On,{className:"flex-1 w-0 outline-none rounded-full h-full pl-1 bg-inherit",placeholder:"请输入口令码",value:h,type:"tel",onValueChange:k=>m(k)}),x.jsx("button",{type:"button",className:"enabled:text-[var(--jssdk-primary-color)] text-sm rounded-full h-4/6 px-2 enabled:hover:bg-[var(--jssdk-primary-color)] enabled:hover:text-[var(--jssdk-primary-foregroud-color)] inline-flex items-center disabled:cursor-not-allowed disabled:text-gray-500",onMouseDown:k=>{k.preventDefault()},onClick:()=>E(),disabled:v||O||!d,children:v?`${C}s`:O?"发送中...":"发送口令码"})]}),o.enabled?x.jsx(Kt,{name:"rememberLogin",children:x.jsxs(vc,{className:"flex items-center gap-2 text-gray-500",onMouseDown:k=>{k.preventDefault()},children:[x.jsx(mc,{checked:g,className:"size-5 flex items-center justify-center rounded-full border-2 data-[checked]:border-[var(--jssdk-primary-color)] data-[unchecked]:border-gray-300",onCheckedChange:k=>y(!!k),children:x.jsx(gc,{children:x.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),x.jsxs("div",{children:[x.jsx("span",{className:"mr-0.5",children:o.days}),x.jsx("span",{children:"天内自动登录"})]})]})}):null,["5199","5012"].includes(r)?x.jsx("div",{className:"text-[#f59e9e] text-center text-[11px]",children:"请点击游戏内“邮件”查收口令码,未收到请重启游戏再次查看"}):null,x.jsx(Ws,{})]})}const At={quickLogin:"_quickLogin_1ibz1_1",quickAccounts:"_quickAccounts_1ibz1_5",selectedAccount:"_selectedAccount_1ibz1_9",accountInfo:"_accountInfo_1ibz1_21",accountName:"_accountName_1ibz1_26",arrow:"_arrow_1ibz1_31",arrowRotate:"_arrowRotate_1ibz1_37",accountList:"_accountList_1ibz1_41",listScroll:"_listScroll_1ibz1_49",accountItem:"_accountItem_1ibz1_58",active:"_active_1ibz1_77",itemName:"_itemName_1ibz1_81",itemInfo:"_itemInfo_1ibz1_86",deleteBtn:"_deleteBtn_1ibz1_97"};function LI(){const{gameId:e,onLoginSuccess:t,triggerRealNameAuth:n,setCurrentLoginType:r,defaultLoginType:o}=xn(),[s,i]=z.useState([]),[a,c]=z.useState(null),[l,u]=z.useState(!1),[d,f]=z.useState(!1),[h,m]=z.useState(!1),[g,y]=z.useState(-1);z.useEffect(()=>{v()},[e]);const v=()=>{const T=Nr(e);i(T),T.length>0?(!a||!T.find(E=>E.openid===a.openid))&&c(T[0]):c(null)},S=T=>{c(s[T]),u(!1)},C=(T,E)=>{T.stopPropagation(),y(E),m(!0)},w=()=>{const T=s[g];if(T){_f(T.openid,e);const E=Nr(e);if(E.length===0){r(o);return}i(E),E.find(O=>O.openid===a?.openid)||c(E[0])}m(!1),y(-1)},b=async()=>{if(a){f(!0);try{wf(a.authorization);const T=await Dp(),E={account:T.account,entity:T.channel_info.entity,token:T.channel_info.token,sign:T.channel_info.sign,accid:T.channel_info.entity.openid,extra_data:T.channel_info.extra_data,gaplaySign:T.channel_info.gaplaySign,realname:T.channel_info.realname};if(Ns(E,a.authorization,e),E.realname&&E.realname.reject>=2){n();return}t?.(E)}catch(T){fn.error(T?.detail),console.error("Quick login failed:",T)}finally{f(!1)}}};return s.length===0?null:x.jsxs("div",{className:At.quickLogin,children:[x.jsxs("div",{className:At.quickAccounts,children:[x.jsxs("div",{className:At.selectedAccount,onClick:()=>u(!l),children:[x.jsx("div",{className:At.accountInfo,children:x.jsx("span",{className:At.accountName,children:a?.username})}),x.jsx(Np,{className:bt(At.arrow,l&&At.arrowRotate)})]}),l&&x.jsx("div",{className:At.accountList,children:x.jsx("div",{className:At.listScroll,children:s.map((T,E)=>x.jsxs("div",{className:bt(At.accountItem,T.openid===a?.openid&&At.active),onClick:()=>S(E),children:[x.jsx("div",{className:At.itemInfo,children:x.jsx("span",{className:At.itemName,children:T.username})}),x.jsx("div",{className:At.deleteBtn,onClick:O=>C(O,E),children:x.jsx(I1,{className:"size-4 text-gray-400 hover:text-red-500"})})]},T.openid))})})]}),x.jsx(Xt,{className:"w-full h-10 mt-4 mb-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",disabled:d,onClick:b,children:d?"登录中...":"登录"}),x.jsx(Ws,{}),x.jsx(bi,{open:h,onOpenChange:m,showCloseIcon:!1,classNames:{popup:"w-[300px] p-6"},children:x.jsxs("div",{className:"text-center",children:[x.jsxs("div",{className:"mb-4",children:[x.jsx("p",{className:"text-base font-medium text-gray-900",children:"是否确认删除该条账号登录记录?"}),x.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"删除后登录记录将不会保存。"})]}),x.jsxs("div",{className:"flex gap-3 mt-6",children:[x.jsx(Xt,{className:"flex-1 h-9 border border-gray-300 rounded-full text-gray-600",onClick:()=>m(!1),children:"取消"}),x.jsx(Xt,{className:"flex-1 h-9 bg-gradient-to-r from-[#497efe] to-[#947afa] text-white rounded-full",onClick:w,children:"确认删除"})]})]})})]})}const FI=Im({name:vi().refine(e=>e.length>=1,{error:"请输入真实姓名",abort:!0}).refine(e=>/^[\u4e00-\u9fa5]{2,6}$/.test(e),{error:"姓名须由 2-6 个汉字组成",abort:!0}),idcard:vi().refine(e=>e.length>=1,{error:"请输入身份证号",abort:!0}).refine(e=>/^\d{17}(\d|X|x)$/.test(e),{error:"身份证号格式不正确",abort:!0})});function $I(){const{gameId:e,onLoginSuccess:t,onAccountLoginSuccess:n,onPhoneLoginSuccess:r,showRealNameModal:o,setShowRealNameModal:s,onClose:i}=xn(),[a,c]=p.useState({}),{mutate:l,isPending:u}=mr({mutationFn:async f=>{const m=Nr(e)[0];if(!m)throw new Error("未找到登录账号信息");await L1({uid:m.uid,authorization:m.authorization,name:f.name,idcard:f.idcard});const g=await F1(m.authorization),y={account:g.account,entity:g.channel_info.entity,token:g.channel_info.token,sign:g.channel_info.sign,accid:g.channel_info.entity.openid,extra_data:g.channel_info.extra_data,gaplaySign:g.channel_info.gaplaySign,realname:g.channel_info.realname};fn.success("实名认证成功"),s(!1),y.account?.mobile?r?.(y):n?.(y),t?.(y)},onError:f=>{fn.error(f.message||"实名认证失败")}}),d=f=>{const h=FI.safeParse(f);if(!h.success){c(ci(h.error).fieldErrors);return}c({}),l(h.data)};return x.jsxs(bi,{open:o,onOpenChange:s,title:"实名认证",showCloseIcon:!1,disablePointerDismissal:!0,classNames:{popup:"w-[400px] p-6 rounded-2xl",title:"text-center text-xl mb-3"},children:[x.jsx("div",{className:"text-sm text-gray-500 mb-6 text-center",children:"根据《关于防止未成年人沉迷网络游戏的通知》,游戏用户需使用有效身份证进行实名认证。"}),x.jsxs(Eo,{onFormSubmit:d,errors:a,className:"space-y-4",children:[x.jsxs(Kt,{name:"name",children:[x.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:x.jsx(On,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的真实姓名"})}),x.jsx(wo,{className:"mt-1 ml-2 text-xs text-red-500"})]}),x.jsxs(Kt,{name:"idcard",children:[x.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:x.jsx(On,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的身份证号",maxLength:18})}),x.jsx(wo,{className:"mt-1 ml-2 text-xs text-red-500"})]}),x.jsx(Xt,{type:"submit",className:"w-full h-12 mt-6 text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full font-bold shadow-lg disabled:opacity-50",disabled:u,children:u?"提交中...":"提交认证"}),x.jsx("button",{type:"button",className:"w-full mt-4 text-sm text-gray-400 hover:text-gray-600 transition-colors",onClick:i,children:"退出游戏"})]})]})}const $m={modal:"_modal_1pbx2_2",close:"_close_1pbx2_8"},wi={autoLoginHint:"_autoLoginHint_h58ls_1",left:"_left_h58ls_22",loading:"_loading_h58ls_28",switchBtn:"_switchBtn_h58ls_37"};function zI({onSwitch:e}){const{autoLoginAccountName:t,setIsAutoLoggingIn:n}=xn(),r=()=>{n(!1),e()};return x.jsxs("div",{className:wi.autoLoginHint,children:[x.jsxs("div",{className:wi.left,children:[x.jsx("div",{className:wi.loading}),x.jsxs("span",{children:[t," 正在登录..."]})]}),x.jsx("button",{className:wi.switchBtn,onClick:r,children:"切换账号"})]})}function VI({open:e,onOpenChange:t}){const{gameId:n,loginTypes:r,currentLoginType:o,closeable:s,isShowGiantLogo:i,onLoginSuccess:a,triggerRealNameAuth:c,showRealNameModal:l,setIsAutoLoggingIn:u,setAutoLoginAccountName:d}=xn(),[f,h]=z.useState(!1),m=z.useMemo(()=>Nr(n),[n,e]),g=e&&m.length>0&&!f;z.useEffect(()=>{if(!e){h(!1),u(!1);return}if(g){const C=m[0];(async()=>{if(!C){h(!0);return}u(!0),d(C.username);try{wf(C.authorization);const b=await Dp(),T={account:b.account,entity:b.channel_info.entity,token:b.channel_info.token,sign:b.channel_info.sign,accid:b.channel_info.entity.openid,extra_data:b.channel_info.extra_data,gaplaySign:b.channel_info.gaplaySign,realname:b.channel_info.realname};if(Ns(T,C.authorization,n),T.realname&&T.realname.reject>=2){u(!1),h(!0),c();return}u(!1),h(!0),t?.(!1),a?.(T)}catch(b){console.error("Auto quick login failed:",b),u(!1),h(!0)}})()}},[e,n,g]);const y=Sf({loginTypes:r,gameId:n}),v=Cf({loginTypes:r,gameId:n}),S=Ef({loginTypes:r,gameId:n});return x.jsxs(x.Fragment,{children:[g&&x.jsx(zI,{onSwitch:()=>h(!0)}),x.jsxs(bi,{open:e&&!g&&!l,onOpenChange:t,classNames:{popup:bt("w-[400px] p-5",$m.modal),close:$m.close},showCloseIcon:s,children:[i&&!YE(n)&&x.jsx("section",{className:"flex items-center justify-center mb-6",children:x.jsx("img",{src:n==="5327"?"https://cdn-imgs.sdk.mobileztgame.com/paycenter/260511150749961295.png":"https://h5.sdk.mobileztgame.com/dist/bg_logo.png",className:"aspect-[240/85] w-32"})}),x.jsxs("section",{children:[o==="quick"&&x.jsx(LI,{}),o===He.MOBILE&&v&&x.jsx(Lm,{}),o===He.ROLE_ID&&y&&x.jsx(Fm,{}),o===He.GIANT&&S&&x.jsx(aT,{})]})]}),x.jsx($I,{})]})}class jI extends z.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t){console.error("[Login SDK] Uncaught error:",t)}render(){return this.state.hasError?null:this.props.children}}function cu({open:e,onOpenChange:t,sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:c=!0,mountToaster:l=!0,toastConfigs:u,...d}){const[f]=z.useState(()=>new pg);return x.jsxs(z.StrictMode,{children:[x.jsx(gg,{client:f,children:x.jsx(Nf,{value:{sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:h=>{nS(eS({gameId:or(d.gameId),serverUserInfo:h})),i?.(h)},onLoginError:a,closeable:c,onClose:()=>t?.(!1),...d},children:x.jsx(jI,{children:x.jsx(VI,{open:e,onOpenChange:t})})})}),l&&x.jsx(WE,{toastConfigs:u})]})}const zm=e=>Za(or(e)),Vm=e=>tS(or(e)),jm=e=>!!Za(or(e));function Bm({loginTypes:e,defaultLoginType:t,gameId:n,onLoginSuccess:r,onLoginError:o}){const s=or(n);if(document.querySelector(".login-sdk-container"))return console.warn("Login component is already active. Multiple instances are not allowed."),{close:()=>{}};const i=document.createElement("div");i.className="login-sdk-container",document.body.appendChild(i);const a=Um.createRoot(i),c=()=>{setTimeout(()=>{a.unmount(),i.remove()},200)},l=()=>{a.render(x.jsx(cu,{gameId:s,loginTypes:e,defaultLoginType:t,open:!1,onOpenChange:u,onLoginSuccess:r,onLoginError:o})),c()},u=d=>{d||l()};return a.render(x.jsx(cu,{gameId:s,loginTypes:e,defaultLoginType:t,open:!0,onOpenChange:u,onLoginSuccess:r,onLoginError:o})),{close:l}}const BI={init:If,login:Bm,logout:Vm,getUserInfo:zm,isLoggedIn:jm};at.ConfigProvider=Nf,at.Login=cu,at.MobileLogin=Lm,at.SDK=BI,at.UidLogin=Fm,at.getGameId=or,at.getUserInfo=zm,at.init=If,at.isLoggedIn=jm,at.login=Bm,at.logout=Vm,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})}));