@gup-fe/js-sdk 2.2.1 → 2.4.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.
- package/README.md +0 -178
- package/dist/js-sdk.bundle.js +24418 -24743
- package/dist/js-sdk.bundle.umd.js +149 -195
- package/dist/js-sdk.js +10581 -10906
- package/dist/js-sdk.umd.js +30 -76
- package/package.json +4 -4
package/dist/js-sdk.umd.js
CHANGED
|
@@ -1,112 +1,66 @@
|
|
|
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+=`
|
|
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_1e3h3_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));--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}._popup_1e3h3_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_1e3h3_5[data-starting-style],._popup_1e3h3_5[data-ending-style]{opacity:0;transform:scale(.95)}._popup_1e3h3_5[data-side=none][data-starting-style]{transform:scale(1);opacity:1}._item_1e3h3_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_1e3h3_24:last-child{border-bottom-width:0px}._item_1e3h3_24:first-of-type{border-top-left-radius:1rem;border-top-right-radius:1rem}._item_1e3h3_24:last-of-type{border-bottom-left-radius:1rem;border-bottom-right-radius:1rem}._item_1e3h3_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_1e3h3_40{grid-column-start:1}._itemText_1e3h3_44{grid-column-start:2;display:flex;justify-content:space-between}._itemCode_1e3h3_48{font-weight:500}._itemLabel_1e3h3_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}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.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}.ml-3{margin-left:.75rem}.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}.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-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))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68 / 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-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-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}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.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}.font-semibold{font-weight:600}.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-800{--tw-text-opacity: 1;color:rgb(31 41 55 / 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-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}.ring{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.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}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.\\[transform\\:translateY\\(var\\(--drawer-swipe-movement-y\\)\\)\\]{transform:translateY(var(--drawer-swipe-movement-y))}.placeholder\\:text-sm::-moz-placeholder{font-size:.875rem;line-height:1.25rem}.placeholder\\:text-sm::placeholder{font-size:.875rem;line-height:1.25rem}.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-\\[ending-style\\]\\:translate-y-full[data-ending-style],.data-\\[starting-style\\]\\:translate-y-full[data-starting-style]{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.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]{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%}.group[data-focused] .group-data-\\[focused\\]\\:border-\\[var\\(--jssdk-primary-color\\)\\]{border-color:var(--jssdk-primary-color)}.group[data-focused] .group-data-\\[focused\\]\\:shadow-\\[0_0_6px_color-mix\\(in_srgb\\,var\\(--jssdk-primary-color\\)\\,transparent_80\\%\\)\\]{--tw-shadow: 0 0 6px color-mix(in srgb,var(--jssdk-primary-color),transparent 80%);--tw-shadow-colored: 0 0 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)}.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(yt,w){typeof exports=="object"&&typeof module<"u"?w(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"],w):(yt=typeof globalThis<"u"?globalThis:yt||self,w(yt.SDK={},yt.jsxRuntime,yt.ReactDOM,yt.React,yt.ReactDOM))})(this,(function(yt,w,em,oe,tm){"use strict";function Uc(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=Uc(oe),Kt=Uc(tm);var Kr=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(){}},Ro=typeof window>"u"||"Deno"in globalThis;function Jt(){}function nm(e,t){return typeof e=="function"?e(t):e}function rm(e){return typeof e=="number"&&e>=0&&e!==1/0}function om(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gi(e,t){return typeof e=="function"?e(t):e}function sm(e,t){return typeof e=="function"?e(t):e}function Bc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==yi(i,t.options))return!1}else if(!Jr(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 Wc(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(tr(t.options.mutationKey)!==tr(s))return!1}else if(!Jr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function yi(e,t){return(t?.queryKeyHashFn||tr)(e)}function tr(e){return JSON.stringify(e,(t,n)=>bi(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Jr(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Jr(e[n],t[n])):!1}function vi(e,t){if(e===t)return e;const n=Zc(e)&&Zc(t);if(n||bi(e)&&bi(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 u=0;for(let l=0;l<i;l++){const d=n?l:s[l];(!n&&c.has(d)||n)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,u++):(a[d]=vi(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&u++)}return o===i&&u===o?e:a}return t}function im(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 Zc(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function bi(e){if(!Gc(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Gc(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Gc(e){return Object.prototype.toString.call(e)==="[object Object]"}function am(e){return new Promise(t=>{setTimeout(t,e)})}function cm(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 vi(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 vi(e,t)}return t}function um(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function lm(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var No=Symbol();function Yc(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===No&&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===No?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function dm(e,t){return typeof e=="function"?e(...t):!!e}var fm=class extends Kr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&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"}},Xc=new fm,pm=class extends Kr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Ro&&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 pm;function hm(){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 mm(e){return Math.min(1e3*2**e,3e4)}function qc(e){return(e??"online")==="online"?Mo.isOnline():!0}var Kc=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wi(e){return e instanceof Kc}function Jc(e){let t=!1,n=0,r=!1,o;const s=hm(),i=g=>{r||(p(new Kc(g)),e.abort?.())},a=()=>{t=!0},c=()=>{t=!1},u=()=>Xc.isFocused()&&(e.networkMode==="always"||Mo.isOnline())&&e.canRun(),l=()=>qc(e.networkMode)&&e.canRun(),d=g=>{r||(r=!0,e.onSuccess?.(g),o?.(),s.resolve(g))},p=g=>{r||(r=!0,e.onError?.(g),o?.(),s.reject(g))},h=()=>new Promise(g=>{o=v=>{(r||u())&&g(v)},e.onPause?.()}).then(()=>{o=void 0,r||e.onContinue?.()}),m=()=>{if(r)return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(y){g=Promise.reject(y)}Promise.resolve(g).then(d).catch(y=>{if(r)return;const C=e.retry??(Ro?0:3),S=e.retryDelay??mm,E=typeof S=="function"?S(n,y):S,b=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,y);if(t||!b){p(y);return}n++,e.onFail?.(n,y),am(E).then(()=>u()?void 0:h()).then(()=>{t?p(y):m()})})};return{promise:s,cancel:i,continue:()=>(o?.(),s),cancelRetry:a,continueRetry:c,canStart:l,start:()=>(l()?m():h().then(m),s)}}var gm=e=>setTimeout(e,0);function ym(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=gm;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 Ot=ym(),Qc=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rm(this.gcTime)&&(this.#e=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ro?1/0:300*1e3))}clearGcTimeout(){this.#e&&(clearTimeout(this.#e),this.#e=void 0)}},vm=class extends Qc{#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=wm(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=cm(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(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>sm(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===No||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>gi(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:!om(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(u=>u.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=Yc(this.options,t),l=(()=>{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,l,this):c(l)},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=>{wi(c)&&c.silent||this.#s({type:"error",error:c}),wi(c)||(this.#n.config.onError?.(c,this),this.#n.config.onSettled?.(this.state.data,c,this)),this.scheduleGc()};return this.#o=Jc({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(u){a(u);return}this.#n.config.onSuccess?.(c,this),this.#n.config.onSettled?.(c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,u)=>{this.#s({type:"failed",failureCount:c,error:u})},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,...bm(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 wi(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),Ot.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function bm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qc(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function wm(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 Sm=class extends Kr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,o=t.queryHash??yi(r,t);let s=this.get(o);return s||(s=new vm({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(){Ot.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=>Bc(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Bc(e,n)):t}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ot.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Em=class extends Qc{#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=Jc({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),Ot.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 xm=class extends Kr{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 Em({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=Ao(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=Ao(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=Ao(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=Ao(e);return typeof t=="string"?this.#t.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Ot.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=>Wc(t,n))}findAll(e={}){return this.getAll().filter(t=>Wc(e,t))}notify(e){Ot.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Ot.batch(()=>Promise.all(e.map(t=>t.continue().catch(Jt))))}};function Ao(e){return e.options.scope?.id}function tu(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 u=async()=>{let l=!1;const d=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",()=>{l=!0}),t.signal)})},p=Yc(t.options,t.fetchOptions),h=async(m,g,v)=>{if(l)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const C=(()=>{const x={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return d(x),x})(),S=await p(C),{maxPages:E}=t.options,b=v?lm:um;return{pages:b(m.pages,S,E),pageParams:b(m.pageParams,g,E)}};if(o&&s.length){const m=o==="backward",g=m?Cm:nu,v={pages:s,pageParams:i},y=g(r,v);a=await h(v,y,m)}else{const m=e??s.length;do{const g=c===0?i[0]??r.initialPageParam:nu(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?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function nu(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 Cm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Tm=class{#e;#t;#n;#r;#o;#i;#a;#s;constructor(e={}){this.#e=e.queryCache||new Sm,this.#t=e.mutationCache||new xm,this.#n=e.defaultOptions||{},this.#r=new Map,this.#o=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Xc.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(gi(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=nm(t,s);if(i!==void 0)return this.#e.build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ot.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;Ot.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Ot.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ot.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e,t={}){return Ot.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=Ot.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(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(gi(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=tu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=tu(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(tr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Jr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#o.set(tr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#o.values()],n={};return t.forEach(r=>{Jr(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=yi(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===No&&(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()}},Om=class extends Kr{#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),im(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&tr(n.mutationKey)!==tr(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){Ot.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)})})}},ru=f.createContext(void 0),Pm=e=>{const t=f.useContext(ru);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},_m=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),w.jsx(ru.Provider,{value:e,children:t}));function sn(e,t){const n=Pm(),[r]=f.useState(()=>new Om(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);const o=f.useSyncExternalStore(f.useCallback(i=>r.subscribe(Ot.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=f.useCallback((i,a)=>{r.mutate(i,a).catch(Jt)},[r]);if(o.error&&dm(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}var Si=function(){return Si=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},Si.apply(this,arguments)};function pn(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(l){try{u(r.next(l))}catch(d){i(d)}}function c(l){try{u(r.throw(l))}catch(d){i(d)}}function u(l){l.done?s(l.value):o(l.value).then(a,c)}u((r=r.apply(e,t||[])).next())})}function hn(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(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(n=0)),n;)try{if(r=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(l){u=[6,l],o=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Im(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 ou(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 su="4.6.2";function Do(e,t){return new Promise(function(n){return setTimeout(n,e,t)})}function km(){return new Promise(function(e){var t=new MessageChannel;t.port1.onmessage=function(){return e()},t.port2.postMessage(null)})}function Rm(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})}):Do(Math.min(e,t))}function iu(e){return!!e&&typeof e.then=="function"}function au(e,t){try{var n=e();iu(n)?n.then(function(r){return t(!0,r)},function(r){return t(!1,r)}):t(!0,n)}catch(r){t(!1,r)}}function cu(e,t,n){return n===void 0&&(n=16),pn(this,void 0,void 0,function(){var r,o,s,i;return hn(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,km()]):[3,3]):[3,4];case 2:a.sent(),a.label=3;case 3:return++s,[3,1];case 4:return[2,r]}})})}function Qr(e){return e.then(void 0,function(){}),e}function Nm(e,t){for(var n=0,r=e.length;n<r;++n)if(e[n]===t)return!0;return!1}function Mm(e,t){return!Nm(e,t)}function Ei(e){return parseInt(e)}function an(e){return parseFloat(e)}function In(e,t){return typeof e=="number"&&isNaN(e)?t:e}function Nt(e){return e.reduce(function(t,n){return t+(n?1:0)},0)}function uu(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 Am(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(p,h){i[p]=i[p]||[],i[p].push(h)};;){var u=a.exec(o[2]);if(!u)break;var l=u[0];switch(l[0]){case".":c("class",l.slice(1));break;case"#":c("id",l.slice(1));break;case"[":{var d=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(l);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 Dm(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 jn(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,u=t[1]&65535,l=0,d=0,p=0,h=0;h+=s+u,p+=h>>>16,h&=65535,p+=o+c,d+=p>>>16,p&=65535,d+=r+a,l+=d>>>16,d&=65535,l+=n+i,l&=65535,e[0]=l<<16|d,e[1]=p<<16|h}function Qt(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,u=t[1]&65535,l=0,d=0,p=0,h=0;h+=s*u,p+=h>>>16,h&=65535,p+=o*u,d+=p>>>16,p&=65535,p+=s*c,d+=p>>>16,p&=65535,d+=r*u,l+=d>>>16,d&=65535,d+=o*c,l+=d>>>16,d&=65535,d+=s*a,l+=d>>>16,d&=65535,l+=n*u+r*c+o*a+s*i,l&=65535,e[0]=l<<16|d,e[1]=p<<16|h}function Tr(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 Wt(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 dt(e,t){e[0]^=t[0],e[1]^=t[1]}var Lm=[4283543511,3981806797],Fm=[3301882366,444984403];function lu(e){var t=[0,e[0]>>>1];dt(e,t),Qt(e,Lm),t[1]=e[0]>>>1,dt(e,t),Qt(e,Fm),t[1]=e[0]>>>1,dt(e,t)}var Lo=[2277735313,289559509],Fo=[1291169091,658871167],du=[0,5],Vm=[0,1390208809],zm=[0,944331445];function $m(e,t){var n=Dm(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],u=[0,0],l;for(l=0;l<s;l=l+16)c[0]=n[l+4]|n[l+5]<<8|n[l+6]<<16|n[l+7]<<24,c[1]=n[l]|n[l+1]<<8|n[l+2]<<16|n[l+3]<<24,u[0]=n[l+12]|n[l+13]<<8|n[l+14]<<16|n[l+15]<<24,u[1]=n[l+8]|n[l+9]<<8|n[l+10]<<16|n[l+11]<<24,Qt(c,Lo),Tr(c,31),Qt(c,Fo),dt(i,c),Tr(i,27),jn(i,a),Qt(i,du),jn(i,Vm),Qt(u,Fo),Tr(u,33),Qt(u,Lo),dt(a,u),Tr(a,31),jn(a,i),Qt(a,du),jn(a,zm);c[0]=0,c[1]=0,u[0]=0,u[1]=0;var d=[0,0];switch(o){case 15:d[1]=n[l+14],Wt(d,48),dt(u,d);case 14:d[1]=n[l+13],Wt(d,40),dt(u,d);case 13:d[1]=n[l+12],Wt(d,32),dt(u,d);case 12:d[1]=n[l+11],Wt(d,24),dt(u,d);case 11:d[1]=n[l+10],Wt(d,16),dt(u,d);case 10:d[1]=n[l+9],Wt(d,8),dt(u,d);case 9:d[1]=n[l+8],dt(u,d),Qt(u,Fo),Tr(u,33),Qt(u,Lo),dt(a,u);case 8:d[1]=n[l+7],Wt(d,56),dt(c,d);case 7:d[1]=n[l+6],Wt(d,48),dt(c,d);case 6:d[1]=n[l+5],Wt(d,40),dt(c,d);case 5:d[1]=n[l+4],Wt(d,32),dt(c,d);case 4:d[1]=n[l+3],Wt(d,24),dt(c,d);case 3:d[1]=n[l+2],Wt(d,16),dt(c,d);case 2:d[1]=n[l+1],Wt(d,8),dt(c,d);case 1:d[1]=n[l],dt(c,d),Qt(c,Lo),Tr(c,31),Qt(c,Fo),dt(i,c)}return dt(i,r),dt(a,r),jn(i,a),jn(a,i),lu(i),lu(a),jn(i,a),jn(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 jm(e){var t;return Si({name:e.name,message:e.message,stack:(t=e.stack)===null||t===void 0?void 0:t.split(`
|
|
3
|
+
`)},e)}function Hm(e){return/^function\s.*?\{\s*\[native code]\s*}$/.test(String(e))}function Um(e){return typeof e!="function"}function Bm(e,t){var n=Qr(new Promise(function(r){var o=Date.now();au(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(Um(c))return r(function(){return{value:c,duration:a}});r(function(){return new Promise(function(u){var l=Date.now();au(c,function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];var h=a+Date.now()-l;if(!d[0])return u({error:d[1],duration:h});u({value:d[1],duration:h})})})})})}));return function(){return n.then(function(o){return o()})}}function Wm(e,t,n,r){var o=Object.keys(e).filter(function(i){return Mm(n,i)}),s=Qr(cu(o,function(i){return Bm(e[i],t)},r));return function(){return pn(this,void 0,void 0,function(){var a,c,u,l,d;return hn(this,function(p){switch(p.label){case 0:return[4,s];case 1:return a=p.sent(),[4,cu(a,function(h){return Qr(h())},r)];case 2:return c=p.sent(),[4,Promise.all(c)];case 3:for(u=p.sent(),l={},d=0;d<o.length;++d)l[o[d]]=u[d];return[2,l]}})})}}function fu(){var e=window,t=navigator;return Nt(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function Zm(){var e=window,t=navigator;return Nt(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!fu()}function eo(){var e=window,t=navigator;return Nt(["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 cn(){var e=window,t=navigator;return Nt(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,t.vendor.indexOf("Apple")===0,"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function xi(){var e=window,t=e.HTMLElement,n=e.Document;return Nt(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function to(){var e=window;return Hm(e.print)&&String(e.browser)==="[object WebPageNamespace]"}function pu(){var e,t,n=window;return Nt(["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 Gm(){var e=window;return Nt([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}function Ym(){var e=window,t=e.URLPattern;return Nt(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}function Xm(){var e=window;return Nt(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}function no(){var e=window,t=navigator,n=e.CSS,r=e.HTMLButtonElement;return Nt([!("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 qm(){if(navigator.platform==="iPad")return!0;var e=screen,t=e.width/e.height;return Nt(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}function Km(){var e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null}function Jm(){var e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}function Ci(){var e=eo(),t=pu(),n=window,r=navigator,o="connection";return e?Nt([!("SharedWorker"in n),r[o]&&"ontypechange"in r[o],!("sinkId"in new Audio)])>=2:t?Nt(["onorientationchange"in n,"orientation"in n,/android/i.test(r.appVersion)])>=2:!1}function Qm(){var e=navigator,t=window,n=Audio.prototype,r=t.visualViewport;return Nt(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,r&&"segments"in r,"getTextInformation"in Image.prototype])>=3}function eg(){return rg()?-4:tg()}function tg(){var e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(ng())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=og(o),c=a[0],u=a[1],l=Qr(c.then(function(d){return sg(d.getChannelData(0).subarray(n))},function(d){if(d.name==="timeout"||d.name==="suspended")return-3;throw d}));return function(){return u(),l}}function ng(){return cn()&&!xi()&&!Xm()}function rg(){return cn()&&no()&&to()||eo()&&Qm()&&Ym()}function og(e){var t=3,n=500,r=500,o=5e3,s=function(){},i=new Promise(function(a,c){var u=!1,l=0,d=0;e.oncomplete=function(m){return a(m.renderedBuffer)};var p=function(){setTimeout(function(){return c(hu("timeout"))},Math.min(r,d+o-Date.now()))},h=function(){try{var m=e.startRendering();switch(iu(m)&&Qr(m),e.state){case"running":d=Date.now(),u&&p();break;case"suspended":document.hidden||l++,u&&l>=t?c(hu("suspended")):setTimeout(h,n);break}}catch(g){c(g)}};h(),s=function(){u||(u=!0,d>0&&p())}});return[i,s]}function sg(e){for(var t=0,n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}function hu(e){var t=new Error(e);return t.name=e,t}function mu(e,t,n){var r,o,s;return n===void 0&&(n=50),pn(this,void 0,void 0,function(){var i,a;return hn(this,function(c){switch(c.label){case 0:i=document,c.label=1;case 1:return i.body?[3,3]:[4,Do(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(u,l){var d=!1,p=function(){d=!0,u()},h=function(v){d=!0,l(v)};a.onload=p,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 v,y;d||(((y=(v=a.contentWindow)===null||v===void 0?void 0:v.document)===null||y===void 0?void 0:y.readyState)==="complete"?p():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,Do(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 ig(e){for(var t=Am(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"?ag(o.style,c):o.setAttribute(a,c)}return o}function ag(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 cg(){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 ug="mmMwWLliI0O&1",lg="48px",Or=["monospace","sans-serif","serif"],gu=["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 dg(){var e=this;return mu(function(t,n){var r=n.document;return pn(e,void 0,void 0,function(){var o,s,i,a,c,u,l,d,p,h,m,g;return hn(this,function(v){for(o=r.body,o.style.fontSize=lg,s=r.createElement("div"),s.style.setProperty("visibility","hidden","important"),i={},a={},c=function(y){var C=r.createElement("span"),S=C.style;return S.position="absolute",S.top="0",S.left="0",S.fontFamily=y,C.textContent=ug,s.appendChild(C),C},u=function(y,C){return c("'".concat(y,"',").concat(C))},l=function(){return Or.map(c)},d=function(){for(var y={},C=function(x){y[x]=Or.map(function(T){return u(x,T)})},S=0,E=gu;S<E.length;S++){var b=E[S];C(b)}return y},p=function(y){return Or.some(function(C,S){return y[S].offsetWidth!==i[C]||y[S].offsetHeight!==a[C]})},h=l(),m=d(),o.appendChild(s),g=0;g<Or.length;g++)i[Or[g]]=h[g].offsetWidth,a[Or[g]]=h[g].offsetHeight;return[2,gu.filter(function(y){return p(m[y])})]})})})}function fg(){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 pg(){return hg(Sg())}function hg(e){var t,n=!1,r,o,s=mg(),i=s[0],a=s[1];return gg(i,a)?(n=yg(a),e?r=o="skipped":(t=vg(i,a),r=t[0],o=t[1])):r=o="unsupported",{winding:n,geometry:r,text:o}}function mg(){var e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}function gg(e,t){return!!(t&&e.toDataURL)}function yg(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}function vg(e,t){bg(e,t);var n=Ti(e),r=Ti(e);if(n!==r)return["unstable","unstable"];wg(e,t);var o=Ti(e);return[o,n]}function bg(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 wg(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 Ti(e){return e.toDataURL()}function Sg(){return cn()&&no()&&to()}function Eg(){var e=navigator,t=0,n;e.maxTouchPoints!==void 0?t=Ei(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 xg(){return navigator.oscpu}function Cg(){var e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(n!==void 0&&t.push([n]),Array.isArray(e.languages))eo()&&Gm()||t.push(e.languages);else if(typeof e.languages=="string"){var r=e.languages;r&&t.push(r.split(","))}return t}function Tg(){return window.screen.colorDepth}function Og(){return In(an(navigator.deviceMemory),void 0)}function Pg(){if(!(cn()&&no()&&to()))return _g()}function _g(){var e=screen,t=function(r){return In(Ei(r),null)},n=[t(e.width),t(e.height)];return n.sort().reverse(),n}var Ig=2500,kg=10,Vo,Oi;function Rg(){if(Oi===void 0){var e=function(){var t=Pi();_i(t)?Oi=setTimeout(e,Ig):(Vo=t,Oi=void 0)};e()}}function Ng(){var e=this;return Rg(),function(){return pn(e,void 0,void 0,function(){var t;return hn(this,function(n){switch(n.label){case 0:return t=Pi(),_i(t)?Vo?[2,ou([],Vo,!0)]:Km()?[4,Jm()]:[3,2]:[3,2];case 1:n.sent(),t=Pi(),n.label=2;case 2:return _i(t)||(Vo=t),[2,t]}})})}}function Mg(){var e=this;if(cn()&&no()&&to())return function(){return Promise.resolve(void 0)};var t=Ng();return function(){return pn(e,void 0,void 0,function(){var n,r;return hn(this,function(o){switch(o.label){case 0:return[4,t()];case 1:return n=o.sent(),r=function(s){return s===null?null:uu(s,kg)},[2,[r(n[0]),r(n[1]),r(n[2]),r(n[3])]]}})})}}function Pi(){var e=screen;return[In(an(e.availTop),null),In(an(e.width)-an(e.availWidth)-In(an(e.availLeft),0),null),In(an(e.height)-an(e.availHeight)-In(an(e.availTop),0),null),In(an(e.availLeft),null)]}function _i(e){for(var t=0;t<4;++t)if(e[t])return!1;return!0}function Ag(){return In(Ei(navigator.hardwareConcurrency),void 0)}function Dg(){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=-Lg();return"UTC".concat(r>=0?"+":"").concat(r)}function Lg(){var e=new Date().getFullYear();return Math.max(an(new Date(e,0,1).getTimezoneOffset()),an(new Date(e,6,1).getTimezoneOffset()))}function Fg(){try{return!!window.sessionStorage}catch{return!0}}function Vg(){try{return!!window.localStorage}catch{return!0}}function zg(){if(!(fu()||Zm()))try{return!!window.indexedDB}catch{return!0}}function $g(){return!!window.openDatabase}function jg(){return navigator.cpuClass}function Hg(){var e=navigator.platform;return e==="MacIntel"&&cn()&&!xi()?qm()?"iPad":"iPhone":e}function Ug(){return navigator.vendor||""}function Bg(){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 Wg(){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 Zg(){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 Gg(e){var t=e===void 0?{}:e,n=t.debug;return pn(this,void 0,void 0,function(){var r,o,s,i,a,c;return hn(this,function(u){switch(u.label){case 0:return Yg()?(r=Zg(),o=Object.keys(r),s=(c=[]).concat.apply(c,o.map(function(l){return r[l]})),[4,Xg(s)]):[2,void 0];case 1:return i=u.sent(),n&&qg(r,i),a=o.filter(function(l){var d=r[l],p=Nt(d.map(function(h){return i[h]}));return p>d.length*.6}),a.sort(),[2,a]}})})}function Yg(){return cn()||Ci()}function Xg(e){var t;return pn(this,void 0,void 0,function(){var n,r,o,s,c,i,a,c;return hn(this,function(u){switch(u.label){case 0:for(n=document,r=n.createElement("div"),o=new Array(e.length),s={},yu(r),c=0;c<e.length;++c)i=ig(e[c]),i.tagName==="DIALOG"&&i.show(),a=n.createElement("div"),yu(a),a.appendChild(i),r.appendChild(a),o[c]=i;u.label=1;case 1:return n.body?[3,3]:[4,Do(50)];case 2:return u.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 yu(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function qg(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
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
|
|
5
|
+
`.concat(t[c]?"🚫":"➡️"," ").concat(c)}}console.log("".concat(n,"\n```"))}function Kg(){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 Jg(){if(vu("inverted"))return!0;if(vu("none"))return!1}function vu(e){return matchMedia("(inverted-colors: ".concat(e,")")).matches}function Qg(){if(bu("active"))return!0;if(bu("none"))return!1}function bu(e){return matchMedia("(forced-colors: ".concat(e,")")).matches}var ey=100;function ty(){if(matchMedia("(min-monochrome: 0)").matches){for(var e=0;e<=ey;++e)if(matchMedia("(max-monochrome: ".concat(e,")")).matches)return e;throw new Error("Too high value")}}function ny(){if(Pr("no-preference"))return 0;if(Pr("high")||Pr("more"))return 1;if(Pr("low")||Pr("less"))return-1;if(Pr("forced"))return 10}function Pr(e){return matchMedia("(prefers-contrast: ".concat(e,")")).matches}function ry(){if(wu("reduce"))return!0;if(wu("no-preference"))return!1}function wu(e){return matchMedia("(prefers-reduced-motion: ".concat(e,")")).matches}function oy(){if(Su("reduce"))return!0;if(Su("no-preference"))return!1}function Su(e){return matchMedia("(prefers-reduced-transparency: ".concat(e,")")).matches}function sy(){if(Eu("high"))return!0;if(Eu("standard"))return!1}function Eu(e){return matchMedia("(dynamic-range: ".concat(e,")")).matches}var et=Math,Mt=function(){return 0};function iy(){var e=et.acos||Mt,t=et.acosh||Mt,n=et.asin||Mt,r=et.asinh||Mt,o=et.atanh||Mt,s=et.atan||Mt,i=et.sin||Mt,a=et.sinh||Mt,c=et.cos||Mt,u=et.cosh||Mt,l=et.tan||Mt,d=et.tanh||Mt,p=et.exp||Mt,h=et.expm1||Mt,m=et.log1p||Mt,g=function(P){return et.pow(et.PI,P)},v=function(P){return et.log(P+et.sqrt(P*P-1))},y=function(P){return et.log(P+et.sqrt(P*P+1))},C=function(P){return et.log((1+P)/(1-P))/2},S=function(P){return et.exp(P)-1/et.exp(P)/2},E=function(P){return(et.exp(P)+1/et.exp(P))/2},b=function(P){return et.exp(P)-1},x=function(P){return(et.exp(2*P)-1)/(et.exp(2*P)+1)},T=function(P){return et.log(1+P)};return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:v(1e154),asin:n(.12312423423423424),asinh:r(1),asinhPf:y(1),atanh:o(.5),atanhPf:C(.5),atan:s(.5),sin:i(-1e300),sinh:a(1),sinhPf:S(1),cos:c(10.000000000123),cosh:u(1),coshPf:E(1),tan:l(-1e300),tanh:d(1),tanhPf:x(1),exp:p(1),expm1:h(1),expm1Pf:b(1),log1p:m(10),log1pPf:T(10),powPI:g(-100)}}var ay="mmMwWLliI0fiflO&1",Ii={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function cy(){return uy(function(e,t){for(var n={},r={},o=0,s=Object.keys(Ii);o<s.length;o++){var i=s[o],a=Ii[i],c=a[0],u=c===void 0?{}:c,l=a[1],d=l===void 0?ay:l,p=e.createElement("span");p.textContent=d,p.style.whiteSpace="nowrap";for(var h=0,m=Object.keys(u);h<m.length;h++){var g=m[h],v=u[g];v!==void 0&&(p.style[g]=v)}n[i]=p,t.append(e.createElement("br"),p)}for(var y=0,C=Object.keys(Ii);y<C.length;y++){var i=C[y];r[i]=n[i].getBoundingClientRect().width}return r})}function uy(e,t){return t===void 0&&(t=4e3),mu(function(n,r){var o=r.document,s=o.body,i=s.style;i.width="".concat(t,"px"),i.webkitTextSizeAdjust=i.textSizeAdjust="none",eo()?s.style.zoom="".concat(1/r.devicePixelRatio):cn()&&(s.style.zoom="reset");var a=o.createElement("div");return a.textContent=ou([],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 ly(){return navigator.pdfViewerEnabled}function dy(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}function fy(){var e=window.ApplePaySession;if(typeof e?.canMakePayments!="function")return-1;if(py())return-3;try{return e.canMakePayments()?1:0}catch(t){return hy(t)}}var py=cg;function hy(e){if(e instanceof Error&&e.name==="InvalidAccessError"&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}function my(){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 xu=-1,Cu=-2,gy=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]),yy=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),vy=["FRAGMENT_SHADER","VERTEX_SHADER"],by=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Tu="WEBGL_debug_renderer_info",wy="WEBGL_polygon_mode";function Sy(e){var t,n,r,o,s,i,a=e.cache,c=Ou(a);if(!c)return xu;if(!Iu(c))return Cu;var u=_u()?null:c.getExtension(Tu);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:u?(r=c.getParameter(u.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:u?(s=c.getParameter(u.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 Ey(e){var t=e.cache,n=Ou(t);if(!n)return xu;if(!Iu(n))return Cu;var r=n.getSupportedExtensions(),o=n.getContextAttributes(),s=[],i=[],a=[],c=[],u=[];if(o)for(var l=0,d=Object.keys(o);l<d.length;l++){var p=d[l];i.push("".concat(p,"=").concat(o[p]))}for(var h=Pu(n),m=0,g=h;m<g.length;m++){var v=g[m],y=n[v];a.push("".concat(v,"=").concat(y).concat(gy.has(y)?"=".concat(n.getParameter(y)):""))}if(r)for(var C=0,S=r;C<S.length;C++){var E=S[C];if(!(E===Tu&&_u()||E===wy&&Ty())){var b=n.getExtension(E);if(!b){s.push(E);continue}for(var x=0,T=Pu(b);x<T.length;x++){var v=T[x],y=b[v];c.push("".concat(v,"=").concat(y).concat(yy.has(y)?"=".concat(n.getParameter(y)):""))}}}for(var P=0,z=vy;P<z.length;P++)for(var I=z[P],D=0,$=by;D<$.length;D++){var V=$[D],N=xy(n,I,V);u.push("".concat(I,".").concat(V,"=").concat(N.join(",")))}return c.sort(),a.sort(),{contextAttributes:i,parameters:a,shaderPrecisions:u,extensions:r,extensionParameters:c,unsupportedExtensions:s}}function Ou(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 xy(e,t,n){var r=e.getShaderPrecisionFormat(e[t],e[n]);return r?[r.rangeMin,r.rangeMax,r.precision]:[]}function Pu(e){var t=Object.keys(e.__proto__);return t.filter(Cy)}function Cy(e){return typeof e=="string"&&!e.match(/[^A-Z0-9_x]/)}function _u(){return pu()}function Ty(){return eo()||cn()}function Iu(e){return typeof e.getParameter=="function"}function Oy(){var e=Ci()||cn();if(!e)return-2;if(!window.AudioContext)return-1;var t=new AudioContext().baseLatency;return t==null?-1:isFinite(t)?t:-3}function Py(){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 _y={fonts:dg,domBlockers:Gg,fontPreferences:cy,audio:eg,screenFrame:Mg,canvas:pg,osCpu:xg,languages:Cg,colorDepth:Tg,deviceMemory:Og,screenResolution:Pg,hardwareConcurrency:Ag,timezone:Dg,sessionStorage:Fg,localStorage:Vg,indexedDB:zg,openDatabase:$g,cpuClass:jg,platform:Hg,plugins:fg,touchSupport:Eg,vendor:Ug,vendorFlavors:Bg,cookiesEnabled:Wg,colorGamut:Kg,invertedColors:Jg,forcedColors:Qg,monochrome:ty,contrast:ny,reducedMotion:ry,reducedTransparency:oy,hdr:sy,math:iy,pdfViewerEnabled:ly,architecture:dy,applePay:fy,privateClickMeasurement:my,audioBaseLatency:Oy,dateTimeLocale:Py,webGlBasics:Sy,webGlExtensions:Ey};function Iy(e){return Wm(_y,e,[])}var ky="$ if upgrade to Pro: https://fpjs.dev/pro";function Ry(e){var t=Ny(e),n=My(t);return{score:t,comment:ky.replace(/\$/g,"".concat(n))}}function Ny(e){if(Ci())return .4;if(cn())return xi()&&!(no()&&to())?.5:.3;var t="value"in e.platform?e.platform.value:"";return/^Win/.test(t)?.6:/^Mac/.test(t)?.5:.7}function My(e){return uu(.99+.01*e,1e-4)}function Ay(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 ku(e){return JSON.stringify(e,function(t,n){return n instanceof Error?jm(n):n},2)}function Ru(e){return $m(Ay(e))}function Dy(e){var t,n=Ry(e);return{get visitorId(){return t===void 0&&(t=Ru(this.components)),t},set visitorId(r){t=r},confidence:n,components:e,version:su}}function Ly(e){return e===void 0&&(e=50),Rm(e,e*2)}function Fy(e,t){var n=Date.now();return{get:function(r){return pn(this,void 0,void 0,function(){var o,s,i;return hn(this,function(a){switch(a.label){case 0:return o=Date.now(),[4,e()];case 1:return s=a.sent(),i=Dy(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(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
|
|
9
|
+
components: `).concat(ku(s),"\n```")),[2,i]}})})}}}function Vy(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{var e=new XMLHttpRequest;e.open("get","https://m1.openfpcdn.io/fingerprintjs/v".concat(su,"/npm-monitoring"),!0),e.send()}catch(t){console.error(t)}}function zy(e){var t;return e===void 0&&(e={}),pn(this,void 0,void 0,function(){var n,r,o;return hn(this,function(s){switch(s.label){case 0:return(!((t=e.monitoring)!==null&&t!==void 0)||t)&&Vy(),n=e.delayFallback,r=e.debug,[4,Ly(n)];case 1:return s.sent(),o=Iy({cache:{},debug:r}),[2,Fy(o,r)]}})})}var $y={load:zy,hashComponents:Ru,componentsToDebugString:ku};function Nu(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=Nu(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mu(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Nu(e))&&(r&&(r+=" "),r+=t);return r}const ki="-",jy=e=>{const t=Uy(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(ki);return a[0]===""&&a.length!==1&&a.shift(),Au(a,t)||Hy(i)},getConflictingClassGroupIds:(i,a)=>{const c=n[i]||[];return a&&r[i]?[...c,...r[i]]:c}}},Au=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?Au(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(ki);return t.validators.find(({validator:i})=>i(s))?.classGroupId},Du=/^\[(.+)\]$/,Hy=e=>{if(Du.test(e)){const t=Du.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Uy=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Wy(Object.entries(e.classGroups),n).forEach(([s,i])=>{Ri(i,r,s,t)}),r},Ri=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:Lu(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(By(o)){Ri(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,i])=>{Ri(i,Lu(t,s),n,r)})})},Lu=(e,t)=>{let n=e;return t.split(ki).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},By=e=>e.isThemeGetter,Wy=(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,Zy=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)}}},Fu="!",Gy=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,i=a=>{const c=[];let u=0,l=0,d;for(let v=0;v<a.length;v++){let y=a[v];if(u===0){if(y===o&&(r||a.slice(v,v+s)===t)){c.push(a.slice(l,v)),l=v+s;continue}if(y==="/"){d=v;continue}}y==="["?u++:y==="]"&&u--}const p=c.length===0?a:a.substring(l),h=p.startsWith(Fu),m=h?p.substring(1):p,g=d&&d>l?d-l:void 0;return{modifiers:c,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:i}):i},Yy=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},Xy=e=>({cache:Zy(e.cacheSize),parseClassName:Gy(e),...jy(e)}),qy=/\s+/,Ky=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],i=e.trim().split(qy);let a="";for(let c=i.length-1;c>=0;c-=1){const u=i[c],{modifiers:l,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(u);let m=!!h,g=r(m?p.substring(0,h):p);if(!g){if(!m){a=u+(a.length>0?" "+a:a);continue}if(g=r(p),!g){a=u+(a.length>0?" "+a:a);continue}m=!1}const v=Yy(l).join(":"),y=d?v+Fu:v,C=y+g;if(s.includes(C))continue;s.push(C);const S=o(g,m);for(let E=0;E<S.length;++E){const b=S[E];s.push(y+b)}a=u+(a.length>0?" "+a:a)}return a};function Jy(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Vu(t))&&(r&&(r+=" "),r+=n);return r}const Vu=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Vu(e[r]))&&(n&&(n+=" "),n+=t);return n};function Qy(e,...t){let n,r,o,s=i;function i(c){const u=t.reduce((l,d)=>d(l),e());return n=Xy(u),r=n.cache.get,o=n.cache.set,s=a,a(c)}function a(c){const u=r(c);if(u)return u;const l=Ky(c,n);return o(c,l),l}return function(){return s(Jy.apply(null,arguments))}}const ut=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},zu=/^\[(?:([a-z-]+):)?(.+)\]$/i,ev=/^\d+\/\d+$/,tv=new Set(["px","full","screen"]),nv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rv=/\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$/,ov=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,sv=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,iv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,kn=e=>_r(e)||tv.has(e)||ev.test(e),Hn=e=>Ir(e,"length",hv),_r=e=>!!e&&!Number.isNaN(Number(e)),Ni=e=>Ir(e,"number",_r),ro=e=>!!e&&Number.isInteger(Number(e)),av=e=>e.endsWith("%")&&_r(e.slice(0,-1)),ze=e=>zu.test(e),Un=e=>nv.test(e),cv=new Set(["length","size","percentage"]),uv=e=>Ir(e,cv,$u),lv=e=>Ir(e,"position",$u),dv=new Set(["image","url"]),fv=e=>Ir(e,dv,gv),pv=e=>Ir(e,"",mv),oo=()=>!0,Ir=(e,t,n)=>{const r=zu.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},hv=e=>rv.test(e)&&!ov.test(e),$u=()=>!1,mv=e=>sv.test(e),gv=e=>iv.test(e),Mi=Qy(()=>{const e=ut("colors"),t=ut("spacing"),n=ut("blur"),r=ut("brightness"),o=ut("borderColor"),s=ut("borderRadius"),i=ut("borderSpacing"),a=ut("borderWidth"),c=ut("contrast"),u=ut("grayscale"),l=ut("hueRotate"),d=ut("invert"),p=ut("gap"),h=ut("gradientColorStops"),m=ut("gradientColorStopPositions"),g=ut("inset"),v=ut("margin"),y=ut("opacity"),C=ut("padding"),S=ut("saturate"),E=ut("scale"),b=ut("sepia"),x=ut("skew"),T=ut("space"),P=ut("translate"),z=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto",ze,t],$=()=>[ze,t],V=()=>["",kn,Hn],N=()=>["auto",_r,ze],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["solid","dashed","dotted","double","none"],_=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",ze],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[_r,ze];return{cacheSize:500,separator:":",theme:{colors:[oo],spacing:[kn,Hn],blur:["none","",Un,ze],brightness:B(),borderColor:[e],borderRadius:["none","","full",Un,ze],borderSpacing:$(),borderWidth:V(),contrast:B(),grayscale:A(),hueRotate:B(),invert:A(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[av,Hn],inset:D(),margin:D(),opacity:B(),padding:$(),saturate:B(),scale:B(),sepia:A(),skew:B(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[Un]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],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:[...O(),ze]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],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",ro,ze]}],basis:[{basis:D()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",ro,ze]}],"grid-cols":[{"grid-cols":[oo]}],"col-start-end":[{col:["auto",{span:["full",ro,ze]},ze]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[oo]}],"row-start-end":[{row:["auto",{span:[ro,ze]},ze]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[C]}],px:[{px:[C]}],py:[{py:[C]}],ps:[{ps:[C]}],pe:[{pe:[C]}],pt:[{pt:[C]}],pr:[{pr:[C]}],pb:[{pb:[C]}],pl:[{pl:[C]}],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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[Un]},Un]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Un,Hn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ni]}],"font-family":[{font:[oo]}],"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",ze]}],"line-clamp":[{"line-clamp":["none",_r,Ni]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",kn,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"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:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",kn,Hn]}],"underline-offset":[{"underline-offset":["auto",kn,ze]}],"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:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],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",ze]}],"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:[...O(),lv]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uv]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fv]}],"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":[y]}],"border-style":[{border:[...k(),"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:k()}],"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:["",...k()]}],"outline-offset":[{"outline-offset":[kn,ze]}],"outline-w":[{outline:[kn,Hn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[kn,Hn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Un,pv]}],"shadow-color":[{shadow:[oo]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[..._(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":_()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Un,ze]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[l]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],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":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[l]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"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",ze]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[E]}],"scale-x":[{"scale-x":[E]}],"scale-y":[{"scale-y":[E]}],rotate:[{rotate:[ro,ze]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[x]}],"skew-y":[{"skew-y":[x]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],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",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"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",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[kn,Hn,Ni]}],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"]}}}),yv=[];function so(e){f.useEffect(e,yv)}const ju={};function wt(e,t){const n=f.useRef(ju);return n.current===ju&&(n.current=e(t)),n}function vv(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 ft=vv("https://base-ui.com/production-error","Base UI"),zo=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(zo.displayName="ToastContext");function Hu(){const e=f.useContext(zo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":ft(73));return e}const de=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(process.env.NODE_ENV!=="production"?"Unsupported number of selectors":ft(1));let a;if(e&&t&&n&&r&&o&&s)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d),g=r(c,u,l,d),v=o(c,u,l,d);return s(p,h,m,g,v,u,l,d)};else if(e&&t&&n&&r&&o)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d),g=r(c,u,l,d);return o(p,h,m,g,u,l,d)};else if(e&&t&&n&&r)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d),m=n(c,u,l,d);return r(p,h,m,u,l,d)};else if(e&&t&&n)a=(c,u,l,d)=>{const p=e(c,u,l,d),h=t(c,u,l,d);return n(p,h,u,l,d)};else if(e&&t)a=(c,u,l,d)=>{const p=e(c,u,l,d);return t(p,u,l,d)};else if(e)a=e;else throw new Error("Missing arguments");return a};var bv=(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})}}},
|
|
12
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:o})}}},wv=(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 u;try{throw new Error}catch(l){({stack:u}=l)}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: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:
|
|
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,` {
|
|
21
|
-
overflow: hidden `).concat(r,`;
|
|
22
|
-
padding-right: `).concat(a,"px ").concat(r,`;
|
|
23
|
-
}
|
|
24
|
-
body[`).concat(Fr,`] {
|
|
25
|
-
overflow: hidden `).concat(r,`;
|
|
26
|
-
overscroll-behavior: contain;
|
|
27
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
28
|
-
padding-left: `.concat(o,`px;
|
|
29
|
-
padding-top: `).concat(s,`px;
|
|
30
|
-
padding-right: `).concat(i,`px;
|
|
31
|
-
margin-left:0;
|
|
32
|
-
margin-top:0;
|
|
33
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
34
|
-
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.`).concat(Gs,` {
|
|
38
|
-
right: `).concat(a,"px ").concat(r,`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.`).concat(Ys,` {
|
|
42
|
-
margin-right: `).concat(a,"px ").concat(r,`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.`).concat(Gs," .").concat(Gs,` {
|
|
46
|
-
right: 0 `).concat(r,`;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.`).concat(Ys," .").concat(Ys,` {
|
|
50
|
-
margin-right: 0 `).concat(r,`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
body[`).concat(Fr,`] {
|
|
54
|
-
`).concat(NC,": ").concat(a,`px;
|
|
55
|
-
}
|
|
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`
|
|
57
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
58
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
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.
|
|
60
|
-
|
|
61
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
62
|
-
|
|
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(
|
|
64
|
-
[data-state=closed]
|
|
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(`
|
|
15
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:s,secondInputs:i,stack:u})}},Sv={inputStabilityCheck:"once",identityFunctionCheck:"once"},$o=Symbol("NOT_FOUND");function Ev(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function xv(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Cv(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 Uu=e=>Array.isArray(e)?e:[e];function Tv(e){const t=Array.isArray(e[0])?e[0]:e;return Cv(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Bu(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var Ov=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Sv,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:bv},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:wv}}};function Pv(e){let t;return{get(n){return t&&e(t.key,n)?t.value:$o},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function _v(e,t){let n=[];function r(a){const c=n.findIndex(u=>t(a,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return $o}function o(a,c){r(a)===$o&&(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 Iv=(e,t)=>e===t;function kv(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 Rv(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=Iv,maxSize:o=1,resultEqualityCheck:s}=n,i=kv(r);let a=0;const c=o<=1?Pv(i):_v(o,i);function u(){let l=c.get(arguments);if(l===$o){if(l=e.apply(null,arguments),a++,s){const p=c.getEntries().find(h=>s(h.value,l));p&&(l=p.value,a!==0&&a--)}c.put(arguments,l)}return l}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>a,u.resetResultsCount=()=>{a=0},u}var Nv=class{constructor(e){this.value=e}deref(){return this.value}},Mv=typeof WeakRef<"u"?WeakRef:Nv,Av=0,Wu=1;function jo(){return{s:Av,v:void 0,o:null,p:null}}function Zu(e,t={}){let n=jo();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:c}=arguments;for(let d=0,p=c;d<p;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=jo(),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=jo(),m.set(h,a)):a=g}}const u=a;let l;if(a.s===Wu)l=a.v;else if(l=e.apply(null,arguments),s++,r){const d=o?.deref?.()??o;d!=null&&r(d,l)&&(l=d,s!==0&&s--),o=typeof l=="object"&&l!==null||typeof l=="function"?new Mv(l):l}return u.s=Wu,u.v=l,l}return i.clearCache=()=>{n=jo(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function Gu(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),Ev(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const l={...n,...c},{memoize:d,memoizeOptions:p=[],argsMemoize:h=Zu,argsMemoizeOptions:m=[],devModeChecks:g={}}=l,v=Uu(p),y=Uu(m),C=Tv(o),S=d(function(){return s++,u.apply(null,arguments)},...v);let E=!0;const b=h(function(){i++;const T=Bu(C,arguments);if(a=S.apply(null,T),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:P,inputStabilityCheck:z}=Ov(E,g);if(P.shouldRun&&P.run(u,T,a),z.shouldRun){const I=Bu(C,arguments);z.run({inputSelectorResults:T,inputSelectorResultsCopy:I},{memoize:d,memoizeOptions:v},arguments)}E&&(E=!1)}return a},...y);return Object.assign(b,{resultFunc:u,memoizedResultFunc:S,dependencies:C,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:d,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var Dv=Gu(Zu),Lv=Object.assign((e,t=Dv)=>{xv(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:()=>Lv});const Fv=Gu({memoize:Rv,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),Vv=(...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":ft(2));return(a,c,u,l)=>{let d=a.__cacheKey__;d||(d={id:n},a.__cacheKey__=d,n+=1);let p=t.get(d);if(!p){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":ft(2))}p=Fv(...h),p.selectorArgs=m,t.set(d,p)}switch(p.selectorArgs[0]=c,p.selectorArgs[1]=u,p.selectorArgs[2]=l,s){case 0:return p(a);case 1:return p(a,c);case 2:return p(a,c,u);case 3:return p(a,c,u,l);default:throw new Error("unreachable")}}};var Ho=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Uo={exports:{}},Ai={};var Yu;function $v(){if(Yu)return Ai;Yu=1;var e=oe;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),g=m[0].inst,v=m[1];return s(function(){g.value=h,g.getSnapshot=p,c(g)&&v({inst:g})},[d,h,p]),o(function(){return c(g)&&v({inst:g}),d(function(){c(g)&&v({inst:g})})},[d]),i(h),h}function c(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function u(d,p){return p()}var l=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return Ai.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:l,Ai}var Di={};var Xu;function jv(){return Xu||(Xu=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){l||o.startTransition===void 0||(l=!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 v=m();s(g,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=i({inst:{value:g,getSnapshot:m}});var y=v[0].inst,C=v[1];return c(function(){y.value=g,y.getSnapshot=m,n(y)&&C({inst:y})},[h,g,m]),a(function(){return n(y)&&C({inst:y}),h(function(){n(y)&&C({inst:y})})},[h]),u(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=oe,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,c=o.useLayoutEffect,u=o.useDebugValue,l=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Di.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Di}var qu;function Li(){return qu||(qu=1,process.env.NODE_ENV==="production"?Uo.exports=$v():Uo.exports=jv()),Uo.exports}var Hv=Li(),Bo={exports:{}},Fi={};var Ku;function Uv(){if(Ku)return Fi;Ku=1;var e=oe,t=Li();function n(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}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 Fi.useSyncExternalStoreWithSelector=function(u,l,d,p,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 y(x){if(!C){if(C=!0,S=x,x=p(x),h!==void 0&&g.hasValue){var T=g.value;if(h(T,x))return E=T}return E=x}if(T=E,r(S,x))return T;var P=p(x);return h!==void 0&&h(T,P)?(S=x,T):(S=x,E=P)}var C=!1,S,E,b=d===void 0?null:d;return[function(){return y(l())},b===null?void 0:function(){return y(b())}]},[l,d,p,h]);var v=o(u,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},Fi}var Vi={};var Ju;function Bv(){return Ju||(Ju=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,l){return u===l&&(u!==0||1/u===1/l)||u!==u&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=oe,n=Li(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,c=t.useDebugValue;Vi.useSyncExternalStoreWithSelector=function(u,l,d,p,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 y(x){if(!C){if(C=!0,S=x,x=p(x),h!==void 0&&g.hasValue){var T=g.value;if(h(T,x))return E=T}return E=x}if(T=E,r(S,x))return T;var P=p(x);return h!==void 0&&h(T,P)?(S=x,T):(S=x,E=P)}var C=!1,S,E,b=d===void 0?null:d;return[function(){return y(l())},b===null?void 0:function(){return y(b())}]},[l,d,p,h]);var v=o(u,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Vi}var Qu;function Wv(){return Qu||(Qu=1,process.env.NODE_ENV==="production"?Bo.exports=Uv():Bo.exports=Bv()),Bo.exports}var Zv=Wv();const Gv=parseInt(f.version,10);function zi(e){return Gv>=e}const Yv=zi(19)?qv:Kv;function We(e,t,n,r,o){return Yv(e,t,n,r,o)}function Xv(e,t,n,r,o){const s=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Hv.useSyncExternalStore(e.subscribe,s,s)}function qv(e,t,n,r,o){return Xv(e,t,n,r,o)}function Kv(e,t,n,r,o){return Zv.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 We(this,t,n,r,o)}}const $i=f[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Jv=$i&&$i!==f.useLayoutEffect?$i:e=>e();function ie(e){const t=wt(Qv).current;return t.next=e,Jv(t.effect),t.trampoline}function Qv(){const e={next:void 0,callback:eb,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function eb(){if(process.env.NODE_ENV!=="production")throw new Error("Base UI: Cannot call an event handler while rendering.")}const he=typeof document<"u"?f.useLayoutEffect:()=>{};function Ct(){}const tl=Object.freeze([]),mt=Object.freeze({});class Wo extends el{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){f.useDebugValue(t),he(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;he(()=>(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);he(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){f.useDebugValue(t);const r=n!==void 0;if(he(()=>{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),We(this,this.selectors[t],n,r,o)}useContextCallback(t,n){f.useDebugValue(t);const r=ie(n??Ct);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)}})}}function Zo(){return typeof window<"u"}function kt(e){return ji(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(ji(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ji(e){return Zo()?e instanceof Node||e instanceof tt(e).Node:!1}function $e(e){return Zo()?e instanceof Element||e instanceof tt(e).Element:!1}function it(e){return Zo()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function kr(e){return!Zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function Bn(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=At(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function tb(e){return/^(table|td|th)$/.test(kt(e))}function Go(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nb=/transform|translate|scale|rotate|perspective|filter/,rb=/paint|layout|strict|content/,nr=e=>!!e&&e!=="none";let Hi;function Ui(e){const t=$e(e)?At(e):e;return nr(t.transform)||nr(t.translate)||nr(t.scale)||nr(t.rotate)||nr(t.perspective)||!Yo()&&(nr(t.backdropFilter)||nr(t.filter))||nb.test(t.willChange||"")||rb.test(t.contain||"")}function ob(e){let t=Nn(e);for(;it(t)&&!Rn(t);){if(Ui(t))return t;if(Go(t))return null;t=Nn(t)}return null}function Yo(){return Hi==null&&(Hi=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Hi}function Rn(e){return/^(html|body|#document)$/.test(kt(e))}function At(e){return tt(e).getComputedStyle(e)}function Xo(e){return $e(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Nn(e){if(kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||kr(e)&&e.host||mn(e);return kr(t)?t.host:t}function nl(e){const t=Nn(e);return Rn(t)?e.ownerDocument?e.ownerDocument.body:e.body:it(t)&&Bn(t)?t:nl(t)}function io(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=nl(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=tt(o);if(s){const a=Bi(i);return t.concat(i,i.visualViewport||[],Bn(o)?o:[],a&&n?io(a):[])}else return t.concat(o,io(o,[],n))}function Bi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gn(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ie(e){return e?.ownerDocument||document}function Fe(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}const qo=null;let rl=globalThis.requestAnimationFrame;class sb{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"&&rl!==requestAnimationFrame&&(rl=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 Ko=new sb;class yn{static create(){return new yn}static request(t){return Ko.request(t)}static cancel(t){return Ko.cancel(t)}currentId=qo;request(t){this.cancel(),this.currentId=Ko.request(()=>{this.currentId=qo,t()})}cancel=()=>{this.currentId!==qo&&(Ko.cancel(this.currentId),this.currentId=qo)};disposeEffect=()=>this.cancel}function ao(){const e=wt(yn.create).current;return so(e.disposeEffect),e}const co=0;class Zt{static create(){return new Zt}currentId=co;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=co,n()},t)}isStarted(){return this.currentId!==co}clear=()=>{this.currentId!==co&&(clearTimeout(this.currentId),this.currentId=co)};disposeEffect=()=>this.clear}function Gt(){const e=wt(Zt.create).current;return so(e.disposeEffect),e}let ol=0;function ib(e){return ol+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ol}`}function Wi(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 Rr=typeof navigator<"u",Zi=cb(),sl=lb(),il=ub(),Gi=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),al=Zi.platform==="MacIntel"&&Zi.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Zi.platform),ab=Rr&&/apple/i.test(navigator.vendor),Jo=Rr&&/android/i.test(sl)||/android/i.test(il);Rr&&sl.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const cl=il.includes("jsdom/");function cb(){if(!Rr)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 ub(){if(!Rr)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function lb(){if(!Rr)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Yi="data-base-ui-focusable",ul="active",ll="selected",dl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wn="ArrowLeft",Zn="ArrowRight",Xi="ArrowUp",uo="ArrowDown";function Pt(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function we(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&kr(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function lt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function fl(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(we(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function un(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 db(e){return e.matches("html,body")}function qi(e){return it(e)&&e.matches(dl)}function fb(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${dl}`)!=null}function Ki(e){return e?e.getAttribute("role")==="combobox"&&qi(e):!1}function Ji(e){if(!e||cl)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function lo(e){return e?e.hasAttribute(Yi)?e:e.querySelector(`[${Yi}]`)||e:null}function vn(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...vn(e,o.id,n)])}function pl(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 Yt(e){e.preventDefault(),e.stopPropagation()}function pb(e){return"nativeEvent"in e}function hl(e){return e.pointerType===""&&e.isTrusted?!0:Jo&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ml(e){return cl?!1:!Jo&&e.width===0&&e.height===0||Jo&&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 fo(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function gl(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const hb=["top","right","bottom","left"],Nr=Math.min,Xt=Math.max,Qo=Math.round,rr=Math.floor,bn=e=>({x:e,y:e}),mb={left:"right",right:"left",bottom:"top",top:"bottom"};function Qi(e,t,n){return Xt(e,Nr(t,n))}function Mn(e,t){return typeof e=="function"?e(t):e}function jt(e){return e.split("-")[0]}function Gn(e){return e.split("-")[1]}function ea(e){return e==="x"?"y":"x"}function ta(e){return e==="y"?"height":"width"}function en(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function na(e){return ea(en(e))}function gb(e,t,n){n===void 0&&(n=!1);const r=Gn(e),o=na(e),s=ta(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=es(i)),[i,es(i)]}function yb(e){const t=es(e);return[ra(e),t,ra(t)]}function ra(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const yl=["left","right"],vl=["right","left"],vb=["top","bottom"],bb=["bottom","top"];function wb(e,t,n){switch(e){case"top":case"bottom":return n?t?vl:yl:t?yl:vl;case"left":case"right":return t?vb:bb;default:return[]}}function Sb(e,t,n,r){const o=Gn(e);let s=wb(jt(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(ra)))),s}function es(e){const t=jt(e);return mb[t]+e.slice(t.length)}function Eb(e){return{top:0,right:0,bottom:0,left:0,...e}}function bl(e){return typeof e!="number"?Eb(e):{top:e,right:e,bottom:e,left:e}}function po(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 ts(e,t,n){return Math.floor(e/t)!==n}function ns(e,t){return t<0||t>=e.length}function oa(e,t){return Dt(e.current,{disabledIndices:t})}function wl(e,t){return Dt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dt(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&&Mr(e,s,r));return s}function xb(e,{event:t,orientation:n,loopFocus:r,onLoop:o,rtl:s,cols:i,disabledIndices:a,minIndex:c,maxIndex:u,prevIndex:l,stopEvent:d=!1}){let p=l,h;if(t.key===Xi?h="up":t.key===uo&&(h="down"),h){const m=[],g=[];let v=!1,y=0;{let z=null,I=-1;e.forEach((D,$)=>{if(D==null)return;y+=1;const V=D.closest('[role="row"]');V&&(v=!0),(V!==z||I===-1)&&(z=V,I+=1,m[I]=[]),m[I].push($),g[$]=I})}let C=!1,S=0;if(v)for(const z of m){const I=z.length;I>S&&(S=I),I!==i&&(C=!0)}const E=C&&y<e.length,b=S||i,x=z=>{if(!C||l===-1)return;const I=g[l];if(I==null)return;const D=m[I].indexOf(l),$=z==="up"?-1:1;for(let V=I+$,N=0;N<m.length;N+=1,V+=$){if(V<0||V>=m.length){if(!r||E)return;if(V=V<0?m.length-1:0,o){const k=Math.min(D,m[V].length-1),_=m[V][k]??m[V][0],M=o(t,l,_);V=g[M]??V}}const O=m[V];for(let k=Math.min(D,O.length-1);k>=0;k-=1){const _=O[k];if(!Mr(e,_,a))return _}}},T=z=>{if(!E||l===-1)return;const I=l%b,D=z==="up"?-b:b,$=u-u%b,V=rr(u/b)+1;for(let N=l-I+D,O=0;O<V;O+=1,N+=D){if(N<0||N>u){if(!r)return;N=N<0?$:0}const k=Math.min(N+b-1,u);for(let _=Math.min(N+I,k);_>=N;_-=1)if(!Mr(e,_,a))return _}};d&&Yt(t);const P=x(h)??T(h);if(P!==void 0)p=P;else if(l===-1)p=h==="up"?u:c;else if(p=Dt(e,{startingIndex:l,amount:b,decrement:h==="up",disabledIndices:a}),r){if(h==="up"&&(l-b<c||p<0)){const z=l%b,I=u%b,D=u-(I-z);I===z?p=u:p=I>z?D:D-b,o&&(p=o(t,l,p))}h==="down"&&l+b>u&&(p=Dt(e,{startingIndex:l%b-b,amount:b,disabledIndices:a}),o&&(p=o(t,l,p)))}ns(e,p)&&(p=l)}if(n==="both"){const m=rr(l/i);t.key===(s?Wn:Zn)&&(d&&Yt(t),l%i!==i-1?(p=Dt(e,{startingIndex:l,disabledIndices:a}),r&&ts(p,i,m)&&(p=Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p)))):r&&(p=Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p))),ts(p,i,m)&&(p=l)),t.key===(s?Zn:Wn)&&(d&&Yt(t),l%i!==0?(p=Dt(e,{startingIndex:l,decrement:!0,disabledIndices:a}),r&&ts(p,i,m)&&(p=Dt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:a}),o&&(p=o(t,l,p)))):r&&(p=Dt(e,{startingIndex:l+(i-l%i),decrement:!0,disabledIndices:a}),o&&(p=o(t,l,p))),ts(p,i,m)&&(p=l));const g=rr(u/i)===m;ns(e,p)&&(r&&g?(p=t.key===(s?Zn:Wn)?u:Dt(e,{startingIndex:l-l%i-1,disabledIndices:a}),o&&(p=o(t,l,p))):p=l)}return p}function Cb(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 u=[];for(let l=0;l<s;l+=1)for(let d=0;d<i;d+=1)u.push(o+l+d*t);o%t+s<=t&&u.every(l=>r[l]==null)?(u.forEach(l=>{r[l]=a}),c=!0):o+=1}}),[...r]}function Tb(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 Ob(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Mr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?rs(o)?!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!0:!1}function Pb(e){return e.visibility==="hidden"||e.visibility==="collapse"}function rs(e,t=e?At(e):null){return!e||!e.isConnected||!t||Pb(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const _b='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Ib(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return kr(n)?n.host:null}function sa(e){for(const t of Array.from(e.children))if(kt(t)==="summary")return t;return null}function kb(e,t){const n=sa(t);return!!n&&(e===n||we(n,e))}function Sl(e){const t=e?kt(e):"";return e!=null&&e.matches(_b)&&(t!=="summary"||e.parentElement!=null&&kt(e.parentElement)==="details"&&sa(e.parentElement)===e)&&(t!=="details"||sa(e)==null)&&(t!=="input"||e.type!=="hidden")}function El(e){if(!Sl(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Ib(t)){const n=t!==e,r=kt(t)==="slot";if(t.hasAttribute("inert")||n&&kt(t)==="details"&&!t.open&&!kb(e,t)||t.hasAttribute("hidden")||!r&&!Rb(t,n))return!1}return!0}function Rb(e,t){const n=At(e);return t?n.display!=="none":rs(e,n)}function xl(e){const t=e.tabIndex;if(t<0){const n=kt(e);if(n==="details"||n==="audio"||n==="video"||it(e)&&e.isContentEditable)return 0}return t}function ia(e){if(kt(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function Nb(e,t){const n=ia(e);if(!n)return!0;const r=t.find(o=>{const s=ia(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=ia(o);return s?.name===n.name&&s.form===n.form})===n}function Cl(e){if(it(e)&&kt(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return it(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Tl(e,t){Cl(e).forEach(n=>{Sl(n)&&t.push(n),Tl(n,t)})}function Ol(e,t,n){Cl(e).forEach(r=>{it(r)&&r.matches(t)&&n.push(r),Ol(r,t,n)})}function aa(e){return El(e)&&xl(e)>=0}function Pl(e){const t=[];return Tl(e,t),t.filter(El)}function ho(e){const t=Pl(e);return t.filter(n=>xl(n)>=0&&Nb(n,t))}function _l(e,t){const n=ho(e),r=n.length;if(r===0)return;const o=Pt(Ie(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function ca(e){return _l(Ie(e).body,1)||e}function Il(e){return _l(Ie(e).body,-1)||e}function kl(e,t){if(!e)return null;const n=ho(Ie(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 Mb(e){return kl(e,1)}function Ab(e){return kl(e,-1)}function Ar(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!we(n,r)}function Db(e){ho(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rl(e){const t=[];Ol(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 os=Vv(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}),wn={toasts:de(e=>e.toasts),isEmpty:de(e=>e.toasts.length===0),toast:de(os,(e,t)=>e.get(t)?.value),toastIndex:de(os,(e,t)=>e.get(t)?.domIndex??-1),toastOffsetY:de(os,(e,t)=>e.get(t)?.offsetY??0),toastVisibleIndex:de(os,(e,t)=>e.get(t)?.visibleIndex??-1),hovering:de(e=>e.hovering),focused:de(e=>e.focused),expanded:de(e=>e.hovering||e.focused),expandedOrOutOfFocus:de(e=>e.hovering||e.focused||!e.isWindowFocused),prevFocusElement:de(e=>e.prevFocusElement)};class Lb extends Wo{timers=new Map;areTimersPaused=!1;constructor(t){super(t,{},wn)}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=wn.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||ib("toast");if(t.id){const u=wn.toast(this.state,t.id);if(u)if(u.transitionStatus==="ending")this.removeToast(t.id,{skipOnRemove:!0});else{const{id:l,transitionStatus:d,...p}=t;return this.updateToastInternal(t.id,p,{resetTimer:!0,markUpdated:!0}),t.id}}const s={...t,id:o,updateKey:0,transitionStatus:"starting"},i=[s,...this.state.toasts],a=i.filter(u=>u.transitionStatus!=="ending");if(a.length>r){const u=a.length-r,l=a.slice(-u),d=new Set(l.map(p=>p.id));this.setToasts(i.map(p=>{const h=d.has(p.id);return p.limited!==h?{...p,limited:h}:p}))}else this.setToasts(i.map(u=>u.limited?{...u,limited:!1}:u));const c=s.timeout??n;return s.type!=="loading"&&c>0&&this.scheduleTimer(o,c,()=>this.closeToast(o)),wn.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=wn.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,u=i?.timeout??o,l=Object.hasOwn(n,"timeout"),d=a.transitionStatus!=="ending"&&a.type!=="loading"&&c>0,p=this.timers.has(t),h=u!==c,m=i?.type==="loading";if(!d&&p){this.timers.get(t)?.timeout?.clear(),this.timers.delete(t);return}if(d&&(!p||h||l||m||r.resetTimer)){const g=this.timers.get(t);g&&(g.timeout?.clear(),this.timers.delete(t)),this.scheduleTimer(t,c,()=>this.closeToast(t)),wn.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(u=>{u.timeout?.clear()}),this.timers.clear();else{const u=wn.toast(this.state,t);if(!u)return;s=[u];const l=this.timers.get(t);l?.timeout&&(l.timeout.clear(),this.timers.delete(t))}let i=0;const c={toasts:o.map(u=>{if(n||u.id===t)return{...u,transitionStatus:"ending",height:0};if(u.transitionStatus==="ending")return u;const l=i>=r;return i+=1,u.limited!==l?{...u,limited:l}:u})};(n||o.length===1)&&(c.hovering=!1,c.focused=!1),this.update(c),s.forEach(u=>{u.transitionStatus!=="ending"&&u.onClose?.()}),this.handleFocusManagement(t)};promiseToast=(t,n)=>{const r=Wi(n.loading),o=this.addToast({...r,type:"loading"}),s=t.then(i=>{const a=Wi(n.success,i);return this.updateToast(o,{...a,type:"success",timeout:a.timeout}),i}).catch(i=>{const a=Wi(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=lt(t);we(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(t,n,r){const o=Date.now(),s=!wn.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=Pt(Ie(this.state.viewport));if(!this.state.viewport||!we(this.state.viewport,n)||!Ji(n))return;if(t===void 0){this.restoreFocusToPrevElement();return}const r=wn.toasts(this.state),o=wn.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 Nl=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:s}=t,i=wt(()=>new Lb({timeout:r,limit:o,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return so(i.disposeEffect),f.useEffect(function(){return s?s[" subscribe"](({action:u,options:l})=>{const d=l.id;u==="promise"&&l.promise?i.promiseToast(l.promise,l):u==="update"&&d?i.updateToast(d,l):u==="close"?i.closeToast(d):i.addToast(l)}):void 0},[i,r,s]),i.useSyncedValues({timeout:r,limit:o}),w.jsx(zo.Provider,{value:i,children:n})};process.env.NODE_ENV!=="production"&&(Nl.displayName="ToastProvider");const Ml={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},ss={...Ml,position:"fixed",top:0,left:0},Al={...Ml,position:"absolute"},Sn=f.forwardRef(function(t,n){const[r,o]=f.useState();he(()=>{ab&&o("button")},[]);const s={tabIndex:0,role:r};return w.jsx("span",{...t,ref:n,style:ss,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});process.env.NODE_ENV!=="production"&&(Sn.displayName="FocusGuard");function or(e,t,n,r){const o=wt(Dl).current;return Vb(o,e,t,n,r)&&Ll(o,[e,t,n,r]),o.callback}function Fb(e){const t=wt(Dl).current;return zb(t,e)&&Ll(t,e),t.callback}function Dl(){return{callback:null,cleanup:null,refs:[]}}function Vb(e,t,n,r,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==o}function zb(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function Ll(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 Fl(e){if(!f.isValidElement(e))return null;const t=e,n=t.props;return(zi(19)?n?.ref:t.ref)??null}function ua(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}let la;process.env.NODE_ENV!=="production"&&(la=new Set);function $b(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");la.has(t)||(la.add(t),console.warn(`Base UI: ${t}`))}}function jb(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 Hb(e,t){return typeof e=="function"?e(t):e}function Ub(e,t){return typeof e=="function"?e(t):e}const da={};function En(e,t,n,r,o){if(!n&&!r&&!o&&!e)return is(t);let s=is(e);return t&&(s=mo(s,t)),n&&(s=mo(s,n)),r&&(s=mo(s,r)),o&&(s=mo(s,o)),s}function Bb(e){if(e.length===0)return da;if(e.length===1)return is(e[0]);let t=is(e[0]);for(let n=1;n<e.length;n+=1)t=mo(t,e[n]);return t}function is(e){return fa(e)?{...zl(e,da)}:Wb(e)}function mo(e,t){return fa(t)?zl(t,e):Zb(e,t)}function Wb(e){const t={...e};for(const n in t){const r=t[n];Vl(n,r)&&(t[n]=$l(r))}return t}function Zb(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=ua(e.style,r);break}case"className":{e[n]=jl(e.className,r);break}default:Vl(n,r)?e[n]=Gb(e[n],r):e[n]=r}}return e}function Vl(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 fa(e){return typeof e=="function"}function zl(e,t){return fa(e)?e(t):e??da}function Gb(e,t){return t?e?(...n)=>{const r=n[0];if(Hl(r)){const s=r;as(s);const i=t(...n);return s.baseUIHandlerPrevented||e?.(...n),i}const o=t(...n);return e?.(...n),o}:$l(t):e}function $l(e){return e&&((...t)=>{const n=t[0];return Hl(n)&&as(n),e(...t)})}function as(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function jl(e,t){return t?e?t+" "+e:t:e}function Hl(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function qe(e,t,n={}){const r=t.render,o=Yb(t,n);if(n.enabled===!1)return null;const s=n.state??mt;return Qb(e,r,o,s)}function Yb(e,t={}){const{className:n,style:r,render:o}=e,{state:s=mt,ref:i,props:a,stateAttributesMapping:c,enabled:u=!0}=t,l=u?Hb(n,s):void 0,d=u?Ub(r,s):void 0,p=u?jb(s,c):mt,h=u&&a?Xb(a):void 0,m=u?ua(p,h)??{}:mt;return typeof document<"u"&&(u?Array.isArray(i)?m.ref=Fb([m.ref,Fl(o),...i]):m.ref=or(m.ref,Fl(o),i):or(null,null)),u?(l!==void 0&&(m.className=jl(m.className,l)),d!==void 0&&(m.style=ua(m.style,d)),m):mt}function Xb(e){return Array.isArray(e)?Bb(e):En(void 0,e)}const qb=Symbol.for("react.lazy"),Kb=/^[A-Z][A-Za-z0-9$]*$/,Jb=/[a-z]/;function Qb(e,t,n,r){if(t){if(typeof t=="function")return process.env.NODE_ENV!=="production"&&e0(t),t(n,r);const o=En(n,t.props);o.ref=n.ref;let s=t;if(s?.$$typeof===qb&&(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 t0(e,n);throw new Error(process.env.NODE_ENV!=="production"?"Base UI: Render element or function are not defined.":ft(8))}function e0(e){const t=e.name;t.length!==0&&Kb.test(t)&&Jb.test(t)&&$b(`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 t0(e,t){return e==="button"?oe.createElement("button",{type:"button",...t,key:t.key}):e==="img"?oe.createElement("img",{alt:"",...t,key:t.key}):f.createElement(e,t)}let n0=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const Ul=f.forwardRef(function(t,n){const{render:r,className:o,style:s,children:i,...a}=t,c=Hu(),u=Gt(),l=f.useRef(!1),d=f.useRef(!1),p=f.useRef(!1),h=c.useState("isEmpty"),m=c.useState("toasts"),g=c.useState("focused"),v=c.useState("expanded"),y=c.useState("prevFocusElement"),C=m[0]?.height??0,S=f.useMemo(()=>m.some(_=>_.transitionStatus==="ending"),[m]);f.useEffect(()=>{const _=c.state.viewport;if(!_)return;function M(j){h||j.key==="F6"&<(j)!==_&&(j.preventDefault(),c.setPrevFocusElement(Pt(Ie(_))),_?.focus({preventScroll:!0}),c.pauseTimers(),c.setFocused(!0))}const A=tt(_);return Fe(A,"keydown",M)},[c,h]),f.useEffect(()=>{const _=c.state.viewport;if(!_||h)return;const M=tt(_);function A(B){lt(B)===M&&(c.setIsWindowFocused(!1),c.pauseTimers())}function j(B){if(B.relatedTarget)return;const U=lt(B),W=Pt(Ie(_));(U===M||!we(_,U)||!Ji(W))&&c.resumeTimers(),u.start(0,()=>c.setIsWindowFocused(!0))}return gn(Fe(M,"blur",A,!0),Fe(M,"focus",j,!0))},[c,u,h]),f.useEffect(()=>{const _=c.state.viewport;if(!_||h)return;const M=Ie(_);return Fe(M,"pointerdown",c.handleDocumentPointerDown,!0)},[h,c]);function E(_){const M=c.state.viewport;M&&(l.current=!0,_.relatedTarget===M?m[0]?.ref?.current?.focus():c.restoreFocusToPrevElement())}function b(_){_.key==="Tab"&&_.shiftKey&<(_.nativeEvent)===c.state.viewport&&(_.preventDefault(),c.restoreFocusToPrevElement(),c.resumeTimers())}function x(){const _=c.state.toasts.some(M=>M.transitionStatus==="ending");!c.state.isWindowFocused||_||p.current||!d.current||(c.resumeTimers(),c.setHovering(!1),d.current=!1)}f.useEffect(x,[S,c]);function T(){c.pauseTimers(),c.setHovering(!0),d.current=!1}function P(){S||p.current?d.current=!0:(c.resumeTimers(),c.setHovering(!1))}function z(_){_.pointerType==="touch"&&(p.current=!0)}function I(_){_.pointerType==="touch"&&(p.current=!1,x())}function D(){if(l.current){l.current=!1;return}g||Ji(Pt(Ie(c.state.viewport)))&&(c.setFocused(!0),c.pauseTimers())}function $(_){!g||we(c.state.viewport,_.relatedTarget)||(c.setFocused(!1),c.resumeTimers())}const V={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:T,onMouseMove:T,onMouseLeave:P,onFocus:D,onBlur:$,onKeyDown:b,onClick:D,onPointerDown:z,onPointerUp:I,onPointerCancel:I},N={expanded:v},O=qe("div",t,{ref:[n,c.setViewport],state:N,props:[V,{style:{[n0.frontmostHeight]:C?`${C}px`:void 0}},a,{children:w.jsxs(f.Fragment,{children:[!h&&y&&w.jsx(Sn,{onFocus:E}),i,!h&&y&&w.jsx(Sn,{onFocus:E})]})}]}),k=f.useMemo(()=>m.filter(_=>_.priority==="high"),[m]);return w.jsxs(f.Fragment,{children:[!h&&y&&w.jsx(Sn,{onFocus:E}),O,!g&&k.length>0&&w.jsx("div",{style:ss,children:k.map(_=>w.jsxs("div",{role:"alert","aria-atomic":!0,children:[w.jsx("div",{children:_.title}),w.jsx("div",{children:_.description})]},_.id))})]})});process.env.NODE_ENV!=="production"&&(Ul.displayName="ToastViewport");function cs(e){return zi(19)?e:e?"true":void 0}const pa=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(pa.displayName="ToastRootContext");function r0(){const e=f.useContext(pa);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":ft(66));return e}let sr=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const o0={[sr.startingStyle]:""},s0={[sr.endingStyle]:""},tn={transitionStatus(e){return e==="starting"?o0:e==="ending"?s0:null}};function An(e){return e==null?e:"current"in e?e.current:e}function Bl(e,t=!1,n=!0){const r=ao();return ie((o,s=null)=>{r.cancel();const i=An(e);if(i==null)return;const a=i,c=()=>{Kt.flushSync(o)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){o();return}function u(){Promise.all(a.getAnimations().map(l=>l.finished)).then(()=>{s?.aborted||c()}).catch(()=>{if(n){s?.aborted||c();return}const l=a.getAnimations();!s?.aborted&&l.length>0&&l.some(d=>d.pending||d.playState!=="finished")&&u()})}if(t){const l=sr.startingStyle;if(!a.hasAttribute(l)){r.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(l)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[l]}),s?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}r.request(u)})}function xn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=ie(o),i=Bl(r,n,!1);f.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}let ir=(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 i0=500,a0={style:{transition:"none"}},ha="data-base-ui-click-trigger",c0="data-base-ui-swipe-ignore",u0="data-swipe-ignore",Wl=`[${c0}]`,l0=`[${u0}]`,d0={fallbackAxisSide:"none"},f0={fallbackAxisSide:"end"},p0={clipPath:"inset(50%)",position:"fixed",top:0,left:0},h0={...tn,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},go=40,m0=10,Yn=.5,g0=1,y0=`${Wl},${l0}`;function Zl(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 v0(e){const n=tt(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 Gl=f.forwardRef(function(t,n){const{toast:r,render:o,className:s,swipeDirection:i=["down","right"],style:a,...c}=t,u=r.positionerProps?.anchor!==void 0;let l=[];u||(l=Array.isArray(i)?i:[i]);const d=l.length>0,p=Hu(),[h,m]=f.useState(void 0),[g,v]=f.useState(!1),[y,C]=f.useState(!1),[S,E]=f.useState(!1),[b,x]=f.useState({x:0,y:0}),[T,P]=f.useState({x:0,y:0,scale:1}),[z,I]=f.useState(),[D,$]=f.useState(),[V,N]=f.useState(null),O=f.useRef(null),k=f.useRef({x:0,y:0}),_=f.useRef({x:0,y:0,scale:1}),M=f.useRef(void 0),A=f.useRef(0),j=f.useRef(!1),B=f.useRef({x:0,y:0}),U=f.useRef(!1),W=p.useState("toastIndex",r.id),G=p.useState("toastVisibleIndex",r.id),Z=p.useState("toastOffsetY",r.id),X=p.useState("focused"),K=p.useState("expanded");xn({open:r.transitionStatus!=="ending",ref:O,onComplete(){r.transitionStatus==="ending"&&p.removeToast(r.id)}});const J=ie((R=!1)=>{const H=O.current;if(!H)return;const L=H.style.height;H.style.height="auto";const F=H.offsetHeight;H.style.height=L;function Q(){p.updateToastInternal(r.id,{ref:O,height:F,...r.transitionStatus==="starting"?{transitionStatus:void 0}:{}})}R?Kt.flushSync(Q):Q()});he(J,[J]);function se(R,H){let L=R,F=H;return!l.includes("left")&&!l.includes("right")?L=R>0?R**Yn:-(Math.abs(R)**Yn):(!l.includes("right")&&R>0&&(L=R**Yn),!l.includes("left")&&R<0&&(L=-(Math.abs(R)**Yn))),!l.includes("up")&&!l.includes("down")?F=H>0?H**Yn:-(Math.abs(H)**Yn):(!l.includes("down")&&H>0&&(F=H**Yn),!l.includes("up")&&H<0&&(F=-(Math.abs(H)**Yn))),{x:L,y:F}}function ae(R){if(R.button!==0)return;R.pointerType==="touch"&&p.pauseTimers();const H=lt(R.nativeEvent);if(!(H&&H.closest(`button,a,input,textarea,[role="button"],${y0}`))){if(j.current=!1,M.current=void 0,A.current=0,k.current={x:R.clientX,y:R.clientY},B.current=k.current,O.current){const F=v0(O.current);_.current=F,P(F),x({x:F.x,y:F.y})}p.setHovering(!0),v(!0),C(!1),N(null),U.current=!0,O.current?.setPointerCapture(R.pointerId)}}function pe(R){if(!g)return;R.preventDefault(),U.current&&(k.current={x:R.clientX,y:R.clientY},U.current=!1);const{clientY:H,clientX:L,movementX:F,movementY:Q}=R;(Q<0&&H>B.current.y||Q>0&&H<B.current.y)&&(B.current={x:B.current.x,y:H}),(F<0&&L>B.current.x||F>0&&L<B.current.x)&&(B.current={x:L,y:B.current.y});const ne=L-k.current.x,te=H-k.current.y,ye=H-B.current.y,_e=L-B.current.x;if(!y&&Math.sqrt(ne*ne+te*te)>=g0&&(C(!0),V===null)){const He=l.includes("left")||l.includes("right"),nt=l.includes("up")||l.includes("down");if(He&&nt){const st=Math.abs(ne),Re=Math.abs(te);N(st>Re?"horizontal":"vertical")}}let Ee;if(!M.current)V==="vertical"?te>0?Ee="down":te<0&&(Ee="up"):V==="horizontal"?ne>0?Ee="right":ne<0&&(Ee="left"):Math.abs(ne)>=Math.abs(te)?Ee=ne>0?"right":"left":Ee=te>0?"down":"up",Ee&&l.includes(Ee)&&(M.current=Ee,A.current=Zl(Ee,ne,te),m(Ee));else{const Ge=M.current,He=Zl(Ge,_e,ye);He>go?(j.current=!1,m(Ge)):!(l.includes("left")&&l.includes("right"))&&!(l.includes("up")&&l.includes("down"))&&A.current-He>=m0&&(j.current=!0)}const Ce=se(ne,te);let Pe=_.current.x,Ve=_.current.y;V==="horizontal"?(l.includes("left")||l.includes("right"))&&(Pe+=Ce.x):(V==="vertical"||(l.includes("left")||l.includes("right"))&&(Pe+=Ce.x),(l.includes("up")||l.includes("down"))&&(Ve+=Ce.y)),x({x:Pe,y:Ve})}function Y(R){if(!g)return;if(v(!1),C(!1),N(null),O.current?.releasePointerCapture(R.pointerId),j.current){x({x:T.x,y:T.y}),m(void 0);return}let H=!1;const L=b.x-T.x,F=b.y-T.y;let Q;for(const ne of l){switch(ne){case"right":L>go&&(H=!0,Q="right");break;case"left":L<-go&&(H=!0,Q="left");break;case"down":F>go&&(H=!0,Q="down");break;case"up":F<-go&&(H=!0,Q="up");break}if(H)break}H?(m(Q),E(!0),p.closeToast(r.id)):(x({x:T.x,y:T.y}),m(void 0))}function me(){g&&(v(!1),C(!1),N(null),x({x:T.x,y:T.y}),m(void 0))}function ge(R){if(R.key==="Escape"){if(!O.current||!we(O.current,Pt(Ie(O.current))))return;p.closeToast(r.id)}}f.useEffect(()=>{if(!d)return;const R=O.current;if(!R)return;function H(L){we(R,lt(L))&&L.preventDefault()}return Fe(R,"touchmove",H,{passive:!1})},[d]);function fe(){if(!g&&b.x===T.x&&b.y===T.y&&!S)return{[ir.swipeMovementX]:"0px",[ir.swipeMovementY]:"0px"};const R=b.x-T.x,H=b.y-T.y;return{transition:g?"none":void 0,transform:g?`translateX(${b.x}px) translateY(${b.y}px) scale(${T.scale})`:void 0,[ir.swipeMovementX]:`${R}px`,[ir.swipeMovementY]:`${H}px`}}const le=r.priority==="high",ce={role:le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":z,"aria-describedby":D,"aria-hidden":le&&!X?!0:void 0,onPointerDown:d?ae:void 0,onPointerMove:d?pe:void 0,onPointerUp:d?Y:void 0,onPointerCancel:d?me:void 0,onKeyDown:ge,inert:cs(r.limited),style:{...fe(),[ir.index]:r.transitionStatus==="ending"?W:G,[ir.offsetY]:`${Z}px`,[ir.height]:r.height?`${r.height}px`:void 0}},ve=f.useMemo(()=>({rootRef:O,toast:r,titleId:z,setTitleId:I,descriptionId:D,setDescriptionId:$,swiping:g,swipeDirection:h,recalculateHeight:J,index:W,visibleIndex:G,expanded:K}),[r,z,D,g,h,J,W,G,K]),ue={transitionStatus:r.transitionStatus,expanded:K,limited:r.limited||!1,type:r.type,swiping:ve.swiping,swipeDirection:ve.swipeDirection},Se=qe("div",t,{ref:[n,ve.rootRef],state:ue,stateAttributesMapping:h0,props:[ce,c]});return w.jsx(pa.Provider,{value:ve,children:Se})});process.env.NODE_ENV!=="production"&&(Gl.displayName="ToastRoot");const Dr={...f};let Yl=0;function b0(e,t="mui"){const[n,r]=f.useState(e),o=e||n;return f.useEffect(()=>{n==null&&(Yl+=1,r(`${t}-${Yl}`))},[n,t]),o}const Xl=Dr.useId;function Xn(e,t){if(Xl!==void 0){const n=Xl();return e??(t?`${t}-${n}`:n)}return b0(e,t)}const ql=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,children:a,...c}=t,{toast:u,setDescriptionId:l}=r0(),d=a??u.description,p=!!d,h=Xn(i);he(()=>{if(p)return l(h),()=>{l(void 0)}},[p,h,l]);const m={type:u.type},g=qe("p",t,{ref:n,state:m,props:{...c,id:h,children:d}});return p?g:null});process.env.NODE_ENV!=="production"&&(ql.displayName="ToastDescription");let ma;process.env.NODE_ENV!=="production"&&(ma=new Set);function ar(...e){if(process.env.NODE_ENV!=="production"){const t=e.join(" ");ma.has(t)||(ma.add(t),console.error(`Base UI: ${t}`))}}const Kl=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Kl.displayName="CompositeRootContext");function w0(e=!1){const t=f.useContext(Kl);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>.":ft(16));return t}function S0(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 u={onKeyDown(l){n&&t&&l.key!=="Tab"&&l.preventDefault()}};return r||(u.tabIndex=o,!s&&n&&(u.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(u["aria-disabled"]=n),s&&(!t||a)&&(u.disabled=n),u},[r,n,t,i,a,s,o])}}function Lr(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=f.useRef(null),a=w0(!0),c=s??a!==void 0,{props:u}=S0({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:o});process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!i.current)return;const h=us(i.current);if(o){if(!h){const m=Dr.captureOwnerStack?.()||"";ar(`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=Dr.captureOwnerStack?.()||"";ar(`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 l=f.useCallback(()=>{const h=i.current;us(h)&&c&&t&&u.disabled===void 0&&h.disabled&&(h.disabled=!1)},[t,u.disabled,c]);he(l,[l]);const d=f.useCallback((h={})=>{const{onClick:m,onMouseDown:g,onKeyUp:v,onKeyDown:y,onPointerDown:C,...S}=h;return En({type:o?"button":void 0,onClick(b){if(t){b.preventDefault();return}m?.(b)},onMouseDown(b){t||g?.(b)},onKeyDown(b){if(t||(as(b),y?.(b),b.baseUIHandlerPrevented))return;const x=b.target===b.currentTarget,T=b.currentTarget,P=us(T),z=!o&&E0(T),I=x&&(o?P:!z),D=b.key==="Enter",$=b.key===" ",V=T.getAttribute("role"),N=V?.startsWith("menuitem")||V==="option"||V==="gridcell";if(x&&c&&$){if(b.defaultPrevented&&N)return;b.preventDefault(),z||o&&P?(T.click(),b.preventBaseUIHandler()):I&&(m?.(b),b.preventBaseUIHandler());return}I&&(!o&&($||D)&&b.preventDefault(),!o&&D&&m?.(b))},onKeyUp(b){if(!t){if(as(b),v?.(b),b.target===b.currentTarget&&o&&c&&us(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}C?.(b)}},o?void 0:{role:"button"},u,S)},[t,u,c,o]),p=ie(h=>{i.current=h,l()});return{getButtonProps:d,buttonRef:p}}function us(e){return it(e)&&e.tagName==="BUTTON"}function E0(e){return!!(e?.tagName==="A"&&e?.href)}function x0(e,t){return t!=null&&!fo(t)?0:typeof e=="function"?e():e}function ga(e,t,n){const r=x0(e,n);return typeof r=="number"?r:r?.[t]}function Jl(e){return typeof e=="function"?e():e}function Ql(e,t){return t||e==="click"||e==="mousedown"}const cr="none",Fr="trigger-press",Lt="trigger-hover",ya="outside-press",va="item-press",C0="close-press",ur="focus-out",ed="escape-key",T0="close-watcher",ba="list-navigation",O0="cancel-open",td="imperative-action",ls="swipe",P0="window-resize";function Ae(e,t,n,r){let o=!1,s=!1;const i=mt;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 _0(e,t,n){const r=mt;return{reason:e,event:t??new Event("base-ui"),...r}}function vt(e){const t=wt(I0,e).current;return t.next=e,he(t.effect),t}function I0(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function ds(e){return`data-base-ui-${e}`}let fs=0;function ps(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(fs);const s=()=>e?.focus({preventScroll:n});if(o)return s(),Ct;const i=requestAnimationFrame(s);return fs=i,()=>{fs===i&&(cancelAnimationFrame(i),fs=0)}}const wa={inert:new WeakMap,"aria-hidden":new WeakMap},nd="data-base-ui-inert",Sa={inert:new WeakSet,"aria-hidden":new WeakSet};let yo=new WeakMap,Ea=0;function k0(e){return Sa[e]}function rd(e){return e?kr(e)?e.host:rd(e.parentNode):null}const xa=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=rd(n);return e.contains(r)?r:null}).filter(n=>n!=null),od=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},sd=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{kt(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function R0(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,c=null;const u=xa(t,e),l=o?xa(t,s):[],d=new Set(l),p=o?sd(t,od(u),new Set(u)).filter(g=>!d.has(g)):[],h=[],m=[];if(i){const g=wa[i],v=k0(i);c=v,a=g;const y=xa(t,Array.from(t.querySelectorAll("[aria-live]"))),C=u.concat(y);sd(t,od(C),new Set(C)).forEach(E=>{const b=E.getAttribute(i),x=b!==null&&b!=="false",T=(g.get(E)||0)+1;g.set(E,T),h.push(E),T===1&&x&&v.add(E),x||E.setAttribute(i,i==="inert"?"":"true")})}return o&&p.forEach(g=>{const v=(yo.get(g)||0)+1;yo.set(g,v),m.push(g),v===1&&g.setAttribute(nd,"")}),Ea+=1,()=>{a&&h.forEach(g=>{const y=(a.get(g)||0)-1;a.set(g,y),y||(!c?.has(g)&&i&&g.removeAttribute(i),c?.delete(g))}),o&&m.forEach(g=>{const v=(yo.get(g)||0)-1;yo.set(g,v),v||g.removeAttribute(nd)}),Ea-=1,Ea||(wa.inert=new WeakMap,wa["aria-hidden"]=new WeakMap,Sa.inert=new WeakSet,Sa["aria-hidden"]=new WeakSet,yo=new WeakMap)}}function id(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=Ie(e[0]).body;return R0(e,i,n,r,{mark:o,markerIgnoreElements:s})}const Ca=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ca.displayName="PortalContext");const ad=()=>f.useContext(Ca),N0=ds("portal");function cd(e={}){const{ref:t,container:n,componentProps:r=mt,elementProps:o}=e,s=Xn(),a=ad()?.portalNode,[c,u]=f.useState(null),[l,d]=f.useState(null),p=ie(v=>{v!==null&&d(v)}),h=f.useRef(null);he(()=>{if(n===null){h.current&&(h.current=null,d(null),u(null));return}if(s==null)return;const v=(n&&(ji(n)?n:n.current))??a??document.body;if(v==null){h.current&&(h.current=null,d(null),u(null));return}h.current!==v&&(h.current=v,d(null),u(v))},[n,a,s]);const m=qe("div",r,{ref:[t,p],props:[{id:s,[N0]:""},o]});return{portalNode:l,portalSubtree:c&&m?Kt.createPortal(m,c):null}}const hs=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,style:c,...u}=t,{portalNode:l,portalSubtree:d}=cd({container:o,ref:n,componentProps:t,elementProps:u}),p=f.useRef(null),h=f.useRef(null),m=f.useRef(null),g=f.useRef(null),[v,y]=f.useState(null),C=f.useRef(!1),S=v?.modal,E=v?.open,b=typeof a=="boolean"?a:!!v&&!v.modal&&v.open&&!!l;f.useEffect(()=>{if(!l||S)return;function T(P){l&&P.relatedTarget&&Ar(P)&&(P.type==="focusin"?C.current&&(Rl(l),C.current=!1):(Db(l),C.current=!0))}return gn(Fe(l,"focusin",T,!0),Fe(l,"focusout",T,!0))},[l,S]),f.useEffect(()=>{!l||E!==!1||(Rl(l),C.current=!1)},[E,l]);const x=f.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:h,beforeInsideRef:m,afterInsideRef:g,portalNode:l,setFocusManagerState:y}),[l]);return w.jsxs(f.Fragment,{children:[d,w.jsxs(Ca.Provider,{value:x,children:[b&&l&&w.jsx(Sn,{"data-type":"outside",ref:p,onFocus:T=>{if(Ar(T,l))m.current?.focus();else{const P=v?v.domReference:null;Il(P)?.focus()}}}),b&&l&&w.jsx("span",{"aria-owns":l.id,style:p0}),l&&Kt.createPortal(r,l),b&&l&&w.jsx(Sn,{"data-type":"outside",ref:h,onFocus:T=>{if(Ar(T,l))g.current?.focus();else{const P=v?v.domReference:null;ca(P)?.focus(),v?.closeOnFocusOut&&v?.onOpenChange(!1,Ae(ur,T.nativeEvent))}}})]})]})});process.env.NODE_ENV!=="production"&&(hs.displayName="FloatingPortal");function ud(){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 M0{nodesRef={current:[]};events=ud();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 Ta=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ta.displayName="FloatingNodeContext");const Oa=f.createContext(null);process.env.NODE_ENV!=="production"&&(Oa.displayName="FloatingTreeContext");const qn=()=>f.useContext(Ta)?.id||null,lr=e=>{const t=f.useContext(Oa);return e??t};function A0(e){const t=Xn(),n=lr(e),r=qn();return he(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function D0(e){const{children:t,id:n}=e,r=qn();return w.jsx(Ta.Provider,{value:f.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function L0(e){const{children:t,externalTree:n}=e,r=wt(()=>n??new M0).current;return w.jsx(Oa.Provider,{value:r,children:t})}function F0(e,t){const n=tt(lt(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 ld=20;let Kn=[];function Pa(){Kn=Kn.filter(e=>e.deref()?.isConnected)}function V0(e){Pa(),e&&kt(e)!=="body"&&(Kn.push(new WeakRef(e)),Kn.length>ld&&(Kn=Kn.slice(-ld)))}function _a(){return Pa(),Kn[Kn.length-1]?.deref()}function z0(e){return e?aa(e)?e:ho(e)[0]||e:null}function dd(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const r=Pl(e).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return aa(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 ms(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:u="",nextFocusableElement:l,previousFocusableElement:d,beforeContentFocusGuardRef:p,externalTree:h,getInsideElements:m}=e,g="rootStore"in t?t.rootStore:t,v=g.useState("open"),y=g.useState("domReferenceElement"),C=g.useState("floatingElement"),{events:S,dataRef:E}=g.context,b=ie(()=>E.current.floatingContext?.nodeId),x=o===!1,T=Ki(y)&&x,P=f.useRef(["content"]),z=vt(o),I=vt(s),D=vt(u),$=lr(h),V=ad(),N=f.useRef(!1),O=f.useRef(!1),k=f.useRef(!1),_=f.useRef(null),M=f.useRef(""),A=f.useRef(""),j=f.useRef(null),B=f.useRef(null),U=or(j,p,V?.beforeInsideRef),W=or(B,V?.afterInsideRef),G=Gt(),Z=Gt(),X=ao(),K=V!=null,J=lo(C),se=ie((Y=J)=>Y?ho(Y):[]),ae=ie(()=>m?.().filter(Y=>Y!=null)??[]);f.useEffect(()=>{if(r||!a)return;function Y(ge){ge.key==="Tab"&&we(J,Pt(Ie(J)))&&se().length===0&&!T&&Yt(ge)}const me=Ie(J);return Fe(me,"keydown",Y)},[r,y,J,a,P,T,se]),f.useEffect(()=>{if(r||!v)return;const Y=Ie(J);function me(){k.current=!1}function ge(le){const ce=lt(le),ve=ae(),ue=we(C,ce)||we(y,ce)||we(V?.portalNode,ce)||ve.some(Se=>Se===ce||we(Se,ce));k.current=!ue,A.current=le.pointerType||"keyboard",ce?.closest(`[${ha}]`)&&(O.current=!0)}function fe(){A.current="keyboard"}return gn(Fe(Y,"pointerdown",ge,!0),Fe(Y,"pointerup",me,!0),Fe(Y,"pointercancel",me,!0),Fe(Y,"keydown",fe,!0))},[r,C,y,J,v,V,ae]),f.useEffect(()=>{if(r||!c)return;const Y=Ie(J);function me(){O.current=!0,Z.start(0,()=>{O.current=!1})}function ge(ve){const ue=lt(ve);aa(ue)&&(_.current=ue)}function fe(ve){const ue=ve.relatedTarget,Se=ve.currentTarget,R=lt(ve);queueMicrotask(()=>{const H=b(),L=g.context.triggerElements,F=ae(),Q=ue?.hasAttribute(ds("focus-guard"))&&[j.current,B.current,V?.beforeInsideRef.current,V?.afterInsideRef.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,An(d),An(l)].includes(ue),ne=!(we(y,ue)||we(C,ue)||we(ue,C)||we(V?.portalNode,ue)||F.some(te=>te===ue||we(te,ue))||ue!=null&&L.hasElement(ue)||L.hasMatchingElement(te=>we(te,ue))||Q||$&&(vn($.nodesRef.current,H).find(te=>we(te.context?.elements.floating,ue)||we(te.context?.elements.domReference,ue))||pl($.nodesRef.current,H).find(te=>[te.context?.elements.floating,lo(te.context?.elements.floating)].includes(ue)||te.context?.elements.domReference===ue)));if(Se===y&&J&&dd(J,P),i&&Se!==y&&!rs(R)&&Pt(Y)===Y.body){if(it(J)&&(J.focus(),i==="popup")){X.request(()=>{J.focus()});return}const te=se(),ye=_.current,_e=(ye&&te.includes(ye)?ye:null)||te[te.length-1]||J;it(_e)&&_e.focus()}if(E.current.insideReactTree){E.current.insideReactTree=!1;return}(T||!a)&&ue&&ne&&!O.current&&(T||ue!==_a())&&(N.current=!0,g.setOpen(!1,Ae(ur,ve)))})}function le(){k.current||(E.current.insideReactTree=!0,G.start(0,()=>{E.current.insideReactTree=!1}))}const ce=it(y)?y:null;if(!(!C&&!ce))return gn(ce&&Fe(ce,"focusout",fe),ce&&Fe(ce,"pointerdown",me),C&&Fe(C,"focusin",ge),C&&Fe(C,"focusout",fe),C&&V&&Fe(C,"focusout",le,!0))},[r,y,C,J,a,$,V,g,c,i,se,T,b,P,E,G,Z,X,l,d,ae]),f.useEffect(()=>{if(r||!C||!v)return;const Y=Array.from(V?.portalNode?.querySelectorAll(`[${ds("portal")}]`)||[]),ge=($?pl($.nodesRef.current,b()):[]).find(Se=>Ki(Se.context?.elements.domReference||null))?.context?.elements.domReference,le=[...[C,...Y,j.current,B.current,V?.beforeOutsideRef.current,V?.afterOutsideRef.current,...ae()],ge,An(d),An(l),T?y:null].filter(Se=>Se!=null),ce=id(le,{ariaHidden:a||T,mark:!1}),ve=[C,...Y].filter(Se=>Se!=null),ue=id(ve);return()=>{ue(),ce()}},[v,r,y,C,a,P,V,T,$,b,l,d,ae]),he(()=>{if(!v||r||!it(J))return;const Y=Ie(J),me=Pt(Y);queueMicrotask(()=>{const ge=z.current,fe=typeof ge=="function"?ge(D.current||""):ge;if(fe===void 0||fe===!1||we(J,me))return;let ce=null;const ve=()=>(ce==null&&(ce=se(J)),ce[0]||J);let ue;fe===!0||fe===null?ue=ve():ue=An(fe),ue=ue||ve(),ps(ue,{preventScroll:ue===J})})},[r,v,J,x,se,z,D]),he(()=>{if(r||!J)return;const Y=Ie(J),me=Pt(Y);V0(me);function ge(le){if(le.open||(M.current=F0(le.nativeEvent,A.current)),le.reason===Lt&&le.nativeEvent.type==="mouseleave"&&(N.current=!0),le.reason===ya)if(le.nested)N.current=!1;else if(hl(le.nativeEvent)||ml(le.nativeEvent))N.current=!1;else{let ce=!1;Ie(J).createElement("div").focus({get preventScroll(){return ce=!0,!1}}),ce?N.current=!1:N.current=!0}}S.on("openchange",ge);function fe(){const le=I.current;let ce=typeof le=="function"?le(M.current):le;if(ce===void 0||ce===!1)return null;if(ce===null&&(ce=!0),typeof ce=="boolean"){const ue=y||_a();return ue&&ue.isConnected?ue:null}const ve=y||_a();return An(ce)||ve||null}return()=>{S.off("openchange",ge);const le=Pt(Y),ce=ae(),ve=we(C,le)||ce.some(R=>R===le||we(R,le))||$&&vn($.nodesRef.current,b(),!1).some(R=>we(R.context?.elements.floating,le)),ue=I.current,Se=fe();queueMicrotask(()=>{const R=z0(Se),H=typeof ue!="boolean";ue&&!N.current&&it(R)&&(!(!H&&R!==le&&le!==Y.body)||ve)&&R.focus({preventScroll:!0}),N.current=!1})}},[r,C,J,I,E,S,$,y,b,ae]),he(()=>{if(!Gi||v||!C)return;const Y=Pt(Ie(C));!it(Y)||!qi(Y)||we(C,Y)&&Y.blur()},[v,C]),he(()=>{if(!(r||!V))return V.setFocusManagerState({modal:a,closeOnFocusOut:c,open:v,onOpenChange:g.setOpen,domReference:y}),()=>{V.setFocusManagerState(null)}},[r,V,a,v,g,c,y]),he(()=>{if(!(r||!J))return dd(J,P),()=>{queueMicrotask(Pa)}},[r,J,P]);const pe=!r&&(a?!T:!0)&&(K||a);return w.jsxs(f.Fragment,{children:[pe&&w.jsx(Sn,{"data-type":"inside",ref:U,onFocus:Y=>{if(a){const me=se();ps(me[me.length-1])}else V?.portalNode&&(N.current=!1,Ar(Y,V.portalNode)?ca(y)?.focus():An(d??V.beforeOutsideRef)?.focus())}}),n,pe&&w.jsx(Sn,{"data-type":"inside",ref:W,onFocus:Y=>{a?ps(se()[0]):V?.portalNode&&(c&&(N.current=!0),Ar(Y,V.portalNode)?Il(y)?.focus():An(l??V.afterOutsideRef)?.focus())}})]})}function Ia(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:u=0,reason:l=Fr}=t,d=f.useRef(void 0),p=ao(),h=Gt(),m=f.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){const v=d.current,y=g.nativeEvent,C=n.select("open");if(g.button!==0||s==="click"||fo(v,!0)&&a)return;const S=r.current.openEvent,E=S?.type,b=n.select("domReferenceElement")!==g.currentTarget,x=C&&b||!(C&&i&&(!(S&&c)||E==="click"||E==="mousedown")),T=lt(y);if(qi(T)){const z=Ae(l,y,T);x&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,z)}):n.setOpen(x,z);return}const P=g.currentTarget;p.request(()=>{const z=Ae(l,y,P);x&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,z)}):n.setOpen(x,z)})},onClick(g){if(s==="mousedown-only")return;const v=d.current;if(s==="mousedown"&&v){d.current=void 0;return}if(fo(v,!0)&&a)return;const y=n.select("open"),C=r.current.openEvent,S=n.select("domReferenceElement")!==g.currentTarget,E=y&&S||!(y&&i&&(!(C&&c)||gl(C))),b=Ae(l,g.nativeEvent,g.currentTarget);E&&v==="touch"&&u>0?h.start(u,()=>{n.setOpen(!0,b)}):n.setOpen(E,b)},onKeyDown(){d.current=void 0}}),[r,s,a,n,c,i,p,h,u,l]);return f.useMemo(()=>o?{reference:m}:mt,[o,m])}const $0={intentional:"onClick",sloppy:"onPointerDown"};function j0(){return!1}function H0(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function ka(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:u="sloppy",referencePress:l=j0,referencePressEvent:d="sloppy",bubbles:p,externalTree:h}=t,m=lr(h),g=ie(typeof c=="function"?c:()=>!1),v=typeof c=="function"?g:c,y=v!==!1,C=ie(()=>u),S=f.useRef(!1),E=f.useRef(!1),b=f.useRef(!1),{escapeKey:x,outsidePress:T}=H0(p),P=f.useRef(null),z=Gt(),I=Gt(),D=ie(()=>{I.clear(),s.current.insideReactTree=!1}),$=f.useRef(!1),V=f.useRef(""),N=ie(l),O=ie(B=>{if(!r||!i||!a||B.key!=="Escape"||$.current)return;const U=s.current.floatingContext?.nodeId,W=m?vn(m.nodesRef.current,U):[];if(!x&&W.length>0){let X=!0;if(W.forEach(K=>{K.context?.open&&!K.context.dataRef.current.__escapeKeyBubbles&&(X=!1)}),!X)return}const G=pb(B)?B.nativeEvent:B,Z=Ae(ed,G);n.setOpen(!1,Z),!x&&!Z.isPropagationAllowed&&B.stopPropagation()}),k=ie(()=>{s.current.insideReactTree=!0,I.start(0,D)});f.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=x,s.current.__outsidePressBubbles=T;const B=new Zt,U=new Zt;function W(){B.clear(),$.current=!0}function G(){B.start(Yo()?5:0,()=>{$.current=!1})}function Z(){b.current=!0,U.start(0,()=>{b.current=!1})}function X(){S.current=!1,E.current=!1}function K(){const L=V.current,F=L==="pen"||!L?"mouse":L,Q=C(),ne=typeof Q=="function"?Q():Q;return typeof ne=="string"?ne:ne[F]}function J(L){const F=K();return F==="intentional"&&L.type!=="click"||F==="sloppy"&&L.type==="click"}function se(L){const F=s.current.floatingContext?.nodeId,Q=m&&vn(m.nodesRef.current,F).some(ne=>un(L,ne.context?.elements.floating));return un(L,n.select("floatingElement"))||un(L,n.select("domReferenceElement"))||Q}function ae(L){if(J(L)){D();return}if(s.current.insideReactTree){D();return}const F=lt(L),Q=`[${ds("inert")}]`,ne=$e(F)?F.getRootNode():null,te=Array.from((kr(ne)?ne:Ie(n.select("floatingElement"))).querySelectorAll(Q)),ye=n.context.triggerElements;if(F&&(ye.hasElement(F)||ye.hasMatchingElement(Pe=>we(Pe,F))))return;let _e=$e(F)?F:null;for(;_e&&!Rn(_e);){const Pe=Nn(_e);if(Rn(Pe)||!$e(Pe))break;_e=Pe}if(te.length&&$e(F)&&!db(F)&&!we(F,n.select("floatingElement"))&&te.every(Pe=>!we(_e,Pe)))return;if(it(F)&&!("touches"in L)){const Pe=Rn(F),Ve=At(F),Ge=/auto|scroll/,He=Pe||Ge.test(Ve.overflowX),nt=Pe||Ge.test(Ve.overflowY),st=He&&F.clientWidth>0&&F.scrollWidth>F.clientWidth,Re=nt&&F.clientHeight>0&&F.scrollHeight>F.clientHeight,Te=Ve.direction==="rtl",Ue=Re&&(Te?L.offsetX<=F.offsetWidth-F.clientWidth:L.offsetX>F.clientWidth),Be=st&&L.offsetY>F.clientHeight;if(Ue||Be)return}if(se(L))return;if(K()==="intentional"&&b.current){U.clear(),b.current=!1;return}if(typeof v=="function"&&!v(L))return;const Ee=s.current.floatingContext?.nodeId,Ce=m?vn(m.nodesRef.current,Ee):[];if(Ce.length>0){let Pe=!0;if(Ce.forEach(Ve=>{Ve.context?.open&&!Ve.context.dataRef.current.__outsidePressBubbles&&(Pe=!1)}),!Pe)return}n.setOpen(!1,Ae(ya,L)),D()}function pe(L){K()!=="sloppy"||L.pointerType==="touch"||!n.select("open")||!i||un(L,n.select("floatingElement"))||un(L,n.select("domReferenceElement"))||ae(L)}function Y(L){if(K()!=="sloppy"||!n.select("open")||!i||un(L,n.select("floatingElement"))||un(L,n.select("domReferenceElement")))return;const F=L.touches[0];F&&(P.current={startTime:Date.now(),startX:F.clientX,startY:F.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},z.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}function me(L,F){const Q=lt(L);if(!Q)return;const ne=Fe(Q,L.type,()=>{F(L),ne()})}function ge(L){V.current="touch",me(L,Y)}function fe(L){z.clear(),L.type==="pointerdown"&&(V.current=L.pointerType),!(L.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)&&me(L,F=>{F.type==="pointerdown"?pe(F):ae(F)})}function le(L){if(!S.current)return;const F=E.current;if(X(),K()==="intentional"){if(L.type==="pointercancel"){F&&Z();return}if(!se(L)){if(F){Z();return}typeof v=="function"&&!v(L)||(U.clear(),b.current=!0,D())}}}function ce(L){if(K()!=="sloppy"||!P.current||un(L,n.select("floatingElement"))||un(L,n.select("domReferenceElement")))return;const F=L.touches[0];if(!F)return;const Q=Math.abs(F.clientX-P.current.startX),ne=Math.abs(F.clientY-P.current.startY),te=Math.sqrt(Q*Q+ne*ne);te>5&&(P.current.dismissOnTouchEnd=!0),te>10&&(ae(L),z.clear(),P.current=null)}function ve(L){me(L,ce)}function ue(L){K()!=="sloppy"||!P.current||un(L,n.select("floatingElement"))||un(L,n.select("domReferenceElement"))||(P.current.dismissOnTouchEnd&&ae(L),z.clear(),P.current=null)}function Se(L){me(L,ue)}const R=Ie(o),H=gn(a&&gn(Fe(R,"keydown",O),Fe(R,"compositionstart",W),Fe(R,"compositionend",G)),y&&gn(Fe(R,"click",fe,!0),Fe(R,"pointerdown",fe,!0),Fe(R,"pointerup",le,!0),Fe(R,"pointercancel",le,!0),Fe(R,"mousedown",fe,!0),Fe(R,"mouseup",le,!0),Fe(R,"touchstart",ge,!0),Fe(R,"touchmove",ve,!0),Fe(R,"touchend",Se,!0)));return()=>{H(),B.clear(),U.clear(),X(),b.current=!1}},[s,o,a,y,v,r,i,x,T,O,D,C,m,n,z]),f.useEffect(D,[v,D]);const _=f.useMemo(()=>({onKeyDown:O,[$0[d]]:B=>{N()&&n.setOpen(!1,Ae(Fr,B.nativeEvent))},...d!=="intentional"&&{onClick(B){N()&&n.setOpen(!1,Ae(Fr,B.nativeEvent))}}}),[O,n,d,N]),M=ie(B=>{if(!r||!i||B.button!==0)return;const U=lt(B.nativeEvent);we(n.select("floatingElement"),U)&&(S.current||(S.current=!0,E.current=!1))}),A=ie(B=>{!r||!i||(B.defaultPrevented||B.nativeEvent.defaultPrevented)&&S.current&&(E.current=!0)}),j=f.useMemo(()=>({onKeyDown:O,onPointerDown:A,onMouseDown:A,onClickCapture:k,onMouseDownCapture(B){k(),M(B)},onPointerDownCapture(B){k(),M(B)},onMouseUpCapture:k,onTouchEndCapture:k,onTouchMoveCapture:k}),[O,k,M,A]);return f.useMemo(()=>i?{reference:_,floating:j,trigger:_}:{},[i,_,j])}function fd(e,t,n){let{reference:r,floating:o}=e;const s=en(t),i=na(t),a=ta(i),c=jt(t),u=s==="y",l=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(c){case"top":h={x:l,y:r.y-o.height};break;case"bottom":h={x:l,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(Gn(t)){case"start":h[i]-=p*(n&&u?-1:1);break;case"end":h[i]+=p*(n&&u?-1:1);break}return h}async function U0(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:a,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:l="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Mn(t,e),m=bl(h),v=a[p?d==="floating"?"reference":"floating":d],y=po(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:u,rootBoundary:l,strategy:c})),C=d==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),E=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},b=po(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:S,strategy:c}):C);return{top:(y.top-b.top+m.top)/E.y,bottom:(b.bottom-y.bottom+m.bottom)/E.y,left:(y.left-b.left+m.left)/E.x,right:(b.right-y.right+m.right)/E.x}}const B0=50,W0=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:U0},c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:l,y:d}=fd(u,r,c),p=r,h=0;const m={};for(let g=0;g<s.length;g++){const v=s[g];if(!v)continue;const{name:y,fn:C}=v,{x:S,y:E,data:b,reset:x}=await C({x:l,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});l=S??l,d=E??d,m[y]={...m[y],...b},x&&h<B0&&(h++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(u=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:l,y:d}=fd(u,p,c)),g=-1)}return{x:l,y:d,placement:p,strategy:o,middlewareData:m}},Z0=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:u}=t,{mainAxis:l=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=Mn(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=jt(o),C=en(a),S=jt(a)===a,E=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=p||(S||!g?[es(a)]:yb(a)),x=m!=="none";!p&&x&&b.push(...Sb(a,g,m,E));const T=[a,...b],P=await c.detectOverflow(t,v),z=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(l&&z.push(P[y]),d){const N=gb(o,i,E);z.push(P[N[0]],P[N[1]])}if(I=[...I,{placement:o,overflows:z}],!z.every(N=>N<=0)){var D,$;const N=(((D=s.flip)==null?void 0:D.index)||0)+1,O=T[N];if(O&&(!(d==="alignment"?C!==en(O):!1)||I.every(M=>en(M.placement)===C?M.overflows[0]>0:!0)))return{data:{index:N,overflows:I},reset:{placement:O}};let k=($=I.filter(_=>_.overflows[0]<=0).sort((_,M)=>_.overflows[1]-M.overflows[1])[0])==null?void 0:$.placement;if(!k)switch(h){case"bestFit":{var V;const _=(V=I.filter(M=>{if(x){const A=en(M.placement);return A===C||A==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(A=>A>0).reduce((A,j)=>A+j,0)]).sort((M,A)=>M[1]-A[1])[0])==null?void 0:V[0];_&&(k=_);break}case"initialPlacement":k=a;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function pd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hd(e){return hb.some(t=>e[t]>=0)}const G0=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...s}=Mn(e,t);switch(o){case"referenceHidden":{const i=await r.detectOverflow(t,{...s,elementContext:"reference"}),a=pd(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:hd(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...s,altBoundary:!0}),a=pd(i,n.floating);return{data:{escapedOffsets:a,escaped:hd(a)}}}default:return{}}}}},md=new Set(["left","top"]);async function Y0(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=jt(n),a=Gn(n),c=en(n)==="y",u=md.has(i)?-1:1,l=s&&c?-1:1,d=Mn(t,e);let{mainAxis:p,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*l,y:p*u}:{x:p*u,y:h*l}}const X0=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 Y0(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}}}}},q0=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:y=>{let{x:C,y:S}=y;return{x:C,y:S}}},...u}=Mn(e,t),l={x:n,y:r},d=await s.detectOverflow(t,u),p=en(jt(o)),h=ea(p);let m=l[h],g=l[p];if(i){const y=h==="y"?"top":"left",C=h==="y"?"bottom":"right",S=m+d[y],E=m-d[C];m=Qi(S,m,E)}if(a){const y=p==="y"?"top":"left",C=p==="y"?"bottom":"right",S=g+d[y],E=g-d[C];g=Qi(S,g,E)}const v=c.fn({...t,[h]:m,[p]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[p]:a}}}}}},K0=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:u=!0}=Mn(e,t),l={x:n,y:r},d=en(o),p=ea(d);let h=l[p],m=l[d];const g=Mn(a,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const S=p==="y"?"height":"width",E=s.reference[p]-s.floating[S]+v.mainAxis,b=s.reference[p]+s.reference[S]-v.mainAxis;h<E?h=E:h>b&&(h=b)}if(u){var y,C;const S=p==="y"?"width":"height",E=md.has(jt(o)),b=s.reference[d]-s.floating[S]+(E&&((y=i.offset)==null?void 0:y[d])||0)+(E?0:v.crossAxis),x=s.reference[d]+s.reference[S]+(E?0:((C=i.offset)==null?void 0:C[d])||0)-(E?v.crossAxis:0);m<b?m=b:m>x&&(m=x)}return{[p]:h,[d]:m}}}},J0=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=()=>{},...u}=Mn(e,t),l=await i.detectOverflow(t,u),d=jt(o),p=Gn(o),h=en(o)==="y",{width:m,height:g}=s.floating;let v,y;d==="top"||d==="bottom"?(v=d,y=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(y=d,v=p==="end"?"top":"bottom");const C=g-l.top-l.bottom,S=m-l.left-l.right,E=Nr(g-l[v],C),b=Nr(m-l[y],S),x=!t.middlewareData.shift;let T=E,P=b;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=S),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=C),x&&!p){const I=Xt(l.left,0),D=Xt(l.right,0),$=Xt(l.top,0),V=Xt(l.bottom,0);h?P=m-2*(I!==0||D!==0?I+D:Xt(l.left,l.right)):T=g-2*($!==0||V!==0?$+V:Xt(l.top,l.bottom))}await c({...t,availableWidth:P,availableHeight:T});const z=await i.getDimensions(a.floating);return m!==z.width||g!==z.height?{reset:{rects:!0}}:{}}}};function gd(e){const t=At(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=it(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Qo(n)!==s||Qo(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function Ra(e){return $e(e)?e:e.contextElement}function Vr(e){const t=Ra(e);if(!it(t))return bn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=gd(t);let i=(s?Qo(n.width):n.width)/r,a=(s?Qo(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Q0=bn(0);function yd(e){const t=tt(e);return!Yo()||!t.visualViewport?Q0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ew(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tt(e)?!1:t}function dr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Ra(e);let i=bn(1);t&&(r?$e(r)&&(i=Vr(r)):i=Vr(e));const a=ew(s,n,r)?yd(s):bn(0);let c=(o.left+a.x)/i.x,u=(o.top+a.y)/i.y,l=o.width/i.x,d=o.height/i.y;if(s){const p=tt(s),h=r&&$e(r)?tt(r):r;let m=p,g=Bi(m);for(;g&&r&&h!==m;){const v=Vr(g),y=g.getBoundingClientRect(),C=At(g),S=y.left+(g.clientLeft+parseFloat(C.paddingLeft))*v.x,E=y.top+(g.clientTop+parseFloat(C.paddingTop))*v.y;c*=v.x,u*=v.y,l*=v.x,d*=v.y,c+=S,u+=E,m=tt(g),g=Bi(m)}}return po({width:l,height:d,x:c,y:u})}function gs(e,t){const n=Xo(e).scrollLeft;return t?t.left+n:dr(mn(e)).left+n}function vd(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 tw(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=mn(r),a=t?Go(t.floating):!1;if(r===i||a&&s)return n;let c={scrollLeft:0,scrollTop:0},u=bn(1);const l=bn(0),d=it(r);if((d||!d&&!s)&&((kt(r)!=="body"||Bn(i))&&(c=Xo(r)),d)){const h=dr(r);u=Vr(r),l.x=h.x+r.clientLeft,l.y=h.y+r.clientTop}const p=i&&!d&&!s?vd(i,c):bn(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+l.x+p.x,y:n.y*u.y-c.scrollTop*u.y+l.y+p.y}}function nw(e){return Array.from(e.getClientRects())}function rw(e){const t=mn(e),n=Xo(e),r=e.ownerDocument.body,o=Xt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Xt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+gs(e);const a=-n.scrollTop;return At(r).direction==="rtl"&&(i+=Xt(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}const bd=25;function ow(e,t){const n=tt(e),r=mn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,a=0,c=0;if(o){s=o.width,i=o.height;const l=Yo();(!l||l&&t==="fixed")&&(a=o.offsetLeft,c=o.offsetTop)}const u=gs(r);if(u<=0){const l=r.ownerDocument,d=l.body,p=getComputedStyle(d),h=l.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-h);m<=bd&&(s-=m)}else u<=bd&&(s+=u);return{width:s,height:i,x:a,y:c}}function sw(e,t){const n=dr(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=it(e)?Vr(e):bn(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,c=o*s.x,u=r*s.y;return{width:i,height:a,x:c,y:u}}function wd(e,t,n){let r;if(t==="viewport")r=ow(e,n);else if(t==="document")r=rw(mn(e));else if($e(t))r=sw(t,n);else{const o=yd(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return po(r)}function Sd(e,t){const n=Nn(e);return n===t||!$e(n)||Rn(n)?!1:At(n).position==="fixed"||Sd(n,t)}function iw(e,t){const n=t.get(e);if(n)return n;let r=io(e,[],!1).filter(a=>$e(a)&&kt(a)!=="body"),o=null;const s=At(e).position==="fixed";let i=s?Nn(e):e;for(;$e(i)&&!Rn(i);){const a=At(i),c=Ui(i);!c&&a.position==="fixed"&&(o=null),(s?!c&&!o:!c&&a.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Bn(i)&&!c&&Sd(e,i))?r=r.filter(l=>l!==i):o=a,i=Nn(i)}return t.set(e,r),r}function aw(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?Go(t)?[]:iw(t,this._c):[].concat(n),r],a=wd(t,i[0],o);let c=a.top,u=a.right,l=a.bottom,d=a.left;for(let p=1;p<i.length;p++){const h=wd(t,i[p],o);c=Xt(h.top,c),u=Nr(h.right,u),l=Nr(h.bottom,l),d=Xt(h.left,d)}return{width:u-d,height:l-c,x:d,y:c}}function cw(e){const{width:t,height:n}=gd(e);return{width:t,height:n}}function uw(e,t,n){const r=it(t),o=mn(t),s=n==="fixed",i=dr(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const c=bn(0);function u(){c.x=gs(o)}if(r||!r&&!s)if((kt(t)!=="body"||Bn(o))&&(a=Xo(t)),r){const h=dr(t,!0,s,t);c.x=h.x+t.clientLeft,c.y=h.y+t.clientTop}else o&&u();s&&!r&&o&&u();const l=o&&!r&&!s?vd(o,a):bn(0),d=i.left+a.scrollLeft-c.x-l.x,p=i.top+a.scrollTop-c.y-l.y;return{x:d,y:p,width:i.width,height:i.height}}function Na(e){return At(e).position==="static"}function Ed(e,t){if(!it(e)||At(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function xd(e,t){const n=tt(e);if(Go(e))return n;if(!it(e)){let o=Nn(e);for(;o&&!Rn(o);){if($e(o)&&!Na(o))return o;o=Nn(o)}return n}let r=Ed(e,t);for(;r&&tb(r)&&Na(r);)r=Ed(r,t);return r&&Rn(r)&&Na(r)&&!Ui(r)?n:r||ob(e)||n}const lw=async function(e){const t=this.getOffsetParent||xd,n=this.getDimensions,r=await n(e.floating);return{reference:uw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dw(e){return At(e).direction==="rtl"}const Cd={convertOffsetParentRelativeRectToViewportRelativeRect:tw,getDocumentElement:mn,getClippingRect:aw,getOffsetParent:xd,getElementRects:lw,getClientRects:nw,getDimensions:cw,getScale:Vr,isElement:$e,isRTL:dw};function Td(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fw(e,t){let n=null,r;const o=mn(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 u=e.getBoundingClientRect(),{left:l,top:d,width:p,height:h}=u;if(a||t(),!p||!h)return;const m=rr(d),g=rr(o.clientWidth-(l+p)),v=rr(o.clientHeight-(d+h)),y=rr(l),S={rootMargin:-m+"px "+-g+"px "+-v+"px "+-y+"px",threshold:Xt(0,Nr(1,c))||1};let E=!0;function b(x){const T=x[0].intersectionRatio;if(T!==c){if(!E)return i();T?i(!1,T):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T===1&&!Td(u,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(b,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,S)}n.observe(e)}return i(!0),s}function Od(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,u=Ra(e),l=o||s?[...u?io(u):[],...t?io(t):[]]:[];l.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const d=u&&a?fw(u,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(y=>{let[C]=y;C&&C.target===u&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),u&&!c&&h.observe(u),t&&h.observe(t));let m,g=c?dr(e):null;c&&v();function v(){const y=dr(e);g&&!Td(g,y)&&n(),g=y,m=requestAnimationFrame(v)}return n(),()=>{var y;l.forEach(C=>{o&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),d?.(),(y=h)==null||y.disconnect(),h=null,c&&cancelAnimationFrame(m)}}const pw=X0,hw=q0,mw=Z0,gw=J0,yw=G0,vw=K0,bw=(e,t,n)=>{const r=new Map,o={platform:Cd,...n},s={...o.platform,_c:r};return W0(e,t,{...o,platform:s})};var ww=typeof document<"u",Sw=function(){},ys=ww?oe.useLayoutEffect:Sw;function vs(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(!vs(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)&&!vs(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Pd(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _d(e,t){const n=Pd(e);return Math.round(t*n)/n}function Ma(e){const t=f.useRef(e);return ys(()=>{t.current=e}),t}function Ew(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:u}=e,[l,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(r);vs(p,r)||h(r);const[m,g]=f.useState(null),[v,y]=f.useState(null),C=f.useCallback(M=>{M!==x.current&&(x.current=M,g(M))},[]),S=f.useCallback(M=>{M!==T.current&&(T.current=M,y(M))},[]),E=s||m,b=i||v,x=f.useRef(null),T=f.useRef(null),P=f.useRef(l),z=c!=null,I=Ma(c),D=Ma(o),$=Ma(u),V=f.useCallback(()=>{if(!x.current||!T.current)return;const M={placement:t,strategy:n,middleware:p};D.current&&(M.platform=D.current),bw(x.current,T.current,M).then(A=>{const j={...A,isPositioned:$.current!==!1};N.current&&!vs(P.current,j)&&(P.current=j,Kt.flushSync(()=>{d(j)}))})},[p,t,n,D,$]);ys(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,d(M=>({...M,isPositioned:!1})))},[u]);const N=f.useRef(!1);ys(()=>(N.current=!0,()=>{N.current=!1}),[]),ys(()=>{if(E&&(x.current=E),b&&(T.current=b),E&&b){if(I.current)return I.current(E,b,V);V()}},[E,b,V,I,z]);const O=f.useMemo(()=>({reference:x,floating:T,setReference:C,setFloating:S}),[C,S]),k=f.useMemo(()=>({reference:E,floating:b}),[E,b]),_=f.useMemo(()=>{const M={position:n,left:0,top:0};if(!k.floating)return M;const A=_d(k.floating,l.x),j=_d(k.floating,l.y);return a?{...M,transform:"translate("+A+"px, "+j+"px)",...Pd(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:j}},[n,a,k.floating,l.x,l.y]);return f.useMemo(()=>({...l,update:V,refs:O,elements:k,floatingStyles:_}),[l,V,O,k,_])}const xw=(e,t)=>{const n=pw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Cw=(e,t)=>{const n=hw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Tw=(e,t)=>({fn:vw(e).fn,options:[e,t]}),Ow=(e,t)=>{const n=mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Pw=(e,t)=>{const n=gw(e);return{name:n.name,fn:n.fn,options:[e,t]}},_w=(e,t)=>{const n=yw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iw={open:de(e=>e.open),transitionStatus:de(e=>e.transitionStatus),domReferenceElement:de(e=>e.domReferenceElement),referenceElement:de(e=>e.positionReference??e.referenceElement),floatingElement:de(e=>e.floatingElement),floatingId:de(e=>e.floatingId)};class Aa extends Wo{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:ud(),nested:r,triggerElements:s},Iw),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&gl(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 vo(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),he(()=>{if(!e&&s&&r!=="ending"&&n){const a=yn.request(()=>{o("ending")});return()=>{yn.cancel(a)}}},[e,s,r,n]),he(()=>{if(!e||t)return;const a=yn.request(()=>{o(void 0)});return()=>{yn.cancel(a)}},[t,e]),he(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=yn.request(()=>{o("idle")});return()=>{yn.cancel(a)}},[t,e,s,r]),{mounted:s,setMounted:i,transitionStatus:r}}function kw(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 Id(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=kw(e,n),i=ie(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 he(()=>{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");he(()=>{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 Rd(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=vo(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=ie(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return xn({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 Rw(){return new Aa({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new bs,floatingId:"",syncOnly:!1,nested:!1,onOpenChange:void 0})}function Nd(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:Rw(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:mt,inactiveTriggerProps:mt,popupProps:mt}}const ws=de(e=>e.triggerIdProp??e.activeTriggerId),Md={open:de(e=>e.openProp??e.open),mounted:de(e=>e.mounted),transitionStatus:de(e=>e.transitionStatus),floatingRootContext:de(e=>e.floatingRootContext),preventUnmountingOnClose:de(e=>e.preventUnmountingOnClose),payload:de(e=>e.payload),activeTriggerId:ws,activeTriggerElement:de(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:de((e,t)=>t!==void 0&&ws(e)===t),isOpenedByTrigger:de((e,t)=>t!==void 0&&ws(e)===t&&e.open),isMountedByTrigger:de((e,t)=>t!==void 0&&ws(e)===t&&e.mounted),triggerProps:de((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:de(e=>e.popupProps),popupElement:de(e=>e.popupElement),positionerElement:de(e=>e.positionerElement)};function Ad(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,o=Xn(),s=qn()!=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=wt(()=>new Aa({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 he(()=>{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}function Nw(e={}){const{nodeId:t,externalTree:n}=e,r=Ad(e),o=e.rootContext||r,s={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[i,a]=f.useState(null),c=f.useRef(null),u=lr(n);he(()=>{s.domReference&&(c.current=s.domReference)},[s.domReference]);const l=Ew({...e,elements:{...s,...i&&{reference:i}}}),d=f.useCallback(P=>{const z=$e(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;a(z),l.refs.setReference(z)},[l.refs]),[p,h]=f.useState(void 0),[m,g]=f.useState(null);o.useSyncedValue("referenceElement",p??null);const v=$e(p)?p:null;o.useSyncedValue("domReferenceElement",p===void 0?s.domReference:v),o.useSyncedValue("floatingElement",m);const y=f.useCallback(P=>{($e(P)||P===null)&&(c.current=P,h(P)),($e(l.refs.reference.current)||l.refs.reference.current===null||P!==null&&!$e(P))&&l.refs.setReference(P)},[l.refs,h]),C=f.useCallback(P=>{g(P),l.refs.setFloating(P)},[l.refs]),S=f.useMemo(()=>({...l.refs,setReference:y,setFloating:C,setPositionReference:d,domReference:c}),[l.refs,y,C,d]),E=f.useMemo(()=>({...l.elements,domReference:s.domReference}),[l.elements,s.domReference]),b=o.useState("open"),x=o.useState("floatingId"),T=f.useMemo(()=>({...l,dataRef:o.context.dataRef,open:b,onOpenChange:o.setOpen,events:o.context.events,floatingId:x,refs:S,elements:E,nodeId:t,rootStore:o}),[l,S,E,t,o,b,x]);return he(()=>{o.context.dataRef.current.floatingContext=T;const P=u?.nodesRef.current.find(z=>z.id===t);P&&(P.context=T)}),f.useMemo(()=>({...l,context:T,refs:S,elements:E,rootStore:o}),[l,S,E,T,o])}function Dd(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,onOpenChange:r}=e,o=Xn(),s=qn()!=null,i=t.useState("open"),a=t.useState("activeTriggerElement"),c=t.useState(n?"popupElement":"positionerElement"),u=t.context.triggerElements,l=wt(()=>new Aa({open:i,transitionStatus:void 0,referenceElement:a,floatingElement:c,triggerElements:u,onOpenChange:r,floatingId:o,syncOnly:!0,nested:s})).current;return he(()=>{const d={open:i,floatingId:o,referenceElement:a,floatingElement:c};$e(a)&&(d.domReferenceElement=a),l.state.positionReference===l.state.referenceElement&&(d.positionReference=a),l.update(d)},[i,o,a,c,l]),l.context.onOpenChange=r,l.context.nested=s,l}class Da{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 Da}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Ss=new WeakMap;function Es(e){if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Ss.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty("pointer-events"),e.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),e.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Ss.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ld(e,t){const{scopeElement:n,referenceElement:r,floatingElement:o}=t,s=Ss.get(n);s&&s!==e&&Es(s),Es(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=o,Ss.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",o.style.pointerEvents="auto"}function Fd(e){const t=wt(Da.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),so(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function Mw(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:u}=t,l=Fd(n),d=lr(),p=qn(),h=ie(()=>Ql(i.current.openEvent?.type,l.interactedInside)),m=ie(()=>{const E=i.current.openEvent?.type;return E?.includes("mouse")&&E!=="mousedown"}),g=ie(E=>fl(E,n.context.triggerElements)),v=f.useCallback(E=>{const b=ga(c,"close",l.pointerType),x=()=>{n.setOpen(!1,Ae(Lt,E)),d?.events.emit("floating.closed",E)};b?l.openChangeTimeout.start(b,x):(l.openChangeTimeout.clear(),x())},[c,n,l,d]),y=ie(()=>{Es(l)}),C=ie(E=>{const b=lt(E);if(!fb(b)){l.interactedInside=!1;return}l.interactedInside=b?.closest("[aria-haspopup]")!=null});he(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,y())},[r,l,y]),f.useEffect(()=>y,[y]),he(()=>{if(a&&r&&l.handleCloseOptions?.blockPointerEvents&&m()&&$e(s)&&o){const E=s,b=o,x=Ie(o),T=d?.nodesRef.current.find(z=>z.id===p)?.context?.elements.floating;T&&(T.style.pointerEvents="");const P=l.handleCloseOptions?.getScope?.()??l.pointerEventsScopeElement??T??E.closest("[data-rootownerid]")??x.body;return Ld(l,{scopeElement:P,referenceElement:E,floatingElement:b}),()=>{y()}}},[a,r,s,o,l,m,d,p,y]);const S=Gt();f.useEffect(()=>{if(!a)return;function E(){l.openChangeTimeout.clear(),S.clear(),d?.events.off("floating.closed",x),y()}function b(P){if(d&&p&&vn(d.nodesRef.current,p).length>0){d.events.on("floating.closed",x);return}if(g(P.relatedTarget))return;const z=i.current.floatingContext?.nodeId??u,I=P.relatedTarget;if(!(d&&z&&$e(I)&&vn(d.nodesRef.current,z,!1).some($=>we($.context?.elements.floating,I)))){if(l.handler){l.handler(P);return}y(),h()||v(P)}}function x(P){!d||!p||vn(d.nodesRef.current,p).length>0||S.start(0,()=>{d.events.off("floating.closed",x),n.setOpen(!1,Ae(Lt,P)),d.events.emit("floating.closed",P)})}const T=o;return gn(T&&Fe(T,"mouseenter",E),T&&Fe(T,"mouseleave",b),T&&Fe(T,"pointerdown",C,!0),()=>{d?.events.off("floating.closed",x)})},[a,o,n,i,u,h,g,v,y,C,l,d,p,S])}const Aw={current:null};function Dw(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:u=0,move:l=!0,triggerElementRef:d=Aw,externalTree:p,isActiveTrigger:h=!0,getHandleCloseContext:m,isClosing:g}=t,v=lr(p),y=Fd(n),C=f.useRef(!1),S=vt(a),E=vt(i),b=vt(u),x=vt(s),T=vt(g);h&&(y.handleCloseOptions=S.current?.__options);const P=ie(()=>Ql(r.current.openEvent?.type,y.interactedInside)),z=ie(N=>fl(N,n.context.triggerElements)),I=ie((N,O,k)=>{const _=n.context.triggerElements;if(_.hasElement(O))return!N||!we(N,O);if(!$e(k))return!1;const M=k;return _.hasMatchingElement(A=>we(A,M))&&(!N||!we(N,M))}),D=ie((N,O=!0)=>{const k=ga(E.current,"close",y.pointerType);k?y.openChangeTimeout.start(k,()=>{n.setOpen(!1,Ae(Lt,N)),v?.events.emit("floating.closed",N)}):O&&(y.openChangeTimeout.clear(),n.setOpen(!1,Ae(Lt,N)),v?.events.emit("floating.closed",N))}),$=ie(()=>{if(!y.handler)return;Ie(n.select("domReferenceElement")).removeEventListener("mousemove",y.handler),y.handler=void 0}),V=ie(()=>{Es(y)});return f.useEffect(()=>$,[$]),f.useEffect(()=>{if(!s)return;function N(O){O.open?C.current=!1:(C.current=O.reason===Lt,$(),y.openChangeTimeout.clear(),y.restTimeout.clear(),y.blockMouseMove=!0,y.restTimeoutPending=!1)}return o.on("openchange",N),()=>{o.off("openchange",N)}},[s,o,y,$]),f.useEffect(()=>{if(!s)return;const N=d.current??(h?n.select("domReferenceElement"):null);if(!$e(N))return;function O(_){if(y.openChangeTimeout.clear(),y.blockMouseMove=!1,c&&!fo(y.pointerType))return;const M=Jl(b.current),A=ga(E.current,"open",y.pointerType),j=lt(_),B=_.currentTarget??null,U=n.select("domReferenceElement");let W=B;if($e(j)&&!n.context.triggerElements.hasElement(j)){for(const Y of n.context.triggerElements.elements())if(we(Y,j)){W=Y;break}}$e(B)&&$e(U)&&!n.context.triggerElements.hasElement(B)&&we(B,U)&&(W=U);const G=W==null?!1:I(U,W,j),Z=n.select("open"),X=T.current?.()??n.select("transitionStatus")==="ending",K=!Z&&X&&C.current,J=!G&&$e(W)&&$e(U)&&we(U,W)&&K,se=M>0&&!A,ae=G&&(Z||K)||J,pe=!Z||G;if(ae){n.setOpen(!0,Ae(Lt,_,W));return}se||(A?y.openChangeTimeout.start(A,()=>{pe&&n.setOpen(!0,Ae(Lt,_,W))}):pe&&n.setOpen(!0,Ae(Lt,_,W)))}function k(_){if(P()){V();return}$();const M=n.select("domReferenceElement"),A=Ie(M);y.restTimeout.clear(),y.restTimeoutPending=!1;const j=r.current.floatingContext??m?.();if(z(_.relatedTarget))return;if(S.current&&j){n.select("open")||y.openChangeTimeout.clear();const W=d.current;y.handler=S.current({...j,tree:v,x:_.clientX,y:_.clientY,onClose(){V(),$(),x.current&&!P()&&W===n.select("domReferenceElement")&&D(_,!0)}}),A.addEventListener("mousemove",y.handler),y.handler(_);return}(y.pointerType!=="touch"||!we(n.select("floatingElement"),_.relatedTarget))&&D(_)}return l?gn(Fe(N,"mousemove",O,{once:!0}),Fe(N,"mouseenter",O),Fe(N,"mouseleave",k)):gn(Fe(N,"mouseenter",O),Fe(N,"mouseleave",k))},[$,V,r,E,D,n,s,S,y,h,I,P,z,c,l,b,d,v,x,m,T]),f.useMemo(()=>{if(!s)return;function N(O){y.pointerType=O.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(O){const{nativeEvent:k}=O,_=O.currentTarget,M=n.select("domReferenceElement"),A=n.select("open"),j=I(M,_,O.target);if(c&&!fo(y.pointerType))return;if(A&&j&&y.handleCloseOptions?.blockPointerEvents){const W=n.select("floatingElement");if(W){const G=y.handleCloseOptions?.getScope?.()??_.ownerDocument.body;Ld(y,{scopeElement:G,referenceElement:_,floatingElement:W})}}const B=Jl(b.current);if(A&&!j||B===0||!j&&y.restTimeoutPending&&O.movementX**2+O.movementY**2<2)return;y.restTimeout.clear();function U(){if(y.restTimeoutPending=!1,P())return;const W=n.select("open");!y.blockMouseMove&&(!W||j)&&n.setOpen(!0,Ae(Lt,k,_))}y.pointerType==="touch"?Kt.flushSync(()=>{U()}):j&&A?U():(y.restTimeoutPending=!0,y.restTimeout.start(B,U))}}},[s,y,P,I,c,n,b])}function bo(e=[]){const t=e.map(u=>u?.reference),n=e.map(u=>u?.floating),r=e.map(u=>u?.item),o=e.map(u=>u?.trigger),s=f.useCallback(u=>xs(u,e,"reference"),t),i=f.useCallback(u=>xs(u,e,"floating"),n),a=f.useCallback(u=>xs(u,e,"item"),r),c=f.useCallback(u=>xs(u,e,"trigger"),o);return f.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:c}),[s,i,a,c])}function xs(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Yi]="");for(const i in e)o&&e&&(i===ul||i===ll)||(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&&Vd(s,a,o,r)}return Vd(s,e,o,r),s}function Vd(e,t,n,r){for(const o in t){const s=t[o];n&&(o===ul||o===ll)||(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 Lw="Escape";function Cs(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Ts(e,t){return Cs(t,e===Xi||e===uo,e===Wn||e===Zn)}function La(e,t,n){return Cs(t,e===uo,n?e===Wn:e===Zn)||e==="Enter"||e===" "||e===""}function Fw(e,t,n){return Cs(t,n?e===Wn:e===Zn,e===uo)}function Vw(e,t,n,r){const o=n?e===Zn:e===Wn,s=e===Xi;return t==="both"||t==="horizontal"&&r&&r>1?e===Lw:Cs(t,o,s)}function zw(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:u=()=>{},enabled:l=!0,selectedIndex:d=null,allowEscape:p=!1,loopFocus:h=!1,nested:m=!1,rtl:g=!1,virtual:v=!1,focusItemOnOpen:y="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:S=!0,disabledIndices:E=void 0,orientation:b="vertical",parentOrientation:x,cols:T=1,id:P,resetOnPointerLeave:z=!0,externalTree:I}=t;process.env.NODE_ENV!=="production"&&(p&&(h||console.warn("`useListNavigation` looping must be enabled to allow escaping."),v||console.warn("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&T>1&&console.warn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const D=lo(o),$=vt(D),V=qn(),N=lr(I);he(()=>{i.current.orientation=b},[i,b]);const O=Ki(s),k=f.useRef(y),_=f.useRef(d??-1),M=f.useRef(null),A=f.useRef(!0),j=ie(R=>{u(_.current===-1?null:_.current,R)}),B=f.useRef(j),U=f.useRef(!!o),W=f.useRef(r),G=f.useRef(!1),Z=f.useRef(!1),X=f.useRef(null),K=vt(E),J=vt(r),se=vt(d),ae=vt(z),pe=ie(()=>{function R(Q){v?N?.events.emit("virtualfocus",Q):X.current=ps(Q,{sync:G.current,preventScroll:!0})}const H=a.current[_.current],L=Z.current;H&&R(H),(G.current?Q=>Q():requestAnimationFrame)(()=>{const Q=a.current[_.current]||H;if(!Q)return;H||R(Q),ge&&(L||!A.current)&&Q.scrollIntoView?.({block:"nearest",inline:"nearest"})})});he(()=>{l&&(r&&o?(_.current=d??-1,k.current&&d!=null&&(Z.current=!0,j())):U.current&&(_.current=-1,B.current()))},[l,r,o,d,j]),he(()=>{if(l){if(!r){G.current=!1;return}if(o)if(c==null){if(G.current=!1,se.current!=null)return;if(U.current&&(_.current=-1,pe()),(!W.current||!U.current)&&k.current&&(M.current!=null||k.current===!0&&M.current==null)){let R=0;const H=()=>{a.current[0]==null?(R<2&&(R?requestAnimationFrame:queueMicrotask)(H),R+=1):(_.current=M.current==null||La(M.current,b,g)||m?oa(a):wl(a),M.current=null,j())};H()}}else ns(a.current,c)||(_.current=c,pe(),Z.current=!1)}},[l,r,o,c,se,m,a,b,g,j,pe,K]),he(()=>{if(!l||o||!N||v||!U.current)return;const R=N.nodesRef.current,H=R.find(Q=>Q.id===V)?.context?.elements.floating,L=Pt(Ie(o)),F=R.some(Q=>Q.context&&we(Q.context.elements.floating,L));H&&!F&&A.current&&H.focus({preventScroll:!0})},[l,o,N,V,v]),he(()=>{B.current=j,W.current=r,U.current=!!o}),he(()=>{r||(M.current=null,k.current=y)},[r,y]);const Y=c!=null,me=ie(R=>{if(!J.current)return;const H=a.current.indexOf(R.currentTarget);H!==-1&&(_.current!==H||c!==H)&&(_.current=H,j(R))}),ge=f.useMemo(()=>({onFocus(H){G.current=!0,me(H)},onClick:({currentTarget:H})=>H.focus({preventScroll:!0}),onMouseMove(H){G.current=!0,Z.current=!1,C&&me(H)},onPointerLeave(H){if(!J.current||!A.current||H.pointerType==="touch")return;G.current=!0;const L=H.relatedTarget;if(!(!C||a.current.includes(L))&&ae.current&&(X.current?.(),X.current=null,_.current=-1,j(H),!v)){const F=$.current,Q=Pt(Ie(F));F&&we(F,Q)&&F.focus({preventScroll:!0})}}}),[me,J,$,C,a,j,ae,v]),fe=f.useCallback(()=>x??N?.nodesRef.current.find(R=>R.id===V)?.context?.dataRef?.current.orientation,[V,N,x]),le=ie(R=>{if(A.current=!1,G.current=!0,R.which===229||!J.current&&R.currentTarget===$.current)return;if(m&&Vw(R.key,b,g,T)){Ts(R.key,fe())||Yt(R),n.setOpen(!1,Ae(ba,R.nativeEvent)),it(s)&&(v?N?.events.emit("virtualfocus",s):s.focus());return}const H=_.current,L=oa(a,E),F=wl(a,E);if(O||(R.key==="Home"&&(Yt(R),_.current=L,j(R)),R.key==="End"&&(Yt(R),_.current=F,j(R))),T>1){const Q=Array.from({length:a.current.length},()=>({width:1,height:1})),ne=Cb(Q,T),te=ne.findIndex(Ee=>Ee!=null&&!Mr(a.current,Ee,E)),ye=ne.reduce((Ee,Ce,Pe)=>Ce!=null&&!Mr(a.current,Ce,E)?Pe:Ee,-1),_e=ne[xb(ne.map(Ee=>Ee!=null?a.current[Ee]:null),{event:R,orientation:b,loopFocus:h,rtl:g,cols:T,disabledIndices:Ob([...(typeof E!="function"?E:null)||a.current.map((Ee,Ce)=>Mr(a.current,Ce,E)?Ce:void 0),void 0],ne),minIndex:te,maxIndex:ye,prevIndex:Tb(_.current>F?L:_.current,Q,ne,T,R.key===uo?"bl":R.key===(g?Wn:Zn)?"tr":"tl"),stopEvent:!0})];if(_e!=null&&(_.current=_e,j(R)),b==="both")return}if(Ts(R.key,b)){if(Yt(R),r&&!v&&Pt(R.currentTarget.ownerDocument)===R.currentTarget){_.current=La(R.key,b,g)?L:F,j(R);return}La(R.key,b,g)?h?H>=F?p&&H!==a.current.length?_.current=-1:(G.current=!1,_.current=L):_.current=Dt(a.current,{startingIndex:H,disabledIndices:E}):_.current=Math.min(F,Dt(a.current,{startingIndex:H,disabledIndices:E})):h?H<=L?p&&H!==-1?_.current=a.current.length:(G.current=!1,_.current=F):_.current=Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:E}):_.current=Math.max(L,Dt(a.current,{startingIndex:H,decrement:!0,disabledIndices:E})),ns(a.current,_.current)&&(_.current=-1),j(R)}}),ce=f.useMemo(()=>v&&r&&Y&&{"aria-activedescendant":`${P}-${c}`},[v,r,Y,P,c]),ve=f.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...O?{}:ce,onKeyDown(R){if(R.key==="Tab"&&R.shiftKey&&r&&!v){const H=lt(R.nativeEvent);if(H&&!we($.current,H))return;Yt(R),n.setOpen(!1,Ae(ur,R.nativeEvent)),it(s)&&s.focus();return}le(R)},onPointerMove(){A.current=!0}}),[ce,le,$,b,O,n,r,v,s]),ue=f.useMemo(()=>{function R(L){y==="auto"&&hl(L.nativeEvent)&&(k.current=!v)}function H(L){k.current=y,y==="auto"&&ml(L.nativeEvent)&&(k.current=!0)}return{onKeyDown(L){const F=n.select("open");A.current=!1;const Q=L.key.startsWith("Arrow"),ne=Fw(L.key,fe(),g),te=Ts(L.key,b),ye=(m?ne:te)||L.key==="Enter"||L.key.trim()==="";if(v&&F)return le(L);if(!(!F&&!S&&Q)){if(ye){const _e=Ts(L.key,fe());M.current=m&&_e?null:L.key}if(m){ne&&(Yt(L),F?(_.current=oa(a,K.current),j(L)):n.setOpen(!0,Ae(ba,L.nativeEvent,L.currentTarget)));return}te&&(se.current!=null&&(_.current=se.current),Yt(L),!F&&S?n.setOpen(!0,Ae(ba,L.nativeEvent,L.currentTarget)):le(L),F&&j(L))}},onFocus(L){n.select("open")&&!v&&(_.current=-1,j(L))},onPointerDown:H,onPointerEnter:H,onMouseDown:R,onClick:R}},[le,K,y,a,m,j,n,S,b,fe,g,se,v]),Se=f.useMemo(()=>({...ce,...ue}),[ce,ue]);return f.useMemo(()=>l?{reference:Se,floating:ve,item:ge,trigger:ue}:{},[l,Se,ve,ue,ge])}const $w=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function zd(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(),u=s?.id||c,l=f.useMemo(()=>lo(i)?.id||o,[i,o]),d=$w.get(a)??a,h=qn()!=null,m=f.useMemo(()=>d==="tooltip"||a==="label"?mt:{"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=f.useMemo(()=>d==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?l:void 0}:{...m,"aria-expanded":r?"true":"false","aria-controls":r?l:void 0,...d==="menu"&&{id:u}},[d,l,r,u,a,m]),v=f.useMemo(()=>{const C={id:l,...d&&{role:d}};return d==="tooltip"||a==="label"?C:{...C,...d==="menu"&&{"aria-labelledby":u}}},[d,l,u,a]),y=f.useCallback(({active:C,selected:S})=>{const E={role:"option",...C&&{id:`${l}-fui-option`}};switch(a){case"select":case"combobox":return{...E,"aria-selected":S}}return{}},[l,a]);return f.useMemo(()=>({reference:g,floating:v,item:y,trigger:m}),[g,v,m,y])}function jw(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:u,enabled:l=!0,resetMs:d=750,selectedIndex:p=null}=t,h=Gt(),m=f.useRef(""),g=f.useRef(p??a??-1),v=f.useRef(null);he(()=>{!o&&p!==null||(h.clear(),v.current=null,m.current!==""&&(m.current=""))},[o,p,h]),he(()=>{o&&m.current===""&&(g.current=p??a??-1)},[o,p,a]);const y=ie(x=>{x?r.current.typing||(r.current.typing=x,u?.(x)):r.current.typing&&(r.current.typing=x,u?.(x))}),C=ie(x=>{function T(O){const k=i?.current[O];return!k||rs(k)}function P(O,k,_=0){if(O.length===0)return-1;const M=(_%O.length+O.length)%O.length,A=k.toLocaleLowerCase();for(let j=0;j<O.length;j+=1){const B=(M+j)%O.length;if(!(!O[B]?.toLocaleLowerCase().startsWith(A)||!T(B)))return B}return-1}const z=s.current;if(m.current.length>0&&x.key===" "&&(Yt(x),y(!0)),m.current.length>0&&m.current[0]!==" "&&P(z,m.current)===-1&&x.key!==" "&&y(!1),z==null||x.key.length!==1||x.ctrlKey||x.metaKey||x.altKey)return;o&&x.key!==" "&&(Yt(x),y(!0));const I=m.current==="";I&&(g.current=p??a??-1),z.every(O=>O?O[0]?.toLocaleLowerCase()!==O[1]?.toLocaleLowerCase():!0)&&m.current===x.key&&(m.current="",g.current=v.current),m.current+=x.key,h.start(d,()=>{m.current="",g.current=v.current,y(!1)});const V=((I?p??a??-1:g.current)??0)+1,N=P(z,m.current,V);N!==-1?(c?.(N),v.current=N):x.key!==" "&&(m.current="",y(!1))}),S=ie(x=>{const T=x.relatedTarget,P=n.select("domReferenceElement"),z=n.select("floatingElement"),I=we(P,T),D=we(z,T);I||D||(h.clear(),m.current="",g.current=v.current,y(!1))}),E=f.useMemo(()=>({onKeyDown:C,onBlur:S}),[C,S]),b=f.useMemo(()=>({onKeyDown:C,onBlur:S}),[C,S]);return f.useMemo(()=>l?{reference:E,floating:b}:{},[l,E,b])}const $d=.1,Hw=$d*$d,rt=.5;function Os(e,t,n,r,o,s){return r>=t!=s>=t&&e<=(o-n)*(t-r)/(s-r)+n}function Ps(e,t,n,r,o,s,i,a,c,u){let l=!1;return Os(e,t,n,r,o,s)&&(l=!l),Os(e,t,o,s,i,a)&&(l=!l),Os(e,t,i,a,c,u)&&(l=!l),Os(e,t,c,u,n,r)&&(l=!l),l}function Uw(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function _s(e,t,n,r,o,s){const i=Math.min(n,o),a=Math.max(n,o),c=Math.min(r,s),u=Math.max(r,s);return e>=i&&e<=a&&t>=c&&t<=u}function Bw(e={}){const{blockPointerEvents:t=!1}=e,n=new Zt,r=({x:o,y:s,placement:i,elements:a,onClose:c,nodeId:u,tree:l})=>{const d=i?.split("-")[0];let p=!1,h=null,m=null,g=typeof performance<"u"?performance.now():0;function v(C,S){const E=performance.now(),b=E-g;if(h===null||m===null||b===0)return h=C,m=S,g=E,!1;const x=C-h,T=S-m,P=x*x+T*T,z=b*b*Hw;return h=C,m=S,g=E,P<z}function y(){n.clear(),c()}return function(S){n.clear();const E=a.domReference,b=a.floating;if(!E||!b||d==null||o==null||s==null)return;const{clientX:x,clientY:T}=S,P=lt(S),z=S.type==="mouseleave",I=we(b,P),D=we(E,P);if(I&&(p=!0,!z))return;if(D&&(p=!1,!z)){p=!0;return}if(z&&$e(S.relatedTarget)&&we(b,S.relatedTarget))return;function $(){return!!(l&&vn(l.nodesRef.current,u).length>0)}function V(){$()||y()}if($())return;const N=E.getBoundingClientRect(),O=b.getBoundingClientRect(),k=o>O.right-O.width/2,_=s>O.bottom-O.height/2,M=O.width>N.width,A=O.height>N.height,j=(M?N:O).left,B=(M?N:O).right,U=(A?N:O).top,W=(A?N:O).bottom;if(d==="top"&&s>=N.bottom-1||d==="bottom"&&s<=N.top+1||d==="left"&&o>=N.right-1||d==="right"&&o<=N.left+1){V();return}let G=!1;switch(d){case"top":G=_s(x,T,j,N.top+1,B,O.bottom-1);break;case"bottom":G=_s(x,T,j,O.top+1,B,N.bottom-1);break;case"left":G=_s(x,T,O.right-1,W,N.left+1,U);break;case"right":G=_s(x,T,N.right-1,W,O.left+1,U);break}if(G)return;if(p&&!Uw(x,T,N)){V();return}if(!z&&v(x,T)){V();return}let Z=!1;switch(d){case"top":{const X=M?rt/2:rt*4,K=M||k?o+X:o-X,J=M?o-X:k?o+X:o-X,se=s+rt+1,ae=k||M?O.bottom-rt:O.top,pe=k?M?O.bottom-rt:O.top:O.bottom-rt;Z=Ps(x,T,K,se,J,se,O.left,ae,O.right,pe);break}case"bottom":{const X=M?rt/2:rt*4,K=M||k?o+X:o-X,J=M?o-X:k?o+X:o-X,se=s-rt,ae=k||M?O.top+rt:O.bottom,pe=k?M?O.top+rt:O.bottom:O.top+rt;Z=Ps(x,T,K,se,J,se,O.left,ae,O.right,pe);break}case"left":{const X=A?rt/2:rt*4,K=A||_?s+X:s-X,J=A?s-X:_?s+X:s-X,se=o+rt+1,ae=_||A?O.right-rt:O.left,pe=_?A?O.right-rt:O.left:O.right-rt;Z=Ps(x,T,ae,O.top,pe,O.bottom,se,K,se,J);break}case"right":{const X=A?rt/2:rt*4,K=A||_?s+X:s-X,J=A?s-X:_?s+X:s-X,se=o-rt,ae=_||A?O.left+rt:O.right,pe=_?A?O.left+rt:O.right:O.left+rt;Z=Ps(x,T,se,K,se,J,ae,O.top,pe,O.bottom);break}}Z?p||n.start(40,V):V()}};return r.__options={...e,blockPointerEvents:t},r}const jd=f.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,style:a,...c}=t,{portalNode:u,portalSubtree:l}=cd({container:o,ref:n,componentProps:t,elementProps:c});return!l&&!u?null:w.jsxs(f.Fragment,{children:[l,u&&Kt.createPortal(r,u)]})});process.env.NODE_ENV!=="production"&&(jd.displayName="FloatingPortalLite");const Ww=jd,Hd=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Hd.displayName="DirectionContext");function Ud(){return f.useContext(Hd)?.direction??"ltr"}const Zw=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:u,padding:l=0,offsetParent:d="real"}=Mn(e,t)||{};if(u==null)return{};const p=bl(l),h={x:n,y:r},m=na(o),g=ta(m),v=await i.getDimensions(u),y=m==="y",C=y?"top":"left",S=y?"bottom":"right",E=y?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[m]-h[m]-s.floating[g],x=h[m]-s.reference[m],T=d==="real"?await i.getOffsetParent?.(u):a.floating;let P=a.floating[E]||s.floating[g];(!P||!await i.isElement?.(T))&&(P=a.floating[E]||s.floating[g]);const z=b/2-x/2,I=P/2-v[g]/2-1,D=Math.min(p[C],I),$=Math.min(p[S],I),V=D,N=P-v[g]-$,O=P/2-v[g]/2+z,k=Qi(V,O,N),_=!c.arrow&&Gn(o)!=null&&O!==k&&s.reference[g]/2-(O<V?D:$)-v[g]/2<0,M=_?O<V?O-V:O-N:0;return{[m]:h[m]+M,data:{[m]:k,centerOffset:O-k-M,..._&&{alignmentOffset:M}},reset:_}}}),Gw=(e,t)=>({...Zw(e),options:[e,t]}),Yw={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 _w().fn(e)).data?.referenceHidden||s}}}},Is={sideX:"left",sideY:"top"},Xw={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:r},elements:{floating:o},platform:s,strategy:i,placement:a}=e,c=tt(o),u=c.getComputedStyle(o);if(!(u.transitionDuration!=="0s"&&u.transitionDuration!==""))return{x:t,y:n,data:Is};const d=await s.getOffsetParent?.(o);let p={width:0,height:0};if(i==="fixed"&&c?.visualViewport)p={width:c.visualViewport.width,height:c.visualViewport.height};else if(d===c){const C=Ie(o);p={width:C.documentElement.clientWidth,height:C.documentElement.clientHeight}}else await s.isElement?.(d)&&(p=await s.getDimensions(d));const h=jt(a);let m=t,g=n;h==="left"&&(m=p.width-(t+r.width)),h==="top"&&(g=p.height-(n+r.height));const v=h==="left"?"right":Is.sideX,y=h==="top"?"bottom":Is.sideY;return{x:m,y:g,data:{sideX:v,sideY:y}}}};function Bd(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 Wd(e,t,n){const{rects:r,placement:o}=e;return{side:Bd(t,jt(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 Zd(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:u=!1,arrowPadding:l=5,disableAnchorTracking:d=!1,keepMounted:p=!1,floatingRootContext:h,mounted:m,collisionAvoidance:g,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:C,lazyFlip:S=!1,externalTree:E}=e,[b,x]=f.useState(null);!m&&b!==null&&x(null);const T=g.side||"flip",P=g.align||"flip",z=g.fallbackAxisSide||"end",I=typeof t=="function"?t:void 0,D=ie(I),$=I?D:t,V=vt(t),N=vt(m),k=Ud()==="rtl",_=b||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":k?"left":"right","inline-start":k?"right":"left"}[r],M=s==="center"?_:`${_}-${s}`;let A=c;const j=1,B=r==="bottom"?j:0,U=r==="top"?j:0,W=r==="right"?j:0,G=r==="left"?j:0;typeof A=="number"?A={top:A+B,right:A+G,bottom:A+U,left:A+W}:A&&(A={top:(A.top||0)+B,right:(A.right||0)+G,bottom:(A.bottom||0)+U,left:(A.left||0)+W});const Z={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:A},X=f.useRef(null),K=vt(o),J=vt(i),pe=[xw(Re=>{const Te=Wd(Re,r,k),Ue=typeof K.current=="function"?K.current(Te):K.current,Be=typeof J.current=="function"?J.current(Te):J.current;return{mainAxis:Ue,crossAxis:Be,alignmentAxis:Be}},[typeof o!="function"?o:0,typeof i!="function"?i:0,k,r])],Y=P==="none"&&T!=="shift",me=!Y&&(u||v||T==="shift"),ge=T==="none"?null:Ow({...Z,padding:{top:A.top+j,right:A.right+j,bottom:A.bottom+j,left:A.left+j},mainAxis:!v&&T==="flip",crossAxis:P==="flip"?"alignment":!1,fallbackAxisSideDirection:z}),fe=Y?null:Cw(Re=>{const Te=Ie(Re.elements.floating).documentElement;return{...Z,rootBoundary:v?{x:0,y:0,width:Te.clientWidth,height:Te.clientHeight}:void 0,mainAxis:P!=="none",crossAxis:me,limiter:u||v?void 0:Tw(Ue=>{if(!X.current)return{};const{width:Be,height:ct}=X.current.getBoundingClientRect(),Ye=en(jt(Ue.placement)),Ut=Ye==="y"?Be:ct,$t=Ye==="y"?A.left+A.right:A.top+A.bottom;return{offset:Ut/2+$t/2}})}},[Z,u,v,A,P]);T==="shift"||P==="shift"||s==="center"?pe.push(fe,ge):pe.push(ge,fe),pe.push(Pw({...Z,apply({elements:{floating:Re},availableWidth:Te,availableHeight:Ue,rects:Be}){if(!N.current)return;const ct=Re.style;ct.setProperty("--available-width",`${Te}px`),ct.setProperty("--available-height",`${Ue}px`);const Ye=tt(Re).devicePixelRatio||1,{x:Ut,y:$t,width:Ke,height:q}=Be.reference,re=(Math.round((Ut+Ke)*Ye)-Math.round(Ut*Ye))/Ye,be=(Math.round(($t+q)*Ye)-Math.round($t*Ye))/Ye;ct.setProperty("--anchor-width",`${re}px`),ct.setProperty("--anchor-height",`${be}px`)}}),Gw(()=>({element:X.current||Ie(X.current).createElement("div"),padding:l,offsetParent:"floating"}),[l]),{name:"transformOrigin",fn(Re){const{elements:Te,middlewareData:Ue,placement:Be,rects:ct,y:Ye}=Re,Ut=jt(Be),$t=en(Ut),Ke=X.current,q=Ue.arrow?.x||0,re=Ue.arrow?.y||0,be=Ke?.clientWidth||0,Le=Ke?.clientHeight||0,je=q+be/2,De=re+Le/2,Qe=Math.abs(Ue.shift?.y||0),Oe=ct.reference.height/2,xe=typeof o=="function"?o(Wd(Re,r,k)):o,Ne=Qe>xe,Me={top:`${je}px calc(100% + ${xe}px)`,bottom:`${je}px ${-xe}px`,left:`calc(100% + ${xe}px) ${De}px`,right:`${-xe}px ${De}px`}[Ut],Xe=`${je}px ${ct.reference.y+Oe-Ye}px`;return Te.floating.style.setProperty("--transform-origin",me&&$t==="y"&&Ne?Xe:Me),{}}},Yw,C),he(()=>{!m&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[m,h]);const le=f.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:ce,elements:ve,x:ue,y:Se,middlewareData:R,update:H,placement:L,context:F,isPositioned:Q,floatingStyles:ne}=Nw({rootContext:h,open:p?m:void 0,placement:M,middleware:pe,strategy:n,whileElementsMounted:p?void 0:(...Re)=>Od(...Re,le),nodeId:y,externalTree:E}),{sideX:te,sideY:ye}=R.adaptiveOrigin||Is,_e=Q?n:"fixed",Ee=f.useMemo(()=>{const Re=C?{position:_e,[te]:ue,[ye]:Se}:{position:_e,...ne};return Q||(Re.opacity=0),Re},[C,_e,te,ue,ye,Se,ne,Q]),Ce=f.useRef(null);he(()=>{if(!m)return;const Re=V.current,Te=typeof Re=="function"?Re():Re,Be=(Gd(Te)?Te.current:Te)||null||null;Be!==Ce.current&&(ce.setPositionReference(Be),Ce.current=Be)},[m,ce,$,V]),f.useEffect(()=>{if(!m)return;const Re=V.current;typeof Re!="function"&&Gd(Re)&&Re.current!==Ce.current&&(ce.setPositionReference(Re.current),Ce.current=Re.current)},[m,ce,$,V]),f.useEffect(()=>{if(p&&m&&ve.domReference&&ve.floating)return Od(ve.domReference,ve.floating,H,le)},[p,m,ve,H,le]);const Pe=jt(L),Ve=Bd(r,Pe,k),Ge=Gn(L)||"center",He=!!R.hide?.referenceHidden;he(()=>{S&&m&&Q&&x(Pe)},[S,m,Q,Pe]);const nt=f.useMemo(()=>({position:"absolute",top:R.arrow?.y,left:R.arrow?.x}),[R.arrow]),st=R.arrow?.centerOffset!==0;return f.useMemo(()=>({positionerStyles:Ee,arrowStyles:nt,arrowRef:X,arrowUncentered:st,side:Ve,align:Ge,physicalSide:Pe,anchorHidden:He,refs:ce,context:F,isPositioned:Q,update:H}),[Ee,nt,X,st,Ve,Ge,Pe,He,ce,F,Q,H])}function Gd(e){return e!=null&&"current"in e}let Ft=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=sr.startingStyle]="startingStyle",e[e.endingStyle=sr.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Fa=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const qw={[Fa.popupOpen]:""},Kw={[Fa.popupOpen]:"",[Fa.pressed]:""},Jw={[Ft.open]:""},Qw={[Ft.closed]:""},eS={[Ft.anchorHidden]:""},Yd={open(e){return e?qw:null}},Xd={open(e){return e?Kw:null}},Cn={open(e){return e?Jw:Qw},anchorHidden(e){return e?eS:null}};function Va(e){return e==="starting"?a0:mt}function qd(e,t,{styles:n,transitionStatus:r,props:o,refs:s,hidden:i,inert:a=!1}){const c={...n};return a&&(c.pointerEvents="none"),qe("div",e,{state:t,ref:s,props:[{role:"presentation",hidden:i,style:c},Va(r),o],stateAttributesMapping:Cn})}function Kd(){const e=f.useContext(zo);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":ft(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 fr(...e){return Mi(Mu(e))}const Jd={Viewport:"_Viewport_ai81v_1",Toast:"_Toast_ai81v_14"};let zr=null,wo=3e3;function tS({timeout:e}){const t=Kd();return f.useEffect(()=>(zr=t,wo=e,()=>{zr=null}),[t,e]),null}const gt={success:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),error:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),info:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo}),warning:(e,t)=>zr?.add({description:e,timeout:t?.timeout||wo})};function nS({toastConfigs:e}){const t=e?.timeout??3e3;return w.jsxs(Nl,{timeout:t,children:[w.jsx(tS,{timeout:t}),w.jsx(rS,{configs:e})]})}function rS({configs:e}){const{toasts:t}=Kd();return w.jsx(Ww,{children:w.jsx(Ul,{className:fr(Jd.Viewport,e?.viewportClassName),children:t.map(n=>w.jsx(Gl,{toast:n,className:fr("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",Jd.Toast,e?.className),style:e?.style,children:w.jsx(ql,{className:"text-xs",children:n.description})},n.id))})})}class oS{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 u in t.data)t.data[u]!==void 0&&a.append(u,t.data[u]);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:u}=this._setTimeout(a,n),l=await Promise.race([i,u].filter(Boolean));if(c&&clearTimeout(c),l.ok){const d=await l.json();return this.interceptors.response(d,l).catch(p=>(this.onError({data:p,response:l}),Promise.reject(d)))}else{const d=await l.json();return this.onError({data:d,response:l}),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 _t=new oS({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","/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys","/passport-api/v2/ztgame/user-center/forget-password/","/passport-api/v2/ztgame/user-center/forget-password/sms-captchas","/passport-api/v2/ztgame/user-center/forget-password/forget-password-update","/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||"未知错误"}`;gt.error(n)}}});function Qd(e){_t.headers.set("Authentication",e)}const at={ROLE_ID:"roleid",GIANT:"giant",MOBILE:"mobile"},ks={default:{types:[at.GIANT,at.MOBILE],default:at.GIANT},5327:{types:[at.GIANT,at.MOBILE],default:at.MOBILE},5273:{types:[at.ROLE_ID],default:at.ROLE_ID},5199:{types:[at.ROLE_ID],default:at.ROLE_ID},5012:{types:[at.ROLE_ID],default:at.ROLE_ID},5242:{types:[at.GIANT,at.MOBILE],default:at.MOBILE}};function St(...e){return Mi(Mu(e))}function sS(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(t,n)=>String.fromCharCode(Number.parseInt(n,16))))}function iS(e){return e==="5199"||e==="5012"}function aS(e){const{entity:t,gaplaySign:n}=e;return sS(`${JSON.stringify(t)}$$${n}`)}function Rs(e,t){return t||ks[e]?.types||ks.default?.types||[]}function cS(e,t){return t||ks[e]?.default||ks.default?.default}function ef({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.GIANT)}function tf({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.ROLE_ID)}function nf({loginTypes:e,gameId:t}){return Rs(t,e).includes(at.MOBILE)}function rf({gameId:e}){_t.headers.set("X-GAME-ID",e),_t.headers.set("X-Login-H5","1");const t=localStorage.getItem("UNIQUE_ID");t&&_t.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}async function uS({gameId:e}){rf({gameId:e});let t=localStorage.getItem("UNIQUE_ID");t||(t=(await(await $y.load()).get()).visitorId,localStorage.setItem("UNIQUE_ID",t)),_t.headers.set("X-Client-Info",JSON.stringify({sdk_version:"3.0.0",device_udid:t,appunid:t}))}const lS=[{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 dS(e){return lS}function fS(e){return"account"in e}function pS({gameId:e,serverUserInfo:t,extraState:n}){const r={game_id:e,xToken:aS(t),saveTime:t.entity.time,$version:"v2",extraState:n};if(fS(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:u}=t.entity;r.openid=s,r.zone={zoneid:c||o,zonename:u,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:u,CHANNELID:l,GAMEPOINT:d,VIPLEVEL:p}=t.entity;r.openid=u,r.channelId=l,r.char={CHARID:s,NAME:i,GAMEPOINT:d,VIPLEVEL:p},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 hS(e){const t=localStorage.getItem("userInfo")||"[]",n=JSON.parse(t),r=n.find(s=>s.game_id===e);r?.openid&&sf(r.openid,e);const o=n.filter(s=>s.game_id!==e);localStorage.setItem("userInfo",JSON.stringify(o))}function mS(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 So="LOGIN_SDK_ACCOUNTS";function $r(e){try{const t=JSON.parse(localStorage.getItem(So)||"[]");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(So)||"[]");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(So,JSON.stringify(a))}function sf(e,t){if(!t)return;const r=JSON.parse(localStorage.getItem(So)||"[]").filter(o=>!(o.openid===e&&o.gameId===t));localStorage.setItem(So,JSON.stringify(r))}let af={};function cf(e){af=e}function pr(e){const t=e||af.gameId;if(!t)throw new Error("gameId is required. Call init({ gameId }) first or pass it as an argument.");return t}const uf=oe.createContext(void 0),gS={enabled:!0,days:7},lf={"--primary-color":"#787bf4","--icon-color":"#a9aad1","--input-border-color":"#cad0e0","--input-label-color":"var(--jssdk-primary-color)","--input-bg-color":"#fff"};function Dn(){const e=oe.use(uf);if(!e)throw new Error("useConfig 必须在 ConfigProvider 中使用");return e}function df({children:e,value:t}){const n=pr(t.gameId),r=Rs(n,t.loginTypes),o=cS(n,t.defaultLoginType),s=oe.useRef(null);rf({gameId:n});const i=oe.useMemo(()=>!t.defaultLoginType&&$r(n).length>0?"quick":o,[t.defaultLoginType,n,o]),[a,c]=oe.useState(i),[u,l]=oe.useState(!0),[d,p]=oe.useState(!1),[h,m]=oe.useState(!1),[g,v]=oe.useState(""),y=()=>{p(!0)};oe.useEffect(()=>{uS({gameId:n})},[n]);const C={...t,gameId:n,loginTypes:r,defaultLoginType:o,autoLoginConfig:{...gS,...t.autoLoginConfig}};oe.useEffect(()=>{document.body.classList.add(`game-${n}`)},[n]);function S(E){Object.entries(E).forEach(([b,x])=>{const T=`--jssdk-${b.replace(/^--/,"")}`;document.documentElement.style.setProperty(T,x)})}return oe.useEffect(()=>{const E=s.current;if(E){const b={...lf,...t.styleVars};S(b)}return()=>{E&&S(lf)}},[t.styleVars]),w.jsx("div",{ref:s,children:w.jsx(uf,{value:{...C,currentLoginType:a,setCurrentLoginType:c,isShowGiantLogo:u,setIsShowGiantLogo:l,showRealNameModal:d,setShowRealNameModal:p,triggerRealNameAuth:y,isAutoLoggingIn:h,setIsAutoLoggingIn:m,autoLoginAccountName:g,setAutoLoginAccountName:v,onClose:t.onClose},children:e})})}function Eo({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)&&ar([`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:u}=f.useRef(t);f.useEffect(()=>{!o&&ff(u)!==ff(t)&&ar([`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=f.useCallback(u=>{o||i(u)},[]);return[a,c]}function ff(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 $a=f.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});process.env.NODE_ENV!=="production"&&($a.displayName="CompositeListContext");function yS(){return f.useContext($a)}function vS(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,s=ie(o),i=f.useRef(0),a=wt(wS).current,c=wt(bS).current,[u,l]=f.useState(0),d=f.useRef(u),p=ie((y,C)=>{c.set(y,C??null),d.current+=1,l(d.current)}),h=ie(y=>{c.delete(y),d.current+=1,l(d.current)}),m=f.useMemo(()=>{const y=new Map;return Array.from(c.keys()).filter(S=>S.isConnected).sort(SS).forEach((S,E)=>{const b=c.get(S)??{};y.set(S,{...b,index:E})}),y},[c,u]);he(()=>{if(typeof MutationObserver!="function"||m.size===0)return;const y=new MutationObserver(C=>{const S=new Set,E=b=>S.has(b)?S.delete(b):S.add(b);C.forEach(b=>{b.removedNodes.forEach(E),b.addedNodes.forEach(E)}),S.size===0&&(d.current+=1,l(d.current))});return m.forEach((C,S)=>{S.parentElement&&y.observe(S.parentElement,{childList:!0})}),()=>{y.disconnect()}},[m]),he(()=>{d.current===u&&(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,u]),he(()=>()=>{n.current=[]},[n]),he(()=>()=>{r&&(r.current=[])},[r]);const g=ie(y=>(a.add(y),()=>{a.delete(y)}));he(()=>{a.forEach(y=>y(m))},[a,m]);const v=f.useMemo(()=>({register:p,unregister:h,subscribeMapChange:g,elementsRef:n,labelsRef:r,nextIndexRef:i}),[p,h,g,n,r,i]);return w.jsx($a.Provider,{value:v,children:t})}function bS(){return new Map}function wS(){return new Set}function SS(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 qt(e){return Xn(e,"base-ui")}let pf=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ES(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:s}=e,{register:i,unregister:a,subscribeMapChange:c,elementsRef:u,labelsRef:l,nextIndexRef:d}=yS(),p=f.useRef(-1),[h,m]=f.useState(s??(o===pf.GuessFromOrder?()=>{if(p.current===-1){const y=d.current;d.current+=1,p.current=y}return p.current}:-1)),g=f.useRef(null),v=f.useCallback(y=>{if(g.current=y,h!==-1&&y!==null&&(u.current[h]=y,l)){const C=t!==void 0;l.current[h]=C?t:r?.current?.textContent??y.textContent}},[h,u,l,t,r]);return he(()=>{if(s!=null)return;const y=g.current;if(y)return i(y,n),()=>{a(y)}},[s,i,a,n]),he(()=>{if(s==null)return c(y=>{const C=g.current?y.get(g.current)?.index:null;C!=null&&m(C)})},[s,c,m]),f.useMemo(()=>({ref:v,index:h}),[h,v])}const hf="ArrowUp",mf="ArrowDown",gf="ArrowLeft",yf="ArrowRight",vf="Home",bf="End",xS=new Set([gf,yf]),CS=new Set([hf,mf]),TS=new Set([...xS,...CS]);[...TS];const Ms=new Set([hf,mf,gf,yf,vf,bf]);function ja(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}let wf={},Sf={},Ef="";function OS(e){if(typeof document>"u")return!1;const t=Ie(e);return tt(t).innerWidth-t.documentElement.clientWidth>0}function PS(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Ie(e),r=n.documentElement,o=n.body,s=Bn(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 u=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,c===u}function _S(e){const t=Ie(e),n=t.documentElement,r=t.body,o=Bn(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 IS(e){const t=Ie(e),n=t.documentElement,r=t.body,o=tt(n);let s=0,i=0,a=!1;const c=yn.create();if(Gi&&(o.visualViewport?.scale??1)!==1)return()=>{};function u(){const h=o.getComputedStyle(n),m=o.getComputedStyle(r),y=(h.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,wf={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Ef=n.style.scrollBehavior,Sf={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 C=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,E=h.overflowY==="scroll"||m.overflowY==="scroll",b=h.overflowX==="scroll"||m.overflowX==="scroll",x=Math.max(0,o.innerWidth-r.clientWidth),T=Math.max(0,o.innerHeight-r.clientHeight),P=parseFloat(m.marginTop)+parseFloat(m.marginBottom),z=parseFloat(m.marginLeft)+parseFloat(m.marginRight),I=Bn(n)?n:r;if(a=PS(e),a){n.style.scrollbarGutter=y,I.style.overflowY="hidden",I.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(C||E)&&(n.style.overflowY="scroll"),(S||b)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:P||T?`calc(100dvh - ${P+T}px)`:"100dvh",width:z||x?`calc(100vw - ${z+x}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 l(){Object.assign(n.style,wf),Object.assign(r.style,Sf),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=Ef)}function d(){l(),c.request(u)}u();const p=Fe(o,"resize",d);return()=>{c.cancel(),l(),typeof o.removeEventListener=="function"&&p()}}class kS{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=Ie(t).documentElement,o=tt(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=Ct;return}const s=al||!OS(t);this.restore=s?_S(t):IS(t)}}const RS=new kS;function xf(e=!0,t=null){he(()=>{if(e)return RS.acquire(t)},[e,t])}function NS(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 As(e,t){const n=f.useRef(e),r=ie(t);he(()=>{n.current!==e&&r(n.current)},[e,r]),he(()=>{n.current=e},[e])}function Ha(e){const[t,n]=f.useState(null),r=ie((i,a)=>{e||n(a||(al?"touch":""))});As(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=NS(r);return f.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}function MS(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:u,triggerProps:l}=Ha(s);kd(t);const{forceUnmount:d}=Rd(s,t),p=f.useCallback(()=>{t.setOpen(!1,Ae(td))},[t]);f.useImperativeHandle(r,()=>({unmount:d,close:p}),[d,p]);const h=Dd({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0}),[m,g]=f.useState(0),[v,y]=f.useState(0),C=m===0,S=zd(h),E=ka(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(D){if(!t.context.outsidePressEnabledRef.current||"button"in D&&D.button!==0||"touches"in D&&D.touches.length!==1)return!1;const $=lt(D);if(C&&!i){const V=$;return a&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===V||t.context.backdropRef.current===V||we(V,c)&&!V?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});xf(s&&a===!0,c);const{getReferenceProps:b,getFloatingProps:x,getTriggerProps:T}=bo([S,E]);t.useContextCallback("onNestedDialogOpen",(D,$)=>{g(D),y($)}),t.useContextCallback("onNestedDialogClose",()=>{g(0),y(0)}),f.useEffect(()=>(n?.onNestedDialogOpen&&s&&n.onNestedDialogOpen(m+1,v+(o?1:0)),n?.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[o,s,m,v,n]);const P=f.useMemo(()=>b(l),[b,l]),z=f.useMemo(()=>T(l),[T,l]),I=f.useMemo(()=>x(),[x]);t.useSyncedValues({openMethod:u,activeTriggerProps:P,inactiveTriggerProps:z,popupProps:I,floatingRootContext:h,nestedOpenDialogCount:m,nestedOpenDrawerCount:v})}const Ua=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ua.displayName="DialogRootContext");function Vt(e){const t=f.useContext(Ua);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>.":ft(27));return t}const AS={...Md,modal:de(e=>e.modal),nested:de(e=>e.nested),nestedOpenDialogCount:de(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:de(e=>e.nestedOpenDrawerCount),disablePointerDismissal:de(e=>e.disablePointerDismissal),openMethod:de(e=>e.openMethod),descriptionElementId:de(e=>e.descriptionElementId),titleElementId:de(e=>e.titleElementId),viewportElement:de(e=>e.viewportElement),role:de(e=>e.role)};class Ba extends Wo{constructor(t){super(DS(t),{popupRef:f.createRef(),backdropRef:f.createRef(),internalBackdropRef:f.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new bs,onOpenChange:void 0,onOpenChangeComplete:void 0},AS)}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=wt(()=>new Ba(n)).current;return t??r}}function DS(e={}){return{...Nd(),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 Ds=f.createContext(!1);process.env.NODE_ENV!=="production"&&(Ds.displayName="IsDrawerContext");function Wa(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d=null}=e,p=Vt(!0),h=f.useContext(Ds),m=!!p,g=Ba.useStore(u?.store,{open:r,openProp:n,activeTriggerId:d,triggerIdProp:l,modal:a,disablePointerDismissal:i,nested:m});ja(()=>{n===void 0&&g.state.open===!1&&r===!0&&g.update({open:!0,activeTriggerId:d})}),g.useControlledProp("openProp",n),g.useControlledProp("triggerIdProp",l),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",s);const v=g.useState("payload");MS({store:g,actionsRef:c,parentContext:p?.store.context,isDrawer:h});const y=f.useMemo(()=>({store:g}),[g]);return w.jsx(Ds.Provider,{value:!1,children:w.jsx(Ua.Provider,{value:y,children:typeof t=="function"?t({payload:v}):t})})}const LS={...Cn,...tn},Za=f.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Vt(),u=c.useState("open"),l=c.useState("nested"),d=c.useState("mounted"),p=c.useState("transitionStatus");return qe("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:LS,props:[{role:"presentation",hidden:!d,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:i||!l})});process.env.NODE_ENV!=="production"&&(Za.displayName="DialogBackdrop");const Ga=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,style:a,...c}=t,{store:u}=Vt(),l=u.useState("open");function d(g){l&&u.setOpen(!1,Ae(C0,g.nativeEvent))}const{getButtonProps:p,buttonRef:h}=Lr({disabled:s,native:i});return qe("button",t,{state:{disabled:s},ref:[n,h],props:[{onClick:d},c,p]})});process.env.NODE_ENV!=="production"&&(Ga.displayName="DialogClose");const Ya=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vt(),u=qt(i);return c.useSyncedValueWithCleanup("descriptionElementId",u),qe("p",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&(Ya.displayName="DialogDescription");let FS=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),VS=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Xa=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Xa.displayName="DialogPortalContext");function qa(){const e=f.useContext(Xa);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Portal> is missing.":ft(26));return e}const zS={...Cn,...tn,nestedDialogOpen(e){return e?{[VS.nestedDialogOpen]:""}:null}},Ka=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:u}=Vt(),l=u.useState("descriptionElementId"),d=u.useState("disablePointerDismissal"),p=u.useState("floatingRootContext"),h=u.useState("popupProps"),m=u.useState("modal"),g=u.useState("mounted"),v=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),C=u.useState("open"),S=u.useState("openMethod"),E=u.useState("titleElementId"),b=u.useState("transitionStatus"),x=u.useState("role");qa(),xn({open:C,ref:u.context.popupRef,onComplete(){C&&u.context.onOpenChangeComplete?.(!0)}});function T($){return $==="touch"?u.context.popupRef.current:!0}const P=s===void 0?T:s,z=y>0,D=qe("div",t,{state:{open:C,nested:v,transitionStatus:b,nestedDialogOpen:z},props:[h,{"aria-labelledby":E??void 0,"aria-describedby":l??void 0,role:x,tabIndex:-1,hidden:!g,onKeyDown($){Ms.has($.key)&&$.stopPropagation()},style:{[FS.nestedDialogs]:y}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:zS});return w.jsx(ms,{context:p,openInteractionType:S,disabled:!g,closeOnFocusOut:!d,initialFocus:P,returnFocus:o,modal:m!==!1,restoreFocus:"popup",children:D})});process.env.NODE_ENV!=="production"&&(Ka.displayName="DialogPopup");const Ls=f.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 w.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"&&(Ls.displayName="InternalBackdrop");const Fs=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vt(),i=s.useState("mounted"),a=s.useState("modal"),c=s.useState("open");return i||r?w.jsx(Xa.Provider,{value:r,children:w.jsxs(hs,{ref:n,...o,children:[i&&a===!0&&w.jsx(Ls,{ref:s.context.internalBackdropRef,inert:cs(!c)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Fs.displayName="DialogPortal");const Vs=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,...a}=t,{store:c}=Vt(),u=qt(i);return c.useSyncedValueWithCleanup("titleElementId",u),qe("h2",t,{ref:n,props:[{id:u},a]})});process.env.NODE_ENV!=="production"&&(Vs.displayName="DialogTitle");const zs=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,id:a,payload:c,handle:u,style:l,...d}=t,p=Vt(!0),h=u?.store??p?.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.":ft(79));const m=qt(a),g=h.useState("floatingRootContext"),v=h.useState("isOpenedByTrigger",m),y=f.useRef(null),{registerTrigger:C,isMountedByThisTrigger:S}=Id(m,y,h,{payload:c}),{getButtonProps:E,buttonRef:b}=Lr({disabled:s,native:i}),x=Ia(g,{enabled:g!=null}),T=bo([x]),P={disabled:s,open:v},z=h.useState("triggerProps",S);return qe("button",t,{state:P,ref:[b,n,C,y],props:[T.getReferenceProps(),z,{[ha]:"",id:m},d,E],stateAttributesMapping:Yd})});process.env.NODE_ENV!=="production"&&(zs.displayName="DialogTrigger");let Cf=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const $S={...Cn,...tn,nested(e){return e?{[Cf.nested]:""}:null},nestedDialogOpen(e){return e?{[Cf.nestedDialogOpen]:""}:null}},Tf=f.forwardRef(function(t,n){const{className:r,render:o,children:s,style:i,...a}=t,c=qa(),{store:u}=Vt(),l=u.useState("open"),d=u.useState("nested"),p=u.useState("transitionStatus"),h=u.useState("nestedOpenDialogCount"),m=u.useState("mounted"),g=h>0;return qe("div",t,{enabled:c||m,state:{open:l,nested:d,transitionStatus:p,nestedDialogOpen:g},ref:[n,u.useStateSetter("viewportElement")],stateAttributesMapping:$S,props:[{role:"presentation",hidden:!m,style:{pointerEvents:l?void 0:"none"},children:s},a]})});process.env.NODE_ENV!=="production"&&(Tf.displayName="DialogViewport");const jS=(e,t)=>Object.is(e,t);function jr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function HS(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:jr(t,r,n))}function xo(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:jr(r,t,n))}function US(e,t,n){return e.filter(r=>!jr(t,r,n))}function Ja(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function BS(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function WS(e){if(!Array.isArray(e))return e!=null&&"null"in e;const t=e;if(BS(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 ZS(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 Ja(e)}function Hr(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?Ja(e.value):Ja(e)}let Of=(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 $s={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Co={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},GS={disabled:!1,...Co},hr={valid(e){return e===null?null:e?{[Of.valid]:""}:{[Of.invalid]:""}}},Qa=f.createContext({invalid:void 0,name:void 0,validityData:{state:$s,errors:[],error:"",value:"",initialValue:null},setValidityData:Ct,disabled:void 0,touched:Co.touched,setTouched:Ct,dirty:Co.dirty,setDirty:Ct,filled:Co.filled,setFilled:Ct,focused:Co.focused,setFocused:Ct,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:GS,markedDirtyRef:{current:!1},registerFieldControl:Ct,validation:{getValidationProps:(e=mt)=>e,getInputValidationProps:(e=mt)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Qa.displayName="FieldRootContext");function mr(e=!0){const t=f.useContext(Qa);if(t.setValidityData===Ct&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":ft(28));return t}function ec(e,t){const{enabled:n=!0,getValue:r,id:o,value:s}=t,{registerFieldControl:i}=mr(),a=f.useRef(null);a.current||(a.current=Symbol()),he(()=>{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 tc=f.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ct,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(tc.displayName="FormContext");function Ur(){return f.useContext(tc)}const nc=f.createContext({controlId:void 0,registerControlId:Ct,labelId:void 0,setLabelId:Ct,messageIds:[],setMessageIds:Ct,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(nc.displayName="LabelableContext");function Ln(){return f.useContext(nc)}function rc(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:s}=Ln(),i=qt(t),a=n?o:void 0,c=wt(()=>Symbol("labelable-control")),u=f.useRef(!1),l=f.useRef(t!=null),d=ie(()=>{!u.current||s===Ct||(u.current=!1,s(c.current,void 0))});return he(()=>{if(s===Ct)return;let p;if(n){const h=r?.current;$e(h)&&h.closest("label")!=null?p=t??null:p=a??i}else if(t!=null)l.current=!0,p=t;else if(l.current)p=i;else{d();return}if(p===void 0){d();return}u.current=!0,s(c.current,p)},[t,r,a,s,n,i,c,d]),f.useEffect(()=>d,[d]),o??i}function YS(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=tt(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,u=parseFloat(o.height)||0,l=Math.max(t.width,i,c),d=Math.max(t.height,a,u),p=l-t.width,h=d-t.height;return{left:t.left-p/2,right:t.right+p/2,top:t.top-h/2,bottom:t.bottom+h/2}}function XS(e,t){return e??t}const qS=20;function Pf(e,t,n,r){const[o,s]=f.useState(!1);he(()=>{if(!e||!t||n==null){s(!1);return}const i=Ie(n).documentElement.clientWidth,a=n.offsetWidth;s(i>0&&a>0&&a>=i-qS)},[e,t,n]),xf(e&&(!t||o),r)}let _f=(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 If(e){return f.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[_f.checked]:""}:{[_f.unchecked]:""}},...hr}),[e.indeterminate])}const kf=f.createContext({disabled:!1});process.env.NODE_ENV!=="production"&&(kf.displayName="FieldItemContext");function KS(){return f.useContext(kf)}function JS(e,t,n,r=!0,o){const[s,i]=f.useState(),a=qt(o?`${o}-label`:void 0),c=e??t??s;return he(()=>{const u=e||t||!r?void 0:QS(n.current,a);s!==u&&i(u)}),c}function QS(e,t){const n=eE(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function eE(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 Rf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Rf.displayName="CheckboxGroupContext");function tE(e=!0){const t=f.useContext(Rf);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>.":ft(3));return t}const oc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(oc.displayName="CheckboxRootContext");function nE(){const e=f.useContext(oc);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>.":ft(14));return e}const rE="data-parent",sc=f.forwardRef(function(t,n){const{checked:r,className:o,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:c,id:u,indeterminate:l=!1,inputRef:d,name:p,onCheckedChange:h,parent:m=!1,readOnly:g=!1,render:v,required:y=!1,uncheckedValue:C,value:S,nativeButton:E=!1,style:b,...x}=t,{clearErrors:T}=Ur(),{disabled:P,name:z,setDirty:I,setFilled:D,setFocused:$,setTouched:V,state:N,validationMode:O,validityData:k,shouldValidateOnChange:_,validation:M}=mr(),A=KS(),{labelId:j,controlId:B,registerControlId:U,getDescriptionProps:W}=Ln(),G=tE(),Z=G?.parent,X=Z&&G.allValues,K=P||A.disabled||G?.disabled||a,J=z??p,se=S??J,ae=qt(),pe=qt();let Y=B;X?Y=m?pe:`${Z.id}-${se}`:u&&(Y=u);let me={};X&&(m?me=G.parent.getParentProps():se&&(me=G.parent.getChildProps(se)));const ge=ie(h),{checked:fe=r,indeterminate:le=l,onCheckedChange:ce,...ve}=me,ue=G?.value,Se=G?.setValue,R=G?.defaultValue,H=f.useRef(null),L=wt(()=>Symbol("checkbox-control")),F=f.useRef(!1),{getButtonProps:Q,buttonRef:ne}=Lr({disabled:K,native:E}),te=G?.validation??M,[ye,_e]=Eo({controlled:se&&ue&&!m?ue.includes(se):fe,default:se&&R&&!m?R.includes(se):s,name:"Checkbox",state:"checked"});he(()=>{U!==Ct&&(F.current=!0,U(L.current,Y))},[Y,G,U,m,L]),f.useEffect(()=>{const Te=L.current;return()=>{!F.current||U===Ct||(F.current=!1,U(Te,void 0))}},[U,L]),ec(H,{enabled:!G,id:ae,value:ye});const Ee=f.useRef(null),Ce=or(d,Ee,te.inputRef),Pe=JS(i,j,Ee,!E,Y??void 0);he(()=>{Ee.current&&(Ee.current.indeterminate=le,ye&&D(!0))},[ye,le,D]),As(ye,()=>{G&&!m||(T(J),D(ye),I(ye!==k.initialValue),_()?te.commit(ye):te.commit(ye,!0))});const Ve=En({checked:ye,disabled:K,form:c,name:m?void 0:J,id:E?void 0:Y??void 0,required:y,ref:Ce,style:J?Al:ss,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Te){if(Te.nativeEvent.defaultPrevented)return;if(g){Te.preventDefault();return}const Ue=Te.currentTarget.checked,Be=Ae(cr,Te.nativeEvent);if(ce?.(Ue,Be),ge(Ue,Be),!Be.isCanceled&&(_e(Ue),se&&ue&&Se&&!m&&!X)){const ct=Ue?[...ue,se]:ue.filter(Ye=>Ye!==se);Se(ct,Be)}},onFocus(){H.current?.focus()}},S!==void 0?{value:(G?ye&&S:S)||""}:mt,W,G?te.getValidationProps:te.getInputValidationProps),Ge=X?!!fe:ye,He=X&&le||l;f.useEffect(()=>{if(!Z||!se)return;const Te=Z.disabledStatesRef.current;return Te.set(se,K),()=>{Te.delete(se)}},[Z,K,se]);const nt=f.useMemo(()=>({...N,checked:Ge,disabled:K,readOnly:g,required:y,indeterminate:He}),[N,Ge,K,g,y,He]),st=If(nt),Re=qe("span",t,{state:nt,ref:[ne,H,n,G?.registerControlRef],props:[{id:E?Y??void 0:ae,role:"checkbox","aria-checked":le?"mixed":ye,"aria-readonly":g||void 0,"aria-required":y||void 0,"aria-labelledby":Pe,[rE]:m?"":void 0,onFocus(){$(!0)},onBlur(){const Te=Ee.current;Te&&(V(!0),$(!1),O==="onBlur"&&te.commit(G?ue:Te.checked))},onClick(Te){g||K||(Te.preventDefault(),Ee.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:Te.shiftKey,ctrlKey:Te.ctrlKey,altKey:Te.altKey,metaKey:Te.metaKey})))}},W,te.getValidationProps,x,ve,Q],stateAttributesMapping:st});return w.jsxs(oc.Provider,{value:nt,children:[Re,!ye&&!G&&J&&!m&&C!==void 0&&w.jsx("input",{type:"hidden",form:c,name:J,value:C}),w.jsx("input",{...Ve,suppressHydrationWarning:!0})]})});process.env.NODE_ENV!=="production"&&(sc.displayName="CheckboxRoot");const ic=f.forwardRef(function(t,n){const{render:r,className:o,style:s,keepMounted:i=!1,...a}=t,c=nE(),u=c.checked||c.indeterminate,{mounted:l,transitionStatus:d,setMounted:p}=vo(u),h=f.useRef(null),m={...c,transitionStatus:d};xn({open:u,ref:h,onComplete(){u||p(!1)}});const g=If(c),v=f.useMemo(()=>({...g,...tn,...hr}),[g]),y=i||l,C=qe("span",t,{ref:[n,h],state:m,stateAttributesMapping:v,props:a});return y?C:null});process.env.NODE_ENV!=="production"&&(ic.displayName="CheckboxIndicator");function oE(e,t){const n=qt(e);return he(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function sE(e={}){const{id:t,fallbackControlId:n,native:r=!1,setLabelId:o,focusControl:s}=e,{controlId:i,setLabelId:a}=Ln(),c=ie(h=>{a(h),o?.(h)}),u=oE(t,c),l=i??n;function d(h){if(s){s(h,l);return}if(!l)return;const m=Ie(h.currentTarget).getElementById(l);it(m)&&iE(m)}function p(h){lt(h.nativeEvent)?.closest("button,input,select,textarea")||(!h.defaultPrevented&&h.detail>1&&h.preventDefault(),!r&&d(h))}return r?{id:u,htmlFor:l??void 0,onMouseDown:p}:{id:u,onClick:p,onPointerDown(h){h.preventDefault()}}}function iE(e){e.focus({focusVisible:!0})}const Nf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Nf.displayName="ToolbarRootContext");function Mf(e){return f.useContext(Nf)}function aE(e,t){const n=f.useRef(null),r=ie(s=>{Kt.flushSync(()=>{e.setOpen(!1,Ae(ur,s.nativeEvent,s.currentTarget))}),Ab(n.current)?.focus()}),o=ie(s=>{const i=e.select("positionerElement");if(i&&Ar(s,i))e.context.beforeContentFocusGuardRef.current?.focus();else{Kt.flushSync(()=>{e.setOpen(!1,Ae(ur,s.nativeEvent,s.currentTarget))});let a=Mb(e.context.triggerFocusTargetRef.current||t.current);for(;a!==null&&we(i,a);){const c=a;if(a=ca(a),a===c)break}a?.focus()}});return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:o}}function cE(e){const[t,n]=f.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}const Af=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Af.displayName="CSPContext");const uE={disableStyleElements:!1};function lE(){return f.useContext(Af)??uE}let Tt=(function(e){return e.nestedDrawers="--nested-drawers",e.height="--drawer-height",e.frontmostHeight="--drawer-frontmost-height",e.swipeMovementX="--drawer-swipe-movement-x",e.swipeMovementY="--drawer-swipe-movement-y",e.snapPointOffset="--drawer-snap-point-offset",e.swipeStrength="--drawer-swipe-strength",e})({}),Fn=(function(e){return e.swipeProgress="--drawer-swipe-progress",e})({});const dE={...Cn,...tn},Df=f.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:i=!1,...a}=t,{store:c}=Vt(),u=c.useState("open"),l=c.useState("nested"),d=c.useState("mounted"),p=c.useState("transitionStatus");return qe("div",t,{state:{open:u,transitionStatus:p},ref:[c.context.backdropRef,n],stateAttributesMapping:dE,props:[{role:"presentation",hidden:!d,style:{pointerEvents:u?void 0:"none",userSelect:"none",WebkitUserSelect:"none",[Fn.swipeProgress]:"0",[Tt.swipeStrength]:"1"}},a],enabled:i||!l})});process.env.NODE_ENV!=="production"&&(Df.displayName="DrawerBackdrop");const Lf="data-drawer-content",Ff=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t;return Vt(),qe("div",t,{ref:n,props:[{[Lf]:""},i]})});process.env.NODE_ENV!=="production"&&(Ff.displayName="DrawerContent");const Vf=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Vf.displayName="DrawerProviderContext");function zf(e){return f.useContext(Vf)}let ln=(function(e){return e[e.open=Ft.open]="open",e[e.closed=Ft.closed]="closed",e[e.startingStyle=Ft.startingStyle]="startingStyle",e[e.endingStyle=Ft.endingStyle]="endingStyle",e.expanded="data-expanded",e.nestedDrawerOpen="data-nested-drawer-open",e.nestedDrawerSwiping="data-nested-drawer-swiping",e.swipeDismiss="data-swipe-dismiss",e.swipeDirection="data-swipe-direction",e.swiping="data-swiping",e})({});const ac=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(ac.displayName="DrawerRootContext");function js(e){const t=f.useContext(ac);if(e===!1&&t===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: DrawerRootContext is missing. Drawer parts must be placed within <Drawer.Root>.":ft(90));return t}function bt(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function $f(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e=="number")return Number.isFinite(e)?e<=1?bt(e,0,1)*t:e:null;const r=e.trim();if(r.endsWith("px")){const o=Number.parseFloat(r);return Number.isFinite(o)?o:null}if(r.endsWith("rem")){const o=Number.parseFloat(r);return Number.isFinite(o)?o*n:null}return null}function fE(e,t){let n=null,r=1/0;for(const o of t){const s=Math.abs(o.height-e);s<r&&(r=s,n=o)}return n}function jf(){const{store:e}=Vt(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o}=js(),s=e.useState("viewportElement"),[i,a]=f.useState(0),[c,u]=f.useState(16),l=ie(()=>{const m=Ie(s).documentElement;s&&a(s.offsetHeight),s||a(m.clientHeight);const g=parseFloat(getComputedStyle(m).fontSize);Number.isFinite(g)&&u(g)});he(()=>{if(l(),!s||typeof ResizeObserver!="function")return;const h=new ResizeObserver(l);return h.observe(s),()=>{h.disconnect()}},[l,s]);const d=f.useMemo(()=>{if(!t||t.length===0||i<=0||o<=0)return[];const h=Math.min(o,i);if(!Number.isFinite(h)||h<=0)return[];const m=t.map(y=>{const C=$f(y,i,c);if(C===null||!Number.isFinite(C))return null;const S=bt(C,0,h);return{value:y,height:S,offset:Math.max(0,o-S)}}).filter(y=>!!y);if(m.length<=1)return m;const g=[],v=[];for(let y=m.length-1;y>=0;y-=1){const C=m[y];v.some(E=>Math.abs(E-C.height)<=1)||(v.push(C.height),g.push(C))}return g.reverse(),g},[o,c,t,i]),p=f.useMemo(()=>{if(n===void 0)return d[0];if(n===null)return;const h=d.find(y=>Object.is(y.value,n));if(h)return h;const m=Math.min(o,i),g=$f(n,i,c);if(g===null||!Number.isFinite(g))return;const v=bt(g,0,m);return fE(v,d)??void 0},[n,o,d,c,i]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:r,popupHeight:o,viewportHeight:i,resolvedSnapPoints:d,activeSnapPointOffset:p?.offset??null}}const cc=f.createContext(null);process.env.NODE_ENV!=="production"&&(cc.displayName="DrawerViewportContext");function pE(e){return f.useContext(cc)}let Hf=!1;function hE(){Hf||(typeof CSS<"u"&&"registerProperty"in CSS&&([Tt.swipeMovementX,Tt.swipeMovementY,Tt.snapPointOffset].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),[{name:Fn.swipeProgress,initialValue:"0"},{name:Tt.swipeStrength,initialValue:"1"}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:"<number>",inherits:!1,initialValue:t})}catch{}})),Hf=!0)}const mE={...Cn,...tn,expanded(e){return e?{[ln.expanded]:""}:null},nestedDrawerOpen(e){return e?{[ln.nestedDrawerOpen]:""}:null},nestedDrawerSwiping(e){return e?{[ln.nestedDrawerSwiping]:""}:null},swipeDirection(e){return e?{[ln.swipeDirection]:e}:null},swiping(e){return e?{[ln.swiping]:""}:null}},Uf=f.forwardRef(function(t,n){const{className:r,finalFocus:o,initialFocus:s,render:i,style:a,...c}=t,{store:u}=Vt(),{swipeDirection:l,frontmostHeight:d,hasNestedDrawer:p,nestedSwiping:h,nestedSwipeProgressStore:m,onPopupHeightChange:g,notifyParentFrontmostHeight:v,notifyParentHasNestedDrawer:y}=js(),C=u.useState("descriptionElementId"),S=u.useState("disablePointerDismissal"),E=u.useState("floatingRootContext"),b=u.useState("popupProps"),x=u.useState("modal"),T=u.useState("mounted"),P=u.useState("nested"),z=u.useState("nestedOpenDrawerCount"),I=u.useState("transitionStatus"),D=u.useState("open"),$=u.useState("openMethod"),V=u.useState("titleElementId"),N=u.useState("role"),O=z>0,k=pE(),_=k?.swiping??!1,M=k?.swipeStrength??null,{snapPoints:A,activeSnapPoint:j,activeSnapPointOffset:B}=jf();qa();const[U,W]=f.useState(0),G=f.useRef(0);process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(k)return;const ge=Dr.captureOwnerStack?.()||"";ar(`<Drawer.Popup> expected to be rendered within <Drawer.Viewport>. Omitting the viewport disables drawer swipe handling and touch scroll locking. Wrap <Drawer.Popup> in <Drawer.Viewport>.${ge}`)},[k]);const Z=ie(()=>{const ge=u.context.popupRef.current;if(!ge)return;const fe=ge.offsetHeight;if(G.current>0&&d>G.current&&fe>G.current)return;if(G.current>0&&p){const ve=G.current;W(ve),g(ve);return}const ce=fe;ce!==G.current&&(G.current=ce,W(ce),g(ce))});he(()=>{if(!T){G.current=0,W(0),g(0);return}const ge=u.context.popupRef.current;if(!ge||(hE(),Z(),typeof ResizeObserver!="function"))return;const fe=new ResizeObserver(Z);return fe.observe(ge),()=>{fe.disconnect()}},[Z,T,O,g,u.context.popupRef]),he(()=>{const ge=u.context.popupRef,fe=()=>{const ce=ge.current;if(!ce)return;const ve=m.getSnapshot();ve>0?ce.style.setProperty(Fn.swipeProgress,`${ve}`):ce.style.setProperty(Fn.swipeProgress,"0")};fe();const le=m.subscribe(fe);return()=>{le();const ce=ge.current;ce&&ce.style.setProperty(Fn.swipeProgress,"0")}},[m,u.context.popupRef]),f.useEffect(()=>{if(D)return v?.(d),()=>{v?.(0)}},[d,D,v]),f.useEffect(()=>y?(y(D||I==="ending"),()=>{y(!1)}):void 0,[y,D,I]),xn({open:D,ref:u.context.popupRef,onComplete(){D&&u.context.onOpenChangeComplete?.(!0)}});const X=s===void 0?u.context.popupRef:s,K={open:D,nested:P,transitionStatus:I,expanded:j===1,nestedDrawerOpen:O,nestedDrawerSwiping:h,swipeDirection:l,swiping:_};let J;U&&!(!p&&I!=="ending")&&(J=`${U}px`);const ae=A&&A.length>0&&(l==="down"||l==="up");let pe=null;ae&&B!==null&&(pe=l==="up"?-B:B);let Y=k?k.getDragStyles():mt;if(ae&&l==="down"){const ge=B??0,fe=Number.parseFloat(String(Y[Tt.swipeMovementY]??0)),le=Number.isFinite(fe)?ge+fe:ge,ce=le<0;if(_&&ce&&Number.isFinite(fe)){const ve=Math.abs(le),Se=-Math.sqrt(ve)-ge;Y={...Y,transform:void 0,[Tt.swipeMovementY]:`${Se}px`}}else Y={...Y,transform:void 0}}const me=qe("div",t,{state:K,props:[b,{"aria-labelledby":V,"aria-describedby":C,role:N,tabIndex:-1,hidden:!T,onKeyDown(ge){Ms.has(ge.key)&&ge.stopPropagation()},style:{...Y,[Fn.swipeProgress]:"0",[Tt.nestedDrawers]:z,[Tt.height]:J,[Tt.snapPointOffset]:typeof pe=="number"?`${pe}px`:"0px",[Tt.frontmostHeight]:d?`${d}px`:void 0,[Tt.swipeStrength]:typeof M=="number"&&Number.isFinite(M)&&M>0?`${M}`:"1"}},c],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:mE});return w.jsx(ms,{context:E,openInteractionType:$,disabled:!T,closeOnFocusOut:!S,initialFocus:X,returnFocus:o,modal:x!==!1,restoreFocus:"popup",children:me})});process.env.NODE_ENV!=="production"&&(Uf.displayName="DrawerPopup");const gE=Fs;var Bf,Wf;function yE(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d=null,swipeDirection:p="down",snapToSequentialPoints:h=!1,snapPoints:m,snapPoint:g,defaultSnapPoint:v,onSnapPointChange:y}=e,C=ie(y),S=js(!0),E=S?.onNestedSwipeProgressChange,b=S?.onNestedFrontmostHeightChange,x=S?.onNestedSwipingChange,T=S?.onNestedDrawerPresenceChange,[P,z]=f.useState(0),[I,D]=f.useState(0),[$,V]=f.useState(!1),[N,O]=f.useState(!1),[k]=f.useState(vE),_=v!==void 0?v:m?.[0]??null,M=g!==void 0,[A,j]=Eo({controlled:g,default:_,name:"Drawer",state:"snapPoint"}),B=f.useRef(!1),U=ie((Y,me)=>{const ge=me??Ae(cr);C?.(Y,ge),!ge.isCanceled&&j(Y)}),W=f.useMemo(()=>M||!m||m.length===0?A:A===null||!m.some(Y=>Object.is(Y,A))?_:A,[A,M,_,m]),G=ie(Y=>{z(Y),!B.current&&Y>0&&D(Y)}),Z=ie(Y=>{if(Y>0){B.current=!0,D(Y);return}B.current=!1,P>0&&D(P)}),X=ie(Y=>{V(Y)}),K=ie(Y=>{k.set(Y),E?.(Y)}),J=ie(Y=>{O(Y),x?.(Y)}),se=ie((Y,me)=>{o?.(Y,me),!me.isCanceled&&!Y&&m&&m.length>0&&U(_,Ae(me.reason,me.event,me.trigger))}),ae=f.useMemo(()=>({swipeDirection:p,snapToSequentialPoints:h,snapPoints:m,activeSnapPoint:W,setActiveSnapPoint:U,frontmostHeight:I,popupHeight:P,hasNestedDrawer:$,nestedSwiping:N,nestedSwipeProgressStore:k,onNestedDrawerPresenceChange:X,onPopupHeightChange:G,onNestedFrontmostHeightChange:Z,onNestedSwipingChange:J,onNestedSwipeProgressChange:K,notifyParentFrontmostHeight:b,notifyParentSwipingChange:x,notifyParentSwipeProgressChange:E,notifyParentHasNestedDrawer:T}),[W,I,$,N,k,T,E,x,b,X,Z,K,J,G,P,U,m,h,p]),pe=typeof t=="function"?Y=>w.jsxs(f.Fragment,{children:[Bf||(Bf=w.jsx(Zf,{})),t(Y)]}):w.jsxs(f.Fragment,{children:[Wf||(Wf=w.jsx(Zf,{})),t]});return w.jsx(ac.Provider,{value:ae,children:w.jsx(Ds.Provider,{value:!0,children:w.jsx(Wa,{open:n,defaultOpen:r,onOpenChange:se,onOpenChangeComplete:s,disablePointerDismissal:i,modal:a,actionsRef:c,handle:u,triggerId:l,defaultTriggerId:d,children:pe})})})}function vE(){let e=0;const t=new Set;return{getSnapshot:()=>e,set(n){const r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(o=>{o()}))},subscribe(n){return t.add(n),()=>{t.delete(n)}}}}function Zf(){const e=Xn(),t=zf(),n=Vt(!1),r=n.store.useState("open"),o=n.store.useState("nestedOpenDialogCount"),s=n.store.useState("popupElement"),i=o===0;return f.useEffect(()=>{if(!(!t||e==null))return()=>{t.removeDrawer(e)}},[e,t]),f.useEffect(()=>{e!=null&&t?.setDrawerOpen(e,r)},[e,r,t]),f.useEffect(()=>{if(!r||!i||!Jo)return;const c=tt(s).CloseWatcher;if(!c)return;function u(p){n.store.select("open")&&n.store.setOpen(!1,Ae(T0,p))}const l=new c,d=Fe(l,"close",u);return()=>{d(),l.destroy()}},[n.store,i,r,s]),null}function uc(e,t){const n=At(e);if(t==="vertical"){const o=n.overflowY;return(o==="auto"||o==="scroll")&&e.scrollHeight>e.clientHeight}const r=n.overflowX;return(r==="auto"||r==="scroll")&&e.scrollWidth>e.clientWidth}function bE(e,t,n){let r=e;for(;r&&r!==t;){for(const o of n)if(uc(r,o))return!0;r=r.parentElement}return!1}function Br(e,t,n="vertical"){let r=it(e)?e:null;for(;r&&r!==t;){if(uc(r,n))return r;r=r.parentElement}return uc(t,n)?t:null}function Hs(e,t,n){return typeof e?.elementFromPoint=="function"?e.elementFromPoint(t,n):null}const wE=40,SE=10,EE=1,xE=50,Gf=16,CE=80,TE='button,a,input,select,textarea,label,[role="button"]';function lc(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 OE(e){const n=tt(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}}function Us(e){return Number.isFinite(e)&&e>0?e:null}function PE(e){return e%2===1}function dc(e,t,n){const r=e[n];if(typeof r=="function")try{r.call(e,t)}catch(o){if(o&&typeof o=="object"&&"name"in o&&o.name==="NotFoundError")return;throw o}}function _E(e){const{enabled:t,directions:n,elementRef:r,movementCssVars:o,canStart:s,ignoreSelectorWhenTouch:i=!0,ignoreScrollableAncestors:a=!1,swipeThreshold:c,onDismiss:u,onProgress:l,onCancel:d,onSwipeStart:p,onRelease:h,onSwipingChange:m,trackDrag:g=!0}=e,v=TE,y=n.length===1?n[0]:void 0,C=Math.max(0,typeof c=="number"?c:wE),S=n.includes("left"),E=n.includes("right"),b=n.includes("up"),x=n.includes("down"),T=S||E,P=b||x,z=f.useMemo(()=>{const q=[];return P&&q.push("vertical"),T&&q.push("horizontal"),q},[T,P]),[I,D]=f.useState(void 0),[$,V]=f.useState(!1),[N,O]=f.useState(!1),[k,_]=f.useState(!1),[M,A]=f.useState({x:0,y:0}),[j,B]=f.useState({x:0,y:0,scale:1}),[U,W]=f.useState(null),G=f.useRef({x:0,y:0}),Z=f.useRef({x:0,y:0}),X=f.useRef(null),K=f.useRef({x:0,y:0,scale:1}),J=f.useRef(void 0),se=f.useRef(0),ae=f.useRef(!1),pe=f.useRef({x:0,y:0}),Y=f.useRef(!1),me=f.useRef(!1),ge=f.useRef(null),fe=f.useRef(!1),le=f.useRef(!1),ce=f.useRef({width:0,height:0}),ve=f.useRef(0),ue=f.useRef(C),Se=f.useRef(null),R=f.useRef(null),H=f.useRef({x:0,y:0}),L=f.useRef(null),F=f.useRef(!1),Q=ie(q=>{F.current!==q&&(F.current=q,V(q),m?.(q))});function ne(q){if(!q)return;if(typeof c!="function"){ue.current=C;return}const re=r.current;if(!re)return;const be=c({element:re,direction:q});ue.current=Math.max(0,be)}const te=ie((q,re)=>{const be=Number.isFinite(q)?bt(q,0,1):0,Le=be!==ve.current;let je=!1;if(re){const De=L.current;je=!De||De.deltaX!==re.deltaX||De.deltaY!==re.deltaY||De.direction!==re.direction}!Le&&!je||(ve.current=be,re?L.current=re:Le&&(L.current=null),l?.(be,re))});function ye(q,re){if(re===null)return;const be=R.current;if(be&&re>be.time){const Le=Math.max(re-be.time,Gf);H.current={x:(q.x-be.x)/Le,y:(q.y-be.y)/Le}}R.current={x:q.x,y:q.y,time:re}}const _e=f.useCallback(()=>{D(void 0),Q(!1),O(!1),_(!1),A({x:0,y:0}),B({x:0,y:0,scale:1}),W(null),te(0),ue.current=C,G.current={x:0,y:0},Z.current={x:0,y:0},K.current={x:0,y:0,scale:1},J.current=void 0,se.current=0,ae.current=!1,pe.current={x:0,y:0},Y.current=!1,X.current=null,me.current=!1,ge.current=null,fe.current=!1,le.current=!1,ce.current={width:0,height:0},Se.current=null,R.current=null,H.current={x:0,y:0},L.current=null},[Q,C,te]);f.useEffect(()=>{typeof c!="function"&&(ue.current=C)},[C,c]);function Ee(q){if("touches"in q){const re=q.touches[0];return re?{x:re.clientX,y:re.clientY}:null}return{x:q.clientX,y:q.clientY}}function Ce(q){return"touches"in q?!0:q.pointerType==="touch"}function Pe(q,re){const be=Ie(r.current);return Hs(be,q.x,q.y)??lt(re)}function Ve(q,re){return T&&!P?Br(q,re,"horizontal"):P&&!T?Br(q,re,"vertical"):Br(q,re,"vertical")??Br(q,re,"horizontal")}function Ge(q,re,be){fe.current=!1;const Le=Ce(q),je=Pe(re,q.nativeEvent),Qe=Ie(r.current).body,Oe=Le&&Qe?Ve(je,Qe):null,xe=be?.ignoreScrollableTarget??!1;if(Oe&&!xe||(fe.current=!!(Oe&&xe),(je?je.closest(v):!1)&&(!Le||i)))return!1;const Me=r.current;if(a&&Me&&je&&z.length>0&&!(be?.ignoreScrollableAncestors??!1)&&bE(je,Me,z))return!1;if(ae.current=!1,J.current=void 0,se.current=0,G.current=re,Se.current=Us(q.timeStamp),pe.current=re,X.current=re,Me){ce.current={width:Me.offsetWidth,height:Me.offsetHeight},ne(y);const Xe=OE(Me);K.current=Xe,Z.current={x:Xe.x,y:Xe.y},B(Xe),A({x:Xe.x,y:Xe.y}),ye({x:Xe.x,y:Xe.y},Se.current),"touches"in q||dc(Me,q.pointerId,"setPointerCapture")}return p?.(q.nativeEvent),Q(!0),O(!1),W(null),Y.current=!0,te(0),!0}function He(){nt(),fe.current=!1,X.current=null}function nt(){me.current=!1,ge.current=null}function st(q){if(He(),!F.current)return;Q(!1),O(!1),W(null);const re=g?j:K.current;Z.current={x:re.x,y:re.y},A({x:re.x,y:re.y}),D(void 0),le.current=!1;const be=r.current;be&&dc(be,q.pointerId,"releasePointerCapture"),te(0,{deltaX:0,deltaY:0,direction:void 0}),d?.(q.nativeEvent)}function Re(q,re){const be=Qe=>Qe>=0?Qe**.5:-(Math.abs(Qe)**.5),Le=(Qe,Oe,xe)=>!Oe&&Qe<0||!xe&&Qe>0?be(Qe):Qe,je=T?Le(q,S,E):be(q),De=P?Le(re,b,x):be(re);return{x:je,y:De}}function Te(q,re,be){const Le=Math.abs(re),je=Math.abs(be);if(P&&be!==0&&(!T||je>=Le)){const Oe=Math.max(0,q.scrollHeight-q.clientHeight),xe=q.scrollTop<=0,Ne=q.scrollTop>=Oe,Me=be>0,Xe=be<0;return Me&&xe&&x||Xe&&Ne&&b}if(T&&re!==0&&(!P||Le>je)){const Oe=Math.max(0,q.scrollWidth-q.clientWidth),xe=q.scrollLeft<=0,Ne=q.scrollLeft>=Oe,Me=re>0,Xe=re<0;return Me&&xe&&E||Xe&&Ne&&S}return null}const Ue=ie(q=>{if(!t||q.defaultPrevented||q.nativeEvent.defaultPrevented||!("touches"in q)&&q.button!==0)return;const re=Ee(q);!re||(me.current=!0,ge.current=re,fe.current=!1,le.current=!1,!(s?s(re,{nativeEvent:q.nativeEvent,direction:y}):!0))||Ge(q,re)&&nt()});function Be(q,re,be){if(!t||!F.current)return;const Le=lt(q.nativeEvent);if(Ce(q)&&!fe.current){const on=q.currentTarget;if(Ve(Le,on))return}if("touches"in q||q.preventDefault(),Y.current){G.current=re;const on=Us(q.timeStamp);on!==null&&(Se.current=on),Y.current=!1}const je=re.x,De=re.y,Qe=be.x,Oe=be.y;(Oe<0&&De>pe.current.y||Oe>0&&De<pe.current.y)&&(pe.current={x:pe.current.x,y:De}),(Qe<0&&je>pe.current.x||Qe>0&&je<pe.current.x)&&(pe.current={x:je,y:pe.current.y});const xe=je-G.current.x,Ne=De-G.current.y,Me=De-pe.current.y,Xe=je-pe.current.x;if(!N&&Math.sqrt(xe*xe+Ne*Ne)>=EE&&(O(!0),U===null&&T&&P)){const qr=Math.abs(xe),Hc=Math.abs(Ne);W(qr>Hc?"horizontal":"vertical")}let Je;if(!J.current)U==="vertical"?Ne>0?Je="down":Ne<0&&(Je="up"):U==="horizontal"?xe>0?Je="right":xe<0&&(Je="left"):Math.abs(xe)>=Math.abs(Ne)?Je=xe>0?"right":"left":Je=Ne>0?"down":"up",Je&&(Je==="left"&&S||Je==="right"&&E||Je==="up"&&b||Je==="down"&&x)&&(J.current=Je,se.current=lc(Je,xe,Ne),D(Je),ne(Je));else{const on=J.current,qr=lc(on,Xe,Me);qr>ue.current?(ae.current=!1,D(on)):!(S&&E)&&!(b&&x)&&se.current-qr>=SE&&(ae.current=!0)}const dn=Re(xe,Ne);let rn=K.current.x,Bt=K.current.y;U==="horizontal"?T&&(rn+=dn.x):(U==="vertical"||T&&(rn+=dn.x),P&&(Bt+=dn.y)),Z.current={x:rn,y:Bt},g&&A({x:rn,y:Bt}),ye({x:rn,y:Bt},Us(q.timeStamp));const er=rn-K.current.x,Pn=Bt-K.current.y,Er=J.current,xr=y??J.current;if(!xr){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}const _n=xr==="left"||xr==="right"?ce.current.width:ce.current.height,fn=K.current.scale||1;if(_n<=0||fn<=0){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}const Cr=lc(xr,rn-K.current.x,Bt-K.current.y);if(Cr<=0){te(0,{deltaX:er,deltaY:Pn,direction:Er});return}te(Cr/(_n*fn),{deltaX:er,deltaY:Pn,direction:Er})}const ct=ie(q=>{const re=Ee(q);if(!re)return;if(!("touches"in q)){const je=PE(q.buttons);je&&(le.current=!0);const De=q.buttons===0&&le.current;if(q.buttons!==0&&!je||De){st(q);return}}if(!$&&me.current){if(!Ce(q)&&(q.defaultPrevented||q.nativeEvent.defaultPrevented)){He();return}if(s?s(re,{nativeEvent:q.nativeEvent,direction:y}):!0){const De=ge.current;let Qe=!1;if(Ce(q)){const xe=r.current;if(De&&xe){const Ne=Pe(re,q.nativeEvent),Xe=Ie(xe).body,Je=Xe?Ve(Ne,Xe):null;if(Je&&(we(xe,Je)||we(Je,xe))){const dn=re.x-De.x,rn=re.y-De.y,Bt=Te(Je,dn,rn);if(Bt===!1)return;Bt===!0&&(Qe=!0)}}}Ge(q,re,{ignoreScrollableTarget:Qe,ignoreScrollableAncestors:Qe})&&(De&&Qe?(nt(),G.current=De,pe.current=De,X.current=De,Y.current=!1):(nt(),fe.current=!1))}}const be=X.current,Le=be===null?{x:0,y:0}:{x:re.x-be.x,y:re.y-be.y};X.current=re,Be(q,re,Le)}),Ye=ie(q=>{if(!t)return;const re=Z.current,be=K.current,Le=re.x-be.x,je=re.y-be.y,De={deltaX:Le,deltaY:je,direction:I??J.current};if(!F.current){He(),te(0,De);return}Q(!1),O(!1),W(null),He(),le.current=!1;const Qe=r.current;Qe&&("touches"in q||dc(Qe,q.pointerId,"releasePointerCapture"));const Oe=Le,xe=je,Ne=Se.current,Me=Us(q.timeStamp),Xe=Ne!==null&&Me!==null&&Me>Ne?Me-Ne:0,Je=Xe>0?Math.max(Xe,xE):0,dn=Je>0?Oe/Je:0,rn=Je>0?xe/Je:0;let Bt=H.current.x,er=H.current.y;const Pn=R.current;if(Pn&&Me!==null&&Me>=Pn.time){const Cr=Me-Pn.time;if(Cr<=CE){const on=Math.max(Cr,Gf),qr=re.x-Pn.x,Hc=re.y-Pn.y,Jh=qr/on,Qh=Hc/on;Jh!==0&&(Bt=Jh),Qh!==0&&(er=Qh)}else Bt=0,er=0}const Er=h?.({event:q.nativeEvent,direction:I??J.current,deltaX:Oe,deltaY:xe,velocityX:dn,velocityY:rn,releaseVelocityX:Bt,releaseVelocityY:er}),xr=typeof Er=="boolean";if(ae.current&&!xr){Z.current={x:be.x,y:be.y},A({x:be.x,y:be.y}),D(void 0),te(0,De);return}let _n=!1,fn;if(xr)_n=Er,fn=I??J.current??y;else for(const Cr of n){switch(Cr){case"right":Oe>ue.current&&(_n=!0,fn="right");break;case"left":Oe<-ue.current&&(_n=!0,fn="left");break;case"down":xe>ue.current&&(_n=!0,fn="down");break;case"up":xe<-ue.current&&(_n=!0,fn="up");break}if(_n)break}_n&&fn?(D(fn),_(!0),u?.(q.nativeEvent,{direction:fn})):(Z.current={x:be.x,y:be.y},A({x:be.x,y:be.y}),D(void 0),te(0,De))}),Ut=f.useCallback(()=>{const q=g?M:Z.current,re=g?j:K.current;if(!$&&q.x===re.x&&q.y===re.y&&!k)return{[o.x]:"0px",[o.y]:"0px"};const be=q.x-re.x,Le=q.y-re.y;return{transition:$?"none":void 0,transform:$?`translateX(${q.x}px) translateY(${q.y}px) scale(${re.scale})`:void 0,[o.x]:`${be}px`,[o.y]:`${Le}px`}},[k,M,j,$,o,g]),$t=f.useCallback(()=>t?{onPointerDown:Ue,onPointerMove:ct,onPointerUp:Ye,onPointerCancel:Ye}:{},[t,Ye,ct,Ue]),Ke=f.useCallback(()=>t?{onTouchStart:Ue,onTouchMove:ct,onTouchEnd:Ye,onTouchCancel:Ye}:{},[t,Ye,ct,Ue]);return{swiping:$,swipeDirection:I,dragDismissed:k,getPointerProps:$t,getTouchProps:Ke,getDragStyles:Ut,reset:_e}}const IE=Vs,kE=zs,fc=10,Yf=.5,Xf=.5,RE=300,qf=4,Kf=.2,NE=4,pc=80,Jf=360,hc=.1,Qf=1,ME=`[${Lf}]`,ep=f.forwardRef(function(t,n){const{className:r,render:o,style:s,children:i,...a}=t,{store:c}=Vt(),{swipeDirection:u,notifyParentSwipingChange:l,notifyParentSwipeProgressChange:d,frontmostHeight:p,snapToSequentialPoints:h}=js(),g=zf()?.visualStateStore,v=c.useState("open"),y=c.useState("mounted"),C=c.useState("nested"),S=c.useState("nestedOpenDrawerCount"),E=c.useState("viewportElement"),b=c.useState("popupElement"),x=S>0,T=u==="left"||u==="right"?"horizontal":"vertical",P=T==="vertical",z=P?"horizontal":"vertical",{snapPoints:I,resolvedSnapPoints:D,activeSnapPoint:$,activeSnapPointOffset:V,setActiveSnapPoint:N,popupHeight:O}=jf(),[k,_]=f.useState(null),M=f.useRef(void 0),A=f.useRef(null),j=ao(),B=f.useRef(!1),U=f.useRef(""),W=f.useRef(!1),G=f.useRef(!1),Z=f.useRef(null),X=f.useMemo(()=>{if(!I||I.length<2||u!=="down"&&u!=="up"||D.length<2)return null;const R=D.map(ne=>ne.offset).filter(ne=>Number.isFinite(ne)).sort((ne,te)=>ne-te);if(R.length<2)return null;const H=R[0],L=R[1],F=R[R.length-1];let Q=L-H;if(!Number.isFinite(Q)||Q<=0){const ne=F-H;if(!Number.isFinite(ne)||ne<=0)return null;Q=ne}return{minOffset:H,range:Q}},[D,I,u]),K=f.useMemo(()=>!X||V===null?null:bt((V-X.minOffset)/X.range,0,1),[V,X]),J=f.useMemo(()=>I&&I.length>0&&(u==="down"||u==="up")?u==="down"?["down","up"]:["up","down"]:[u],[I,u]),se=ie(R=>{tp(c.context.popupRef.current,c.context.backdropRef.current,R)}),ae=ie(()=>{se(!1),c.context.popupRef.current?.removeAttribute(sr.endingStyle),_(null)}),pe=ie(()=>{B.current&&(B.current=!1,l?.(!1))}),Y=ie(({resolvedProgress:R,shouldTrackProgress:H,notifyParent:L})=>{const F=v&&!C&&H,Q=F?R:0,ne=v&&H?R:0;L&&d&&(d(ne),ne<=0&&pe()),g?.set({swipeProgress:Q,frontmostHeight:Q>0?p:0});const te=c.context.backdropRef.current;if(te){if(!F||Q<=0){te.style.setProperty(Fn.swipeProgress,"0"),te.style.removeProperty(Tt.height);return}te.style.setProperty(Fn.swipeProgress,`${Q}`),p>0?te.style.setProperty(Tt.height,`${p}px`):te.style.removeProperty(Tt.height)}});function me({direction:R,deltaX:H,deltaY:L,velocityX:F,velocityY:Q,releaseVelocityX:ne,releaseVelocityY:te}){if(!R)return null;const ye=c.context.popupRef.current;if(!ye)return null;const _e=R==="left"||R==="right"?ye.offsetWidth:ye.offsetHeight;if(!Number.isFinite(_e)||_e<=0)return null;const Ee=R==="left"||R==="right"?H:L,Ce=I&&I.length>0?V??0:0;let Pe=0;R==="down"?Pe=Ce:R==="up"&&(Pe=-Ce);const Ve=Pe+Ee,Ge=R==="left"||R==="up"?-Ve:Ve,He=Math.max(0,_e-Ge);if(!Number.isFinite(He)||He<=0)return null;const nt=R==="left"||R==="right"?ne:te,st=R==="left"||R==="right"?F:Q,Re=Math.abs(nt)>0&&Number.isFinite(nt)?nt:st,Te=R==="left"||R==="up"?-Re:Re;if(!Number.isFinite(Te)||Te<=Kf)return null;const Ue=bt(Te,Kf,NE),Be=bt(He/Ue,pc,Jf);if(!Number.isFinite(Be))return null;const ct=(Be-pc)/(Jf-pc),Ye=bt(hc+ct*(Qf-hc),hc,Qf);return!Number.isFinite(Ye)||Ye<=0?null:Ye}function ge(R){if(B.current||!R)return;const H=R.direction??u,L=H==="left"||H==="right"?R.deltaX:R.deltaY;!Number.isFinite(L)||Math.abs(L)<fc||(B.current=!0,l?.(!0))}const fe=_E({enabled:y&&!x,directions:J,elementRef:c.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:Tt.swipeMovementX,y:Tt.swipeMovementY},onSwipeStart(R){if("touches"in R||"pointerType"in R&&R.pointerType==="touch")return;const H=c.context.popupRef.current;if(!H)return;const F=Ie(H).getSelection?.();if(!F||F.isCollapsed)return;const Q=$e(F.anchorNode)?F.anchorNode:F.anchorNode?.parentElement,ne=$e(F.focusNode)?F.focusNode:F.focusNode?.parentElement;!we(H,Q)&&!we(H,ne)||F.removeAllRanges()},onSwipingChange(R){np(c.context.backdropRef.current,R),!R&&!d&&pe()},swipeThreshold({element:R,direction:H}){return rp(R,H)},canStart(R,H){const L=c.context.popupRef.current;if(!L)return!1;const F=L.ownerDocument,Q=Hs(F,R.x,R.y);if(!Q||!we(L,Q))return!1;const ne=H.nativeEvent;return!(("touches"in ne||"pointerType"in ne&&ne.pointerType==="touch")&&sp(F,L)||ne.type==="touchstart"&&mc(Q))},onProgress(R,H){ge(H);const L=H?.direction??fe.swipeDirection,F=L===void 0||L===u,Q=!!(I&&I.length>0),te=Q&&(u==="down"||u==="up")||!Q||u==="left"||u==="right"||F;let ye=R;if(X&&O>0){if(H&&Number.isFinite(H.deltaY)){const _e=V??X.minOffset,Ee=bt(_e+H.deltaY,0,O);ye=bt((Ee-X.minOffset)/X.range,0,1)}else if(K!==null)ye=K;else if(L==="down"||L==="up"){const _e=R*O,Ee=V??X.minOffset,Ce=L==="down"?Ee+_e:Ee-_e;ye=bt((Ce-X.minOffset)/X.range,0,1)}}Y({resolvedProgress:ye,shouldTrackProgress:te,notifyParent:!0})},onRelease({event:R,deltaX:H,deltaY:L,direction:F,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ye}){const _e={deltaX:H,deltaY:L,velocityX:Q,velocityY:ne,releaseVelocityX:te,releaseVelocityY:ye};function Ee(Ke){const q=c.context.popupRef.current;q&&(pe(),se(!0),q.style.removeProperty("transition"),q.setAttribute(sr.endingStyle,""),Kt.flushSync(()=>{_(me({direction:Ke,..._e}))}))}if(!I||I.length===0){if(!F){ae();return}const Ke=c.context.popupRef.current;if(!Ke){ae();return}const q=rp(Ke,F),re=F==="left"||F==="right"?H:L;if(!Number.isFinite(re)){ae();return}const be=F==="left"||F==="up"?-re:re;if(be<=0)return ae(),!1;const Le=F==="left"||F==="right"?Q:ne;if((F==="left"||F==="up"?-Le:Le)>=Yf&&be>0)return Ee(F),!0;const De=be>q;return De?Ee(F):ae(),De}if(u!=="down"&&u!=="up"){ae();return}if(!O||D.length===0){ae();return}const Ce=u==="down"?L:-L;if(!Number.isFinite(Ce)){ae();return}const Pe=Math.sign(Ce),Ve=u==="down"?ye:-ye,Ge=u==="down"?ne:-ne;let He=Number.isFinite(Ve)?Ve:Ge;if(Pe!==0&&Math.abs(Ce)>=fc&&Number.isFinite(He)){const Ke=Math.sign(He);Ke!==0&&Ke!==Pe&&(He=Ge)}const nt=V??0,st=bt(nt+Ce,0,O),Re=Number.isFinite(He)&&Math.abs(He)>=Xf?bt(He,-qf,qf)*RE:0,Te=h?st:bt(st+Re,0,O),Ue=Ae(ls,R),Be=()=>(M.current=$,N?.(null,Ue),Ee(u),!0);if(h){const Ke=[...D].sort((Ne,Me)=>Ne.offset-Me.offset);if(Ke.length===0)return ae(),!1;let q=0,re=Math.abs(nt-Ke[0].offset);for(let Ne=1;Ne<Ke.length;Ne+=1){const Me=Math.abs(nt-Ke[Ne].offset);Me<re&&(re=Me,q=Ne)}let be=Ke[0];re=Math.abs(Te-be.offset);for(const Ne of Ke){const Me=Math.abs(Te-Ne.offset);Me<re&&(re=Me,be=Ne)}const Le=Math.sign(He),je=Pe!==0&&Le!==0&&Le===Pe&&Math.abs(He)>=Xf;let De=Te;if(je){const Ne=bt(q+Pe,0,Ke.length-1);if(Ne!==q){const Me=Ke[Ne];(Pe>0?Te<Me.offset:Te>Me.offset)&&(be=Me,De=Me.offset)}else if(Pe>0)return Be()}const Oe=Math.abs(De-O),xe=Math.abs(De-be.offset);return Oe<xe?Be():(N?.(be.value,Ue),ae(),!1)}if(He>=Yf&&Ce>0)return Be();let ct=D[0],Ye=Math.abs(Te-ct.offset);for(const Ke of D){const q=Math.abs(Te-Ke.offset);q<Ye&&(Ye=q,ct=Ke)}return Math.abs(Te-O)<Ye?Be():(N?.(ct.value,Ue),ae(),!1)},onDismiss(R){g?.set({swipeProgress:0,frontmostHeight:0});const H=c.context.backdropRef.current;H&&(H.style.setProperty(Fn.swipeProgress,"0"),H.style.removeProperty(Tt.height));const L=Ae(ls,R);if(c.setOpen(!1,L),L.isCanceled){const F=M.current;F!==void 0&&N?.(F,Ae(ls,R)),M.current=void 0,A.current?.(),ae();return}if(c.select("open")){const F=R;j.request(()=>{if(c.select("open")){const Q=M.current;Q!==void 0&&N?.(Q,Ae(ls,F)),M.current=void 0,ae(),A.current?.()}else M.current=void 0});return}M.current=void 0,se(!0)}}),le=fe.getPointerProps(),ce=fe.getTouchProps(),ve=fe.reset;A.current=ve,f.useEffect(()=>{const R=E??b;if(!R)return;const H=R,L=Ie(H),F=tt(L);function Q(ne){if(G.current)return;const te=Z.current,ye=ne.touches[0];if(!ye||!te)return;const _e=P?ye.clientY-te.lastY:ye.clientX-te.lastX;if(ip(ne,F)){te.allowSwipe=!1,gr(te,ye);return}if(ne.touches.length===2){gr(te,ye);return}if(sp(L,H)||!v||!y||x){gr(te,ye);return}if(FE(te,ye,P)){gr(te,ye);return}const Ce=te.scrollTarget;if(!Ce||Ce===L.documentElement||Ce===L.body){ne.cancelable&&ne.preventDefault(),gr(te,ye);return}if(!VE(Ce,T)){ne.cancelable&&ne.preventDefault(),gr(te,ye);return}const Ve=_e;if(Ve!==0){const Ge=$E(Ce,T,u,Ve);te.allowSwipe?ne.cancelable&&ne.preventDefault():ne.cancelable&&Ge?(te.allowSwipe=!0,ne.preventDefault()):te.allowSwipe=!1}gr(te,ye)}return Fe(L,"touchmove",Q,{passive:!1,capture:!0})},[y,x,v,b,P,T,u,E]),f.useEffect(()=>{if(!X||fe.swiping)return;Y({resolvedProgress:!v||C?0:K??0,shouldTrackProgress:!0,notifyParent:!1})},[Y,p,C,d,v,K,X,fe.swiping,c,g]),f.useEffect(()=>{if(d)return v||d(0),()=>{d(0)}},[d,v]),f.useEffect(()=>{v&&(ve(),ae())},[ae,v,ve]),f.useEffect(()=>()=>{g?.set({swipeProgress:0,frontmostHeight:0}),np(c.context.backdropRef.current,!1),pe()},[pe,c,g]);const ue=f.useMemo(()=>({swiping:fe.swiping,getDragStyles:fe.getDragStyles,swipeStrength:k??null,setSwipeDismissed(R){tp(c.context.popupRef.current,c.context.backdropRef.current,R)}}),[c,fe.getDragStyles,fe.swiping,k]);function Se(){G.current=!1,Z.current=null,U.current="",W.current=!1}return w.jsx(Tf,{ref:n,className:r,render:o,...En(a,{onPointerDown(R){if(U.current=R.pointerType,W.current=R.pointerType==="pen",!v||!y||x)return;const H=Ie(R.currentTarget),L=Hs(H,R.clientX,R.clientY);mc(L)||AE(L)||R.pointerType!=="touch"&&le.onPointerDown?.(R)},onPointerMove(R){R.pointerType!=="touch"&&le.onPointerMove?.(R)},onPointerUp(R){U.current===R.pointerType&&(U.current=""),R.pointerType!=="touch"&&le.onPointerUp?.(R)},onPointerCancel(R){U.current===R.pointerType&&(U.current=""),R.pointerType!=="touch"&&le.onPointerCancel?.(R)},onTouchStart(R){if(U.current==="pen"&&W.current){W.current=!1,G.current=!1,Z.current=null;return}if(!v||!y||x){G.current=!1,Z.current=null;return}const L=R.touches[0];if(!L)return;if(ap(R)){G.current=!1,Z.current=null;return}const F=Ie(R.currentTarget),Q=Hs(F,L.clientX,L.clientY);if(G.current=mc(Q),G.current){Z.current=null;return}const ne=E??b,te=lt(R.nativeEvent),ye=$e(te)?te:null;if(ne&&ye&&!we(ne,ye)){G.current=!0,Z.current=null;return}let _e=null,Ee=!1;ne&&ye&&(_e=Br(ye,ne,T),Ee=Br(ye,ne,z)!=null);let Ce=null;_e&&(Ce=zE(_e,T,u)?null:!1),Z.current={startX:L.clientX,startY:L.clientY,lastX:L.clientX,lastY:L.clientY,scrollTarget:_e,hasCrossAxisScrollableContent:Ee,allowSwipe:Ce,preserveNativeCrossAxisScroll:!1},ce.onTouchStart?.(R)},onTouchMove(R){if(G.current||ap(R))return;const H=Z.current;H?.preserveNativeCrossAxisScroll||H?.allowSwipe===!1||H?.scrollTarget!=null&&!H.allowSwipe||ce.onTouchMove?.(R)},onTouchEnd(R){Se(),ce.onTouchEnd?.(R)},onTouchCancel(R){Se(),ce.onTouchCancel?.(R)},"data-nested-dialog-open":void 0}),children:w.jsx(cc.Provider,{value:ue,children:i})})});process.env.NODE_ENV!=="production"&&(ep.displayName="DrawerViewport");function tp(e,t,n){if(n){e?.setAttribute(ln.swipeDismiss,""),t?.setAttribute(ln.swipeDismiss,"");return}e?.removeAttribute(ln.swipeDismiss),t?.removeAttribute(ln.swipeDismiss)}function np(e,t){if(e){if(t){e.setAttribute(ln.swiping,"");return}e.removeAttribute(ln.swiping)}}function mc(e){return!!e?.closest(Wl)}function AE(e){return!!e?.closest(ME)}function rp(e,t){const n=t==="left"||t==="right"?e.offsetWidth:e.offsetHeight;return Math.max(n*.5,fc)}function op(e,t){return e instanceof t.HTMLInputElement&&e.type==="range"}function DE(e){return $e(e)?e.tagName==="INPUT"||e.tagName==="TEXTAREA":!1}function LE(e,t){const n=$e(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,r=$e(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||we(t,n)||we(t,r)}function sp(e,t){const n=Pt(e);if(!!(n&&we(t,n))&&DE(n)){const{selectionStart:s,selectionEnd:i}=n;if(s!=null&&i!=null&&s<i)return!0}const o=e.getSelection?.();return!o||o.isCollapsed?!1:LE(o,t)}function ip(e,t){const n=e.composedPath();return n?n.some(r=>op(r,t)):op(lt(e),t)}function ap(e){return ip(e.nativeEvent,tt(e.currentTarget))}function gr(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function FE(e,t,n){if(e.preserveNativeCrossAxisScroll)return!0;if(e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;const r=n?t.clientY-e.startY:t.clientX-e.startX,o=n?t.clientX-e.startX:t.clientY-e.startY,s=Math.abs(r),i=Math.abs(o);return i<6||i<=s+2?!1:(e.preserveNativeCrossAxisScroll=!0,!0)}function VE(e,t){return t==="vertical"?e.scrollHeight>e.clientHeight:e.scrollWidth>e.clientWidth}function cp(e,t){if(t==="vertical"){const r=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:r}}const n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function zE(e,t,n){const{offset:r,max:o}=cp(e,t),s=up(n,t);return s===null?!1:s?r<=0:r>=o}function $E(e,t,n,r){const{offset:o,max:s}=cp(e,t),i=up(n,t);return i===null||!(i?r>0:r<0)?!1:i?o<=0:o>=s}function up(e,t){return t==="vertical"?e==="down"?!0:e==="up"?!1:null:e==="right"?!0:e==="left"?!1:null}const lp=f.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});process.env.NODE_ENV!=="production"&&(lp.displayName="FieldsetRootContext");function jE(e=!1){const t=f.useContext(lp);if(!t&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>.":ft(86));return t}const dp=function(t){const n=qt(),r=t.controlId===void 0?n:t.controlId,[o,s]=f.useState(r),[i,a]=f.useState(t.labelId),[c,u]=f.useState([]),l=wt(()=>new Map),{messageIds:d}=Ln(),p=ie((g,v)=>{const y=l.current;if(v===void 0){y.delete(g);return}y.set(g,v),s(C=>{if(y.size===0)return;let S;for(const E of y.values()){if(C!==void 0&&E===C)return C;S===void 0&&(S=E)}return S})}),h=f.useCallback(g=>En({"aria-describedby":d.concat(c).join(" ")||void 0},g),[d,c]),m=f.useMemo(()=>({controlId:o,registerControlId:p,labelId:i,setLabelId:a,messageIds:c,setMessageIds:u,getDescriptionProps:h}),[o,p,i,a,c,u,h]);return w.jsx(nc.Provider,{value:m,children:t.children})};process.env.NODE_ENV!=="production"&&(dp.displayName="LabelableProvider");function Bs(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Ws=Object.keys($s);function HE(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Ws)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function UE(e){const{formRef:t,clearErrors:n}=Ur(),{setValidityData:r,validate:o,validityData:s,validationDebounceTime:i,invalid:a,markedDirtyRef:c,state:u,name:l,shouldValidateOnChange:d}=e,{controlId:p,getDescriptionProps:h}=Ln(),m=Gt(),g=f.useRef(null),v=ie(async(S,E=!1)=>{const b=g.current;if(!b)return;if(E){if(u.valid!==!1)return;const V=b.validity;if(!V.valueMissing){const O={value:S,state:{...$s,valid:!0},error:"",errors:[],initialValue:s.initialValue};if(b.setCustomValidity(""),p){const k=t.current.fields.get(p);k&&t.current.fields.set(p,{...k,...Bs(O,!1)})}r(O);return}const N=Ws.reduce((O,k)=>(O[k]=V[k],O),{});if(!N.valid&&!HE(N))return}function x(V){const N=Ws.reduce((k,_)=>(k[_]=V.validity[_],k),{});let O=!1;for(const k of Ws)if(k!=="valid"){if(k==="valueMissing"&&N[k])O=!0;else if(N[k])return N}return O&&!c.current&&(N.valid=!0,N.valueMissing=!1),N}m.clear();let T=null,P=[];const z=x(b);let I;const D=d();if(b.validationMessage&&!D)I=b.validationMessage,P=[b.validationMessage];else{const V=Array.from(t.current.fields.values()).reduce((O,k)=>(k.name&&(O[k.name]=k.getValue()),O),{}),N=o(S,V);typeof N=="object"&&N!==null&&"then"in N?T=await N:T=N,T!==null?(z.valid=!1,z.customError=!0,Array.isArray(T)?(P=T,b.setCustomValidity(T.join(`
|
|
19
|
+
`))):T&&(P=[T],b.setCustomValidity(T))):D&&(b.setCustomValidity(""),z.customError=!1,b.validationMessage?(I=b.validationMessage,P=[b.validationMessage]):b.validity.valid&&!z.valid&&(z.valid=!0))}const $={value:S,state:z,error:I??(Array.isArray(T)?T[0]:T??""),errors:P,initialValue:s.initialValue};if(p){const V=t.current.fields.get(p);V&&t.current.fields.set(p,{...V,...Bs($,a)})}r($)}),y=f.useCallback((S={})=>En(h,u.valid===!1?{"aria-invalid":!0}:mt,S),[h,u.valid]),C=f.useCallback((S={})=>En({onChange(E){if(E.nativeEvent.defaultPrevented)return;if(n(l),!d()){v(E.currentTarget.value,!0);return}const b=E.currentTarget;if(b.value===""){v(b.value);return}m.clear(),i?m.start(i,()=>{v(b.value)}):v(b.value)}},y(S)),[y,n,l,m,v,i,d]);return f.useMemo(()=>({getValidationProps:y,getInputValidationProps:C,inputRef:g,commit:v}),[y,C,v])}function BE(e){const{commit:t,invalid:n,markedDirtyRef:r,name:o,setValidityData:s,validityData:i}=e,{formRef:a}=Ur(),c=f.useRef(null),u=f.useRef(null),l=f.useRef(null),d=ie(()=>{const v=u.current;if(v)return v.getValue?v.getValue():v.value}),p=ie((v=!0)=>{const y=u.current;if(!y)return;let C=y.value;C===void 0&&(C=d()),r.current=!0,v?Kt.flushSync(()=>t(C)):t(C)});function h(){const v=u.current;!v||!v.id||a.current.fields.set(v.id,{getValue:d,name:o,controlRef:v.controlRef??l,validityData:Bs(i,n),validate:p})}function m(v=u.current?.id){v&&a.current.fields.delete(v)}function g(){const v=u.current;if(!v)return;let y=v.value;y===void 0&&(y=d()),i.initialValue===null&&y!==null&&s(C=>({...C,initialValue:y}))}return he(()=>{const v=u.current;!v||!v.id||a.current.fields.set(v.id,{getValue:d,name:o,controlRef:v.controlRef??l,validityData:Bs(i,n),validate:p})},[a,d,n,o,p,i]),he(()=>{const v=a.current.fields;return()=>{const y=u.current?.id;y&&v.delete(y)}},[a]),ie((v,y)=>{if(!y){c.current===v&&(c.current=null,m(),u.current=null);return}const C=u.current?.id;c.current=v,u.current=y,C&&C!==y.id&&m(C),g(),h()})}const fp=f.forwardRef(function(t,n){const{errors:r,validationMode:o,submitAttemptedRef:s}=Ur(),{render:i,className:a,validate:c,validationDebounceTime:u=0,validationMode:l=o,name:d,disabled:p=!1,invalid:h,dirty:m,touched:g,actionsRef:v,style:y,...C}=t,{disabled:S}=jE(),E=ie(c||(()=>null)),b=S||p,[x,T]=f.useState(!1),[P,z]=f.useState(!1),[I,D]=f.useState(!1),[$,V]=f.useState(!1),N=m??P,O=g??x,k=f.useRef(!1),_=ie(pe=>{m===void 0&&(pe&&(k.current=!0),z(pe))}),M=ie(pe=>{g===void 0&&T(pe)}),A=ie(()=>l==="onChange"||l==="onSubmit"&&s.current),j=!!d&&Object.hasOwn(r,d)&&r[d]!==void 0,B=h===!0||j,[U,W]=f.useState({state:$s,error:"",errors:[],value:null,initialValue:null}),G=!B&&U.state.valid,Z=f.useMemo(()=>({disabled:b,touched:O,dirty:N,valid:G,filled:I,focused:$}),[b,O,N,G,I,$]),X=UE({setValidityData:W,validate:E,validityData:U,validationDebounceTime:u,invalid:B,markedDirtyRef:k,state:Z,name:d,shouldValidateOnChange:A}),K=f.useCallback(()=>{k.current=!0,X.commit(U.value)},[X,U]),J=BE({commit:X.commit,invalid:B,markedDirtyRef:k,name:d,setValidityData:W,validityData:U});f.useImperativeHandle(v,()=>({validate:K}),[K]);const se=f.useMemo(()=>({invalid:B,name:d,validityData:U,setValidityData:W,disabled:b,touched:O,setTouched:M,dirty:N,setDirty:_,filled:I,setFilled:D,focused:$,setFocused:V,validate:E,validationMode:l,validationDebounceTime:u,shouldValidateOnChange:A,state:Z,markedDirtyRef:k,registerFieldControl:J,validation:X}),[B,d,U,b,O,M,N,_,I,D,$,V,E,l,u,A,Z,J,X]),ae=qe("div",t,{ref:n,state:Z,props:C,stateAttributesMapping:hr});return w.jsx(Qa.Provider,{value:se,children:ae})});process.env.NODE_ENV!=="production"&&(fp.displayName="FieldRootInner");const Wr=f.forwardRef(function(t,n){return w.jsx(dp,{children:w.jsx(fp,{...t,ref:n})})});process.env.NODE_ENV!=="production"&&(Wr.displayName="FieldRoot");const gc=f.forwardRef(function(t,n){const{render:r,className:o,style:s,id:i,nativeLabel:a=!0,...c}=t,u=mr(!1),{labelId:l}=Ln(),d=f.useRef(null),p=sE({id:l??i,native:a});return process.env.NODE_ENV!=="production"&&f.useEffect(()=>{if(!d.current)return;const m=d.current.tagName==="LABEL";if(a){if(!m){const g=Dr.captureOwnerStack?.()||"";ar(`<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=Dr.captureOwnerStack?.()||"";ar(`<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]),qe("label",t,{ref:[n,d],state:u.state,props:[p,c],stateAttributesMapping:hr})});process.env.NODE_ENV!=="production"&&(gc.displayName="FieldLabel");const WE={...hr,...tn},Zs=f.forwardRef(function(t,n){const{render:r,id:o,className:s,match:i,style:a,...c}=t,u=qt(o),{validityData:l,state:d,name:p}=mr(!1),{setMessageIds:h}=Ln(),{errors:m}=Ur(),g=p?m[p]:null,v=typeof i=="string";let y=!1;i===!0?y=!0:v?y=!!l.state[i]:y=!!g||l.state.valid===!1;const{mounted:C,transitionStatus:S,setMounted:E}=vo(y);he(()=>{if(!(!y||!u))return h(O=>O.concat(u)),()=>{h(O=>O.filter(k=>k!==u))}},[y,u,h]);const b=f.useRef(null),[x,T]=f.useState(null),[P,z]=f.useState(null),I=l.errors.length>1?w.jsx("ul",{children:l.errors.map(O=>w.jsx("li",{children:O},O))}):l.error,D=v?I:g||I;let $=l.error;g!=null?$=Array.isArray(g)?JSON.stringify(g):g:l.errors.length>1&&($=JSON.stringify(l.errors)),y&&$!==P&&(z($),T(D)),xn({open:y,ref:b,onComplete(){y||E(!1)}});const V={...d,transitionStatus:S},N=qe("div",t,{ref:[n,b],state:V,props:[{id:u,children:y?D:x},c],stateAttributesMapping:WE,enabled:C});return C?N:null});process.env.NODE_ENV!=="production"&&(Zs.displayName="FieldError");const Gs=f.forwardRef(function(t,n){const{render:r,className:o,id:s,name:i,value:a,disabled:c=!1,onValueChange:u,defaultValue:l,autoFocus:d=!1,style:p,...h}=t,{state:m,name:g,disabled:v,setTouched:y,setDirty:C,validityData:S,setFocused:E,setFilled:b,validationMode:x,validation:T}=mr(),P=v||c,z=g??i,I={...m,disabled:P},{labelId:D}=Ln(),$=rc({id:s});he(()=>{const A=a!=null;T.inputRef.current?.value||A&&a!==""?b(!0):A&&a===""&&b(!1)},[T.inputRef,b,a]);const V=f.useRef(null);he(()=>{d&&V.current===Pt(Ie(V.current))&&E(!0)},[d,E]);const[N]=Eo({controlled:a,default:l,name:"FieldControl",state:"value"}),O=a!==void 0,k=O?N:void 0,_=ie(()=>T.inputRef.current?.value);return ec(T.inputRef,{id:$,value:k,getValue:_}),qe("input",t,{ref:[n,V],state:I,props:[{id:$,disabled:P,name:z,ref:T.inputRef,"aria-labelledby":D,autoFocus:d,...O?{value:k}:{defaultValue:l},onChange(A){const j=A.currentTarget.value;u?.(j,Ae(cr,A.nativeEvent)),C(j!==S.initialValue),b(j!=="")},onFocus(){E(!0)},onBlur(A){y(!0),E(!1),x==="onBlur"&&T.commit(A.currentTarget.value)},onKeyDown(A){A.currentTarget.tagName==="INPUT"&&A.key==="Enter"&&(y(!0),T.commit(A.currentTarget.value))}},T.getInputValidationProps(),h],stateAttributesMapping:hr})});process.env.NODE_ENV!=="production"&&(Gs.displayName="FieldControl");const To=f.forwardRef(function(t,n){const{render:r,className:o,validationMode:s="onSubmit",errors:i,onSubmit:a,onFormSubmit:c,actionsRef:u,style:l,...d}=t,p=f.useRef({fields:new Map}),h=f.useRef(!1),m=f.useRef(!1),g=ie(x=>{x&&(x.focus(),x.tagName==="INPUT"&&x.select())}),[v,y]=f.useState(i);As(i,()=>{y(i)}),f.useEffect(()=>{if(!h.current)return;h.current=!1;const x=Array.from(p.current.fields.values()).filter(T=>T.validityData.state.valid===!1);x.length&&g(x[0].controlRef.current)},[v,g]);const C=f.useCallback(x=>{const T=Array.from(p.current.fields.values());if(x){const P=T.find(z=>z.name===x);P&&P.validate(!1)}else T.forEach(P=>{P.validate(!1)})},[]);f.useImperativeHandle(u,()=>({validate:C}),[C]);const S=qe("form",t,{ref:n,props:[{noValidate:!0,onSubmit(x){m.current=!0;let T=Array.from(p.current.fields.values());T.forEach(z=>{z.validate()}),T=Array.from(p.current.fields.values());const P=T.filter(z=>!z.validityData.state.valid);if(P.length)x.preventDefault(),g(P[0].controlRef.current);else if(h.current=!0,a?.(x),c){x.preventDefault();const z=T.reduce((I,D)=>(D.name&&(I[D.name]=D.getValue()),I),{});c(z,_0(cr,x.nativeEvent))}}},d]}),E=ie(x=>{if(x&&v&&mt.hasOwnProperty.call(v,x)){const T={...v};delete T[x],y(T)}}),b=f.useMemo(()=>({formRef:p,validationMode:s,errors:v??mt,clearErrors:E,submitAttemptedRef:m}),[p,s,v,E]);return w.jsx(tc.Provider,{value:b,children:S})});process.env.NODE_ENV!=="production"&&(To.displayName="Form");const yc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(yc.displayName="PopoverRootContext");function Vn(e){const t=f.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>.":ft(47));return t}function ZE(){return{...Nd(),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 GE={...Md,disabled:de(e=>e.disabled),instantType:de(e=>e.instantType),openMethod:de(e=>e.openMethod),openChangeReason:de(e=>e.openChangeReason),modal:de(e=>e.modal),focusManagerModal:de(e=>e.focusManagerModal),stickIfOpen:de(e=>e.stickIfOpen),titleElementId:de(e=>e.titleElementId),descriptionElementId:de(e=>e.descriptionElementId),openOnHover:de(e=>e.openOnHover),closeDelay:de(e=>e.closeDelay),hasViewport:de(e=>e.hasViewport)};class vc extends Wo{constructor(t){const n={...ZE(),...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 bs},GE)}setOpen=(t,n)=>{const r=n.reason===Lt,o=n.reason===Fr&&n.event.detail===0,s=!t&&(n.reason===ed||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(i0,()=>{this.set("stickIfOpen",!1)}),Kt.flushSync(i)):i(),o||s?this.set("instantType",o?"click":"dismiss"):n.reason===ur?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const r=wt(()=>new vc(n)).current,o=t??r;return so(r.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function pp({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:s,modal:i=!1,handle:a,triggerId:c,defaultTriggerId:u=null}=e,l=vc.useStore(a?.store,{modal:i,open:r,openProp:n,activeTriggerId:u,triggerIdProp:c});ja(()=>{n===void 0&&l.state.open===!1&&r===!0&&l.update({open:!0,activeTriggerId:u})}),l.useControlledProp("openProp",n),l.useControlledProp("triggerIdProp",c);const d=l.useState("open"),p=l.useState("payload");l.useContextCallback("onOpenChange",o),l.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:m}=Ha(d);kd(l);const{forceUnmount:g}=Rd(d,l,()=>{l.update({stickIfOpen:!0,openChangeReason:null})});f.useEffect(()=>{d||l.context.stickIfOpenTimeout.clear()},[l,d]);const v=f.useCallback(()=>{l.setOpen(!1,Ae(td))},[l]);f.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:v}),[g,v]);const y=Dd({popupStore:l,onOpenChange:l.setOpen}),C=ka(y,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),S=zd(y),{getReferenceProps:E,getFloatingProps:b,getTriggerProps:x}=bo([C,S]),T=f.useMemo(()=>E(m),[E,m]),P=f.useMemo(()=>x(m),[x,m]),z=f.useMemo(()=>b(),[b]);l.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:T,inactiveTriggerProps:P,popupProps:z,floatingRootContext:y,nested:qn()!=null});const I=f.useMemo(()=>({store:l}),[l]);return w.jsx(yc.Provider,{value:I,children:typeof t=="function"?t({payload:p}):t})}function YE(e){return Vn(!0)?w.jsx(pp,{props:e}):w.jsx(L0,{children:w.jsx(pp,{props:e})})}const XE=300,hp=f.forwardRef(function(t,n){const{render:r,className:o,disabled:s=!1,nativeButton:i=!0,handle:a,payload:c,openOnHover:u=!1,delay:l=XE,closeDelay:d=0,id:p,style:h,...m}=t,g=Vn(!0),v=a?.store??g?.store;if(!v)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.":ft(74));const y=qt(p),C=v.useState("isTriggerActive",y),S=v.useState("floatingRootContext"),E=v.useState("isOpenedByTrigger",y),b=f.useRef(null),{registerTrigger:x,isMountedByThisTrigger:T}=Id(y,b,v,{payload:c,disabled:s,openOnHover:u,closeDelay:d}),P=v.useState("openChangeReason"),z=v.useState("stickIfOpen"),I=v.useState("openMethod"),D=v.useState("focusManagerModal"),$=Dw(S,{enabled:S!=null&&u&&(I!=="touch"||P!==Fr),mouseOnly:!0,move:!1,handleClose:Bw(),restMs:l,delay:{close:d},triggerElementRef:b,isActiveTrigger:C,isClosing:()=>v.select("transitionStatus")==="ending"}),V=Ia(S,{enabled:S!=null,stickIfOpen:z}),N=bo([V]),O=v.useState("triggerProps",T),k={disabled:s,open:E},{getButtonProps:_,buttonRef:M}=Lr({disabled:s,native:i}),A=f.useMemo(()=>({open(G){return G&&P===Fr?Xd.open(G):Yd.open(G)}}),[P]),j=qe("button",t,{state:k,ref:[M,n,x,b],props:[N.getReferenceProps(),$,O,{[ha]:"",id:y},m,_],stateAttributesMapping:A}),{preFocusGuardRef:B,handlePreFocusGuardFocus:U,handleFocusTargetFocus:W}=aE(v,b);return C&&!D?w.jsxs(f.Fragment,{children:[w.jsx(Sn,{ref:B,onFocus:U}),w.jsx(f.Fragment,{children:j},y),w.jsx(Sn,{ref:v.context.triggerFocusTargetRef,onFocus:W})]}):w.jsx(f.Fragment,{children:j},y)});process.env.NODE_ENV!=="production"&&(hp.displayName="PopoverTrigger");const bc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(bc.displayName="PopoverPortalContext");function qE(){const e=f.useContext(bc);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":ft(45));return e}const mp=f.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:s}=Vn();return s.useState("mounted")||r?w.jsx(bc.Provider,{value:r,children:w.jsx(hs,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(mp.displayName="PopoverPortal");const wc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(wc.displayName="PopoverPositionerContext");function gp(){const e=f.useContext(wc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":ft(46));return e}const yp=f.forwardRef(function(t,n){const{render:r,className:o,anchor:s,positionMethod:i="absolute",side:a="bottom",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p=5,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:v=f0,style:y,...C}=t,{store:S}=Vn(),E=qE(),b=A0(),x=S.useState("floatingRootContext"),T=S.useState("mounted"),P=S.useState("open"),z=S.useState("openChangeReason"),I=S.useState("activeTriggerElement"),D=S.useState("modal"),$=S.useState("openMethod"),V=S.useState("positionerElement"),N=S.useState("instantType"),O=S.useState("transitionStatus"),k=S.useState("hasViewport"),_=f.useRef(null),M=Bl(V,!1,!1),A=Zd({anchor:s,floatingRootContext:x,positionMethod:i,mounted:T,side:a,sideOffset:u,align:c,alignOffset:l,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:m,disableAnchorTracking:g,keepMounted:E,nodeId:b,collisionAvoidance:v,adaptiveOrigin:k?Xw:void 0}),j=x.useState("domReferenceElement");he(()=>{const G=j,Z=_.current;if(G&&(_.current=G),Z&&G&&G!==Z){S.set("instantType",void 0);const X=new AbortController;return M(()=>{S.set("instantType","trigger-change")},X.signal),()=>{X.abort()}}},[j,M,S]);const B={open:P,side:A.side,align:A.align,anchorHidden:A.anchorHidden,instant:N};Pf(P&&D===!0&&z!==Lt,$==="touch",V,I);const U=f.useCallback(G=>{S.set("positionerElement",G)},[S]),W=qd(t,B,{styles:A.positionerStyles,transitionStatus:O,props:C,refs:[n,U],hidden:!T,inert:!P});return w.jsxs(wc.Provider,{value:A,children:[T&&D===!0&&z!==Lt&&w.jsx(Ls,{ref:S.context.internalBackdropRef,inert:cs(!P),cutout:I}),w.jsx(D0,{id:b,children:W})]})});process.env.NODE_ENV!=="production"&&(yp.displayName="PopoverPositioner");const vp=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(vp.displayName="ClosePartContext");function KE(){const[e,t]=f.useState(0),n=ie(()=>(t(o=>o+1),()=>{t(o=>Math.max(0,o-1))}));return{context:f.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}function JE(e){const{value:t,children:n}=e;return w.jsx(vp.Provider,{value:t,children:n})}const QE={...Cn,...tn},bp=f.forwardRef(function(t,n){const{className:r,render:o,initialFocus:s,finalFocus:i,style:a,...c}=t,{store:u}=Vn(),l=gp(),d=Mf()!=null,{context:p,hasClosePart:h}=KE(),m=u.useState("open"),g=u.useState("openMethod"),v=u.useState("instantType"),y=u.useState("transitionStatus"),C=u.useState("popupProps"),S=u.useState("titleElementId"),E=u.useState("descriptionElementId"),b=u.useState("modal"),x=u.useState("mounted"),T=u.useState("openChangeReason"),P=u.useState("activeTriggerElement"),z=u.useState("floatingRootContext");xn({open:m,ref:u.context.popupRef,onComplete(){m&&u.context.onOpenChangeComplete?.(!0)}});const I=u.useState("disabled"),D=u.useState("openOnHover"),$=u.useState("closeDelay");Mw(z,{enabled:D&&!I,closeDelay:$});function V(A){return A==="touch"?u.context.popupRef.current:!0}const N=s===void 0?V:s,O={open:m,side:l.side,align:l.align,instant:v,transitionStatus:y},k=b!==!1&&h;u.useSyncedValue("focusManagerModal",k);const _=f.useCallback(A=>{u.set("popupElement",A)},[u]),M=qe("div",t,{state:O,ref:[n,u.context.popupRef,_],props:[C,{"aria-labelledby":S,"aria-describedby":E,onKeyDown(A){d&&Ms.has(A.key)&&A.stopPropagation()}},Va(y),c],stateAttributesMapping:QE});return w.jsx(ms,{context:z,openInteractionType:g,modal:k,disabled:!x||T===Lt,initialFocus:N,returnFocus:i,restoreFocus:"popup",previousFocusableElement:it(P)?P:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:w.jsx(JE,{value:p,children:M})})});process.env.NODE_ENV!=="production"&&(bp.displayName="PopoverPopup");const wp=f.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=Vn(),c=a.useState("open"),{arrowRef:u,side:l,align:d,arrowUncentered:p,arrowStyles:h}=gp();return qe("div",t,{state:{open:c,side:l,align:d,uncentered:p},ref:[n,u],props:[{style:h,"aria-hidden":!0},i],stateAttributesMapping:Cn})});process.env.NODE_ENV!=="production"&&(wp.displayName="PopoverArrow");const e1={...Cn,...tn},Sp=f.forwardRef(function(t,n){const{className:r,render:o,style:s,...i}=t,{store:a}=Vn(),c=a.useState("open"),u=a.useState("mounted"),l=a.useState("transitionStatus"),d=a.useState("openChangeReason");return qe("div",t,{state:{open:c,transitionStatus:l},ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!u,style:{pointerEvents:d===Lt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:e1})});process.env.NODE_ENV!=="production"&&(Sp.displayName="PopoverBackdrop");const Ep=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Vn(),c=qt(i.id);return he(()=>(a.set("titleElementId",c),()=>{a.set("titleElementId",void 0)}),[a,c]),qe("h2",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(Ep.displayName="PopoverTitle");const xp=f.forwardRef(function(t,n){const{render:r,className:o,style:s,...i}=t,{store:a}=Vn(),c=qt(i.id);return he(()=>(a.set("descriptionElementId",c),()=>{a.set("descriptionElementId",void 0)}),[a,c]),qe("p",t,{ref:n,props:[{id:c},i]})});process.env.NODE_ENV!=="production"&&(xp.displayName="PopoverDescription");const Ys="base-ui-disable-scrollbar",Sc={className:Ys,getElement(e){return w.jsx("style",{nonce:e,href:Ys,precedence:"base-ui:low",children:`.${Ys}{scrollbar-width:none}.${Ys}::-webkit-scrollbar{display:none}`})}};process.env.NODE_ENV!=="production"&&(Sc.getElement.displayName="styleDisableScrollbar.getElement");const zn=1;function Cp(e,t){return Math.max(0,e-t)}function t1(e,t){if(t<=0)return 0;const n=bt(e,0,t),r=n,o=t-n,s=r<=zn,i=o<=zn;return s&&i?r<=o?0:t:s?0:i?t:n}const Ec=f.createContext(null);process.env.NODE_ENV!=="production"&&(Ec.displayName="SelectRootContext");const xc=f.createContext(null);process.env.NODE_ENV!=="production"&&(xc.displayName="SelectFloatingContext");function Zr(){const e=f.useContext(Ec);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":ft(60));return e}function Tp(){const e=f.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>.":ft(61));return e}const Ze={id:de(e=>e.id),labelId:de(e=>e.labelId),modal:de(e=>e.modal),multiple:de(e=>e.multiple),items:de(e=>e.items),itemToStringLabel:de(e=>e.itemToStringLabel),itemToStringValue:de(e=>e.itemToStringValue),isItemEqualToValue:de(e=>e.isItemEqualToValue),value:de(e=>e.value),hasSelectedValue:de(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Hr(t,r)!==""}),hasNullItemLabel:de((e,t)=>t?WS(e.items):!1),open:de(e=>e.open),mounted:de(e=>e.mounted),forceMount:de(e=>e.forceMount),transitionStatus:de(e=>e.transitionStatus),openMethod:de(e=>e.openMethod),activeIndex:de(e=>e.activeIndex),selectedIndex:de(e=>e.selectedIndex),isActive:de((e,t)=>e.activeIndex===t),isSelected:de((e,t,n)=>{const r=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(s=>jr(n,s,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:jr(n,o,r)}),isSelectedByFocus:de((e,t)=>e.selectedIndex===t),popupProps:de(e=>e.popupProps),triggerProps:de(e=>e.triggerProps),triggerElement:de(e=>e.triggerElement),positionerElement:de(e=>e.positionerElement),listElement:de(e=>e.listElement),scrollUpArrowVisible:de(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:de(e=>e.scrollDownArrowVisible),hasScrollArrows:de(e=>e.hasScrollArrows)};function n1(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:s,defaultOpen:i=!1,onOpenChange:a,name:c,form:u,autoComplete:l,disabled:d=!1,readOnly:p=!1,required:h=!1,modal:m=!0,actionsRef:g,inputRef:v,onOpenChangeComplete:y,items:C,multiple:S=!1,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x=jS,highlightItemOnHover:T=!0,children:P}=e,{clearErrors:z}=Ur(),{setDirty:I,setTouched:D,setFocused:$,shouldValidateOnChange:V,validityData:N,setFilled:O,name:k,disabled:_,validation:M,validationMode:A}=mr(),j=rc({id:t}),B=_||d,U=k??c,[W,G]=Eo({controlled:n,default:S?r??tl:r,name:"Select",state:"value"}),[Z,X]=Eo({controlled:s,default:i,name:"Select",state:"open"}),K=f.useRef([]),J=f.useRef([]),se=f.useRef(null),ae=f.useRef(null),pe=f.useRef(0),Y=f.useRef(null),me=f.useRef([]),ge=f.useRef(!1),fe=f.useRef(!1),le=f.useRef(null),ce=f.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ve=f.useRef(!1),{mounted:ue,setMounted:Se,transitionStatus:R}=vo(Z),{openMethod:H,triggerProps:L}=Ha(Z),F=wt(()=>new el({id:j,labelId:void 0,modal:m,multiple:S,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x,value:W,open:Z,mounted:ue,transitionStatus:R,items:C,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Q=We(F,Ze.activeIndex),ne=We(F,Ze.selectedIndex),te=We(F,Ze.triggerElement),ye=We(F,Ze.positionerElement),_e=cE(H),Ee=H??_e,Ce=f.useMemo(()=>S&&Array.isArray(W)&&W.length===0?"":Hr(W,b),[S,W,b]),Pe=f.useMemo(()=>S&&Array.isArray(W)?W.map(Oe=>Hr(Oe,b)):Hr(W,b),[S,W,b]),Ve=vt(F.state.triggerElement),Ge=ie(()=>Pe);ec(Ve,{id:j,value:W,getValue:Ge});const He=f.useRef(W);he(()=>{W!==He.current&&F.set("forceMount",!0)},[F,W]),he(()=>{O(S?Array.isArray(W)&&W.length>0:W!=null)},[S,W,O]),he(function(){if(Z)return;const xe=me.current;if(S){const Me=Array.isArray(W)?W:[];if(Me.length===0){F.set("selectedIndex",null);return}const Xe=Me[Me.length-1],Je=xo(xe,Xe,x);F.set("selectedIndex",Je===-1?null:Je);return}const Ne=xo(xe,W,x);F.set("selectedIndex",Ne===-1?null:Ne)},[S,Z,W,me,x,F]),As(W,()=>{z(U),I(W!==N.initialValue),V()?M.commit(W):M.commit(W,!0)});const nt=ie((Oe,xe)=>{if(a?.(Oe,xe),!xe.isCanceled&&(X(Oe),!Oe&&(xe.reason===ur||xe.reason===ya)&&(D(!0),$(!1),A==="onBlur"&&M.commit(W)),!Oe&&F.state.activeIndex!==null)){const Ne=K.current[F.state.activeIndex];queueMicrotask(()=>{Ne?.setAttribute("tabindex","-1")})}}),st=ie(()=>{Se(!1),F.update({activeIndex:null,openMethod:null}),y?.(!1)});xn({enabled:!g,open:Z,ref:se,onComplete(){Z||st()}}),f.useImperativeHandle(g,()=>({unmount:st}),[st]);const Re=ie((Oe,xe)=>{o?.(Oe,xe),!xe.isCanceled&&G(Oe)}),Te=ie(()=>{const Oe=F.state.listElement||se.current;if(!Oe)return;const xe=Cp(Oe.scrollHeight,Oe.clientHeight),Ne=t1(Oe.scrollTop,xe),Me=Ne>0,Xe=Ne<xe;F.state.scrollUpArrowVisible!==Me&&F.set("scrollUpArrowVisible",Me),F.state.scrollDownArrowVisible!==Xe&&F.set("scrollDownArrowVisible",Xe)}),Ue=Ad({open:Z,onOpenChange:nt,elements:{reference:te,floating:ye}}),Be=Ia(Ue,{enabled:!p&&!B,event:"mousedown"}),ct=ka(Ue,{bubbles:!1}),Ye=zw(Ue,{enabled:!p&&!B,listRef:K,activeIndex:Q,selectedIndex:ne,disabledIndices:tl,onNavigate(Oe){Oe===null&&!Z||F.set("activeIndex",Oe)},focusItemOnHover:T}),Ut=jw(Ue,{enabled:!p&&!B&&(Z||!S),listRef:J,activeIndex:Q,selectedIndex:ne,onMatch(Oe){Z?F.set("activeIndex",Oe):Re(me.current[Oe],Ae("none"))},onTypingChange(Oe){ge.current=Oe}}),{getReferenceProps:$t,getFloatingProps:Ke,getItemProps:q}=bo([Be,ct,Ye,Ut]),re=f.useMemo(()=>En($t(),L,j?{id:j}:mt),[$t,L,j]);ja(()=>{F.update({popupProps:Ke(),triggerProps:re})}),he(()=>{F.update({id:j,modal:m,multiple:S,value:W,open:Z,mounted:ue,transitionStatus:R,popupProps:Ke(),triggerProps:re,items:C,itemToStringLabel:E,itemToStringValue:b,isItemEqualToValue:x,openMethod:Ee})},[F,j,m,S,W,Z,ue,R,Ke,re,C,E,b,x,Ee]);const be=f.useMemo(()=>({store:F,name:U,required:h,disabled:B,readOnly:p,multiple:S,highlightItemOnHover:T,setValue:Re,setOpen:nt,listRef:K,popupRef:se,scrollHandlerRef:ae,handleScrollArrowVisibility:Te,scrollArrowsMountedCountRef:pe,getItemProps:q,events:Ue.context.events,valueRef:Y,valuesRef:me,labelsRef:J,typingRef:ge,selectionRef:ce,selectedItemTextRef:le,validation:M,onOpenChangeComplete:y,keyboardActiveRef:fe,alignItemWithTriggerActiveRef:ve,initialValueRef:He}),[F,U,h,B,p,S,T,Re,nt,q,Ue.context.events,M,y,Te]),Le=or(v,M.inputRef),je=S&&Array.isArray(W)&&W.length>0,De=S?void 0:U,Qe=f.useMemo(()=>!S||!Array.isArray(W)||!U?null:W.map(Oe=>{const xe=Hr(Oe,b);return w.jsx("input",{type:"hidden",form:u,name:U,value:xe},xe)}),[S,W,u,U,b]);return w.jsx(Ec.Provider,{value:be,children:w.jsxs(xc.Provider,{value:Ue,children:[P,w.jsx("input",{...M.getInputValidationProps({onFocus(){F.state.triggerElement?.focus({focusVisible:!0})},onChange(Oe){if(Oe.nativeEvent.defaultPrevented)return;const xe=Oe.currentTarget.value,Ne=Ae(cr,Oe.nativeEvent);function Me(){if(S)return;const Xe=me.current.find(Je=>Hr(Je,b).toLowerCase()===xe.toLowerCase()||ZS(Je,E).toLowerCase()===xe.toLowerCase());Xe!=null&&(I(Xe!==N.initialValue),Re(Xe,Ne),V()&&M.commit(Xe))}F.set("forceMount",!0),queueMicrotask(Me)}}),id:j&&De==null?`${j}-hidden-input`:void 0,form:u,name:De,autoComplete:l,value:Ce,disabled:B,required:h&&!je,readOnly:p,ref:Le,style:U?Al:ss,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Qe]})})}const Xs=2,r1=400,Op=200,o1={...Xd,...hr,value:()=>null},Pp=f.forwardRef(function(t,n){const{render:r,className:o,id:s,disabled:i=!1,nativeButton:a=!0,style:c,...u}=t,{setTouched:l,setFocused:d,validationMode:p,state:h,disabled:m}=mr(),{labelId:g}=Ln(),{store:v,setOpen:y,selectionRef:C,validation:S,readOnly:E,required:b,alignItemWithTriggerActiveRef:x,disabled:T,keyboardActiveRef:P}=Zr(),z=m||T||i,I=We(v,Ze.open),D=We(v,Ze.value),$=We(v,Ze.triggerProps),V=We(v,Ze.positionerElement),N=We(v,Ze.listElement),O=We(v,Ze.id),k=We(v,Ze.labelId),_=We(v,Ze.hasSelectedValue),M=!_&&I,A=We(v,Ze.hasNullItemLabel,M),j=s??O,B=XS(g,k);rc({id:j});const U=vt(V),W=f.useRef(null),{getButtonProps:G,buttonRef:Z}=Lr({disabled:z,native:a}),X=ie(fe=>{v.set("triggerElement",fe)}),K=or(n,W,Z,X),J=Gt(),se=Gt(),ae=Gt(),pe=Gt();f.useEffect(()=>{if(I)return!(_||A)?ae.start(r1,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):pe.start(Op,()=>{C.current.allowUnselectedMouseUp=!0,ae.start(Op,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{ae.clear(),pe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},se.clear()},[I,_,A,C,se,ae,pe]);const Y=f.useMemo(()=>N?.id??lo(V)?.id,[N,V]),me=En($,{id:j,role:"combobox","aria-expanded":I?"true":"false","aria-haspopup":"listbox","aria-controls":I?Y:void 0,"aria-labelledby":B,"aria-readonly":E||void 0,"aria-required":b||void 0,tabIndex:z?-1:0,ref:K,onFocus(fe){d(!0),I&&x.current&&y(!1,Ae(cr,fe.nativeEvent)),J.start(0,()=>{v.set("forceMount",!0)})},onBlur(fe){we(V,fe.relatedTarget)||(l(!0),d(!1),p==="onBlur"&&S.commit(D))},onPointerMove(){P.current=!1},onKeyDown(){P.current=!0},onMouseDown(fe){if(I)return;const le=Ie(fe.currentTarget);function ce(ve){if(!W.current)return;const ue=ve.target;if(we(W.current,ue)||we(U.current,ue)||ue===W.current)return;const Se=YS(W.current);ve.clientX>=Se.left-Xs&&ve.clientX<=Se.right+Xs&&ve.clientY>=Se.top-Xs&&ve.clientY<=Se.bottom+Xs||y(!1,Ae(O0,ve))}se.start(0,()=>{le.addEventListener("mouseup",ce,{once:!0})})}},S.getValidationProps,u,G);me.role="combobox";const ge={...h,open:I,disabled:z,value:D,readOnly:E,placeholder:!_};return qe("button",t,{ref:[n,W],state:ge,stateAttributesMapping:o1,props:me})});process.env.NODE_ENV!=="production"&&(Pp.displayName="SelectTrigger");const _p=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(_p.displayName="SelectPortalContext");const Ip=f.forwardRef(function(t,n){const{store:r}=Zr(),o=We(r,Ze.mounted),s=We(r,Ze.forceMount);return o||s?w.jsx(_p.Provider,{value:!0,children:w.jsx(hs,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(Ip.displayName="SelectPortal");const Cc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Cc.displayName="SelectPositionerContext");function s1(){const e=f.useContext(Cc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":ft(59));return e}function qs(e,t){e&&Object.assign(e.style,t)}const i1={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},a1={position:"fixed"},kp=f.forwardRef(function(t,n){const{anchor:r,positionMethod:o="absolute",className:s,render:i,side:a="bottom",align:c="center",sideOffset:u=0,alignOffset:l=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p,arrowPadding:h=5,sticky:m=!1,disableAnchorTracking:g,alignItemWithTrigger:v=!0,collisionAvoidance:y=d0,style:C,...S}=t,{store:E,listRef:b,labelsRef:x,alignItemWithTriggerActiveRef:T,selectedItemTextRef:P,valuesRef:z,initialValueRef:I,popupRef:D,setValue:$}=Zr(),V=Tp(),N=We(E,Ze.open),O=We(E,Ze.mounted),k=We(E,Ze.modal),_=We(E,Ze.value),M=We(E,Ze.openMethod),A=We(E,Ze.positionerElement),j=We(E,Ze.triggerElement),B=We(E,Ze.isItemEqualToValue),U=We(E,Ze.transitionStatus),W=f.useRef(null),G=f.useRef(null),[Z,X]=f.useState(v),K=O&&Z&&M!=="touch";!O&&Z!==v&&X(v),he(()=>{O||(Ze.scrollUpArrowVisible(E.state)&&E.set("scrollUpArrowVisible",!1),Ze.scrollDownArrowVisible(E.state)&&E.set("scrollDownArrowVisible",!1))},[E,O]),f.useImperativeHandle(T,()=>K),Pf((K||k)&&N,M==="touch",A,j);const J=Zd({anchor:r,floatingRootContext:V,positionMethod:o,mounted:O,side:a,sideOffset:u,align:c,alignOffset:l,arrowPadding:h,collisionBoundary:d,collisionPadding:p,sticky:m,disableAnchorTracking:g??K,collisionAvoidance:y,keepMounted:!0}),se=K?"none":J.side,ae=K?a1:J.positionerStyles,pe={open:N,side:se,align:J.align,anchorHidden:J.anchorHidden},Y=ie(ce=>{E.set("positionerElement",ce)}),me=qd(t,pe,{styles:ae,transitionStatus:U,props:S,refs:[n,Y],hidden:!O,inert:!N}),ge=f.useRef(0),fe=ie(ce=>{if(ce.size===0&&ge.current===0||z.current.length===0)return;const ve=ge.current;if(ge.current=ce.size,ce.size===ve)return;const ue=Ae(cr);if(ve!==0&&!E.state.multiple&&_!==null&&xo(z.current,_,B)===-1){const R=I.current,L=R!=null&&xo(z.current,R,B)!==-1?R:null;$(L,ue),L===null&&(E.set("selectedIndex",null),P.current=null)}if(ve!==0&&E.state.multiple&&Array.isArray(_)){const Se=H=>xo(z.current,H,B)!==-1,R=_.filter(H=>Se(H));(R.length!==_.length||R.some(H=>!HS(_,H,B)))&&($(R,ue),R.length===0&&(E.set("selectedIndex",null),P.current=null))}if(N&&K){E.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Se={height:""};qs(A,Se),qs(D.current,Se)}}),le=f.useMemo(()=>({...J,side:se,alignItemWithTriggerActive:K,setControlledAlignItemWithTrigger:X,scrollUpArrowRef:W,scrollDownArrowRef:G}),[J,se,K,X]);return w.jsx(vS,{elementsRef:b,labelsRef:x,onMapChange:fe,children:w.jsxs(Cc.Provider,{value:le,children:[O&&k&&w.jsx(Ls,{inert:cs(!N),cutout:j}),me]})})});process.env.NODE_ENV!=="production"&&(kp.displayName="SelectPositioner");const c1={...Cn,...tn},Rp=f.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:i,...a}=t,{store:c,popupRef:u,onOpenChangeComplete:l,setOpen:d,valueRef:p,selectedItemTextRef:h,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:v,scrollHandlerRef:y,listRef:C,highlightItemOnHover:S}=Zr(),{side:E,align:b,alignItemWithTriggerActive:x,isPositioned:T,setControlledAlignItemWithTrigger:P,scrollDownArrowRef:z,scrollUpArrowRef:I}=s1(),D=Mf()!=null,$=Tp(),V=Ud(),{nonce:N,disableStyleElements:O}=lE(),k=We(c,Ze.id),_=We(c,Ze.open),M=We(c,Ze.mounted),A=We(c,Ze.popupProps),j=We(c,Ze.transitionStatus),B=We(c,Ze.triggerElement),U=We(c,Ze.positionerElement),W=We(c,Ze.listElement),G=f.useRef(!1),Z=f.useRef(!1),X=f.useRef({}),K=ao(),J=ie(Y=>{if(!U||!u.current||!Z.current)return;if(G.current||!x){v();return}const me=U.style.top==="0px",ge=U.style.bottom==="0px";if(!me&&!ge){v();return}const fe=Mp(U),le=Oo(U.getBoundingClientRect().height,"y",fe),ce=Ie(U),ve=getComputedStyle(U),ue=parseFloat(ve.marginTop),Se=parseFloat(ve.marginBottom),R=Np(getComputedStyle(u.current)),H=Math.min(ce.documentElement.clientHeight-ue-Se,R),L=Y.scrollTop,F=Ks(Y);let Q=0,ne=null,te=!1,ye=!1;const _e=Ve=>{U.style.height=`${Ve}px`},Ee=(Ve,Ge)=>{const He=bt(Ve,0,H-le);He>0&&_e(le+He),Y.scrollTop=Ge,H-(le+He)<=zn&&(G.current=!0),v()},Ce=me?F-L:L,Pe=Math.min(le+Ce,H);if(Q=Pe,Ce<=zn){Ee(Ce,me?F:0);return}if(H-Pe>zn)me?ye=!0:ne=0;else if(te=!0,ge&&L<F){const Ve=le+Ce-H;ne=L-(Ce-Ve)}if(Q=Math.ceil(Q),Q!==0&&_e(Q),ye||ne!=null){const Ve=Ks(Y),Ge=ye?Ve:bt(ne,0,Ve);Math.abs(Y.scrollTop-Ge)>zn&&(Y.scrollTop=Ge)}(te||Q>=H-zn)&&(G.current=!0),v()});f.useImperativeHandle(y,()=>J,[J]),xn({open:_,ref:u,onComplete(){_&&l?.(!0)}});const se={open:_,transitionStatus:j,side:E,align:b};he(()=>{!U||!u.current||Object.keys(X.current).length||(X.current={top:U.style.top||"0",left:U.style.left||"0",right:U.style.right,height:U.style.height,bottom:U.style.bottom,minHeight:U.style.minHeight,maxHeight:U.style.maxHeight,marginTop:U.style.marginTop,marginBottom:U.style.marginBottom})},[u,U]),he(()=>{_||x||(Z.current=!1,G.current=!1,qs(U,X.current))},[_,x,U,u]),he(()=>{const Y=u.current;if(!_||!B||!U||!Y||x&&!T||c.state.transitionStatus==="ending")return;if(!x){Z.current=!0,K.request(v),Y.style.removeProperty("--transform-origin");return}const me=u1(Y);Y.style.removeProperty("--transform-origin");try{const ge=h.current,fe=p.current,le=getComputedStyle(U),ce=getComputedStyle(Y),ve=Ie(B),ue=tt(U),Se=Mp(B),R=Js(B.getBoundingClientRect(),Se),H=Js(U.getBoundingClientRect(),Se),L=R.height,F=W||Y,Q=F.scrollHeight,ne=parseFloat(ce.borderBottomWidth),te=parseFloat(le.marginTop)||10,ye=parseFloat(le.marginBottom)||10,_e=parseFloat(le.minHeight)||100,Ee=Np(ce),Ce=5,Pe=5,Ve=20,Ge=ve.documentElement.clientHeight-te-ye,He=ve.documentElement.clientWidth,nt=Ge-R.bottom+L;let st,Re=V==="rtl"?R.right-H.width:R.left,Te=0;if(ge&&fe){const Le=Js(fe.getBoundingClientRect(),Se);st=Js(ge.getBoundingClientRect(),Se),Re=H.left+(V==="rtl"?Le.right-st.right:Le.left-st.left);const je=Le.top-R.top+Le.height/2;Te=st.top-H.top+st.height/2-je}const Ue=nt+Te+ye+ne;let Be=Math.min(Ge,Ue);const ct=Ge-te-ye,Ye=Ue-Be,Ut=He-Pe;U.style.left=`${bt(Re,Ce,Ut-H.width)}px`,U.style.height=`${Be}px`,U.style.maxHeight="auto",U.style.marginTop=`${te}px`,U.style.marginBottom=`${ye}px`,Y.style.height="100%";const $t=Ks(F),Ke=Ye>=$t-zn;Ke&&(Be=Math.min(Ge,H.height)-(Ye-$t));const q=R.top<Ve||R.bottom>Ge-Ve||Math.ceil(Be)+zn<Math.min(Q,_e),re=(ue.visualViewport?.scale??1)!==1&&Gi;if(q||re){Z.current=!0,qs(U,X.current),P(!1);return}const be=Math.max(_e,Be);if(Ke){const Le=Math.max(0,Ge-Ue);U.style.top=H.height>=ct?"0":`${Le}px`,U.style.height=`${Be}px`,F.scrollTop=Ks(F)}else U.style.bottom="0",F.scrollTop=Ye;if(st){const Le=H.top,je=H.height,De=st.top+st.height/2,Qe=je>0?(De-Le)/je*100:50,Oe=bt(Qe,0,100);Y.style.setProperty("--transform-origin",`50% ${Oe}%`)}(be===Ge||Be>=Ee)&&(G.current=!0),v(),S&&c.state.selectedIndex===null&&c.state.activeIndex===null&&C.current[0]!=null&&c.set("activeIndex",0),Z.current=!0}finally{me()}},[c,_,U,B,p,h,u,v,x,P,K,z,I,W,C,S,V,T]),f.useEffect(()=>{if(!x||!U||!_)return;const Y=tt(U);function me(ge){d(!1,Ae(P0,ge))}return Fe(Y,"resize",me)},[d,x,U,_]);const ae={...W?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${k}-list`},onKeyDown(Y){m.current=!0,D&&Ms.has(Y.key)&&Y.stopPropagation()},onMouseMove(){m.current=!1},onScroll(Y){W||J(Y.currentTarget)},...x&&{style:W?{height:"100%"}:i1}},pe=qe("div",t,{ref:[n,u],state:se,stateAttributesMapping:c1,props:[A,ae,Va(j),{className:!W&&x?Sc.className:void 0},a]});return w.jsxs(f.Fragment,{children:[!O&&Sc.getElement(N),w.jsx(ms,{context:$,modal:!1,disabled:!M,returnFocus:i,restoreFocus:!0,children:pe})]})});process.env.NODE_ENV!=="production"&&(Rp.displayName="SelectPopup");function Np(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ks(e){return Cp(e.scrollHeight,e.clientHeight)}function Mp(e){return Cd.getScale(e)}function Oo(e,t,n){return e/n[t]}function Js(e,t){return po({x:Oo(e.x,"x",t),y:Oo(e.y,"y",t),width:Oo(e.width,"x",t),height:Oo(e.height,"y",t)})}const Ap=[["transform","none"],["scale","1"],["translate","0 0"]];function u1(e){const{style:t}=e,n={};for(const[r,o]of Ap)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[r]of Ap){const o=n[r];o?t.setProperty(r,o):t.removeProperty(r)}}}const Tc=f.createContext(void 0);process.env.NODE_ENV!=="production"&&(Tc.displayName="SelectItemContext");function Oc(){const e=f.useContext(Tc);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":ft(57));return e}const Dp=f.memo(f.forwardRef(function(t,n){const{render:r,className:o,value:s=null,label:i,disabled:a=!1,nativeButton:c=!1,style:u,...l}=t,d=f.useRef(null),p=ES({label:i,textRef:d,indexGuessBehavior:pf.GuessFromOrder}),{store:h,getItemProps:m,setOpen:g,setValue:v,selectionRef:y,typingRef:C,valuesRef:S,multiple:E,selectedItemTextRef:b}=Zr(),x=We(h,Ze.isActive,p.index),T=We(h,Ze.isSelected,p.index,s),P=We(h,Ze.isSelectedByFocus,p.index),z=We(h,Ze.isItemEqualToValue),I=p.index,D=I!==-1,$=f.useRef(null),V=vt(I);he(()=>{if(!D)return;const Z=S.current;return Z[I]=s,()=>{delete Z[I]}},[D,I,s,S]),he(()=>{if(!D)return;const Z=h.state.value;let X=Z;E&&Array.isArray(Z)&&Z.length>0&&(X=Z[Z.length-1]),X!==void 0&&jr(s,X,z)&&(h.set("selectedIndex",I),d.current&&(b.current=d.current))},[D,I,E,z,h,s,b]);const N={disabled:a,selected:T,highlighted:x},O=m({active:x,selected:T});O.id=void 0;const k=f.useRef(null),_=f.useRef("mouse"),M=f.useRef(!1),{getButtonProps:A,buttonRef:j}=Lr({disabled:a,focusableWhenDisabled:!0,native:c,composite:!0});function B(Z){const X=h.state.value;if(E){const K=Array.isArray(X)?X:[],J=T?US(K,s,z):[...K,s];v(J,Ae(va,Z))}else v(s,Ae(va,Z)),g(!1,Ae(va,Z))}const U={role:"option","aria-selected":T,tabIndex:x?0:-1,onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(Z){k.current=Z.key,h.set("activeIndex",I),Z.key===" "&&C.current&&Z.preventDefault()},onClick(Z){M.current=!1,!(Z.type==="keydown"&&k.current===null)&&(a||Z.type==="keydown"&&k.current===" "&&C.current||_.current!=="touch"&&!x||(k.current=null,B(Z.nativeEvent)))},onPointerEnter(Z){_.current=Z.pointerType},onPointerDown(Z){_.current=Z.pointerType,M.current=!0},onMouseUp(){if(a)return;if(M.current){M.current=!1;return}const Z=!y.current.allowSelectedMouseUp&&T,X=!y.current.allowUnselectedMouseUp&&!T;Z||X||_.current!=="touch"&&!x||$.current?.click()}},W=qe("div",t,{ref:[j,n,p.ref,$],state:N,props:[O,U,l,A]}),G=f.useMemo(()=>({selected:T,indexRef:V,textRef:d,selectedByFocus:P,hasRegistered:D}),[T,V,d,P,D]);return w.jsx(Tc.Provider,{value:G,children:W})}));process.env.NODE_ENV!=="production"&&(Dp.displayName="SelectItem");const Lp=f.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=Oc();return r||o?w.jsx(Fp,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Lp.displayName="SelectItemIndicator");const Fp=f.memo(f.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:s,...i}=e,{selected:a}=Oc(),c=f.useRef(null),{transitionStatus:u,setMounted:l}=vo(a),p=qe("span",e,{ref:[t,c],state:{selected:a,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:tn});return xn({open:a,ref:c,onComplete(){a||l(!1)}}),p}));process.env.NODE_ENV!=="production"&&(Fp.displayName="Inner");const Vp=f.memo(f.forwardRef(function(t,n){const{indexRef:r,textRef:o,selectedByFocus:s,hasRegistered:i}=Oc(),{selectedItemTextRef:a}=Zr(),{className:c,render:u,style:l,...d}=t,p=f.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 qe("div",t,{ref:[p,n,o],props:d})}));process.env.NODE_ENV!=="production"&&(Vp.displayName="SelectItemText");function Rt({as:e,children:t,className:n,disabled:r,...o}){const s=e||"button",i=s==="button";return w.jsx(s,{className:Mi("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 l1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),d1=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),zp=e=>{const t=d1(e);return t.charAt(0).toUpperCase()+t.slice(1)},$p=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),f1=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var p1={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 h1=oe.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},c)=>oe.createElement("svg",{ref:c,...p1,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$p("lucide",o),...!s&&!f1(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,l])=>oe.createElement(u,l)),...Array.isArray(s)?s:[s]]));const $n=(e,t)=>{const n=oe.forwardRef(({className:r,...o},s)=>oe.createElement(h1,{ref:s,iconNode:t,className:$p(`lucide-${l1(zp(e))}`,`lucide-${e}`,r),...o}));return n.displayName=zp(e),n};const Pc=$n("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const jp=$n("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const Hp=$n("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 Up=$n("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 m1=$n("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);const g1=$n("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 y1=$n("user-round",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);const v1=$n("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 Bp=$n("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function b1(e){return _t.get("/channel/game/role/mail-captcha",e)}function w1(e){return _t.get("/channel/game/role/auth",e)}function S1(e){return _t.post("/passport-api/v2/ztgame/auth/login",{account:e.account,password:e.password,channel_login:1,channel_id:6})}function E1(e){return _t.post("/passport-api/v2/sms-captchas",{mobile:e.mobile,type:e.type||"register",is_voice:0,nationcode:e.countryCode})}function x1(e){return _t.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 Wp(){return _t.post("/passport-api/v2/ztgame/auth/auth",{channel_login:1,channel_id:6})}function C1(e){return _t.post(`/passport-api/v2/ztgame/users/${e.uid}/idcard`,{name:e.name,idcard:e.idcard},{headers:{Authentication:e.authorization}})}function T1(e){return _t.post("/passport-api/v2/ztgame/auth/re-auth",{type:"auth",channel_id:6,ad_id:"",channel_login:1},{headers:{Authentication:e}})}function O1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/",e)}function P1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/sms-captchas",e)}function Zp(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-keys",e)}function _1(e){return _t.post("/passport-api/v2/ztgame/user-center/forget-password/forget-password-update",e)}const I1="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 k1(e){return w.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 500 500",...e,children:[w.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"}),w.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"}),w.jsx("defs",{children:w.jsxs("linearGradient",{id:"a",x1:250,x2:250,y1:0,y2:500,gradientUnits:"userSpaceOnUse",children:[w.jsx("stop",{stopColor:"#497EFE"}),w.jsx("stop",{offset:1,stopColor:"#947AFA"})]})})]})}function Qs(){const{gameId:e,loginTypes:t,currentLoginType:n,setCurrentLoginType:r}=Dn(),o=tf({loginTypes:t,gameId:e}),s=nf({loginTypes:t,gameId:e}),i=ef({loginTypes:t,gameId:e}),a=[];return i&&n!==at.GIANT&&a.push({type:at.GIANT,label:e==="5327"?"账号密码登录":"巨人账号",icon:e==="5327"?null:w.jsx("img",{className:"size-4",src:I1})}),s&&n!==at.MOBILE&&a.push({type:at.MOBILE,label:"手机号登录",icon:w.jsx(m1,{className:"size-4"})}),o&&n!==at.ROLE_ID&&a.push({type:at.ROLE_ID,label:"ID 登录",icon:w.jsx(k1,{className:"size-4"})}),n!=="quick"&&$r(e).length>0&&a.push({type:"quick",label:"快捷登录",icon:w.jsx(v1,{className:"size-4"})}),a.length?w.jsx("div",{className:"text-gray-500 text-xs flex justify-center items-center gap-2 mb-4",children:a.map((c,u)=>w.jsxs(Rt,{className:"h-7 px-3 border rounded-full border-gray-300 gap-1.5",onClick:()=>r(c.type),children:[c.icon,w.jsx("span",{children:c.label})]},c.type))}):null}function R1(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 90 90",fill:"currentColor",...e,children:w.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 N1(e){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",fill:"currentColor",...e,children:w.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 _c,Gp;function M1(){if(Gp)return _c;Gp=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 Ho=="object"&&Ho&&Ho.Object===Object&&Ho,u=typeof self=="object"&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),d=Object.prototype,p=d.toString,h=Math.max,m=Math.min,g=function(){return l.Date.now()};function v(b,x,T){var P,z,I,D,$,V,N=0,O=!1,k=!1,_=!0;if(typeof b!="function")throw new TypeError(e);x=E(x)||0,y(T)&&(O=!!T.leading,k="maxWait"in T,I=k?h(E(T.maxWait)||0,x):I,_="trailing"in T?!!T.trailing:_);function M(K){var J=P,se=z;return P=z=void 0,N=K,D=b.apply(se,J),D}function A(K){return N=K,$=setTimeout(U,x),O?M(K):D}function j(K){var J=K-V,se=K-N,ae=x-J;return k?m(ae,I-se):ae}function B(K){var J=K-V,se=K-N;return V===void 0||J>=x||J<0||k&&se>=I}function U(){var K=g();if(B(K))return W(K);$=setTimeout(U,j(K))}function W(K){return $=void 0,_&&P?M(K):(P=z=void 0,D)}function G(){$!==void 0&&clearTimeout($),N=0,P=V=z=$=void 0}function Z(){return $===void 0?D:W(g())}function X(){var K=g(),J=B(K);if(P=arguments,z=this,V=K,J){if($===void 0)return A(V);if(k)return $=setTimeout(U,x),M(V)}return $===void 0&&($=setTimeout(U,x)),D}return X.cancel=G,X.flush=Z,X}function y(b){var x=typeof b;return!!b&&(x=="object"||x=="function")}function C(b){return!!b&&typeof b=="object"}function S(b){return typeof b=="symbol"||C(b)&&p.call(b)==n}function E(b){if(typeof b=="number")return b;if(S(b))return t;if(y(b)){var x=typeof b.valueOf=="function"?b.valueOf():b;b=y(x)?x+"":x}if(typeof b!="string")return b===0?b:+b;b=b.replace(r,"");var T=s.test(b);return T||i.test(b)?a(b.slice(2),T?2:8):o.test(b)?t:+b}return _c=v,_c}M1();function A1(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[t,n]=oe.useState(e),r=oe.useCallback(()=>{n(!0)},[]),o=oe.useCallback(()=>{n(!1)},[]),s=oe.useCallback(()=>{n(i=>!i)},[]);return{value:t,setValue:n,setTrue:r,setFalse:o,toggle:s}}var Yp=typeof window<"u"?oe.useLayoutEffect:oe.useEffect;function D1(e){const[t,n]=oe.useState(e),r=oe.useCallback(()=>{n(i=>i+1)},[]),o=oe.useCallback(()=>{n(i=>i-1)},[]),s=oe.useCallback(()=>{n(e)},[e]);return{count:t,increment:r,decrement:o,reset:s,setCount:n}}function L1(e,t){const n=oe.useRef(e);Yp(()=>{n.current=e},[e]),oe.useEffect(()=>{if(t===null)return;const r=setInterval(()=>{n.current()},t);return()=>{clearInterval(r)}},[t])}function F1({countStart:e,countStop:t=0,intervalMs:n=1e3,isIncrement:r=!1}){const{count:o,increment:s,decrement:i,reset:a}=D1(e),{value:c,setTrue:u,setFalse:l}=A1(!1),d=oe.useCallback(()=>{l(),a()},[l,a]),p=oe.useCallback(()=>{if(o===t){l();return}r?s():i()},[o,t,i,s,r,l]);return L1(p,c?n:null),[o,{startCountdown:u,stopCountdown:l,resetCountdown:d}]}var V1=typeof window>"u";function z1(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const r=a=>V1?t:window.matchMedia(a).matches,[o,s]=oe.useState(()=>n?r(e):t);function i(){s(r(e))}return Yp(()=>{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 Xp({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,zIndex:a,classNames:c}){return z1("(min-width: 1024px)")?w.jsxs(Wa,{open:o,onOpenChange:i,disablePointerDismissal:!0,children:[e&&w.jsx(zs,{className:c?.trigger,children:e}),w.jsxs(Fs,{children:[w.jsx(Za,{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"}),w.jsxs(Ka,{style:{zIndex:a},className:fr("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&&w.jsx(Vs,{className:fr("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Ya,{className:fr("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Ga,{className:"absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",children:w.jsx(Bp,{})}),w.jsx("div",{children:r})]})]})]}):w.jsxs(yE,{open:o,onOpenChange:i,children:[e&&w.jsx(kE,{className:c?.trigger,children:e}),w.jsxs(gE,{children:[w.jsx(Df,{style:{zIndex:a},className:fr("fixed inset-0 bg-black/70 transition-opacity duration-300 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-70 z-[990] backdrop-blur-sm",c?.backdrop)}),w.jsx(ep,{style:{zIndex:a},className:"fixed inset-0 z-[991]",children:w.jsx(Uf,{className:fr("fixed bottom-0 left-0 right-0 rounded-t-xl bg-white p-4 transition-transform duration-300 data-[starting-style]:translate-y-full data-[ending-style]:translate-y-full","[transform:translateY(var(--drawer-swipe-movement-y))]",c?.mobilePopup),children:w.jsxs(Ff,{children:[w.jsx("div",{"aria-hidden":!0,className:"mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-4"}),w.jsx(IE,{className:"sr-only",children:t}),w.jsx("div",{children:r})]})})})]})]})}function qp({checked:e,onChange:t}){const[n,r]=oe.useState(!1),[o,s]=oe.useState(!1);return w.jsxs("div",{children:[w.jsx(Xp,{title:"用户协议",open:n,onOpenChange:r,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/license-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),w.jsx(Xp,{title:"隐私政策",open:o,onOpenChange:s,zIndex:993,classNames:{desktopPopup:"w-[90vw] lg:w-[60vw]"},children:w.jsx("iframe",{src:"https://www.gatribe.com/privacy-light.html?channel_id=1&game_id=5327",className:"w-full h-[70vh]"})}),w.jsx(Wr,{name:"rememberLogin",children:w.jsxs(gc,{className:"flex items-center justify-center text-gray-500 text-xs md:text-sm",children:[w.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:w.jsx(ic,{children:w.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsx("span",{className:"ml-2",children:"我已详细阅读并同意"}),w.jsx(Rt,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>r(!0),type:"button",children:"《用户协议》"}),w.jsx("span",{children:"及"}),w.jsx(Rt,{className:"text-[var(--jssdk-primary-color)]",onClick:()=>s(!0),type:"button",children:"《隐私政策》"})]})})]})}function Po({trigger:e,title:t,description:n,children:r,open:o,showCloseIcon:s=!0,onOpenChange:i,disablePointerDismissal:a=!1,classNames:c}){return w.jsxs(Wa,{open:o,onOpenChange:i,disablePointerDismissal:a,children:[e&&w.jsx(zs,{className:c?.trigger,children:e}),w.jsxs(Fs,{children:[w.jsx(Za,{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}),w.jsxs(Ka,{className:St("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&&w.jsx(Vs,{className:St("-mt-1.5 mb-1 text-lg font-medium",c?.title),children:t}),n&&w.jsx(Ya,{className:St("mb-6 text-base text-gray-600",c?.description),children:n}),s&&w.jsx(Ga,{className:St("absolute right-4 top-4 text-gray-700 hover:bg-gray-200 rounded p-0.5",c?.close),children:w.jsx(Bp,{})}),w.jsx("div",{children:r})]})]})]})}function Tn({name:e,prefix:t,suffix:n,className:r,inputClassName:o,error:s,...i}){return w.jsxs(Wr,{name:e,className:"group",children:[w.jsxs("div",{className:St("flex items-center border border-[var(--jssdk-input-border-color)] group-data-[focused]:border-[var(--jssdk-primary-color)] group-data-[focused]:shadow-[0_0_6px_color-mix(in_srgb,var(--jssdk-primary-color),transparent_80%)] rounded-full bg-white px-3 gap-2 h-12 transition-all duration-200",s&&"border-red-500",r),children:[t,w.jsx(Gs,{className:St("flex-1 w-0 outline-none rounded-full h-full pl-1",o),...i}),n]}),w.jsx(Zs,{className:"text-red-500 text-xs mt-1 ml-3"})]})}function $1({account:e,forgetPasswordKey:t,onSuccess:n}){const[r,o]=oe.useState(""),[s,i]=oe.useState(!1),{mutate:a,isPending:c}=sn({mutationFn:()=>_1({account:e,forget_password_key:t,password:r}),onSuccess:l=>{l?.code===0||!l?.error?n():gt.warning(l.detail||l.error||"重置失败")}}),u=()=>{if(!r){gt.warning("请输入新密码");return}if(r.length<6||r.length>18){gt.warning("密码长度需要在6-18位之间");return}a()};return w.jsxs("div",{className:"space-y-4",children:[w.jsx("div",{className:"text-sm text-gray-500 mb-4 text-center",children:"请设置新的登录密码"}),w.jsx(Tn,{name:"password",type:s?"text":"password",autoComplete:"off",inputClassName:"placeholder:text-sm",placeholder:"请输入6-18位由数字、字母组成的密码",value:r,autoFocus:!0,onValueChange:l=>o(l),suffix:w.jsx(Rt,{onClick:()=>i(!s),type:"button",children:s?w.jsx(Up,{className:"size-5 text-gray-400"}):w.jsx(Hp,{className:"size-5 text-gray-400"})})}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:u,disabled:!r||c,children:c?"重置中...":"确定修改"})]})}var j1=function(e){return typeof e=="number"};function H1(e){var t=oe.useRef(e);return t.current=e,t}var ei={exports:{}},U1=ei.exports,Kp;function B1(){return Kp||(Kp=1,(function(e,t){(function(n,r){e.exports=r()})(U1,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",i="second",a="minute",c="hour",u="day",l="week",d="month",p="quarter",h="year",m="date",g="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,C={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(N){var O=["th","st","nd","rd"],k=N%100;return"["+N+(O[(k-20)%10]||O[k]||O[0])+"]"}},S=function(N,O,k){var _=String(N);return!_||_.length>=O?N:""+Array(O+1-_.length).join(k)+N},E={s:S,z:function(N){var O=-N.utcOffset(),k=Math.abs(O),_=Math.floor(k/60),M=k%60;return(O<=0?"+":"-")+S(_,2,"0")+":"+S(M,2,"0")},m:function N(O,k){if(O.date()<k.date())return-N(k,O);var _=12*(k.year()-O.year())+(k.month()-O.month()),M=O.clone().add(_,d),A=k-M<0,j=O.clone().add(_+(A?-1:1),d);return+(-(_+(k-M)/(A?M-j:j-M))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:d,y:h,w:l,d:u,D:m,h:c,m:a,s:i,ms:s,Q:p}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},b="en",x={};x[b]=C;var T="$isDayjsObject",P=function(N){return N instanceof $||!(!N||!N[T])},z=function N(O,k,_){var M;if(!O)return b;if(typeof O=="string"){var A=O.toLowerCase();x[A]&&(M=A),k&&(x[A]=k,M=A);var j=O.split("-");if(!M&&j.length>1)return N(j[0])}else{var B=O.name;x[B]=O,M=B}return!_&&M&&(b=M),M||!_&&b},I=function(N,O){if(P(N))return N.clone();var k=typeof O=="object"?O:{};return k.date=N,k.args=arguments,new $(k)},D=E;D.l=z,D.i=P,D.w=function(N,O){return I(N,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var $=(function(){function N(k){this.$L=z(k.locale,null,!0),this.parse(k),this.$x=this.$x||k.x||{},this[T]=!0}var O=N.prototype;return O.parse=function(k){this.$d=(function(_){var M=_.date,A=_.utc;if(M===null)return new Date(NaN);if(D.u(M))return new Date;if(M instanceof Date)return new Date(M);if(typeof M=="string"&&!/Z$/i.test(M)){var j=M.match(v);if(j){var B=j[2]-1||0,U=(j[7]||"0").substring(0,3);return A?new Date(Date.UTC(j[1],B,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)):new Date(j[1],B,j[3]||1,j[4]||0,j[5]||0,j[6]||0,U)}}return new Date(M)})(k),this.init()},O.init=function(){var k=this.$d;this.$y=k.getFullYear(),this.$M=k.getMonth(),this.$D=k.getDate(),this.$W=k.getDay(),this.$H=k.getHours(),this.$m=k.getMinutes(),this.$s=k.getSeconds(),this.$ms=k.getMilliseconds()},O.$utils=function(){return D},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function(k,_){var M=I(k);return this.startOf(_)<=M&&M<=this.endOf(_)},O.isAfter=function(k,_){return I(k)<this.startOf(_)},O.isBefore=function(k,_){return this.endOf(_)<I(k)},O.$g=function(k,_,M){return D.u(k)?this[_]:this.set(M,k)},O.unix=function(){return Math.floor(this.valueOf()/1e3)},O.valueOf=function(){return this.$d.getTime()},O.startOf=function(k,_){var M=this,A=!!D.u(_)||_,j=D.p(k),B=function(se,ae){var pe=D.w(M.$u?Date.UTC(M.$y,ae,se):new Date(M.$y,ae,se),M);return A?pe:pe.endOf(u)},U=function(se,ae){return D.w(M.toDate()[se].apply(M.toDate("s"),(A?[0,0,0,0]:[23,59,59,999]).slice(ae)),M)},W=this.$W,G=this.$M,Z=this.$D,X="set"+(this.$u?"UTC":"");switch(j){case h:return A?B(1,0):B(31,11);case d:return A?B(1,G):B(0,G+1);case l:var K=this.$locale().weekStart||0,J=(W<K?W+7:W)-K;return B(A?Z-J:Z+(6-J),G);case u:case m:return U(X+"Hours",0);case c:return U(X+"Minutes",1);case a:return U(X+"Seconds",2);case i:return U(X+"Milliseconds",3);default:return this.clone()}},O.endOf=function(k){return this.startOf(k,!1)},O.$set=function(k,_){var M,A=D.p(k),j="set"+(this.$u?"UTC":""),B=(M={},M[u]=j+"Date",M[m]=j+"Date",M[d]=j+"Month",M[h]=j+"FullYear",M[c]=j+"Hours",M[a]=j+"Minutes",M[i]=j+"Seconds",M[s]=j+"Milliseconds",M)[A],U=A===u?this.$D+(_-this.$W):_;if(A===d||A===h){var W=this.clone().set(m,1);W.$d[B](U),W.init(),this.$d=W.set(m,Math.min(this.$D,W.daysInMonth())).$d}else B&&this.$d[B](U);return this.init(),this},O.set=function(k,_){return this.clone().$set(k,_)},O.get=function(k){return this[D.p(k)]()},O.add=function(k,_){var M,A=this;k=Number(k);var j=D.p(_),B=function(G){var Z=I(A);return D.w(Z.date(Z.date()+Math.round(G*k)),A)};if(j===d)return this.set(d,this.$M+k);if(j===h)return this.set(h,this.$y+k);if(j===u)return B(1);if(j===l)return B(7);var U=(M={},M[a]=r,M[c]=o,M[i]=n,M)[j]||1,W=this.$d.getTime()+k*U;return D.w(W,this)},O.subtract=function(k,_){return this.add(-1*k,_)},O.format=function(k){var _=this,M=this.$locale();if(!this.isValid())return M.invalidDate||g;var A=k||"YYYY-MM-DDTHH:mm:ssZ",j=D.z(this),B=this.$H,U=this.$m,W=this.$M,G=M.weekdays,Z=M.months,X=M.meridiem,K=function(ae,pe,Y,me){return ae&&(ae[pe]||ae(_,A))||Y[pe].slice(0,me)},J=function(ae){return D.s(B%12||12,ae,"0")},se=X||function(ae,pe,Y){var me=ae<12?"AM":"PM";return Y?me.toLowerCase():me};return A.replace(y,(function(ae,pe){return pe||(function(Y){switch(Y){case"YY":return String(_.$y).slice(-2);case"YYYY":return D.s(_.$y,4,"0");case"M":return W+1;case"MM":return D.s(W+1,2,"0");case"MMM":return K(M.monthsShort,W,Z,3);case"MMMM":return K(Z,W);case"D":return _.$D;case"DD":return D.s(_.$D,2,"0");case"d":return String(_.$W);case"dd":return K(M.weekdaysMin,_.$W,G,2);case"ddd":return K(M.weekdaysShort,_.$W,G,3);case"dddd":return G[_.$W];case"H":return String(B);case"HH":return D.s(B,2,"0");case"h":return J(1);case"hh":return J(2);case"a":return se(B,U,!0);case"A":return se(B,U,!1);case"m":return String(U);case"mm":return D.s(U,2,"0");case"s":return String(_.$s);case"ss":return D.s(_.$s,2,"0");case"SSS":return D.s(_.$ms,3,"0");case"Z":return j}return null})(ae)||j.replace(":","")}))},O.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},O.diff=function(k,_,M){var A,j=this,B=D.p(_),U=I(k),W=(U.utcOffset()-this.utcOffset())*r,G=this-U,Z=function(){return D.m(j,U)};switch(B){case h:A=Z()/12;break;case d:A=Z();break;case p:A=Z()/3;break;case l:A=(G-W)/6048e5;break;case u:A=(G-W)/864e5;break;case c:A=G/o;break;case a:A=G/r;break;case i:A=G/n;break;default:A=G}return M?A:D.a(A)},O.daysInMonth=function(){return this.endOf(d).$D},O.$locale=function(){return x[this.$L]},O.locale=function(k,_){if(!k)return this.$L;var M=this.clone(),A=z(k,_,!0);return A&&(M.$L=A),M},O.clone=function(){return D.w(this.$d,this)},O.toDate=function(){return new Date(this.valueOf())},O.toJSON=function(){return this.isValid()?this.toISOString():null},O.toISOString=function(){return this.$d.toISOString()},O.toString=function(){return this.$d.toUTCString()},N})(),V=$.prototype;return I.prototype=V,[["$ms",s],["$s",i],["$m",a],["$H",c],["$W",u],["$M",d],["$y",h],["$D",m]].forEach((function(N){V[N[1]]=function(O){return this.$g(O,N[0],N[1])}})),I.extend=function(N,O){return N.$i||(N(O,$,I),N.$i=!0),I},I.locale=z,I.isDayjs=P,I.unix=function(N){return I(1e3*N)},I.en=x[b],I.Ls=x,I.p={},I}))})(ei)),ei.exports}var W1=B1();const Z1=zv(W1);var Ic=function(e){if(!e)return 0;var t=Z1(e).valueOf()-Date.now();return t<0?0:t},G1=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}},Jp=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=oe.useMemo(function(){return j1(n)&&n>0?Date.now()+n:void 0},[n]),c="leftTime"in e?a:r,u=Im(oe.useState(function(){return Ic(c)}),2),l=u[0],d=u[1],p=H1(i);oe.useEffect(function(){if(!c){d(0);return}d(Ic(c));var m=setInterval(function(){var g,v=Ic(c);d(v),v===0&&(clearInterval(m),(g=p.current)===null||g===void 0||g.call(p))},s);return function(){return clearInterval(m)}},[c,s]);var h=oe.useMemo(function(){return G1(l)},[l]);return[l,h]};function Y1({account:e,mobile:t,onNext:n}){const[r,o]=oe.useState(""),[s,i]=oe.useState(),[a]=Jp({leftTime:s?s*1e3:void 0,interval:1e3,onEnd(){i(void 0)}}),{mutate:c,isPending:u}=sn({mutationFn:()=>P1({account:e,type:"reset-password",is_voice:0,t:"ctoken"}),onSuccess:h=>{i(h.lock_time),gt.success("验证码已发送,请注意查收")}}),{mutate:l,isPending:d}=sn({mutationFn:()=>Zp({account:e,captcha:r,t:"reset-password"}),onSuccess:h=>{h?.forget_password_key?n(h.forget_password_key):gt.warning("安全验证失败")},onError:h=>{gt.warning(h?.message||h?.detail||"验证失败")}}),p=()=>{if(!r){gt.warning("请输入验证码");return}l()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入验证码,短信将发送至您的绑定手机"," ",w.jsx("span",{className:"font-semibold text-gray-700",children:t})]}),w.jsx(Tn,{name:"verificationCode",placeholder:"请输入验证码",value:r,type:"number",autoFocus:!0,onValueChange:h=>o(h),suffix:w.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:()=>c(),disabled:!!s||u,children:u?"发送中...":s?`${Math.round(a/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:p,disabled:d,children:d?"验证中...":"下一步"})]})}function X1({account:e,onNext:t}){const[n,r]=oe.useState(""),{mutate:o,isPending:s}=sn({mutationFn:()=>Zp({account:e,idcard:n,t:"reset-password"}),onSuccess:a=>{a?.forget_password_key?t(a.forget_password_key):gt.warning("安全验证失败")}}),i=()=>{if(!n){gt.warning("请输入身份证号");return}o()};return w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"该账号未绑定手机,请输入注册时填写的身份证信息"]}),w.jsx(Tn,{name:"idCard",placeholder:"请输入身份证号",value:n,autoFocus:!0,onChange:a=>r(a.currentTarget.value)}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:i,disabled:s,children:s?"验证中...":"下一步"})]})}function q1({onClose:e,defaultAccount:t=""}){const[n,r]=oe.useState("account"),[o,s]=oe.useState(t),[i,a]=oe.useState(""),[c,u]=oe.useState(2),[l,d]=oe.useState(""),p=oe.useRef(null);oe.useEffect(()=>{if(!window.captchaZtgame){const y=document.createElement("script");y.type="text/javascript",y.src=`//nocaptcha.ztgame.com/static/verify2023/js/captcha.js?t=${new Date().getTime()}`,y.id="captchaZtgameScript",document.body.appendChild(y)}},[]);const{mutate:h,isPending:m}=sn({mutationFn:async y=>O1({account:o,nonce:y.nonce,token:y.token,type:y.type,t:"ctoken"}),onSuccess:y=>{const C=y.type;u(C),a(C===2?y.mobile:""),r("secure"),p.current?.onRefresh?.()},onError:y=>{gt.warning(y?.message||y?.detail||"验证失败"),p.current?.onRefresh?.()}}),g=()=>{if(!o){gt.warning("请输入账号信息");return}window.captchaZtgame?window.captchaZtgame.init({appsceneid:"pt_login",usertype:"1",el:"captcha-forget-pwd",mode:"popup",styles:{width:300,height:150,fontSize:"14px"},popupStyles:{position:"fixed",top:"30%",left:"50%",zIndex:"99999"},onSuccess(y,C){p.current=y,h({nonce:y.nonce,token:C.data.token,type:y.type})},onLoad(y){p.current=y,y.onVerify()},onFail(){}}):gt.warning("安全组件未加载,请稍后再试")},v=y=>{d(y),r("reset")};return w.jsxs("div",{className:"space-y-5",children:[w.jsx("div",{id:"captcha-forget-pwd"}),n==="account"&&w.jsxs("div",{className:"space-y-4",children:[w.jsxs("div",{className:"text-sm text-gray-500 mb-4 text-center",children:["为了您的账号安全,请先进行安全验证",w.jsx("br",{}),"请输入您的账号信息"]}),w.jsx(Tn,{name:"account",placeholder:"请输入账号信息",autoFocus:!0,value:o,onChange:y=>s(y.currentTarget.value)}),w.jsx(Rt,{className:"mt-6 h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",onClick:g,disabled:!o||m,children:m?"验证中...":"下一步"})]}),n==="secure"&&(c===2?w.jsx(Y1,{account:o,mobile:i,onNext:v}):w.jsx(X1,{account:o,onNext:v})),n==="reset"&&w.jsx($1,{account:o,forgetPasswordKey:l,onSuccess:()=>r("success")}),n==="success"&&w.jsxs("div",{className:"space-y-4 py-6",children:[w.jsx("div",{className:"text-center text-lg font-medium text-gray-800",children:"重置密码成功"}),w.jsx(Rt,{className:"mt-6 h-10 w-full bg-gray-100 text-gray-700 rounded-full hover:bg-gray-200",onClick:()=>e?.(),children:"返回登录"})]})]})}function K1(){const{gameId:e,onAccountLoginSuccess:t,onLoginSuccess:n,onLoginError:r,triggerRealNameAuth:o}=Dn(),s=oe.useRef(null),[i,a]=oe.useState(""),[c,u]=oe.useState(""),[l,d]=oe.useState(!1),[p,h]=oe.useState(!0),[m,g]=oe.useState(!1),{mutate:v,isPending:y}=sn({mutationFn:()=>S1({account:i,password:c}),onSuccess:S=>{const E={account:S.account,entity:S.channel_info.entity,token:S.channel_info.token,sign:S.channel_info.sign,accid:S.channel_info.entity.openid,extra_data:S.channel_info.extra_data,gaplaySign:S.channel_info.gaplaySign,realname:S.channel_info.realname};if(Ns(E,S._auth,e),E.realname&&E.realname.reject>=2){o();return}t?.(E),n?.(E)},onError:S=>{r?.(S)}});async function C(S){if(S.preventDefault(),!p){gt.warning("请先阅读并同意用户协议和隐私政策");return}if(!i||!c){gt.warning("请输入账号和密码");return}v()}return w.jsx(w.Fragment,{children:w.jsxs(To,{ref:s,onSubmit:C,className:"space-y-5",children:[w.jsx(Tn,{name:"account",placeholder:e==="5327"?"请输入账号":"请输入巨人通行证账号",autoFocus:!0,onChange:S=>a(S.currentTarget.value),prefix:e==="5327"?w.jsx(y1,{className:"size-5 text-gray-400"}):w.jsx(R1,{className:"size-5 text-gray-400"})}),w.jsx(Tn,{name:"password",type:l?"text":"password",autoComplete:"off",placeholder:"请输入密码",value:c,onValueChange:S=>u(S),prefix:w.jsx(N1,{className:"size-5 text-gray-400"}),suffix:w.jsx(Rt,{onClick:()=>d(!l),type:"button",children:l?w.jsx(Up,{className:"size-5 text-gray-400"}):w.jsx(Hp,{className:"size-5 text-gray-400"})})}),w.jsxs("section",{children:[w.jsx("div",{className:"flex justify-end mb-1",children:w.jsx(Po,{title:"忘记密码",open:m,onOpenChange:g,trigger:w.jsx("button",{type:"button",className:"text-[var(--jssdk-primary-color)] text-sm",children:"忘记密码"}),children:w.jsx(q1,{onClose:()=>g(!1),defaultAccount:i})})}),w.jsx(Rt,{className:"h-10 w-full text-white bg-gradient-to-r from-[#497efe] to-[#947afa] rounded-full shadow-lg",type:"submit",disabled:y,children:"登录"})]}),w.jsx(Qs,{}),w.jsx(qp,{checked:p,onChange:h})]})})}var Qp;function ee(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 u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){const p=l[d];p in a||(a[p]=u[p].bind(a))}}const o=n?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;const u=n?.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const l of u._zod.deferred)l();return u}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 Gr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Qp=globalThis).__zod_globalConfig??(Qp.__zod_globalConfig={});const kc=globalThis.__zod_globalConfig;function yr(e){return kc}function th(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 Rc(e,t){return typeof t=="bigint"?t.toString():t}function Nc(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Mc(e){return e==null}function Ac(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const nh=Symbol("evaluating");function ot(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==nh)return r===void 0&&(r=nh,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function vr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Jn(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function rh(e){return JSON.stringify(e)}function J1(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const oh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ti(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Q1=Nc(()=>{if(kc.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function _o(e){if(ti(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ti(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function sh(e){return _o(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const ex=new Set(["string","number","symbol"]);function ni(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ke(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 tx(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function nx(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=Jn(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 vr(this,"shape",i),i},checks:[]});return Qn(e,s)}function rx(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=Jn(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 vr(this,"shape",i),i},checks:[]});return Qn(e,s)}function ox(e,t){if(!_o(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=Jn(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return vr(this,"shape",s),s}});return Qn(e,o)}function sx(e,t){if(!_o(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return vr(this,"shape",r),r}});return Qn(e,n)}function ix(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=Jn(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return vr(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Qn(e,n)}function ax(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=Jn(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return vr(this,"shape",c),c},checks:[]});return Qn(t,i)}function cx(e,t,n){const r=Jn(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 vr(this,"shape",s),s}});return Qn(t,r)}function Yr(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 ux(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 ih(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ri(e){return typeof e=="string"?e:e?.message}function br(e,t,n){const r=e.message?e.message:ri(e.inst?._zod.def?.error?.(e))??ri(t?.error?.(e))??ri(n.customError?.(e))??ri(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 Dc(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 ah=(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,Rc,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ch=ee("$ZodError",ah),uh=ee("$ZodError",ah,{Parent:Error});function oi(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 lx(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,u=0;for(;u<a.length;){const l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(t(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return r(e),n}const Lc=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 Gr;if(i.issues.length){const a=new(o?.Err??e)(i.issues.map(c=>br(c,s,yr())));throw oh(a,o?.callee),a}return i.value},Fc=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=>br(c,s,yr())));throw oh(a,o?.callee),a}return i.value},si=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 Gr;return s.issues.length?{success:!1,error:new(e??ch)(s.issues.map(i=>br(i,o,yr())))}:{success:!0,data:s.value}},dx=si(uh),ii=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=>br(i,o,yr())))}:{success:!0,data:s.value}},fx=ii(uh),px=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Lc(e)(t,n,o)},hx=e=>(t,n,r)=>Lc(e)(t,n,r),mx=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Fc(e)(t,n,o)},gx=e=>async(t,n,r)=>Fc(e)(t,n,r),yx=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return si(e)(t,n,o)},vx=e=>(t,n,r)=>si(e)(t,n,r),bx=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return ii(e)(t,n,o)},wx=e=>async(t,n,r)=>ii(e)(t,n,r),Sx=/^[cC][0-9a-z]{6,}$/,Ex=/^[0-9a-z]+$/,xx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Cx=/^[0-9a-vA-V]{20}$/,Tx=/^[A-Za-z0-9]{27}$/,Ox=/^[a-zA-Z0-9_-]{21}$/,Px=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_x=/^([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})$/,lh=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)$/,Ix=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Rx(){return new RegExp(kx,"u")}const Nx=/^(?:(?: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])$/,Mx=/^(([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}|:))$/,Ax=/^((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])$/,Dx=/^(([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])$/,Lx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dh=/^[A-Za-z0-9_-]*$/,Fx=/^https?$/,Vx=/^\+[1-9]\d{6,14}$/,fh="(?:(?:\\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])))",zx=new RegExp(`^${fh}$`);function ph(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 $x(e){return new RegExp(`^${ph(e)}$`)}function jx(e){const t=ph({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(`^${fh}T(?:${r})$`)}const Hx=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ux=/^[^A-Z]*$/,Bx=/^[^a-z]*$/,On=ee("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Wx=ee("$ZodCheckMaxLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(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=Dc(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Zx=ee("$ZodCheckMinLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(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=Dc(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Gx=ee("$ZodCheckLengthEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Mc(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=Dc(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})}}),ai=ee("$ZodCheckStringFormat",(e,t)=>{var n,r;On.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=()=>{})}),Yx=ee("$ZodCheckRegex",(e,t)=>{ai.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})}}),Xx=ee("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ux),ai.init(e,t)}),qx=ee("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Bx),ai.init(e,t)}),Kx=ee("$ZodCheckIncludes",(e,t)=>{On.init(e,t);const n=ni(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})}}),Jx=ee("$ZodCheckStartsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`^${ni(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})}}),Qx=ee("$ZodCheckEndsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`.*${ni(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})}}),eC=ee("$ZodCheckOverwrite",(e,t)=>{On.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tC{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
20
|
`).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
|
|
68
|
-
if (${
|
|
21
|
+
`))}}const nC={major:4,minor:4,patch:3},Et=ee("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nC;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 u=Yr(i),l;for(const d of a){if(d._zod.def.when){if(ux(i)||!d._zod.def.when(i))continue}else if(u)continue;const p=i.issues.length,h=d._zod.check(i);if(h instanceof Promise&&c?.async===!1)throw new Gr;if(l||h instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await h,i.issues.length!==p&&(u||(u=Yr(i,p)))});else{if(i.issues.length===p)continue;u||(u=Yr(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(Yr(i))return i.aborted=!0,i;const u=o(a,r,c);if(u instanceof Promise){if(c.async===!1)throw new Gr;return u.then(l=>e._zod.parse(l,c))}return e._zod.parse(u,c)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction==="backward"){const u=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}const c=e._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Gr;return c.then(u=>o(u,r,a))}return o(c,r,a)}}ot(e,"~standard",()=>({validate:o=>{try{const s=dx(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return fx(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Vc=ee("$ZodString",(e,t)=>{Et.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Hx(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}}),pt=ee("$ZodStringFormat",(e,t)=>{ai.init(e,t),Vc.init(e,t)}),rC=ee("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_x),pt.init(e,t)}),oC=ee("$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=lh(r))}else t.pattern??(t.pattern=lh());pt.init(e,t)}),sC=ee("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ix),pt.init(e,t)}),iC=ee("$ZodURL",(e,t)=>{pt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===Fx.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})}}}),aC=ee("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Rx()),pt.init(e,t)}),cC=ee("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ox),pt.init(e,t)}),uC=ee("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Sx),pt.init(e,t)}),lC=ee("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ex),pt.init(e,t)}),dC=ee("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xx),pt.init(e,t)}),fC=ee("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Cx),pt.init(e,t)}),pC=ee("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Tx),pt.init(e,t)}),hC=ee("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=jx(t)),pt.init(e,t)}),mC=ee("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=zx),pt.init(e,t)}),gC=ee("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=$x(t)),pt.init(e,t)}),yC=ee("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Px),pt.init(e,t)}),vC=ee("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Nx),pt.init(e,t),e._zod.bag.format="ipv4"}),bC=ee("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Mx),pt.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})}}}),wC=ee("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ax),pt.init(e,t)}),SC=ee("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Dx),pt.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 hh(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const EC=ee("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Lx),pt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{hh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function xC(e){if(!dh.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return hh(n)}const CC=ee("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=dh),pt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{xC(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),TC=ee("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Vx),pt.init(e,t)});function OC(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 PC=ee("$ZodJWT",(e,t)=>{pt.init(e,t),e._zod.check=n=>{OC(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),_C=ee("$ZodUnknown",(e,t)=>{Et.init(e,t),e._zod.parse=n=>n}),IC=ee("$ZodNever",(e,t)=>{Et.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function mh(e,t,n){e.issues.length&&t.issues.push(...ih(n,e.issues)),t.value[n]=e.value}const kC=ee("$ZodArray",(e,t)=>{Et.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(u=>mh(u,n,i))):mh(c,n,i)}return s.length?Promise.all(s).then(()=>n):n}});function ci(e,t,n,r,o,s){const i=n in r;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...ih(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 gh(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=tx(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function yh(e,t,n,r,o,s){const i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(const p in t){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}const h=c.run({value:t[p],issues:[]},r);h instanceof Promise?e.push(h.then(m=>ci(m,n,p,t,l,d))):ci(h,n,p,t,l,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 RC=ee("$ZodObject",(e,t)=>{if(Et.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=Nc(()=>gh(t));ot(e._zod,"propValues",()=>{const a=t.shape,c={};for(const u in a){const l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(const d of l.values)c[u].add(d)}}return c});const o=ti,s=t.catchall;let i;e._zod.parse=(a,c)=>{i??(i=r.value);const u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const l=[],d=i.shape;for(const p of i.keys){const h=d[p],m=h._zod.optin==="optional",g=h._zod.optout==="optional",v=h._zod.run({value:u[p],issues:[]},c);v instanceof Promise?l.push(v.then(y=>ci(y,a,p,u,m,g))):ci(v,a,p,u,m,g)}return s?yh(l,u,a,c,r.value,e):l.length?Promise.all(l).then(()=>a):a}}),NC=ee("$ZodObjectJIT",(e,t)=>{RC.init(e,t);const n=e._zod.parse,r=Nc(()=>gh(t)),o=p=>{const h=new tC(["shape","payload","ctx"]),m=r.value,g=S=>{const E=rh(S);return`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`};h.write("const input = payload.value;");const v=Object.create(null);let y=0;for(const S of m.keys)v[S]=`key_${y++}`;h.write("const newResult = {};");for(const S of m.keys){const E=v[S],b=rh(S),x=p[S],T=x?._zod?.optin==="optional",P=x?._zod?.optout==="optional";h.write(`const ${E} = ${g(S)};`),T&&P?h.write(`
|
|
22
|
+
if (${E}.issues.length) {
|
|
69
23
|
if (${b} in input) {
|
|
70
|
-
payload.issues = payload.issues.concat(${
|
|
24
|
+
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
71
25
|
...iss,
|
|
72
26
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
73
27
|
})));
|
|
74
28
|
}
|
|
75
29
|
}
|
|
76
30
|
|
|
77
|
-
if (${
|
|
31
|
+
if (${E}.value === undefined) {
|
|
78
32
|
if (${b} in input) {
|
|
79
33
|
newResult[${b}] = undefined;
|
|
80
34
|
}
|
|
81
35
|
} else {
|
|
82
|
-
newResult[${b}] = ${
|
|
36
|
+
newResult[${b}] = ${E}.value;
|
|
83
37
|
}
|
|
84
38
|
|
|
85
|
-
`):
|
|
86
|
-
if (${
|
|
87
|
-
payload.issues = payload.issues.concat(${
|
|
39
|
+
`):T?h.write(`
|
|
40
|
+
if (${E}.issues.length) {
|
|
41
|
+
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
88
42
|
...iss,
|
|
89
43
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
90
44
|
})));
|
|
91
45
|
}
|
|
92
46
|
|
|
93
|
-
if (${
|
|
47
|
+
if (${E}.value === undefined) {
|
|
94
48
|
if (${b} in input) {
|
|
95
49
|
newResult[${b}] = undefined;
|
|
96
50
|
}
|
|
97
51
|
} else {
|
|
98
|
-
newResult[${b}] = ${
|
|
52
|
+
newResult[${b}] = ${E}.value;
|
|
99
53
|
}
|
|
100
54
|
|
|
101
55
|
`):h.write(`
|
|
102
|
-
const ${
|
|
103
|
-
if (${
|
|
104
|
-
payload.issues = payload.issues.concat(${
|
|
56
|
+
const ${E}_present = ${b} in input;
|
|
57
|
+
if (${E}.issues.length) {
|
|
58
|
+
payload.issues = payload.issues.concat(${E}.issues.map(iss => ({
|
|
105
59
|
...iss,
|
|
106
60
|
path: iss.path ? [${b}, ...iss.path] : [${b}]
|
|
107
61
|
})));
|
|
108
62
|
}
|
|
109
|
-
if (!${
|
|
63
|
+
if (!${E}_present && !${E}.issues.length) {
|
|
110
64
|
payload.issues.push({
|
|
111
65
|
code: "invalid_type",
|
|
112
66
|
expected: "nonoptional",
|
|
@@ -115,14 +69,14 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
115
69
|
});
|
|
116
70
|
}
|
|
117
71
|
|
|
118
|
-
if (${
|
|
119
|
-
if (${
|
|
72
|
+
if (${E}_present) {
|
|
73
|
+
if (${E}.value === undefined) {
|
|
120
74
|
newResult[${b}] = undefined;
|
|
121
75
|
} else {
|
|
122
|
-
newResult[${b}] = ${
|
|
76
|
+
newResult[${b}] = ${E}.value;
|
|
123
77
|
}
|
|
124
78
|
}
|
|
125
79
|
|
|
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>
|
|
80
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");const C=h.compile();return(S,E)=>C(p,S,E)};let s;const i=ti,a=!kc.jitless,u=a&&Q1.value,l=t.catchall;let d;e._zod.parse=(p,h)=>{d??(d=r.value);const m=p.value;return i(m)?a&&u&&h?.async===!1&&h.jitless!==!0?(s||(s=o(t.shape)),p=s(p,h),l?yh([],m,p,h,d,e):p):n(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function vh(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=>!Yr(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=>br(i,r,yr())))}),t)}const MC=ee("$ZodUnion",(e,t)=>{Et.init(e,t),ot(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ot(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ot(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ot(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=>Ac(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=>vh(a,r,e,o)):vh(i,r,e,o)}}),AC=ee("$ZodIntersection",(e,t)=>{Et.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,u])=>bh(n,c,u)):bh(n,s,i)}});function zc(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(_o(e)&&_o(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=zc(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=zc(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 bh(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}),Yr(e))return e;const i=zc(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 DC=ee("$ZodEnum",(e,t)=>{Et.init(e,t);const n=th(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>ex.has(typeof o)).map(o=>typeof o=="string"?ni(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}}),LC=ee("$ZodTransform",(e,t)=>{Et.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eh(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 Gr;return n.value=o,n.fallback=!0,n}});function wh(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Sh=ee("$ZodOptional",(e,t)=>{Et.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ot(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ac(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=>wh(i,o)):wh(s,o)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),FC=ee("$ZodExactOptional",(e,t)=>{Sh.init(e,t),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),VC=ee("$ZodNullable",(e,t)=>{Et.init(e,t),ot(e._zod,"optin",()=>t.innerType._zod.optin),ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ac(n.source)}|null)$`):void 0}),ot(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)}),zC=ee("$ZodDefault",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(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=>Eh(s,t)):Eh(o,t)}});function Eh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $C=ee("$ZodPrefault",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(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))}),jC=ee("$ZodNonOptional",(e,t)=>{Et.init(e,t),ot(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=>xh(s,e)):xh(o,e)}});function xh(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 HC=ee("$ZodCatch",(e,t)=>{Et.init(e,t),e._zod.optin="optional",ot(e._zod,"optout",()=>t.innerType._zod.optout),ot(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=>br(i,r,yr()))},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=>br(s,r,yr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),UC=ee("$ZodPipe",(e,t)=>{Et.init(e,t),ot(e._zod,"values",()=>t.in._zod.values),ot(e._zod,"optin",()=>t.in._zod.optin),ot(e._zod,"optout",()=>t.out._zod.optout),ot(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=>ui(i,t.in,r)):ui(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>ui(s,t.out,r)):ui(o,t.out,r)}});function ui(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 BC=ee("$ZodReadonly",(e,t)=>{Et.init(e,t),ot(e._zod,"propValues",()=>t.innerType._zod.propValues),ot(e._zod,"values",()=>t.innerType._zod.values),ot(e._zod,"optin",()=>t.innerType?._zod?.optin),ot(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(Ch):Ch(o)}});function Ch(e){return e.value=Object.freeze(e.value),e}const WC=ee("$ZodCustom",(e,t)=>{On.init(e,t),Et.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=>Th(s,n,r,e));Th(o,n,r,e)}});function Th(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 Oh;class ZC{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 GC(){return new ZC}(Oh=globalThis).__zod_globalRegistry??(Oh.__zod_globalRegistry=GC());const ko=globalThis.__zod_globalRegistry;function YC(e,t){return new e({type:"string",...ke(t)})}function XC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function Ph(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function qC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function KC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function JC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function QC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function eT(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function tT(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function nT(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function rT(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function oT(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function sT(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function iT(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function aT(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function cT(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function uT(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function lT(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function dT(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function fT(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function pT(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function hT(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function mT(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function gT(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function yT(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function vT(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function bT(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function wT(e){return new e({type:"unknown"})}function ST(e,t){return new e({type:"never",...ke(t)})}function _h(e,t){return new Wx({check:"max_length",...ke(t),maximum:e})}function li(e,t){return new Zx({check:"min_length",...ke(t),minimum:e})}function Ih(e,t){return new Gx({check:"length_equals",...ke(t),length:e})}function ET(e,t){return new Yx({check:"string_format",format:"regex",...ke(t),pattern:e})}function xT(e){return new Xx({check:"string_format",format:"lowercase",...ke(e)})}function CT(e){return new qx({check:"string_format",format:"uppercase",...ke(e)})}function TT(e,t){return new Kx({check:"string_format",format:"includes",...ke(t),includes:e})}function OT(e,t){return new Jx({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function PT(e,t){return new Qx({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function Xr(e){return new eC({check:"overwrite",tx:e})}function _T(e){return Xr(t=>t.normalize(e))}function IT(){return Xr(e=>e.trim())}function kT(){return Xr(e=>e.toLowerCase())}function RT(){return Xr(e=>e.toUpperCase())}function NT(){return Xr(e=>J1(e))}function MT(e,t,n){return new e({type:"array",element:t,...ke(n)})}function AT(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ke(n)})}function DT(e,t){const n=LT(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 LT(e,t){const n=new On({check:"custom",...ke(t)});return n._zod.check=e,n}function kh(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 It(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 l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{const p=i.schema,h=t.processors[o.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);h(e,t,p,l)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),It(d,t,l),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&zt(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 Rh(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,p=e.external.uri??(m=>m);if(d)return{ref:p(d)};const h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${p("__shared")}#/${a}/${h}`}}if(i[1]===n)return{ref:"#"};const u=`#/${a}/`,l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;const a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);const l=a.schema;for(const d in l)delete l[d];l.$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
81
|
|
|
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"})}));
|
|
82
|
+
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 u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){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 Nh(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 u=c.def??c.schema,l={...u},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")?(u.allOf=u.allOf??[],u.allOf.push(m)):Object.assign(u,m),Object.assign(u,l),a._zod.parent===d)for(const v in u)v==="$ref"||v==="allOf"||v in l||delete u[v];if(m.$ref&&h.def)for(const v in u)v==="$ref"||v==="allOf"||v in h.def&&JSON.stringify(u[v])===JSON.stringify(h.def[v])&&delete u[v]}const p=a._zod.parent;if(p&&p!==d){r(p);const h=e.seen.get(p);if(h?.schema.$ref&&(u.$ref=h.schema.$ref,h.def))for(const m in u)m==="$ref"||m==="allOf"||m in h.def&&JSON.stringify(u[m])===JSON.stringify(h.def[m])&&delete u[m]}e.override({zodSchema:a,jsonSchema:u,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:di(t,"input",e.processors),output:di(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function zt(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 zt(r.element,n);if(r.type==="set")return zt(r.valueType,n);if(r.type==="lazy")return zt(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 zt(r.innerType,n);if(r.type==="intersection")return zt(r.left,n)||zt(r.right,n);if(r.type==="record"||r.type==="map")return zt(r.keyType,n)||zt(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:zt(r.in,n)||zt(r.out,n);if(r.type==="object"){for(const o in r.shape)if(zt(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(zt(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(zt(o,n))return!0;return!!(r.rest&&zt(r.rest,n))}return!1}const FT=(e,t={})=>n=>{const r=kh({...n,processors:t});return It(e,r),Rh(r,e),Nh(r,e)},di=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=kh({...o??{},target:s,io:t,processors:n});return It(e,i),Rh(i,e),Nh(i,e)},VT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},zT=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=VT[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},$T=(e,t,n,r)=>{n.not={}},jT=(e,t,n,r)=>{},HT=(e,t,n,r)=>{const o=e._zod.def,s=th(o.entries);s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},UT=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},BT=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},WT=(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=It(s.element,t,{...r,path:[...r.path,"items"]})},ZT=(e,t,n,r)=>{const o=n,s=e._zod.def;o.type="object",o.properties={};const i=s.shape;for(const u in i)o.properties[u]=It(i[u],t,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{const l=s.shape[u]._zod;return t.io==="input"?l.optin===void 0:l.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=It(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},GT=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>It(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},YT=(e,t,n,r)=>{const o=e._zod.def,s=It(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=It(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c},XT=(e,t,n,r)=>{const o=e._zod.def,s=It(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"}]},qT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},KT=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},JT=(e,t,n,r)=>{const o=e._zod.def;It(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)))},QT=(e,t,n,r)=>{const o=e._zod.def;It(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},eO=(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;It(i,t,r);const a=t.seen.get(e);a.ref=i},tO=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},Mh=(e,t,n,r)=>{const o=e._zod.def;It(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},nO=ee("ZodISODateTime",(e,t)=>{hC.init(e,t),ht.init(e,t)});function rO(e){return gT(nO,e)}const oO=ee("ZodISODate",(e,t)=>{mC.init(e,t),ht.init(e,t)});function sO(e){return yT(oO,e)}const iO=ee("ZodISOTime",(e,t)=>{gC.init(e,t),ht.init(e,t)});function aO(e){return vT(iO,e)}const cO=ee("ZodISODuration",(e,t)=>{yC.init(e,t),ht.init(e,t)});function uO(e){return bT(cO,e)}const nn=ee("ZodError",(e,t)=>{ch.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>lx(e,n)},flatten:{value:n=>oi(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Rc,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Rc,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),lO=Lc(nn),dO=Fc(nn),fO=si(nn),pO=ii(nn),hO=px(nn),mO=hx(nn),gO=mx(nn),yO=gx(nn),vO=yx(nn),bO=vx(nn),wO=bx(nn),SO=wx(nn),Ah=new WeakMap;function fi(e,t,n){const r=Object.getPrototypeOf(e);let o=Ah.get(r);if(o||(o=new Set,Ah.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 xt=ee("ZodType",(e,t)=>(Et.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:di(e,"input"),output:di(e,"output")}}),e.toJSONSchema=FT(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>lO(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>fO(e,n,r),e.parseAsync=async(n,r)=>dO(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>pO(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>hO(e,n,r),e.decode=(n,r)=>mO(e,n,r),e.encodeAsync=async(n,r)=>gO(e,n,r),e.decodeAsync=async(n,r)=>yO(e,n,r),e.safeEncode=(n,r)=>vO(e,n,r),e.safeDecode=(n,r)=>bO(e,n,r),e.safeEncodeAsync=async(n,r)=>wO(e,n,r),e.safeDecodeAsync=async(n,r)=>SO(e,n,r),fi(e,"ZodType",{check(...n){const r=this.def;return this.clone(Jn(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 Qn(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(pP(n,r))},superRefine(n,r){return this.check(hP(n,r))},overwrite(n){return this.check(Xr(n))},optional(){return $h(this)},exactOptional(){return eP(this)},nullable(){return jh(this)},nullish(){return $h(jh(this))},nonoptional(n){return iP(this,n)},array(){return BO(this)},or(n){return GO([this,n])},and(n){return XO(this,n)},transform(n){return Uh(this,JO(n))},default(n){return rP(this,n)},prefault(n){return sP(this,n)},catch(n){return cP(this,n)},pipe(n){return Uh(this,n)},readonly(){return dP(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)),Dh=ee("_ZodString",(e,t)=>{Vc.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>zT(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fi(e,"_ZodString",{regex(...r){return this.check(ET(...r))},includes(...r){return this.check(TT(...r))},startsWith(...r){return this.check(OT(...r))},endsWith(...r){return this.check(PT(...r))},min(...r){return this.check(li(...r))},max(...r){return this.check(_h(...r))},length(...r){return this.check(Ih(...r))},nonempty(...r){return this.check(li(1,...r))},lowercase(r){return this.check(xT(r))},uppercase(r){return this.check(CT(r))},trim(){return this.check(IT())},normalize(...r){return this.check(_T(...r))},toLowerCase(){return this.check(kT())},toUpperCase(){return this.check(RT())},slugify(){return this.check(NT())}})}),EO=ee("ZodString",(e,t)=>{Vc.init(e,t),Dh.init(e,t),e.email=n=>e.check(XC(xO,n)),e.url=n=>e.check(eT(CO,n)),e.jwt=n=>e.check(mT(zO,n)),e.emoji=n=>e.check(tT(TO,n)),e.guid=n=>e.check(Ph(Lh,n)),e.uuid=n=>e.check(qC(hi,n)),e.uuidv4=n=>e.check(KC(hi,n)),e.uuidv6=n=>e.check(JC(hi,n)),e.uuidv7=n=>e.check(QC(hi,n)),e.nanoid=n=>e.check(nT(OO,n)),e.guid=n=>e.check(Ph(Lh,n)),e.cuid=n=>e.check(rT(PO,n)),e.cuid2=n=>e.check(oT(_O,n)),e.ulid=n=>e.check(sT(IO,n)),e.base64=n=>e.check(fT(LO,n)),e.base64url=n=>e.check(pT(FO,n)),e.xid=n=>e.check(iT(kO,n)),e.ksuid=n=>e.check(aT(RO,n)),e.ipv4=n=>e.check(cT(NO,n)),e.ipv6=n=>e.check(uT(MO,n)),e.cidrv4=n=>e.check(lT(AO,n)),e.cidrv6=n=>e.check(dT(DO,n)),e.e164=n=>e.check(hT(VO,n)),e.datetime=n=>e.check(rO(n)),e.date=n=>e.check(sO(n)),e.time=n=>e.check(aO(n)),e.duration=n=>e.check(uO(n))});function pi(e){return YC(EO,e)}const ht=ee("ZodStringFormat",(e,t)=>{pt.init(e,t),Dh.init(e,t)}),xO=ee("ZodEmail",(e,t)=>{sC.init(e,t),ht.init(e,t)}),Lh=ee("ZodGUID",(e,t)=>{rC.init(e,t),ht.init(e,t)}),hi=ee("ZodUUID",(e,t)=>{oC.init(e,t),ht.init(e,t)}),CO=ee("ZodURL",(e,t)=>{iC.init(e,t),ht.init(e,t)}),TO=ee("ZodEmoji",(e,t)=>{aC.init(e,t),ht.init(e,t)}),OO=ee("ZodNanoID",(e,t)=>{cC.init(e,t),ht.init(e,t)}),PO=ee("ZodCUID",(e,t)=>{uC.init(e,t),ht.init(e,t)}),_O=ee("ZodCUID2",(e,t)=>{lC.init(e,t),ht.init(e,t)}),IO=ee("ZodULID",(e,t)=>{dC.init(e,t),ht.init(e,t)}),kO=ee("ZodXID",(e,t)=>{fC.init(e,t),ht.init(e,t)}),RO=ee("ZodKSUID",(e,t)=>{pC.init(e,t),ht.init(e,t)}),NO=ee("ZodIPv4",(e,t)=>{vC.init(e,t),ht.init(e,t)}),MO=ee("ZodIPv6",(e,t)=>{bC.init(e,t),ht.init(e,t)}),AO=ee("ZodCIDRv4",(e,t)=>{wC.init(e,t),ht.init(e,t)}),DO=ee("ZodCIDRv6",(e,t)=>{SC.init(e,t),ht.init(e,t)}),LO=ee("ZodBase64",(e,t)=>{EC.init(e,t),ht.init(e,t)}),FO=ee("ZodBase64URL",(e,t)=>{CC.init(e,t),ht.init(e,t)}),VO=ee("ZodE164",(e,t)=>{TC.init(e,t),ht.init(e,t)}),zO=ee("ZodJWT",(e,t)=>{PC.init(e,t),ht.init(e,t)}),$O=ee("ZodUnknown",(e,t)=>{_C.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>jT()});function Fh(){return wT($O)}const jO=ee("ZodNever",(e,t)=>{IC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>$T(e,n,r)});function HO(e){return ST(jO,e)}const UO=ee("ZodArray",(e,t)=>{kC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>WT(e,n,r,o),e.element=t.element,fi(e,"ZodArray",{min(n,r){return this.check(li(n,r))},nonempty(n){return this.check(li(1,n))},max(n,r){return this.check(_h(n,r))},length(n,r){return this.check(Ih(n,r))},unwrap(){return this.element}})});function BO(e,t){return MT(UO,e,t)}const WO=ee("ZodObject",(e,t)=>{NC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ZT(e,n,r,o),ot(e,"shape",()=>t.shape),fi(e,"ZodObject",{keyof(){return qO(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Fh()})},loose(){return this.clone({...this._zod.def,catchall:Fh()})},strict(){return this.clone({...this._zod.def,catchall:HO()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return ox(this,n)},safeExtend(n){return sx(this,n)},merge(n){return ix(this,n)},pick(n){return nx(this,n)},omit(n){return rx(this,n)},partial(...n){return ax(zh,this,n[0])},required(...n){return cx(Hh,this,n[0])}})});function Vh(e,t){const n={type:"object",shape:e??{},...ke(t)};return new WO(n)}const ZO=ee("ZodUnion",(e,t)=>{MC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>GT(e,n,r,o),e.options=t.options});function GO(e,t){return new ZO({type:"union",options:e,...ke(t)})}const YO=ee("ZodIntersection",(e,t)=>{AC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>YT(e,n,r,o)});function XO(e,t){return new YO({type:"intersection",left:e,right:t})}const $c=ee("ZodEnum",(e,t)=>{DC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(r,o,s)=>HT(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 $c({...t,checks:[],...ke(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 $c({...t,checks:[],...ke(o),entries:s})}});function qO(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new $c({type:"enum",entries:n,...ke(t)})}const KO=ee("ZodTransform",(e,t)=>{LC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>BT(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new eh(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 JO(e){return new KO({type:"transform",transform:e})}const zh=ee("ZodOptional",(e,t)=>{Sh.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $h(e){return new zh({type:"optional",innerType:e})}const QO=ee("ZodExactOptional",(e,t)=>{FC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mh(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function eP(e){return new QO({type:"optional",innerType:e})}const tP=ee("ZodNullable",(e,t)=>{VC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>XT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function jh(e){return new tP({type:"nullable",innerType:e})}const nP=ee("ZodDefault",(e,t)=>{zC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>KT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rP(e,t){return new nP({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():sh(t)}})}const oP=ee("ZodPrefault",(e,t)=>{$C.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>JT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function sP(e,t){return new oP({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():sh(t)}})}const Hh=ee("ZodNonOptional",(e,t)=>{jC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>qT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function iP(e,t){return new Hh({type:"nonoptional",innerType:e,...ke(t)})}const aP=ee("ZodCatch",(e,t)=>{HC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>QT(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function cP(e,t){return new aP({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const uP=ee("ZodPipe",(e,t)=>{UC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>eO(e,n,r,o),e.in=t.in,e.out=t.out});function Uh(e,t){return new uP({type:"pipe",in:e,out:t})}const lP=ee("ZodReadonly",(e,t)=>{BC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>tO(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function dP(e){return new lP({type:"readonly",innerType:e})}const fP=ee("ZodCustom",(e,t)=>{WC.init(e,t),xt.init(e,t),e._zod.processJSONSchema=(n,r,o)=>UT(e,n)});function pP(e,t={}){return AT(fP,e,t)}function hP(e,t){return DT(e,t)}const wr={trigger:"_trigger_1e3h3_1",popup:"_popup_1e3h3_5",item:"_item_1e3h3_24",indicator:"_indicator_1e3h3_40",itemText:"_itemText_1e3h3_44",itemCode:"_itemCode_1e3h3_48",itemLabel:"_itemLabel_1e3h3_52"};function mP({value:e,onValueChange:t}){const{gameId:n}=Dn(),r=dS(),o=f.useMemo(()=>r.find(i=>i.id===e||i.value===e)?.id||e,[r,e]);return w.jsxs(n1,{value:o,onValueChange:s=>{const i=r.find(a=>a.id===s);i&&t?.(i.value)},children:[w.jsxs(Pp,{className:wr.trigger,children:[w.jsx("span",{children:r.find(s=>s.id===o)?.value}),w.jsx(jp,{className:"size-4"})]}),w.jsx(Ip,{children:w.jsx(kp,{className:"outline-none z-[999]",sideOffset:-4,align:"start",children:w.jsx(Rp,{className:wr.popup,children:r.map(({label:s,value:i,id:a})=>w.jsxs(Dp,{value:a,className:wr.item,children:[w.jsx(Lp,{className:wr.indicator,children:w.jsx(Pc,{className:"size-3"})}),w.jsxs(Vp,{className:wr.itemText,children:[w.jsx("span",{className:wr.itemCode,children:i}),w.jsx("span",{className:wr.itemLabel,children:s})]})]},a))})})})]})}const Bh=Vh({phoneNumber:pi().regex(/^[1-9]\d{10}$/,"请输入正确的手机号"),verificationCode:pi().length(4,"请输入 6 位验证码")});function Wh(){const{mobileLoginConfig:e={},gameId:t,onPhoneLoginSuccess:n,onLoginSuccess:r,onLoginError:o,triggerRealNameAuth:s}=Dn(),[i,a]=oe.useState("86"),[c,u]=oe.useState(""),l=oe.useRef(null),[d,p]=oe.useState(""),[h,m]=oe.useState(),[g,v]=oe.useState(!0),[y,C]=oe.useState({}),[S]=Jp({leftTime:h?h*1e3:void 0,interval:1e3,onEnd(){m(void 0)}}),{mutate:E,isPending:b}=sn({mutationFn:()=>E1({mobile:c,countryCode:i,type:e.smsType}),onSuccess:I=>{m(I.lock_time),gt.success("验证码已发送,请注意查收")}}),{mutate:x,isPending:T}=sn({mutationFn:async()=>{const I=await x1({mobile:c,countryCode:i,captcha:d});m(void 0);const D={account:I.account,entity:I.channel_info.entity,token:I.channel_info.token,sign:I.channel_info.sign,accid:I.channel_info.entity.openid,extra_data:I.channel_info.extra_data,gaplaySign:I.channel_info.gaplaySign,realname:I.channel_info.realname};if(Ns(D,I._auth,t),D.realname&&D.realname.reject>=2){s();return}return n&&await n(D),r?.(D),I},onError:I=>{o?.(I)}});function P(){if(!g){gt.warning("请先阅读并同意用户协议和隐私政策");return}const I=new FormData(l.current),D=Bh.pick({phoneNumber:!0}).safeParse(Object.fromEntries(I));if(!D.success){C(oi(D.error).fieldErrors);return}E()}async function z(I){if(I.preventDefault(),!g)return gt.warning("请先阅读并同意用户协议和隐私政策"),{errors:{}};const D=new FormData(I.currentTarget),$=Bh.safeParse(Object.fromEntries(D));return $.success?(x(),{errors:{}}):{errors:oi($.error).fieldErrors}}return w.jsx(w.Fragment,{children:w.jsxs(To,{ref:l,errors:y,onSubmit:async I=>{const D=await z(I);C(D.errors)},className:"space-y-5",children:[w.jsx(Tn,{name:"phoneNumber",placeholder:"请输入手机号码",autoFocus:!0,type:"tel",onChange:I=>u(I.currentTarget.value),prefix:w.jsx(mP,{value:i,onValueChange:a})}),w.jsx(Tn,{name:"verificationCode",placeholder:"请输入验证码",value:d,type:"number",onValueChange:I=>p(I),suffix:w.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:()=>P(),disabled:!!h||b,children:b?"发送中...":h?`${Math.round(S/1e3)}s 后重新获取`:"获取验证码"})}),w.jsx(Rt,{className:St("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||"登录"}),w.jsx(Qs,{}),w.jsx(qp,{checked:g,onChange:v})]})})}function gP(e){return w.jsxs("svg",{width:"20",height:"10",viewBox:"0 0 20 10",fill:"none",...e,children:[w.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"}),w.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 yP({children:e,title:t,description:n,content:r,classNames:o={}}){return w.jsxs(YE,{children:[w.jsx(hp,{className:o.trigger,delay:0,children:e}),w.jsxs(mp,{children:[w.jsx(Sp,{className:St("fixed inset-0 bg-black/20 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",o.backdrop)}),w.jsx(yp,{sideOffset:8,className:o.positioner,children:w.jsxs(bp,{className:St("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:[w.jsx(wp,{className:St("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:w.jsx(gP,{})}),t&&w.jsx(Ep,{className:"text-base font-medium",children:t}),n&&w.jsx(xp,{className:"text-base text-gray-600",children:n}),r]})})]})]})}const Sr={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 Zh({onUidLoginSuccess:e,customSendUidMailCaptcha:t,customValidateUidMailCaptcha:n}={}){const{gameId:r,autoLoginConfig:o,sceneId:s,onUidLoginSuccess:i,onLoginSuccess:a,onLoginError:c,uidLoginConfig:u={}}=Dn(),l=oe.useRef(null),[d,p]=oe.useState(""),[h,m]=oe.useState(""),[g,v]=oe.useState(!0),[y,C]=oe.useState(!1),[S,{startCountdown:E,resetCountdown:b}]=F1({countStart:120,intervalMs:1e3}),{mutate:x}=sn({mutationFn:()=>{const I=o.enabled?o.days:void 0;return n?n({gameId:r,captcha:h,expireInDays:g?I:void 0,accountId:d,sceneId:s}):w1({game_id:r,charid:d,captcha_type:"login",captcha:h,expires_day:g?I:void 0,scene_id:s,...u.uidMailExtraParams})},onSuccess:I=>{i?.(I),e?.(I),a?.(I)},onError:I=>{c?.(I)}}),{mutate:T,isPending:P}=sn({mutationFn:()=>t?t({gameId:r,accountId:d}):b1({game_id:r,captcha_type:"login",charid:d,scene_id:s,...u.uidMailExtraParams}),onSuccess:I=>{E(),gt.success(I.error)}});async function z(I){I.preventDefault(),x()}return oe.useEffect(()=>{h.length===6&&d&&setTimeout(()=>{l.current?.requestSubmit()},0)},[h,d]),oe.useEffect(()=>{S===0&&b(),C(S!==120)},[S,b]),w.jsxs(To,{ref:l,onSubmit:z,className:St("space-y-6",Sr.form),autoComplete:"off",children:[["5199","5012"].includes(r)?w.jsx("p",{className:"text-center text-xs text-white/80",children:"请点击游戏右上角“设置”查看账号ID"}):null,w.jsx(Tn,{name:"accountId",className:St(Sr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入账号 ID",autoFocus:!0,type:"tel",onChange:I=>p(I.currentTarget.value),prefix:w.jsx(yP,{content:w.jsx("div",{className:St(Sr.uidGet,u.uidGetterImageClassName)}),classNames:{backdrop:"z-[992]",positioner:"z-[992]",popup:St("rounded-2xl shadow-lg",Sr.uidGetPopup),arrow:Sr.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:w.jsx("span",{children:"!"})})}),w.jsx(Tn,{name:"verificationCode",className:St(Sr.inputControl,"bg-[var(--jssdk-input-bg-color)]"),inputClassName:"bg-inherit",placeholder:"请输入口令码",value:h,type:"tel",onValueChange:I=>m(I),prefix:w.jsx(Po,{trigger:w.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:w.jsx("div",{className:St(Sr.mailCodeGet,u.mailCodeGetterImageClassName)})}),suffix:w.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:I=>{I.preventDefault()},onClick:()=>T(),disabled:y||P||!d,children:y?`${S}s`:P?"发送中...":"发送口令码"})}),o.enabled?w.jsx(Wr,{name:"rememberLogin",children:w.jsxs(gc,{className:"flex items-center gap-2 text-gray-500",onMouseDown:I=>{I.preventDefault()},children:[w.jsx(sc,{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:I=>v(!!I),children:w.jsx(ic,{children:w.jsx(Pc,{className:"size-3 text-[var(--jssdk-primary-color)]",strokeWidth:4})})}),w.jsxs("div",{children:[w.jsx("span",{className:"mr-0.5",children:o.days}),w.jsx("span",{children:"天内自动登录"})]})]})}):null,["5199","5012"].includes(r)?w.jsx("div",{className:"text-[#f59e9e] text-center text-[11px]",children:"请点击游戏内“邮件”查收口令码,未收到请重启游戏再次查看"}):null,w.jsx(Qs,{})]})}const Ht={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 vP(){const{gameId:e,onLoginSuccess:t,triggerRealNameAuth:n,setCurrentLoginType:r,defaultLoginType:o}=Dn(),[s,i]=oe.useState([]),[a,c]=oe.useState(null),[u,l]=oe.useState(!1),[d,p]=oe.useState(!1),[h,m]=oe.useState(!1),[g,v]=oe.useState(-1);oe.useEffect(()=>{y()},[e]);const y=()=>{const x=$r(e);i(x),x.length>0?(!a||!x.find(T=>T.openid===a.openid))&&c(x[0]):c(null)},C=x=>{c(s[x]),l(!1)},S=(x,T)=>{x.stopPropagation(),v(T),m(!0)},E=()=>{const x=s[g];if(x){sf(x.openid,e);const T=$r(e);if(T.length===0){r(o);return}i(T),T.find(P=>P.openid===a?.openid)||c(T[0])}m(!1),v(-1)},b=async()=>{if(a){p(!0);try{Qd(a.authorization);const x=await Wp(),T={account:x.account,entity:x.channel_info.entity,token:x.channel_info.token,sign:x.channel_info.sign,accid:x.channel_info.entity.openid,extra_data:x.channel_info.extra_data,gaplaySign:x.channel_info.gaplaySign,realname:x.channel_info.realname};if(Ns(T,a.authorization,e),T.realname&&T.realname.reject>=2){n();return}t?.(T)}catch(x){gt.error(x?.detail),console.error("Quick login failed:",x)}finally{p(!1)}}};return s.length===0?null:w.jsxs("div",{className:Ht.quickLogin,children:[w.jsxs("div",{className:Ht.quickAccounts,children:[w.jsxs("div",{className:Ht.selectedAccount,onClick:()=>l(!u),children:[w.jsx("div",{className:Ht.accountInfo,children:w.jsx("span",{className:Ht.accountName,children:a?.username})}),w.jsx(jp,{className:St(Ht.arrow,u&&Ht.arrowRotate)})]}),u&&w.jsx("div",{className:Ht.accountList,children:w.jsx("div",{className:Ht.listScroll,children:s.map((x,T)=>w.jsxs("div",{className:St(Ht.accountItem,x.openid===a?.openid&&Ht.active),onClick:()=>C(T),children:[w.jsx("div",{className:Ht.itemInfo,children:w.jsx("span",{className:Ht.itemName,children:x.username})}),w.jsx("div",{className:Ht.deleteBtn,onClick:P=>S(P,T),children:w.jsx(g1,{className:"size-4 text-gray-400 hover:text-red-500"})})]},x.openid))})})]}),w.jsx(Rt,{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?"登录中...":"登录"}),w.jsx(Qs,{}),w.jsx(Po,{open:h,onOpenChange:m,showCloseIcon:!1,classNames:{popup:"w-[300px] p-6"},children:w.jsxs("div",{className:"text-center",children:[w.jsxs("div",{className:"mb-4",children:[w.jsx("p",{className:"text-base font-medium text-gray-900",children:"是否确认删除该条账号登录记录?"}),w.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"删除后登录记录将不会保存。"})]}),w.jsxs("div",{className:"flex gap-3 mt-6",children:[w.jsx(Rt,{className:"flex-1 h-9 border border-gray-300 rounded-full text-gray-600",onClick:()=>m(!1),children:"取消"}),w.jsx(Rt,{className:"flex-1 h-9 bg-gradient-to-r from-[#497efe] to-[#947afa] text-white rounded-full",onClick:E,children:"确认删除"})]})]})})]})}const bP=Vh({name:pi().refine(e=>e.length>=1,{error:"请输入真实姓名",abort:!0}).refine(e=>/^[\u4e00-\u9fa5]{2,6}$/.test(e),{error:"姓名须由 2-6 个汉字组成",abort:!0}),idcard:pi().refine(e=>e.length>=1,{error:"请输入身份证号",abort:!0}).refine(e=>/^\d{17}(\d|X|x)$/.test(e),{error:"身份证号格式不正确",abort:!0})});function wP(){const{gameId:e,onLoginSuccess:t,onAccountLoginSuccess:n,onPhoneLoginSuccess:r,showRealNameModal:o,setShowRealNameModal:s,onClose:i}=Dn(),[a,c]=f.useState({}),{mutate:u,isPending:l}=sn({mutationFn:async p=>{const m=$r(e)[0];if(!m)throw new Error("未找到登录账号信息");await C1({uid:m.uid,authorization:m.authorization,name:p.name,idcard:p.idcard});const g=await T1(m.authorization),v={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};gt.success("实名认证成功"),s(!1),v.account?.mobile?r?.(v):n?.(v),t?.(v)},onError:p=>{gt.error(p.message||"实名认证失败")}}),d=p=>{const h=bP.safeParse(p);if(!h.success){c(oi(h.error).fieldErrors);return}c({}),u(h.data)};return w.jsxs(Po,{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:[w.jsx("div",{className:"text-sm text-gray-500 mb-6 text-center",children:"根据《关于防止未成年人沉迷网络游戏的通知》,游戏用户需使用有效身份证进行实名认证。"}),w.jsxs(To,{onFormSubmit:d,errors:a,className:"space-y-4",children:[w.jsxs(Wr,{name:"name",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Gs,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的真实姓名"})}),w.jsx(Zs,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsxs(Wr,{name:"idcard",children:[w.jsx("div",{className:"flex items-center border border-gray-300 rounded-full px-4 h-12 focus-within:border-[#787bf4] transition-colors",children:w.jsx(Gs,{className:"flex-1 outline-none text-base bg-transparent",placeholder:"请输入您的身份证号",maxLength:18})}),w.jsx(Zs,{className:"mt-1 ml-2 text-xs text-red-500"})]}),w.jsx(Rt,{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:l,children:l?"提交中...":"提交认证"}),w.jsx("button",{type:"button",className:"w-full mt-4 text-sm text-gray-400 hover:text-gray-600 transition-colors",onClick:i,children:"退出游戏"})]})]})}const Gh={modal:"_modal_1pbx2_2",close:"_close_1pbx2_8"},mi={autoLoginHint:"_autoLoginHint_h58ls_1",left:"_left_h58ls_22",loading:"_loading_h58ls_28",switchBtn:"_switchBtn_h58ls_37"};function SP({onSwitch:e}){const{autoLoginAccountName:t,setIsAutoLoggingIn:n}=Dn(),r=()=>{n(!1),e()};return w.jsxs("div",{className:mi.autoLoginHint,children:[w.jsxs("div",{className:mi.left,children:[w.jsx("div",{className:mi.loading}),w.jsxs("span",{children:[t," 正在登录..."]})]}),w.jsx("button",{className:mi.switchBtn,onClick:r,children:"切换账号"})]})}function EP({open:e,onOpenChange:t}){const{gameId:n,loginTypes:r,currentLoginType:o,closeable:s,isShowGiantLogo:i,onLoginSuccess:a,triggerRealNameAuth:c,showRealNameModal:u,setIsAutoLoggingIn:l,setAutoLoginAccountName:d}=Dn(),[p,h]=oe.useState(!1),m=oe.useMemo(()=>$r(n),[n,e]),g=e&&m.length>0&&!p;oe.useEffect(()=>{if(!e){h(!1),l(!1);return}if(g){const S=m[0];(async()=>{if(!S){h(!0);return}l(!0),d(S.username);try{Qd(S.authorization);const b=await Wp(),x={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(x,S.authorization,n),x.realname&&x.realname.reject>=2){l(!1),h(!0),c();return}l(!1),h(!0),t?.(!1),a?.(x)}catch(b){console.error("Auto quick login failed:",b),l(!1),h(!0)}})()}},[e,n,g]);const v=tf({loginTypes:r,gameId:n}),y=nf({loginTypes:r,gameId:n}),C=ef({loginTypes:r,gameId:n});return w.jsxs(w.Fragment,{children:[g&&w.jsx(SP,{onSwitch:()=>h(!0)}),w.jsxs(Po,{open:e&&!g&&!u,onOpenChange:t,classNames:{popup:St("w-[400px] p-5",Gh.modal),close:Gh.close},showCloseIcon:s,children:[i&&!iS(n)&&w.jsx("section",{className:"flex items-center justify-center mb-6",children:w.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"})}),w.jsxs("section",{children:[o==="quick"&&w.jsx(vP,{}),o===at.MOBILE&&y&&w.jsx(Wh,{}),o===at.ROLE_ID&&v&&w.jsx(Zh,{}),o===at.GIANT&&C&&w.jsx(K1,{})]})]}),w.jsx(wP,{})]})}class xP extends oe.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 jc({open:e,onOpenChange:t,sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:i,onLoginError:a,closeable:c=!0,mountToaster:u=!0,toastConfigs:l,...d}){const[p]=oe.useState(()=>new Tm);return w.jsxs(oe.StrictMode,{children:[w.jsx(_m,{client:p,children:w.jsx(df,{value:{sceneId:n,onPhoneLoginSuccess:r,onAccountLoginSuccess:o,onUidLoginSuccess:s,onLoginSuccess:h=>{mS(pS({gameId:pr(d.gameId),serverUserInfo:h})),i?.(h)},onLoginError:a,closeable:c,onClose:()=>t?.(!1),...d},children:w.jsx(xP,{children:w.jsx(EP,{open:e,onOpenChange:t})})})}),u&&w.jsx(nS,{toastConfigs:l})]})}const Yh=e=>za(pr(e)),Xh=e=>hS(pr(e)),qh=e=>!!za(pr(e));function Kh({loginTypes:e,defaultLoginType:t,gameId:n,onLoginSuccess:r,onLoginError:o}){const s=pr(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=em.createRoot(i),c=()=>{setTimeout(()=>{a.unmount(),i.remove()},200)},u=()=>{a.render(w.jsx(jc,{gameId:s,loginTypes:e,defaultLoginType:t,open:!1,onOpenChange:l,onLoginSuccess:r,onLoginError:o})),c()},l=d=>{d||u()};return a.render(w.jsx(jc,{gameId:s,loginTypes:e,defaultLoginType:t,open:!0,onOpenChange:l,onLoginSuccess:r,onLoginError:o})),{close:u}}const CP={init:cf,login:Kh,logout:Xh,getUserInfo:Yh,isLoggedIn:qh};yt.ConfigProvider=df,yt.Login=jc,yt.MobileLogin=Wh,yt.SDK=CP,yt.UidLogin=Zh,yt.getGameId=pr,yt.getUserInfo=Yh,yt.init=cf,yt.isLoggedIn=qh,yt.login=Kh,yt.logout=Xh,Object.defineProperty(yt,Symbol.toStringTag,{value:"Module"})}));
|