@nextclaw/ui 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,337 +0,0 @@
1
- var am=t=>{throw TypeError(t)};var _c=(t,r,o)=>r.has(t)||am("Cannot "+o);var M=(t,r,o)=>(_c(t,r,"read from private field"),o?o.call(t):r.get(t)),ye=(t,r,o)=>r.has(t)?am("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,o),ue=(t,r,o,a)=>(_c(t,r,"write to private field"),a?a.call(t,o):r.set(t,o),o),Re=(t,r,o)=>(_c(t,r,"access private method"),o);var sl=(t,r,o,a)=>({set _(l){ue(t,r,l,o)},get _(){return M(t,r,a)}});function bw(t,r){for(var o=0;o<r.length;o++){const a=r[o];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in t)){const u=Object.getOwnPropertyDescriptor(a,l);u&&Object.defineProperty(t,l,u.get?u:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function o(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(l){if(l.ep)return;l.ep=!0;const u=o(l);fetch(l.href,u)}})();function Lg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dc={exports:{}},ka={},zc={exports:{}},Te={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var im;function Sw(){if(im)return Te;im=1;var t=Symbol.for("react.element"),r=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),b=Symbol.iterator;function C(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,w={};function k(O,K,le){this.props=O,this.context=K,this.refs=w,this.updater=le||v}k.prototype.isReactComponent={},k.prototype.setState=function(O,K){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,K,"setState")},k.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function j(){}j.prototype=k.prototype;function R(O,K,le){this.props=O,this.context=K,this.refs=w,this.updater=le||v}var N=R.prototype=new j;N.constructor=R,E(N,k.prototype),N.isPureReactComponent=!0;var T=Array.isArray,U=Object.prototype.hasOwnProperty,V={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function X(O,K,le){var ce,xe={},Se=null,re=null;if(K!=null)for(ce in K.ref!==void 0&&(re=K.ref),K.key!==void 0&&(Se=""+K.key),K)U.call(K,ce)&&!W.hasOwnProperty(ce)&&(xe[ce]=K[ce]);var ge=arguments.length-2;if(ge===1)xe.children=le;else if(1<ge){for(var Ce=Array(ge),Ne=0;Ne<ge;Ne++)Ce[Ne]=arguments[Ne+2];xe.children=Ce}if(O&&O.defaultProps)for(ce in ge=O.defaultProps,ge)xe[ce]===void 0&&(xe[ce]=ge[ce]);return{$$typeof:t,type:O,key:Se,ref:re,props:xe,_owner:V.current}}function H(O,K){return{$$typeof:t,type:O.type,key:K,ref:O.ref,props:O.props,_owner:O._owner}}function G(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function _(O){var K={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(le){return K[le]})}var L=/\/+/g;function B(O,K){return typeof O=="object"&&O!==null&&O.key!=null?_(""+O.key):K.toString(36)}function Q(O,K,le,ce,xe){var Se=typeof O;(Se==="undefined"||Se==="boolean")&&(O=null);var re=!1;if(O===null)re=!0;else switch(Se){case"string":case"number":re=!0;break;case"object":switch(O.$$typeof){case t:case r:re=!0}}if(re)return re=O,xe=xe(re),O=ce===""?"."+B(re,0):ce,T(xe)?(le="",O!=null&&(le=O.replace(L,"$&/")+"/"),Q(xe,K,le,"",function(Ne){return Ne})):xe!=null&&(G(xe)&&(xe=H(xe,le+(!xe.key||re&&re.key===xe.key?"":(""+xe.key).replace(L,"$&/")+"/")+O)),K.push(xe)),1;if(re=0,ce=ce===""?".":ce+":",T(O))for(var ge=0;ge<O.length;ge++){Se=O[ge];var Ce=ce+B(Se,ge);re+=Q(Se,K,le,Ce,xe)}else if(Ce=C(O),typeof Ce=="function")for(O=Ce.call(O),ge=0;!(Se=O.next()).done;)Se=Se.value,Ce=ce+B(Se,ge++),re+=Q(Se,K,le,Ce,xe);else if(Se==="object")throw K=String(O),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return re}function te(O,K,le){if(O==null)return O;var ce=[],xe=0;return Q(O,ce,"","",function(Se){return K.call(le,Se,xe++)}),ce}function ae(O){if(O._status===-1){var K=O._result;K=K(),K.then(function(le){(O._status===0||O._status===-1)&&(O._status=1,O._result=le)},function(le){(O._status===0||O._status===-1)&&(O._status=2,O._result=le)}),O._status===-1&&(O._status=0,O._result=K)}if(O._status===1)return O._result.default;throw O._result}var ie={current:null},F={transition:null},q={ReactCurrentDispatcher:ie,ReactCurrentBatchConfig:F,ReactCurrentOwner:V};function ee(){throw Error("act(...) is not supported in production builds of React.")}return Te.Children={map:te,forEach:function(O,K,le){te(O,function(){K.apply(this,arguments)},le)},count:function(O){var K=0;return te(O,function(){K++}),K},toArray:function(O){return te(O,function(K){return K})||[]},only:function(O){if(!G(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},Te.Component=k,Te.Fragment=o,Te.Profiler=l,Te.PureComponent=R,Te.StrictMode=a,Te.Suspense=m,Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,Te.act=ee,Te.cloneElement=function(O,K,le){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var ce=E({},O.props),xe=O.key,Se=O.ref,re=O._owner;if(K!=null){if(K.ref!==void 0&&(Se=K.ref,re=V.current),K.key!==void 0&&(xe=""+K.key),O.type&&O.type.defaultProps)var ge=O.type.defaultProps;for(Ce in K)U.call(K,Ce)&&!W.hasOwnProperty(Ce)&&(ce[Ce]=K[Ce]===void 0&&ge!==void 0?ge[Ce]:K[Ce])}var Ce=arguments.length-2;if(Ce===1)ce.children=le;else if(1<Ce){ge=Array(Ce);for(var Ne=0;Ne<Ce;Ne++)ge[Ne]=arguments[Ne+2];ce.children=ge}return{$$typeof:t,type:O.type,key:xe,ref:Se,props:ce,_owner:re}},Te.createContext=function(O){return O={$$typeof:f,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:u,_context:O},O.Consumer=O},Te.createElement=X,Te.createFactory=function(O){var K=X.bind(null,O);return K.type=O,K},Te.createRef=function(){return{current:null}},Te.forwardRef=function(O){return{$$typeof:h,render:O}},Te.isValidElement=G,Te.lazy=function(O){return{$$typeof:x,_payload:{_status:-1,_result:O},_init:ae}},Te.memo=function(O,K){return{$$typeof:g,type:O,compare:K===void 0?null:K}},Te.startTransition=function(O){var K=F.transition;F.transition={};try{O()}finally{F.transition=K}},Te.unstable_act=ee,Te.useCallback=function(O,K){return ie.current.useCallback(O,K)},Te.useContext=function(O){return ie.current.useContext(O)},Te.useDebugValue=function(){},Te.useDeferredValue=function(O){return ie.current.useDeferredValue(O)},Te.useEffect=function(O,K){return ie.current.useEffect(O,K)},Te.useId=function(){return ie.current.useId()},Te.useImperativeHandle=function(O,K,le){return ie.current.useImperativeHandle(O,K,le)},Te.useInsertionEffect=function(O,K){return ie.current.useInsertionEffect(O,K)},Te.useLayoutEffect=function(O,K){return ie.current.useLayoutEffect(O,K)},Te.useMemo=function(O,K){return ie.current.useMemo(O,K)},Te.useReducer=function(O,K,le){return ie.current.useReducer(O,K,le)},Te.useRef=function(O){return ie.current.useRef(O)},Te.useState=function(O){return ie.current.useState(O)},Te.useSyncExternalStore=function(O,K,le){return ie.current.useSyncExternalStore(O,K,le)},Te.useTransition=function(){return ie.current.useTransition()},Te.version="18.3.1",Te}var lm;function zd(){return lm||(lm=1,zc.exports=Sw()),zc.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var um;function Cw(){if(um)return ka;um=1;var t=zd(),r=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function f(h,m,g){var x,b={},C=null,v=null;g!==void 0&&(C=""+g),m.key!==void 0&&(C=""+m.key),m.ref!==void 0&&(v=m.ref);for(x in m)a.call(m,x)&&!u.hasOwnProperty(x)&&(b[x]=m[x]);if(h&&h.defaultProps)for(x in m=h.defaultProps,m)b[x]===void 0&&(b[x]=m[x]);return{$$typeof:r,type:h,key:C,ref:v,props:b,_owner:l.current}}return ka.Fragment=o,ka.jsx=f,ka.jsxs=f,ka}var cm;function kw(){return cm||(cm=1,Dc.exports=Cw()),Dc.exports}var d=kw(),y=zd();const se=Lg(y),_g=bw({__proto__:null,default:se},[y]);var al={},Fc={exports:{}},zt={},Bc={exports:{}},Uc={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var dm;function Ew(){return dm||(dm=1,(function(t){function r(F,q){var ee=F.length;F.push(q);e:for(;0<ee;){var O=ee-1>>>1,K=F[O];if(0<l(K,q))F[O]=q,F[ee]=K,ee=O;else break e}}function o(F){return F.length===0?null:F[0]}function a(F){if(F.length===0)return null;var q=F[0],ee=F.pop();if(ee!==q){F[0]=ee;e:for(var O=0,K=F.length,le=K>>>1;O<le;){var ce=2*(O+1)-1,xe=F[ce],Se=ce+1,re=F[Se];if(0>l(xe,ee))Se<K&&0>l(re,xe)?(F[O]=re,F[Se]=ee,O=Se):(F[O]=xe,F[ce]=ee,O=ce);else if(Se<K&&0>l(re,ee))F[O]=re,F[Se]=ee,O=Se;else break e}}return q}function l(F,q){var ee=F.sortIndex-q.sortIndex;return ee!==0?ee:F.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var f=Date,h=f.now();t.unstable_now=function(){return f.now()-h}}var m=[],g=[],x=1,b=null,C=3,v=!1,E=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function N(F){for(var q=o(g);q!==null;){if(q.callback===null)a(g);else if(q.startTime<=F)a(g),q.sortIndex=q.expirationTime,r(m,q);else break;q=o(g)}}function T(F){if(w=!1,N(F),!E)if(o(m)!==null)E=!0,ae(U);else{var q=o(g);q!==null&&ie(T,q.startTime-F)}}function U(F,q){E=!1,w&&(w=!1,j(X),X=-1),v=!0;var ee=C;try{for(N(q),b=o(m);b!==null&&(!(b.expirationTime>q)||F&&!_());){var O=b.callback;if(typeof O=="function"){b.callback=null,C=b.priorityLevel;var K=O(b.expirationTime<=q);q=t.unstable_now(),typeof K=="function"?b.callback=K:b===o(m)&&a(m),N(q)}else a(m);b=o(m)}if(b!==null)var le=!0;else{var ce=o(g);ce!==null&&ie(T,ce.startTime-q),le=!1}return le}finally{b=null,C=ee,v=!1}}var V=!1,W=null,X=-1,H=5,G=-1;function _(){return!(t.unstable_now()-G<H)}function L(){if(W!==null){var F=t.unstable_now();G=F;var q=!0;try{q=W(!0,F)}finally{q?B():(V=!1,W=null)}}else V=!1}var B;if(typeof R=="function")B=function(){R(L)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,te=Q.port2;Q.port1.onmessage=L,B=function(){te.postMessage(null)}}else B=function(){k(L,0)};function ae(F){W=F,V||(V=!0,B())}function ie(F,q){X=k(function(){F(t.unstable_now())},q)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){E||v||(E=!0,ae(U))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return C},t.unstable_getFirstCallbackNode=function(){return o(m)},t.unstable_next=function(F){switch(C){case 1:case 2:case 3:var q=3;break;default:q=C}var ee=C;C=q;try{return F()}finally{C=ee}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,q){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var ee=C;C=F;try{return q()}finally{C=ee}},t.unstable_scheduleCallback=function(F,q,ee){var O=t.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?O+ee:O):ee=O,F){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=ee+K,F={id:x++,callback:q,priorityLevel:F,startTime:ee,expirationTime:K,sortIndex:-1},ee>O?(F.sortIndex=ee,r(g,F),o(m)===null&&F===o(g)&&(w?(j(X),X=-1):w=!0,ie(T,ee-O))):(F.sortIndex=K,r(m,F),E||v||(E=!0,ae(U))),F},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(F){var q=C;return function(){var ee=C;C=q;try{return F.apply(this,arguments)}finally{C=ee}}}})(Uc)),Uc}var fm;function Nw(){return fm||(fm=1,Bc.exports=Ew()),Bc.exports}/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var hm;function Pw(){if(hm)return zt;hm=1;var t=zd(),r=Nw();function o(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,s=1;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};function u(e,n){f(e,n),f(e+"Capture",n)}function f(e,n){for(l[e]=n,e=0;e<n.length;e++)a.add(n[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),m=Object.prototype.hasOwnProperty,g=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x={},b={};function C(e){return m.call(b,e)?!0:m.call(x,e)?!1:g.test(e)?b[e]=!0:(x[e]=!0,!1)}function v(e,n,s,i){if(s!==null&&s.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return i?!1:s!==null?!s.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function E(e,n,s,i){if(n===null||typeof n>"u"||v(e,n,s,i))return!0;if(i)return!1;if(s!==null)switch(s.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function w(e,n,s,i,c,p,S){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=i,this.attributeNamespace=c,this.mustUseProperty=s,this.propertyName=e,this.type=n,this.sanitizeURL=p,this.removeEmptyString=S}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){k[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];k[n]=new w(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){k[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){k[e]=new w(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){k[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){k[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){k[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){k[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){k[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function R(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(j,R);k[n]=new w(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(j,R);k[n]=new w(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(j,R);k[n]=new w(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){k[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),k.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){k[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function N(e,n,s,i){var c=k.hasOwnProperty(n)?k[n]:null;(c!==null?c.type!==0:i||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(E(n,s,c,i)&&(s=null),i||c===null?C(n)&&(s===null?e.removeAttribute(n):e.setAttribute(n,""+s)):c.mustUseProperty?e[c.propertyName]=s===null?c.type===3?!1:"":s:(n=c.attributeName,i=c.attributeNamespace,s===null?e.removeAttribute(n):(c=c.type,s=c===3||c===4&&s===!0?"":""+s,i?e.setAttributeNS(i,n,s):e.setAttribute(n,s))))}var T=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,U=Symbol.for("react.element"),V=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),X=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),G=Symbol.for("react.provider"),_=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ie=Symbol.for("react.offscreen"),F=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Object.assign,O;function K(e){if(O===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
34
- `+O+e}var le=!1;function ce(e,n){if(!e||le)return"";le=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch($){var i=$}Reflect.construct(e,[],n)}else{try{n.call()}catch($){i=$}e.call(n.prototype)}else{try{throw Error()}catch($){i=$}e()}}catch($){if($&&i&&typeof $.stack=="string"){for(var c=$.stack.split(`
35
- `),p=i.stack.split(`
36
- `),S=c.length-1,P=p.length-1;1<=S&&0<=P&&c[S]!==p[P];)P--;for(;1<=S&&0<=P;S--,P--)if(c[S]!==p[P]){if(S!==1||P!==1)do if(S--,P--,0>P||c[S]!==p[P]){var I=`
37
- `+c[S].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),I}while(1<=S&&0<=P);break}}}finally{le=!1,Error.prepareStackTrace=s}return(e=e?e.displayName||e.name:"")?K(e):""}function xe(e){switch(e.tag){case 5:return K(e.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return e=ce(e.type,!1),e;case 11:return e=ce(e.type.render,!1),e;case 1:return e=ce(e.type,!0),e;default:return""}}function Se(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case W:return"Fragment";case V:return"Portal";case H:return"Profiler";case X:return"StrictMode";case B:return"Suspense";case Q:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _:return(e.displayName||"Context")+".Consumer";case G:return(e._context.displayName||"Context")+".Provider";case L:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return n=e.displayName||null,n!==null?n:Se(e.type)||"Memo";case ae:n=e._payload,e=e._init;try{return Se(e(n))}catch{}}return null}function re(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Se(n);case 8:return n===X?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n}return null}function ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ce(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Ne(e){var n=Ce(e)?"checked":"value",s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),i=""+e[n];if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var c=s.get,p=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return c.call(this)},set:function(S){i=""+S,p.call(this,S)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Me(e){e._valueTracker||(e._valueTracker=Ne(e))}function Ie(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var s=n.getValue(),i="";return e&&(i=Ce(e)?e.checked?"true":"false":e.value),e=i,e!==s?(n.setValue(e),!0):!1}function Ze(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function yt(e,n){var s=n.checked;return ee({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??e._wrapperState.initialChecked})}function En(e,n){var s=n.defaultValue==null?"":n.defaultValue,i=n.checked!=null?n.checked:n.defaultChecked;s=ge(n.value!=null?n.value:s),e._wrapperState={initialChecked:i,initialValue:s,controlled:n.type==="checkbox"||n.type==="radio"?n.checked!=null:n.value!=null}}function on(e,n){n=n.checked,n!=null&&N(e,"checked",n,!1)}function sn(e,n){on(e,n);var s=ge(n.value),i=n.type;if(s!=null)i==="number"?(s===0&&e.value===""||e.value!=s)&&(e.value=""+s):e.value!==""+s&&(e.value=""+s);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}n.hasOwnProperty("value")?Nn(e,n.type,s):n.hasOwnProperty("defaultValue")&&Nn(e,n.type,ge(n.defaultValue)),n.checked==null&&n.defaultChecked!=null&&(e.defaultChecked=!!n.defaultChecked)}function yr(e,n,s){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var i=n.type;if(!(i!=="submit"&&i!=="reset"||n.value!==void 0&&n.value!==null))return;n=""+e._wrapperState.initialValue,s||n===e.value||(e.value=n),e.defaultValue=n}s=e.name,s!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,s!==""&&(e.name=s)}function Nn(e,n,s){(n!=="number"||Ze(e.ownerDocument)!==e)&&(s==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+s&&(e.defaultValue=""+s))}var vr=Array.isArray;function Gt(e,n,s,i){if(e=e.options,n){n={};for(var c=0;c<s.length;c++)n["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=n.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&i&&(e[s].defaultSelected=!0)}else{for(s=""+ge(s),n=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}n!==null||e[c].disabled||(n=e[c])}n!==null&&(n.selected=!0)}}function Do(e,n){if(n.dangerouslySetInnerHTML!=null)throw Error(o(91));return ee({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pn(e,n){var s=n.value;if(s==null){if(s=n.children,n=n.defaultValue,s!=null){if(n!=null)throw Error(o(92));if(vr(s)){if(1<s.length)throw Error(o(93));s=s[0]}n=s}n==null&&(n=""),s=n}e._wrapperState={initialValue:ge(s)}}function Ka(e,n){var s=ge(n.value),i=ge(n.defaultValue);s!=null&&(s=""+s,s!==e.value&&(e.value=s),n.defaultValue==null&&e.defaultValue!==s&&(e.defaultValue=s)),i!=null&&(e.defaultValue=""+i)}function Qa(e){var n=e.textContent;n===e._wrapperState.initialValue&&n!==""&&n!==null&&(e.value=n)}function Et(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jn(e,n){return e==null||e==="http://www.w3.org/1999/xhtml"?Et(n):e==="http://www.w3.org/2000/svg"&&n==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var zo,qa=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(n,s,i,c){MSApp.execUnsafeLocalFunction(function(){return e(n,s,i,c)})}:e})(function(e,n){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=n;else{for(zo=zo||document.createElement("div"),zo.innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=zo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}});function Rn(e,n){if(n){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=n;return}}e.textContent=n}var so={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ga=["Webkit","ms","Moz","O"];Object.keys(so).forEach(function(e){Ga.forEach(function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),so[n]=so[e]})});function Fo(e,n,s){return n==null||typeof n=="boolean"||n===""?"":s||typeof n!="number"||n===0||so.hasOwnProperty(e)&&so[e]?(""+n).trim():n+"px"}function Qn(e,n){e=e.style;for(var s in n)if(n.hasOwnProperty(s)){var i=s.indexOf("--")===0,c=Fo(s,n[s],i);s==="float"&&(s="cssFloat"),i?e.setProperty(s,c):e[s]=c}}var Ya=ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mn(e,n){if(n){if(Ya[e]&&(n.children!=null||n.dangerouslySetInnerHTML!=null))throw Error(o(137,e));if(n.dangerouslySetInnerHTML!=null){if(n.children!=null)throw Error(o(60));if(typeof n.dangerouslySetInnerHTML!="object"||!("__html"in n.dangerouslySetInnerHTML))throw Error(o(61))}if(n.style!=null&&typeof n.style!="object")throw Error(o(62))}}function $s(e,n){if(e.indexOf("-")===-1)return typeof n.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ws=null;function Bo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Uo=null,xr=null,Tn=null;function an(e){if(e=ua(e)){if(typeof Uo!="function")throw Error(o(280));var n=e.stateNode;n&&(n=wi(n),Uo(e.stateNode,e.type,n))}}function Xa(e){xr?Tn?Tn.push(e):Tn=[e]:xr=e}function Ee(){if(xr){var e=xr,n=Tn;if(Tn=xr=null,an(e),n)for(e=0;e<n.length;e++)an(n[e])}}function _e(e,n){return e(n)}function Fe(){}var Nt=!1;function Tt(e,n,s){if(Nt)return e(n,s);Nt=!0;try{return _e(e,n,s)}finally{Nt=!1,(xr!==null||Tn!==null)&&(Fe(),Ee())}}function It(e,n){var s=e.stateNode;if(s===null)return null;var i=wi(s);if(i===null)return null;s=i[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,n,typeof s));return s}var ln=!1;if(h)try{var ht={};Object.defineProperty(ht,"passive",{get:function(){ln=!0}}),window.addEventListener("test",ht,ht),window.removeEventListener("test",ht,ht)}catch{ln=!1}function In(e,n,s,i,c,p,S,P,I){var $=Array.prototype.slice.call(arguments,3);try{n.apply(s,$)}catch(Z){this.onError(Z)}}var Hs=!1,Ja=null,Za=!1,tu=null,j0={onError:function(e){Hs=!0,Ja=e}};function R0(e,n,s,i,c,p,S,P,I){Hs=!1,Ja=null,In.apply(j0,arguments)}function M0(e,n,s,i,c,p,S,P,I){if(R0.apply(this,arguments),Hs){if(Hs){var $=Ja;Hs=!1,Ja=null}else throw Error(o(198));Za||(Za=!0,tu=$)}}function ao(e){var n=e,s=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(s=n.return),e=n.return;while(e)}return n.tag===3?s:null}function Rf(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function Mf(e){if(ao(e)!==e)throw Error(o(188))}function T0(e){var n=e.alternate;if(!n){if(n=ao(e),n===null)throw Error(o(188));return n!==e?null:e}for(var s=e,i=n;;){var c=s.return;if(c===null)break;var p=c.alternate;if(p===null){if(i=c.return,i!==null){s=i;continue}break}if(c.child===p.child){for(p=c.child;p;){if(p===s)return Mf(c),e;if(p===i)return Mf(c),n;p=p.sibling}throw Error(o(188))}if(s.return!==i.return)s=c,i=p;else{for(var S=!1,P=c.child;P;){if(P===s){S=!0,s=c,i=p;break}if(P===i){S=!0,i=c,s=p;break}P=P.sibling}if(!S){for(P=p.child;P;){if(P===s){S=!0,s=p,i=c;break}if(P===i){S=!0,i=p,s=c;break}P=P.sibling}if(!S)throw Error(o(189))}}if(s.alternate!==i)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:n}function Tf(e){return e=T0(e),e!==null?If(e):null}function If(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var n=If(e);if(n!==null)return n;e=e.sibling}return null}var Of=r.unstable_scheduleCallback,Af=r.unstable_cancelCallback,I0=r.unstable_shouldYield,O0=r.unstable_requestPaint,et=r.unstable_now,A0=r.unstable_getCurrentPriorityLevel,nu=r.unstable_ImmediatePriority,Lf=r.unstable_UserBlockingPriority,ei=r.unstable_NormalPriority,L0=r.unstable_LowPriority,_f=r.unstable_IdlePriority,ti=null,On=null;function _0(e){if(On&&typeof On.onCommitFiberRoot=="function")try{On.onCommitFiberRoot(ti,e,void 0,(e.current.flags&128)===128)}catch{}}var un=Math.clz32?Math.clz32:F0,D0=Math.log,z0=Math.LN2;function F0(e){return e>>>=0,e===0?32:31-(D0(e)/z0|0)|0}var ni=64,ri=4194304;function Vs(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function oi(e,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,c=e.suspendedLanes,p=e.pingedLanes,S=s&268435455;if(S!==0){var P=S&~c;P!==0?i=Vs(P):(p&=S,p!==0&&(i=Vs(p)))}else S=s&~c,S!==0?i=Vs(S):p!==0&&(i=Vs(p));if(i===0)return 0;if(n!==0&&n!==i&&(n&c)===0&&(c=i&-i,p=n&-n,c>=p||c===16&&(p&4194240)!==0))return n;if((i&4)!==0&&(i|=s&16),n=e.entangledLanes,n!==0)for(e=e.entanglements,n&=i;0<n;)s=31-un(n),c=1<<s,i|=e[s],n&=~c;return i}function B0(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function U0(e,n){for(var s=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,p=e.pendingLanes;0<p;){var S=31-un(p),P=1<<S,I=c[S];I===-1?((P&s)===0||(P&i)!==0)&&(c[S]=B0(P,n)):I<=n&&(e.expiredLanes|=P),p&=~P}}function ru(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Df(){var e=ni;return ni<<=1,(ni&4194240)===0&&(ni=64),e}function ou(e){for(var n=[],s=0;31>s;s++)n.push(e);return n}function Ks(e,n,s){e.pendingLanes|=n,n!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,n=31-un(n),e[n]=s}function $0(e,n){var s=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<s;){var c=31-un(s),p=1<<c;n[c]=0,i[c]=-1,e[c]=-1,s&=~p}}function su(e,n){var s=e.entangledLanes|=n;for(e=e.entanglements;s;){var i=31-un(s),c=1<<i;c&n|e[i]&n&&(e[i]|=n),s&=~c}}var ze=0;function zf(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ff,au,Bf,Uf,$f,iu=!1,si=[],wr=null,br=null,Sr=null,Qs=new Map,qs=new Map,Cr=[],W0="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Wf(e,n){switch(e){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":br=null;break;case"mouseover":case"mouseout":Sr=null;break;case"pointerover":case"pointerout":Qs.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":qs.delete(n.pointerId)}}function Gs(e,n,s,i,c,p){return e===null||e.nativeEvent!==p?(e={blockedOn:n,domEventName:s,eventSystemFlags:i,nativeEvent:p,targetContainers:[c]},n!==null&&(n=ua(n),n!==null&&au(n)),e):(e.eventSystemFlags|=i,n=e.targetContainers,c!==null&&n.indexOf(c)===-1&&n.push(c),e)}function H0(e,n,s,i,c){switch(n){case"focusin":return wr=Gs(wr,e,n,s,i,c),!0;case"dragenter":return br=Gs(br,e,n,s,i,c),!0;case"mouseover":return Sr=Gs(Sr,e,n,s,i,c),!0;case"pointerover":var p=c.pointerId;return Qs.set(p,Gs(Qs.get(p)||null,e,n,s,i,c)),!0;case"gotpointercapture":return p=c.pointerId,qs.set(p,Gs(qs.get(p)||null,e,n,s,i,c)),!0}return!1}function Hf(e){var n=io(e.target);if(n!==null){var s=ao(n);if(s!==null){if(n=s.tag,n===13){if(n=Rf(s),n!==null){e.blockedOn=n,$f(e.priority,function(){Bf(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ai(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var s=uu(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Ws=i,s.target.dispatchEvent(i),Ws=null}else return n=ua(s),n!==null&&au(n),e.blockedOn=s,!1;n.shift()}return!0}function Vf(e,n,s){ai(e)&&s.delete(n)}function V0(){iu=!1,wr!==null&&ai(wr)&&(wr=null),br!==null&&ai(br)&&(br=null),Sr!==null&&ai(Sr)&&(Sr=null),Qs.forEach(Vf),qs.forEach(Vf)}function Ys(e,n){e.blockedOn===n&&(e.blockedOn=null,iu||(iu=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,V0)))}function Xs(e){function n(c){return Ys(c,e)}if(0<si.length){Ys(si[0],e);for(var s=1;s<si.length;s++){var i=si[s];i.blockedOn===e&&(i.blockedOn=null)}}for(wr!==null&&Ys(wr,e),br!==null&&Ys(br,e),Sr!==null&&Ys(Sr,e),Qs.forEach(n),qs.forEach(n),s=0;s<Cr.length;s++)i=Cr[s],i.blockedOn===e&&(i.blockedOn=null);for(;0<Cr.length&&(s=Cr[0],s.blockedOn===null);)Hf(s),s.blockedOn===null&&Cr.shift()}var $o=T.ReactCurrentBatchConfig,ii=!0;function K0(e,n,s,i){var c=ze,p=$o.transition;$o.transition=null;try{ze=1,lu(e,n,s,i)}finally{ze=c,$o.transition=p}}function Q0(e,n,s,i){var c=ze,p=$o.transition;$o.transition=null;try{ze=4,lu(e,n,s,i)}finally{ze=c,$o.transition=p}}function lu(e,n,s,i){if(ii){var c=uu(e,n,s,i);if(c===null)Nu(e,n,i,li,s),Wf(e,i);else if(H0(c,e,n,s,i))i.stopPropagation();else if(Wf(e,i),n&4&&-1<W0.indexOf(e)){for(;c!==null;){var p=ua(c);if(p!==null&&Ff(p),p=uu(e,n,s,i),p===null&&Nu(e,n,i,li,s),p===c)break;c=p}c!==null&&i.stopPropagation()}else Nu(e,n,i,null,s)}}var li=null;function uu(e,n,s,i){if(li=null,e=Bo(i),e=io(e),e!==null)if(n=ao(e),n===null)e=null;else if(s=n.tag,s===13){if(e=Rf(n),e!==null)return e;e=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return li=e,null}function Kf(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(A0()){case nu:return 1;case Lf:return 4;case ei:case L0:return 16;case _f:return 536870912;default:return 16}default:return 16}}var kr=null,cu=null,ui=null;function Qf(){if(ui)return ui;var e,n=cu,s=n.length,i,c="value"in kr?kr.value:kr.textContent,p=c.length;for(e=0;e<s&&n[e]===c[e];e++);var S=s-e;for(i=1;i<=S&&n[s-i]===c[p-i];i++);return ui=c.slice(e,1<i?1-i:void 0)}function ci(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function di(){return!0}function qf(){return!1}function $t(e){function n(s,i,c,p,S){this._reactName=s,this._targetInst=c,this.type=i,this.nativeEvent=p,this.target=S,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(s=e[P],this[P]=s?s(p):p[P]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?di:qf,this.isPropagationStopped=qf,this}return ee(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=di)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=di)},persist:function(){},isPersistent:di}),n}var Wo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},du=$t(Wo),Js=ee({},Wo,{view:0,detail:0}),q0=$t(Js),fu,hu,Zs,fi=ee({},Js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:mu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Zs&&(Zs&&e.type==="mousemove"?(fu=e.screenX-Zs.screenX,hu=e.screenY-Zs.screenY):hu=fu=0,Zs=e),fu)},movementY:function(e){return"movementY"in e?e.movementY:hu}}),Gf=$t(fi),G0=ee({},fi,{dataTransfer:0}),Y0=$t(G0),X0=ee({},Js,{relatedTarget:0}),pu=$t(X0),J0=ee({},Wo,{animationName:0,elapsedTime:0,pseudoElement:0}),Z0=$t(J0),ex=ee({},Wo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),tx=$t(ex),nx=ee({},Wo,{data:0}),Yf=$t(nx),rx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ox={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},sx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ax(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=sx[e])?!!n[e]:!1}function mu(){return ax}var ix=ee({},Js,{key:function(e){if(e.key){var n=rx[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=ci(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ox[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:mu,charCode:function(e){return e.type==="keypress"?ci(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ci(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lx=$t(ix),ux=ee({},fi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xf=$t(ux),cx=ee({},Js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:mu}),dx=$t(cx),fx=ee({},Wo,{propertyName:0,elapsedTime:0,pseudoElement:0}),hx=$t(fx),px=ee({},fi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mx=$t(px),gx=[9,13,27,32],gu=h&&"CompositionEvent"in window,ea=null;h&&"documentMode"in document&&(ea=document.documentMode);var yx=h&&"TextEvent"in window&&!ea,Jf=h&&(!gu||ea&&8<ea&&11>=ea),Zf=" ",eh=!1;function th(e,n){switch(e){case"keyup":return gx.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ho=!1;function vx(e,n){switch(e){case"compositionend":return nh(n);case"keypress":return n.which!==32?null:(eh=!0,Zf);case"textInput":return e=n.data,e===Zf&&eh?null:e;default:return null}}function xx(e,n){if(Ho)return e==="compositionend"||!gu&&th(e,n)?(e=Qf(),ui=cu=kr=null,Ho=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Jf&&n.locale!=="ko"?null:n.data;default:return null}}var wx={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rh(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!wx[e.type]:n==="textarea"}function oh(e,n,s,i){Xa(i),n=yi(n,"onChange"),0<n.length&&(s=new du("onChange","change",null,s,i),e.push({event:s,listeners:n}))}var ta=null,na=null;function bx(e){Sh(e,0)}function hi(e){var n=Go(e);if(Ie(n))return e}function Sx(e,n){if(e==="change")return n}var sh=!1;if(h){var yu;if(h){var vu="oninput"in document;if(!vu){var ah=document.createElement("div");ah.setAttribute("oninput","return;"),vu=typeof ah.oninput=="function"}yu=vu}else yu=!1;sh=yu&&(!document.documentMode||9<document.documentMode)}function ih(){ta&&(ta.detachEvent("onpropertychange",lh),na=ta=null)}function lh(e){if(e.propertyName==="value"&&hi(na)){var n=[];oh(n,na,e,Bo(e)),Tt(bx,n)}}function Cx(e,n,s){e==="focusin"?(ih(),ta=n,na=s,ta.attachEvent("onpropertychange",lh)):e==="focusout"&&ih()}function kx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hi(na)}function Ex(e,n){if(e==="click")return hi(n)}function Nx(e,n){if(e==="input"||e==="change")return hi(n)}function Px(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var cn=typeof Object.is=="function"?Object.is:Px;function ra(e,n){if(cn(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var s=Object.keys(e),i=Object.keys(n);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var c=s[i];if(!m.call(n,c)||!cn(e[c],n[c]))return!1}return!0}function uh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ch(e,n){var s=uh(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=n&&i>=n)return{node:s,offset:n-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=uh(s)}}function dh(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?dh(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function fh(){for(var e=window,n=Ze();n instanceof e.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)e=n.contentWindow;else break;n=Ze(e.document)}return n}function xu(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}function jx(e){var n=fh(),s=e.focusedElem,i=e.selectionRange;if(n!==s&&s&&s.ownerDocument&&dh(s.ownerDocument.documentElement,s)){if(i!==null&&xu(s)){if(n=i.start,e=i.end,e===void 0&&(e=n),"selectionStart"in s)s.selectionStart=n,s.selectionEnd=Math.min(e,s.value.length);else if(e=(n=s.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var c=s.textContent.length,p=Math.min(i.start,c);i=i.end===void 0?p:Math.min(i.end,c),!e.extend&&p>i&&(c=i,i=p,p=c),c=ch(s,p);var S=ch(s,i);c&&S&&(e.rangeCount!==1||e.anchorNode!==c.node||e.anchorOffset!==c.offset||e.focusNode!==S.node||e.focusOffset!==S.offset)&&(n=n.createRange(),n.setStart(c.node,c.offset),e.removeAllRanges(),p>i?(e.addRange(n),e.extend(S.node,S.offset)):(n.setEnd(S.node,S.offset),e.addRange(n)))}}for(n=[],e=s;e=e.parentNode;)e.nodeType===1&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<n.length;s++)e=n[s],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Rx=h&&"documentMode"in document&&11>=document.documentMode,Vo=null,wu=null,oa=null,bu=!1;function hh(e,n,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;bu||Vo==null||Vo!==Ze(i)||(i=Vo,"selectionStart"in i&&xu(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),oa&&ra(oa,i)||(oa=i,i=yi(wu,"onSelect"),0<i.length&&(n=new du("onSelect","select",null,n,s),e.push({event:n,listeners:i}),n.target=Vo)))}function pi(e,n){var s={};return s[e.toLowerCase()]=n.toLowerCase(),s["Webkit"+e]="webkit"+n,s["Moz"+e]="moz"+n,s}var Ko={animationend:pi("Animation","AnimationEnd"),animationiteration:pi("Animation","AnimationIteration"),animationstart:pi("Animation","AnimationStart"),transitionend:pi("Transition","TransitionEnd")},Su={},ph={};h&&(ph=document.createElement("div").style,"AnimationEvent"in window||(delete Ko.animationend.animation,delete Ko.animationiteration.animation,delete Ko.animationstart.animation),"TransitionEvent"in window||delete Ko.transitionend.transition);function mi(e){if(Su[e])return Su[e];if(!Ko[e])return e;var n=Ko[e],s;for(s in n)if(n.hasOwnProperty(s)&&s in ph)return Su[e]=n[s];return e}var mh=mi("animationend"),gh=mi("animationiteration"),yh=mi("animationstart"),vh=mi("transitionend"),xh=new Map,wh="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Er(e,n){xh.set(e,n),u(n,[e])}for(var Cu=0;Cu<wh.length;Cu++){var ku=wh[Cu],Mx=ku.toLowerCase(),Tx=ku[0].toUpperCase()+ku.slice(1);Er(Mx,"on"+Tx)}Er(mh,"onAnimationEnd"),Er(gh,"onAnimationIteration"),Er(yh,"onAnimationStart"),Er("dblclick","onDoubleClick"),Er("focusin","onFocus"),Er("focusout","onBlur"),Er(vh,"onTransitionEnd"),f("onMouseEnter",["mouseout","mouseover"]),f("onMouseLeave",["mouseout","mouseover"]),f("onPointerEnter",["pointerout","pointerover"]),f("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var sa="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ix=new Set("cancel close invalid load scroll toggle".split(" ").concat(sa));function bh(e,n,s){var i=e.type||"unknown-event";e.currentTarget=s,M0(i,n,void 0,e),e.currentTarget=null}function Sh(e,n){n=(n&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],c=i.event;i=i.listeners;e:{var p=void 0;if(n)for(var S=i.length-1;0<=S;S--){var P=i[S],I=P.instance,$=P.currentTarget;if(P=P.listener,I!==p&&c.isPropagationStopped())break e;bh(c,P,$),p=I}else for(S=0;S<i.length;S++){if(P=i[S],I=P.instance,$=P.currentTarget,P=P.listener,I!==p&&c.isPropagationStopped())break e;bh(c,P,$),p=I}}}if(Za)throw e=tu,Za=!1,tu=null,e}function $e(e,n){var s=n[Iu];s===void 0&&(s=n[Iu]=new Set);var i=e+"__bubble";s.has(i)||(Ch(n,e,2,!1),s.add(i))}function Eu(e,n,s){var i=0;n&&(i|=4),Ch(s,e,i,n)}var gi="_reactListening"+Math.random().toString(36).slice(2);function aa(e){if(!e[gi]){e[gi]=!0,a.forEach(function(s){s!=="selectionchange"&&(Ix.has(s)||Eu(s,!1,e),Eu(s,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[gi]||(n[gi]=!0,Eu("selectionchange",!1,n))}}function Ch(e,n,s,i){switch(Kf(n)){case 1:var c=K0;break;case 4:c=Q0;break;default:c=lu}s=c.bind(null,n,s,e),c=void 0,!ln||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(n,s,{capture:!0,passive:c}):e.addEventListener(n,s,!0):c!==void 0?e.addEventListener(n,s,{passive:c}):e.addEventListener(n,s,!1)}function Nu(e,n,s,i,c){var p=i;if((n&1)===0&&(n&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var P=i.stateNode.containerInfo;if(P===c||P.nodeType===8&&P.parentNode===c)break;if(S===4)for(S=i.return;S!==null;){var I=S.tag;if((I===3||I===4)&&(I=S.stateNode.containerInfo,I===c||I.nodeType===8&&I.parentNode===c))return;S=S.return}for(;P!==null;){if(S=io(P),S===null)return;if(I=S.tag,I===5||I===6){i=p=S;continue e}P=P.parentNode}}i=i.return}Tt(function(){var $=p,Z=Bo(s),ne=[];e:{var J=xh.get(e);if(J!==void 0){var de=du,he=e;switch(e){case"keypress":if(ci(s)===0)break e;case"keydown":case"keyup":de=lx;break;case"focusin":he="focus",de=pu;break;case"focusout":he="blur",de=pu;break;case"beforeblur":case"afterblur":de=pu;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Gf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Y0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=dx;break;case mh:case gh:case yh:de=Z0;break;case vh:de=hx;break;case"scroll":de=q0;break;case"wheel":de=mx;break;case"copy":case"cut":case"paste":de=tx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=Xf}var pe=(n&4)!==0,tt=!pe&&e==="scroll",D=pe?J!==null?J+"Capture":null:J;pe=[];for(var A=$,z;A!==null;){z=A;var oe=z.stateNode;if(z.tag===5&&oe!==null&&(z=oe,D!==null&&(oe=It(A,D),oe!=null&&pe.push(ia(A,oe,z)))),tt)break;A=A.return}0<pe.length&&(J=new de(J,he,null,s,Z),ne.push({event:J,listeners:pe}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",J&&s!==Ws&&(he=s.relatedTarget||s.fromElement)&&(io(he)||he[qn]))break e;if((de||J)&&(J=Z.window===Z?Z:(J=Z.ownerDocument)?J.defaultView||J.parentWindow:window,de?(he=s.relatedTarget||s.toElement,de=$,he=he?io(he):null,he!==null&&(tt=ao(he),he!==tt||he.tag!==5&&he.tag!==6)&&(he=null)):(de=null,he=$),de!==he)){if(pe=Gf,oe="onMouseLeave",D="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Xf,oe="onPointerLeave",D="onPointerEnter",A="pointer"),tt=de==null?J:Go(de),z=he==null?J:Go(he),J=new pe(oe,A+"leave",de,s,Z),J.target=tt,J.relatedTarget=z,oe=null,io(Z)===$&&(pe=new pe(D,A+"enter",he,s,Z),pe.target=z,pe.relatedTarget=tt,oe=pe),tt=oe,de&&he)t:{for(pe=de,D=he,A=0,z=pe;z;z=Qo(z))A++;for(z=0,oe=D;oe;oe=Qo(oe))z++;for(;0<A-z;)pe=Qo(pe),A--;for(;0<z-A;)D=Qo(D),z--;for(;A--;){if(pe===D||D!==null&&pe===D.alternate)break t;pe=Qo(pe),D=Qo(D)}pe=null}else pe=null;de!==null&&kh(ne,J,de,pe,!1),he!==null&&tt!==null&&kh(ne,tt,he,pe,!0)}}e:{if(J=$?Go($):window,de=J.nodeName&&J.nodeName.toLowerCase(),de==="select"||de==="input"&&J.type==="file")var me=Sx;else if(rh(J))if(sh)me=Nx;else{me=kx;var we=Cx}else(de=J.nodeName)&&de.toLowerCase()==="input"&&(J.type==="checkbox"||J.type==="radio")&&(me=Ex);if(me&&(me=me(e,$))){oh(ne,me,s,Z);break e}we&&we(e,J,$),e==="focusout"&&(we=J._wrapperState)&&we.controlled&&J.type==="number"&&Nn(J,"number",J.value)}switch(we=$?Go($):window,e){case"focusin":(rh(we)||we.contentEditable==="true")&&(Vo=we,wu=$,oa=null);break;case"focusout":oa=wu=Vo=null;break;case"mousedown":bu=!0;break;case"contextmenu":case"mouseup":case"dragend":bu=!1,hh(ne,s,Z);break;case"selectionchange":if(Rx)break;case"keydown":case"keyup":hh(ne,s,Z)}var be;if(gu)e:{switch(e){case"compositionstart":var ke="onCompositionStart";break e;case"compositionend":ke="onCompositionEnd";break e;case"compositionupdate":ke="onCompositionUpdate";break e}ke=void 0}else Ho?th(e,s)&&(ke="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(ke="onCompositionStart");ke&&(Jf&&s.locale!=="ko"&&(Ho||ke!=="onCompositionStart"?ke==="onCompositionEnd"&&Ho&&(be=Qf()):(kr=Z,cu="value"in kr?kr.value:kr.textContent,Ho=!0)),we=yi($,ke),0<we.length&&(ke=new Yf(ke,e,null,s,Z),ne.push({event:ke,listeners:we}),be?ke.data=be:(be=nh(s),be!==null&&(ke.data=be)))),(be=yx?vx(e,s):xx(e,s))&&($=yi($,"onBeforeInput"),0<$.length&&(Z=new Yf("onBeforeInput","beforeinput",null,s,Z),ne.push({event:Z,listeners:$}),Z.data=be))}Sh(ne,n)})}function ia(e,n,s){return{instance:e,listener:n,currentTarget:s}}function yi(e,n){for(var s=n+"Capture",i=[];e!==null;){var c=e,p=c.stateNode;c.tag===5&&p!==null&&(c=p,p=It(e,s),p!=null&&i.unshift(ia(e,p,c)),p=It(e,n),p!=null&&i.push(ia(e,p,c))),e=e.return}return i}function Qo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function kh(e,n,s,i,c){for(var p=n._reactName,S=[];s!==null&&s!==i;){var P=s,I=P.alternate,$=P.stateNode;if(I!==null&&I===i)break;P.tag===5&&$!==null&&(P=$,c?(I=It(s,p),I!=null&&S.unshift(ia(s,I,P))):c||(I=It(s,p),I!=null&&S.push(ia(s,I,P)))),s=s.return}S.length!==0&&e.push({event:n,listeners:S})}var Ox=/\r\n?/g,Ax=/\u0000|\uFFFD/g;function Eh(e){return(typeof e=="string"?e:""+e).replace(Ox,`
38
- `).replace(Ax,"")}function vi(e,n,s){if(n=Eh(n),Eh(e)!==n&&s)throw Error(o(425))}function xi(){}var Pu=null,ju=null;function Ru(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Mu=typeof setTimeout=="function"?setTimeout:void 0,Lx=typeof clearTimeout=="function"?clearTimeout:void 0,Nh=typeof Promise=="function"?Promise:void 0,_x=typeof queueMicrotask=="function"?queueMicrotask:typeof Nh<"u"?function(e){return Nh.resolve(null).then(e).catch(Dx)}:Mu;function Dx(e){setTimeout(function(){throw e})}function Tu(e,n){var s=n,i=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"){if(i===0){e.removeChild(c),Xs(n);return}i--}else s!=="$"&&s!=="$?"&&s!=="$!"||i++;s=c}while(s);Xs(n)}function Nr(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?")break;if(n==="/$")return null}}return e}function Ph(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"){if(n===0)return e;n--}else s==="/$"&&n++}e=e.previousSibling}return null}var qo=Math.random().toString(36).slice(2),An="__reactFiber$"+qo,la="__reactProps$"+qo,qn="__reactContainer$"+qo,Iu="__reactEvents$"+qo,zx="__reactListeners$"+qo,Fx="__reactHandles$"+qo;function io(e){var n=e[An];if(n)return n;for(var s=e.parentNode;s;){if(n=s[qn]||s[An]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(e=Ph(e);e!==null;){if(s=e[An])return s;e=Ph(e)}return n}e=s,s=e.parentNode}return null}function ua(e){return e=e[An]||e[qn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Go(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(o(33))}function wi(e){return e[la]||null}var Ou=[],Yo=-1;function Pr(e){return{current:e}}function We(e){0>Yo||(e.current=Ou[Yo],Ou[Yo]=null,Yo--)}function Be(e,n){Yo++,Ou[Yo]=e.current,e.current=n}var jr={},vt=Pr(jr),Ot=Pr(!1),lo=jr;function Xo(e,n){var s=e.type.contextTypes;if(!s)return jr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===n)return i.__reactInternalMemoizedMaskedChildContext;var c={},p;for(p in s)c[p]=n[p];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=c),c}function At(e){return e=e.childContextTypes,e!=null}function bi(){We(Ot),We(vt)}function jh(e,n,s){if(vt.current!==jr)throw Error(o(168));Be(vt,n),Be(Ot,s)}function Rh(e,n,s){var i=e.stateNode;if(n=n.childContextTypes,typeof i.getChildContext!="function")return s;i=i.getChildContext();for(var c in i)if(!(c in n))throw Error(o(108,re(e)||"Unknown",c));return ee({},s,i)}function Si(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||jr,lo=vt.current,Be(vt,e),Be(Ot,Ot.current),!0}function Mh(e,n,s){var i=e.stateNode;if(!i)throw Error(o(169));s?(e=Rh(e,n,lo),i.__reactInternalMemoizedMergedChildContext=e,We(Ot),We(vt),Be(vt,e)):We(Ot),Be(Ot,s)}var Gn=null,Ci=!1,Au=!1;function Th(e){Gn===null?Gn=[e]:Gn.push(e)}function Bx(e){Ci=!0,Th(e)}function Rr(){if(!Au&&Gn!==null){Au=!0;var e=0,n=ze;try{var s=Gn;for(ze=1;e<s.length;e++){var i=s[e];do i=i(!0);while(i!==null)}Gn=null,Ci=!1}catch(c){throw Gn!==null&&(Gn=Gn.slice(e+1)),Of(nu,Rr),c}finally{ze=n,Au=!1}}return null}var Jo=[],Zo=0,ki=null,Ei=0,Yt=[],Xt=0,uo=null,Yn=1,Xn="";function co(e,n){Jo[Zo++]=Ei,Jo[Zo++]=ki,ki=e,Ei=n}function Ih(e,n,s){Yt[Xt++]=Yn,Yt[Xt++]=Xn,Yt[Xt++]=uo,uo=e;var i=Yn;e=Xn;var c=32-un(i)-1;i&=~(1<<c),s+=1;var p=32-un(n)+c;if(30<p){var S=c-c%5;p=(i&(1<<S)-1).toString(32),i>>=S,c-=S,Yn=1<<32-un(n)+c|s<<c|i,Xn=p+e}else Yn=1<<p|s<<c|i,Xn=e}function Lu(e){e.return!==null&&(co(e,1),Ih(e,1,0))}function _u(e){for(;e===ki;)ki=Jo[--Zo],Jo[Zo]=null,Ei=Jo[--Zo],Jo[Zo]=null;for(;e===uo;)uo=Yt[--Xt],Yt[Xt]=null,Xn=Yt[--Xt],Yt[Xt]=null,Yn=Yt[--Xt],Yt[Xt]=null}var Wt=null,Ht=null,Qe=!1,dn=null;function Oh(e,n){var s=tn(5,null,null,0);s.elementType="DELETED",s.stateNode=n,s.return=e,n=e.deletions,n===null?(e.deletions=[s],e.flags|=16):n.push(s)}function Ah(e,n){switch(e.tag){case 5:var s=e.type;return n=n.nodeType!==1||s.toLowerCase()!==n.nodeName.toLowerCase()?null:n,n!==null?(e.stateNode=n,Wt=e,Ht=Nr(n.firstChild),!0):!1;case 6:return n=e.pendingProps===""||n.nodeType!==3?null:n,n!==null?(e.stateNode=n,Wt=e,Ht=null,!0):!1;case 13:return n=n.nodeType!==8?null:n,n!==null?(s=uo!==null?{id:Yn,overflow:Xn}:null,e.memoizedState={dehydrated:n,treeContext:s,retryLane:1073741824},s=tn(18,null,null,0),s.stateNode=n,s.return=e,e.child=s,Wt=e,Ht=null,!0):!1;default:return!1}}function Du(e){return(e.mode&1)!==0&&(e.flags&128)===0}function zu(e){if(Qe){var n=Ht;if(n){var s=n;if(!Ah(e,n)){if(Du(e))throw Error(o(418));n=Nr(s.nextSibling);var i=Wt;n&&Ah(e,n)?Oh(i,s):(e.flags=e.flags&-4097|2,Qe=!1,Wt=e)}}else{if(Du(e))throw Error(o(418));e.flags=e.flags&-4097|2,Qe=!1,Wt=e}}}function Lh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Wt=e}function Ni(e){if(e!==Wt)return!1;if(!Qe)return Lh(e),Qe=!0,!1;var n;if((n=e.tag!==3)&&!(n=e.tag!==5)&&(n=e.type,n=n!=="head"&&n!=="body"&&!Ru(e.type,e.memoizedProps)),n&&(n=Ht)){if(Du(e))throw _h(),Error(o(418));for(;n;)Oh(e,n),n=Nr(n.nextSibling)}if(Lh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));e:{for(e=e.nextSibling,n=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"){if(n===0){Ht=Nr(e.nextSibling);break e}n--}else s!=="$"&&s!=="$!"&&s!=="$?"||n++}e=e.nextSibling}Ht=null}}else Ht=Wt?Nr(e.stateNode.nextSibling):null;return!0}function _h(){for(var e=Ht;e;)e=Nr(e.nextSibling)}function es(){Ht=Wt=null,Qe=!1}function Fu(e){dn===null?dn=[e]:dn.push(e)}var Ux=T.ReactCurrentBatchConfig;function ca(e,n,s){if(e=s.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(o(309));var i=s.stateNode}if(!i)throw Error(o(147,e));var c=i,p=""+e;return n!==null&&n.ref!==null&&typeof n.ref=="function"&&n.ref._stringRef===p?n.ref:(n=function(S){var P=c.refs;S===null?delete P[p]:P[p]=S},n._stringRef=p,n)}if(typeof e!="string")throw Error(o(284));if(!s._owner)throw Error(o(290,e))}return e}function Pi(e,n){throw e=Object.prototype.toString.call(n),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Dh(e){var n=e._init;return n(e._payload)}function zh(e){function n(D,A){if(e){var z=D.deletions;z===null?(D.deletions=[A],D.flags|=16):z.push(A)}}function s(D,A){if(!e)return null;for(;A!==null;)n(D,A),A=A.sibling;return null}function i(D,A){for(D=new Map;A!==null;)A.key!==null?D.set(A.key,A):D.set(A.index,A),A=A.sibling;return D}function c(D,A){return D=Dr(D,A),D.index=0,D.sibling=null,D}function p(D,A,z){return D.index=z,e?(z=D.alternate,z!==null?(z=z.index,z<A?(D.flags|=2,A):z):(D.flags|=2,A)):(D.flags|=1048576,A)}function S(D){return e&&D.alternate===null&&(D.flags|=2),D}function P(D,A,z,oe){return A===null||A.tag!==6?(A=Mc(z,D.mode,oe),A.return=D,A):(A=c(A,z),A.return=D,A)}function I(D,A,z,oe){var me=z.type;return me===W?Z(D,A,z.props.children,oe,z.key):A!==null&&(A.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ae&&Dh(me)===A.type)?(oe=c(A,z.props),oe.ref=ca(D,A,z),oe.return=D,oe):(oe=Xi(z.type,z.key,z.props,null,D.mode,oe),oe.ref=ca(D,A,z),oe.return=D,oe)}function $(D,A,z,oe){return A===null||A.tag!==4||A.stateNode.containerInfo!==z.containerInfo||A.stateNode.implementation!==z.implementation?(A=Tc(z,D.mode,oe),A.return=D,A):(A=c(A,z.children||[]),A.return=D,A)}function Z(D,A,z,oe,me){return A===null||A.tag!==7?(A=xo(z,D.mode,oe,me),A.return=D,A):(A=c(A,z),A.return=D,A)}function ne(D,A,z){if(typeof A=="string"&&A!==""||typeof A=="number")return A=Mc(""+A,D.mode,z),A.return=D,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case U:return z=Xi(A.type,A.key,A.props,null,D.mode,z),z.ref=ca(D,null,A),z.return=D,z;case V:return A=Tc(A,D.mode,z),A.return=D,A;case ae:var oe=A._init;return ne(D,oe(A._payload),z)}if(vr(A)||q(A))return A=xo(A,D.mode,z,null),A.return=D,A;Pi(D,A)}return null}function J(D,A,z,oe){var me=A!==null?A.key:null;if(typeof z=="string"&&z!==""||typeof z=="number")return me!==null?null:P(D,A,""+z,oe);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case U:return z.key===me?I(D,A,z,oe):null;case V:return z.key===me?$(D,A,z,oe):null;case ae:return me=z._init,J(D,A,me(z._payload),oe)}if(vr(z)||q(z))return me!==null?null:Z(D,A,z,oe,null);Pi(D,z)}return null}function de(D,A,z,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number")return D=D.get(z)||null,P(A,D,""+oe,me);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case U:return D=D.get(oe.key===null?z:oe.key)||null,I(A,D,oe,me);case V:return D=D.get(oe.key===null?z:oe.key)||null,$(A,D,oe,me);case ae:var we=oe._init;return de(D,A,z,we(oe._payload),me)}if(vr(oe)||q(oe))return D=D.get(z)||null,Z(A,D,oe,me,null);Pi(A,oe)}return null}function he(D,A,z,oe){for(var me=null,we=null,be=A,ke=A=0,dt=null;be!==null&&ke<z.length;ke++){be.index>ke?(dt=be,be=null):dt=be.sibling;var Le=J(D,be,z[ke],oe);if(Le===null){be===null&&(be=dt);break}e&&be&&Le.alternate===null&&n(D,be),A=p(Le,A,ke),we===null?me=Le:we.sibling=Le,we=Le,be=dt}if(ke===z.length)return s(D,be),Qe&&co(D,ke),me;if(be===null){for(;ke<z.length;ke++)be=ne(D,z[ke],oe),be!==null&&(A=p(be,A,ke),we===null?me=be:we.sibling=be,we=be);return Qe&&co(D,ke),me}for(be=i(D,be);ke<z.length;ke++)dt=de(be,D,ke,z[ke],oe),dt!==null&&(e&&dt.alternate!==null&&be.delete(dt.key===null?ke:dt.key),A=p(dt,A,ke),we===null?me=dt:we.sibling=dt,we=dt);return e&&be.forEach(function(zr){return n(D,zr)}),Qe&&co(D,ke),me}function pe(D,A,z,oe){var me=q(z);if(typeof me!="function")throw Error(o(150));if(z=me.call(z),z==null)throw Error(o(151));for(var we=me=null,be=A,ke=A=0,dt=null,Le=z.next();be!==null&&!Le.done;ke++,Le=z.next()){be.index>ke?(dt=be,be=null):dt=be.sibling;var zr=J(D,be,Le.value,oe);if(zr===null){be===null&&(be=dt);break}e&&be&&zr.alternate===null&&n(D,be),A=p(zr,A,ke),we===null?me=zr:we.sibling=zr,we=zr,be=dt}if(Le.done)return s(D,be),Qe&&co(D,ke),me;if(be===null){for(;!Le.done;ke++,Le=z.next())Le=ne(D,Le.value,oe),Le!==null&&(A=p(Le,A,ke),we===null?me=Le:we.sibling=Le,we=Le);return Qe&&co(D,ke),me}for(be=i(D,be);!Le.done;ke++,Le=z.next())Le=de(be,D,ke,Le.value,oe),Le!==null&&(e&&Le.alternate!==null&&be.delete(Le.key===null?ke:Le.key),A=p(Le,A,ke),we===null?me=Le:we.sibling=Le,we=Le);return e&&be.forEach(function(ww){return n(D,ww)}),Qe&&co(D,ke),me}function tt(D,A,z,oe){if(typeof z=="object"&&z!==null&&z.type===W&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case U:e:{for(var me=z.key,we=A;we!==null;){if(we.key===me){if(me=z.type,me===W){if(we.tag===7){s(D,we.sibling),A=c(we,z.props.children),A.return=D,D=A;break e}}else if(we.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===ae&&Dh(me)===we.type){s(D,we.sibling),A=c(we,z.props),A.ref=ca(D,we,z),A.return=D,D=A;break e}s(D,we);break}else n(D,we);we=we.sibling}z.type===W?(A=xo(z.props.children,D.mode,oe,z.key),A.return=D,D=A):(oe=Xi(z.type,z.key,z.props,null,D.mode,oe),oe.ref=ca(D,A,z),oe.return=D,D=oe)}return S(D);case V:e:{for(we=z.key;A!==null;){if(A.key===we)if(A.tag===4&&A.stateNode.containerInfo===z.containerInfo&&A.stateNode.implementation===z.implementation){s(D,A.sibling),A=c(A,z.children||[]),A.return=D,D=A;break e}else{s(D,A);break}else n(D,A);A=A.sibling}A=Tc(z,D.mode,oe),A.return=D,D=A}return S(D);case ae:return we=z._init,tt(D,A,we(z._payload),oe)}if(vr(z))return he(D,A,z,oe);if(q(z))return pe(D,A,z,oe);Pi(D,z)}return typeof z=="string"&&z!==""||typeof z=="number"?(z=""+z,A!==null&&A.tag===6?(s(D,A.sibling),A=c(A,z),A.return=D,D=A):(s(D,A),A=Mc(z,D.mode,oe),A.return=D,D=A),S(D)):s(D,A)}return tt}var ts=zh(!0),Fh=zh(!1),ji=Pr(null),Ri=null,ns=null,Bu=null;function Uu(){Bu=ns=Ri=null}function $u(e){var n=ji.current;We(ji),e._currentValue=n}function Wu(e,n,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,i!==null&&(i.childLanes|=n)):i!==null&&(i.childLanes&n)!==n&&(i.childLanes|=n),e===s)break;e=e.return}}function rs(e,n){Ri=e,Bu=ns=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&n)!==0&&(Lt=!0),e.firstContext=null)}function Jt(e){var n=e._currentValue;if(Bu!==e)if(e={context:e,memoizedValue:n,next:null},ns===null){if(Ri===null)throw Error(o(308));ns=e,Ri.dependencies={lanes:0,firstContext:e}}else ns=ns.next=e;return n}var fo=null;function Hu(e){fo===null?fo=[e]:fo.push(e)}function Bh(e,n,s,i){var c=n.interleaved;return c===null?(s.next=s,Hu(n)):(s.next=c.next,c.next=s),n.interleaved=s,Jn(e,i)}function Jn(e,n){e.lanes|=n;var s=e.alternate;for(s!==null&&(s.lanes|=n),s=e,e=e.return;e!==null;)e.childLanes|=n,s=e.alternate,s!==null&&(s.childLanes|=n),s=e,e=e.return;return s.tag===3?s.stateNode:null}var Mr=!1;function Vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uh(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Zn(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function Tr(e,n,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ae&2)!==0){var c=i.pending;return c===null?n.next=n:(n.next=c.next,c.next=n),i.pending=n,Jn(e,s)}return c=i.interleaved,c===null?(n.next=n,Hu(i)):(n.next=c.next,c.next=n),i.interleaved=n,Jn(e,s)}function Mi(e,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194240)!==0)){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,su(e,s)}}function $h(e,n){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var c=null,p=null;if(s=s.firstBaseUpdate,s!==null){do{var S={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};p===null?c=p=S:p=p.next=S,s=s.next}while(s!==null);p===null?c=p=n:p=p.next=n}else c=p=n;s={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:p,shared:i.shared,effects:i.effects},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=n:e.next=n,s.lastBaseUpdate=n}function Ti(e,n,s,i){var c=e.updateQueue;Mr=!1;var p=c.firstBaseUpdate,S=c.lastBaseUpdate,P=c.shared.pending;if(P!==null){c.shared.pending=null;var I=P,$=I.next;I.next=null,S===null?p=$:S.next=$,S=I;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,P=Z.lastBaseUpdate,P!==S&&(P===null?Z.firstBaseUpdate=$:P.next=$,Z.lastBaseUpdate=I))}if(p!==null){var ne=c.baseState;S=0,Z=$=I=null,P=p;do{var J=P.lane,de=P.eventTime;if((i&J)===J){Z!==null&&(Z=Z.next={eventTime:de,lane:0,tag:P.tag,payload:P.payload,callback:P.callback,next:null});e:{var he=e,pe=P;switch(J=n,de=s,pe.tag){case 1:if(he=pe.payload,typeof he=="function"){ne=he.call(de,ne,J);break e}ne=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=pe.payload,J=typeof he=="function"?he.call(de,ne,J):he,J==null)break e;ne=ee({},ne,J);break e;case 2:Mr=!0}}P.callback!==null&&P.lane!==0&&(e.flags|=64,J=c.effects,J===null?c.effects=[P]:J.push(P))}else de={eventTime:de,lane:J,tag:P.tag,payload:P.payload,callback:P.callback,next:null},Z===null?($=Z=de,I=ne):Z=Z.next=de,S|=J;if(P=P.next,P===null){if(P=c.shared.pending,P===null)break;J=P,P=J.next,J.next=null,c.lastBaseUpdate=J,c.shared.pending=null}}while(!0);if(Z===null&&(I=ne),c.baseState=I,c.firstBaseUpdate=$,c.lastBaseUpdate=Z,n=c.shared.interleaved,n!==null){c=n;do S|=c.lane,c=c.next;while(c!==n)}else p===null&&(c.shared.lanes=0);mo|=S,e.lanes=S,e.memoizedState=ne}}function Wh(e,n,s){if(e=n.effects,n.effects=null,e!==null)for(n=0;n<e.length;n++){var i=e[n],c=i.callback;if(c!==null){if(i.callback=null,i=s,typeof c!="function")throw Error(o(191,c));c.call(i)}}}var da={},Ln=Pr(da),fa=Pr(da),ha=Pr(da);function ho(e){if(e===da)throw Error(o(174));return e}function Ku(e,n){switch(Be(ha,n),Be(fa,e),Be(Ln,da),e=n.nodeType,e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:jn(null,"");break;default:e=e===8?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=jn(n,e)}We(Ln),Be(Ln,n)}function os(){We(Ln),We(fa),We(ha)}function Hh(e){ho(ha.current);var n=ho(Ln.current),s=jn(n,e.type);n!==s&&(Be(fa,e),Be(Ln,s))}function Qu(e){fa.current===e&&(We(Ln),We(fa))}var Ge=Pr(0);function Ii(e){for(var n=e;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return n}else if(n.tag===19&&n.memoizedProps.revealOrder!==void 0){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var qu=[];function Gu(){for(var e=0;e<qu.length;e++)qu[e]._workInProgressVersionPrimary=null;qu.length=0}var Oi=T.ReactCurrentDispatcher,Yu=T.ReactCurrentBatchConfig,po=0,Ye=null,at=null,ut=null,Ai=!1,pa=!1,ma=0,$x=0;function xt(){throw Error(o(321))}function Xu(e,n){if(n===null)return!1;for(var s=0;s<n.length&&s<e.length;s++)if(!cn(e[s],n[s]))return!1;return!0}function Ju(e,n,s,i,c,p){if(po=p,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Oi.current=e===null||e.memoizedState===null?Kx:Qx,e=s(i,c),pa){p=0;do{if(pa=!1,ma=0,25<=p)throw Error(o(301));p+=1,ut=at=null,n.updateQueue=null,Oi.current=qx,e=s(i,c)}while(pa)}if(Oi.current=Di,n=at!==null&&at.next!==null,po=0,ut=at=Ye=null,Ai=!1,n)throw Error(o(300));return e}function Zu(){var e=ma!==0;return ma=0,e}function _n(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ye.memoizedState=ut=e:ut=ut.next=e,ut}function Zt(){if(at===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var n=ut===null?Ye.memoizedState:ut.next;if(n!==null)ut=n,at=e;else{if(e===null)throw Error(o(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},ut===null?Ye.memoizedState=ut=e:ut=ut.next=e}return ut}function ga(e,n){return typeof n=="function"?n(e):n}function ec(e){var n=Zt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=at,c=i.baseQueue,p=s.pending;if(p!==null){if(c!==null){var S=c.next;c.next=p.next,p.next=S}i.baseQueue=c=p,s.pending=null}if(c!==null){p=c.next,i=i.baseState;var P=S=null,I=null,$=p;do{var Z=$.lane;if((po&Z)===Z)I!==null&&(I=I.next={lane:0,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null}),i=$.hasEagerState?$.eagerState:e(i,$.action);else{var ne={lane:Z,action:$.action,hasEagerState:$.hasEagerState,eagerState:$.eagerState,next:null};I===null?(P=I=ne,S=i):I=I.next=ne,Ye.lanes|=Z,mo|=Z}$=$.next}while($!==null&&$!==p);I===null?S=i:I.next=P,cn(i,n.memoizedState)||(Lt=!0),n.memoizedState=i,n.baseState=S,n.baseQueue=I,s.lastRenderedState=i}if(e=s.interleaved,e!==null){c=e;do p=c.lane,Ye.lanes|=p,mo|=p,c=c.next;while(c!==e)}else c===null&&(s.lanes=0);return[n.memoizedState,s.dispatch]}function tc(e){var n=Zt(),s=n.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,c=s.pending,p=n.memoizedState;if(c!==null){s.pending=null;var S=c=c.next;do p=e(p,S.action),S=S.next;while(S!==c);cn(p,n.memoizedState)||(Lt=!0),n.memoizedState=p,n.baseQueue===null&&(n.baseState=p),s.lastRenderedState=p}return[p,i]}function Vh(){}function Kh(e,n){var s=Ye,i=Zt(),c=n(),p=!cn(i.memoizedState,c);if(p&&(i.memoizedState=c,Lt=!0),i=i.queue,nc(Gh.bind(null,s,i,e),[e]),i.getSnapshot!==n||p||ut!==null&&ut.memoizedState.tag&1){if(s.flags|=2048,ya(9,qh.bind(null,s,i,c,n),void 0,null),ct===null)throw Error(o(349));(po&30)!==0||Qh(s,n,c)}return c}function Qh(e,n,s){e.flags|=16384,e={getSnapshot:n,value:s},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.stores=[e]):(s=n.stores,s===null?n.stores=[e]:s.push(e))}function qh(e,n,s,i){n.value=s,n.getSnapshot=i,Yh(n)&&Xh(e)}function Gh(e,n,s){return s(function(){Yh(n)&&Xh(e)})}function Yh(e){var n=e.getSnapshot;e=e.value;try{var s=n();return!cn(e,s)}catch{return!0}}function Xh(e){var n=Jn(e,1);n!==null&&mn(n,e,1,-1)}function Jh(e){var n=_n();return typeof e=="function"&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},n.queue=e,e=e.dispatch=Vx.bind(null,Ye,e),[n.memoizedState,e]}function ya(e,n,s,i){return e={tag:e,create:n,destroy:s,deps:i,next:null},n=Ye.updateQueue,n===null?(n={lastEffect:null,stores:null},Ye.updateQueue=n,n.lastEffect=e.next=e):(s=n.lastEffect,s===null?n.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,n.lastEffect=e)),e}function Zh(){return Zt().memoizedState}function Li(e,n,s,i){var c=_n();Ye.flags|=e,c.memoizedState=ya(1|n,s,void 0,i===void 0?null:i)}function _i(e,n,s,i){var c=Zt();i=i===void 0?null:i;var p=void 0;if(at!==null){var S=at.memoizedState;if(p=S.destroy,i!==null&&Xu(i,S.deps)){c.memoizedState=ya(n,s,p,i);return}}Ye.flags|=e,c.memoizedState=ya(1|n,s,p,i)}function ep(e,n){return Li(8390656,8,e,n)}function nc(e,n){return _i(2048,8,e,n)}function tp(e,n){return _i(4,2,e,n)}function np(e,n){return _i(4,4,e,n)}function rp(e,n){if(typeof n=="function")return e=e(),n(e),function(){n(null)};if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function op(e,n,s){return s=s!=null?s.concat([e]):null,_i(4,4,rp.bind(null,n,e),s)}function rc(){}function sp(e,n){var s=Zt();n=n===void 0?null:n;var i=s.memoizedState;return i!==null&&n!==null&&Xu(n,i[1])?i[0]:(s.memoizedState=[e,n],e)}function ap(e,n){var s=Zt();n=n===void 0?null:n;var i=s.memoizedState;return i!==null&&n!==null&&Xu(n,i[1])?i[0]:(e=e(),s.memoizedState=[e,n],e)}function ip(e,n,s){return(po&21)===0?(e.baseState&&(e.baseState=!1,Lt=!0),e.memoizedState=s):(cn(s,n)||(s=Df(),Ye.lanes|=s,mo|=s,e.baseState=!0),n)}function Wx(e,n){var s=ze;ze=s!==0&&4>s?s:4,e(!0);var i=Yu.transition;Yu.transition={};try{e(!1),n()}finally{ze=s,Yu.transition=i}}function lp(){return Zt().memoizedState}function Hx(e,n,s){var i=Lr(e);if(s={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null},up(e))cp(n,s);else if(s=Bh(e,n,s,i),s!==null){var c=jt();mn(s,e,i,c),dp(s,n,i)}}function Vx(e,n,s){var i=Lr(e),c={lane:i,action:s,hasEagerState:!1,eagerState:null,next:null};if(up(e))cp(n,c);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=n.lastRenderedReducer,p!==null))try{var S=n.lastRenderedState,P=p(S,s);if(c.hasEagerState=!0,c.eagerState=P,cn(P,S)){var I=n.interleaved;I===null?(c.next=c,Hu(n)):(c.next=I.next,I.next=c),n.interleaved=c;return}}catch{}finally{}s=Bh(e,n,c,i),s!==null&&(c=jt(),mn(s,e,i,c),dp(s,n,i))}}function up(e){var n=e.alternate;return e===Ye||n!==null&&n===Ye}function cp(e,n){pa=Ai=!0;var s=e.pending;s===null?n.next=n:(n.next=s.next,s.next=n),e.pending=n}function dp(e,n,s){if((s&4194240)!==0){var i=n.lanes;i&=e.pendingLanes,s|=i,n.lanes=s,su(e,s)}}var Di={readContext:Jt,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},Kx={readContext:Jt,useCallback:function(e,n){return _n().memoizedState=[e,n===void 0?null:n],e},useContext:Jt,useEffect:ep,useImperativeHandle:function(e,n,s){return s=s!=null?s.concat([e]):null,Li(4194308,4,rp.bind(null,n,e),s)},useLayoutEffect:function(e,n){return Li(4194308,4,e,n)},useInsertionEffect:function(e,n){return Li(4,2,e,n)},useMemo:function(e,n){var s=_n();return n=n===void 0?null:n,e=e(),s.memoizedState=[e,n],e},useReducer:function(e,n,s){var i=_n();return n=s!==void 0?s(n):n,i.memoizedState=i.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},i.queue=e,e=e.dispatch=Hx.bind(null,Ye,e),[i.memoizedState,e]},useRef:function(e){var n=_n();return e={current:e},n.memoizedState=e},useState:Jh,useDebugValue:rc,useDeferredValue:function(e){return _n().memoizedState=e},useTransition:function(){var e=Jh(!1),n=e[0];return e=Wx.bind(null,e[1]),_n().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,s){var i=Ye,c=_n();if(Qe){if(s===void 0)throw Error(o(407));s=s()}else{if(s=n(),ct===null)throw Error(o(349));(po&30)!==0||Qh(i,n,s)}c.memoizedState=s;var p={value:s,getSnapshot:n};return c.queue=p,ep(Gh.bind(null,i,p,e),[e]),i.flags|=2048,ya(9,qh.bind(null,i,p,s,n),void 0,null),s},useId:function(){var e=_n(),n=ct.identifierPrefix;if(Qe){var s=Xn,i=Yn;s=(i&~(1<<32-un(i)-1)).toString(32)+s,n=":"+n+"R"+s,s=ma++,0<s&&(n+="H"+s.toString(32)),n+=":"}else s=$x++,n=":"+n+"r"+s.toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Qx={readContext:Jt,useCallback:sp,useContext:Jt,useEffect:nc,useImperativeHandle:op,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ap,useReducer:ec,useRef:Zh,useState:function(){return ec(ga)},useDebugValue:rc,useDeferredValue:function(e){var n=Zt();return ip(n,at.memoizedState,e)},useTransition:function(){var e=ec(ga)[0],n=Zt().memoizedState;return[e,n]},useMutableSource:Vh,useSyncExternalStore:Kh,useId:lp,unstable_isNewReconciler:!1},qx={readContext:Jt,useCallback:sp,useContext:Jt,useEffect:nc,useImperativeHandle:op,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ap,useReducer:tc,useRef:Zh,useState:function(){return tc(ga)},useDebugValue:rc,useDeferredValue:function(e){var n=Zt();return at===null?n.memoizedState=e:ip(n,at.memoizedState,e)},useTransition:function(){var e=tc(ga)[0],n=Zt().memoizedState;return[e,n]},useMutableSource:Vh,useSyncExternalStore:Kh,useId:lp,unstable_isNewReconciler:!1};function fn(e,n){if(e&&e.defaultProps){n=ee({},n),e=e.defaultProps;for(var s in e)n[s]===void 0&&(n[s]=e[s]);return n}return n}function oc(e,n,s,i){n=e.memoizedState,s=s(i,n),s=s==null?n:ee({},n,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var zi={isMounted:function(e){return(e=e._reactInternals)?ao(e)===e:!1},enqueueSetState:function(e,n,s){e=e._reactInternals;var i=jt(),c=Lr(e),p=Zn(i,c);p.payload=n,s!=null&&(p.callback=s),n=Tr(e,p,c),n!==null&&(mn(n,e,c,i),Mi(n,e,c))},enqueueReplaceState:function(e,n,s){e=e._reactInternals;var i=jt(),c=Lr(e),p=Zn(i,c);p.tag=1,p.payload=n,s!=null&&(p.callback=s),n=Tr(e,p,c),n!==null&&(mn(n,e,c,i),Mi(n,e,c))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var s=jt(),i=Lr(e),c=Zn(s,i);c.tag=2,n!=null&&(c.callback=n),n=Tr(e,c,i),n!==null&&(mn(n,e,i,s),Mi(n,e,i))}};function fp(e,n,s,i,c,p,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,S):n.prototype&&n.prototype.isPureReactComponent?!ra(s,i)||!ra(c,p):!0}function hp(e,n,s){var i=!1,c=jr,p=n.contextType;return typeof p=="object"&&p!==null?p=Jt(p):(c=At(n)?lo:vt.current,i=n.contextTypes,p=(i=i!=null)?Xo(e,c):jr),n=new n(s,p),e.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=zi,e.stateNode=n,n._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=c,e.__reactInternalMemoizedMaskedChildContext=p),n}function pp(e,n,s,i){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,i),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,i),n.state!==e&&zi.enqueueReplaceState(n,n.state,null)}function sc(e,n,s,i){var c=e.stateNode;c.props=s,c.state=e.memoizedState,c.refs={},Vu(e);var p=n.contextType;typeof p=="object"&&p!==null?c.context=Jt(p):(p=At(n)?lo:vt.current,c.context=Xo(e,p)),c.state=e.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(oc(e,n,p,s),c.state=e.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(n=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),n!==c.state&&zi.enqueueReplaceState(c,c.state,null),Ti(e,s,c,i),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308)}function ss(e,n){try{var s="",i=n;do s+=xe(i),i=i.return;while(i);var c=s}catch(p){c=`
39
- Error generating stack: `+p.message+`
40
- `+p.stack}return{value:e,source:n,stack:c,digest:null}}function ac(e,n,s){return{value:e,source:null,stack:s??null,digest:n??null}}function ic(e,n){try{console.error(n.value)}catch(s){setTimeout(function(){throw s})}}var Gx=typeof WeakMap=="function"?WeakMap:Map;function mp(e,n,s){s=Zn(-1,s),s.tag=3,s.payload={element:null};var i=n.value;return s.callback=function(){Vi||(Vi=!0,Sc=i),ic(e,n)},s}function gp(e,n,s){s=Zn(-1,s),s.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var c=n.value;s.payload=function(){return i(c)},s.callback=function(){ic(e,n)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(s.callback=function(){ic(e,n),typeof i!="function"&&(Or===null?Or=new Set([this]):Or.add(this));var S=n.stack;this.componentDidCatch(n.value,{componentStack:S!==null?S:""})}),s}function yp(e,n,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Gx;var c=new Set;i.set(n,c)}else c=i.get(n),c===void 0&&(c=new Set,i.set(n,c));c.has(s)||(c.add(s),e=uw.bind(null,e,n,s),n.then(e,e))}function vp(e){do{var n;if((n=e.tag===13)&&(n=e.memoizedState,n=n!==null?n.dehydrated!==null:!0),n)return e;e=e.return}while(e!==null);return null}function xp(e,n,s,i,c){return(e.mode&1)===0?(e===n?e.flags|=65536:(e.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(n=Zn(-1,1),n.tag=2,Tr(s,n,1))),s.lanes|=1),e):(e.flags|=65536,e.lanes=c,e)}var Yx=T.ReactCurrentOwner,Lt=!1;function Pt(e,n,s,i){n.child=e===null?Fh(n,null,s,i):ts(n,e.child,s,i)}function wp(e,n,s,i,c){s=s.render;var p=n.ref;return rs(n,c),i=Ju(e,n,s,i,p,c),s=Zu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~c,er(e,n,c)):(Qe&&s&&Lu(n),n.flags|=1,Pt(e,n,i,c),n.child)}function bp(e,n,s,i,c){if(e===null){var p=s.type;return typeof p=="function"&&!Rc(p)&&p.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(n.tag=15,n.type=p,Sp(e,n,p,i,c)):(e=Xi(s.type,null,i,n,n.mode,c),e.ref=n.ref,e.return=n,n.child=e)}if(p=e.child,(e.lanes&c)===0){var S=p.memoizedProps;if(s=s.compare,s=s!==null?s:ra,s(S,i)&&e.ref===n.ref)return er(e,n,c)}return n.flags|=1,e=Dr(p,i),e.ref=n.ref,e.return=n,n.child=e}function Sp(e,n,s,i,c){if(e!==null){var p=e.memoizedProps;if(ra(p,i)&&e.ref===n.ref)if(Lt=!1,n.pendingProps=i=p,(e.lanes&c)!==0)(e.flags&131072)!==0&&(Lt=!0);else return n.lanes=e.lanes,er(e,n,c)}return lc(e,n,s,i,c)}function Cp(e,n,s){var i=n.pendingProps,c=i.children,p=e!==null?e.memoizedState:null;if(i.mode==="hidden")if((n.mode&1)===0)n.memoizedState={baseLanes:0,cachePool:null,transitions:null},Be(is,Vt),Vt|=s;else{if((s&1073741824)===0)return e=p!==null?p.baseLanes|s:s,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,Be(is,Vt),Vt|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=p!==null?p.baseLanes:s,Be(is,Vt),Vt|=i}else p!==null?(i=p.baseLanes|s,n.memoizedState=null):i=s,Be(is,Vt),Vt|=i;return Pt(e,n,c,s),n.child}function kp(e,n){var s=n.ref;(e===null&&s!==null||e!==null&&e.ref!==s)&&(n.flags|=512,n.flags|=2097152)}function lc(e,n,s,i,c){var p=At(s)?lo:vt.current;return p=Xo(n,p),rs(n,c),s=Ju(e,n,s,i,p,c),i=Zu(),e!==null&&!Lt?(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~c,er(e,n,c)):(Qe&&i&&Lu(n),n.flags|=1,Pt(e,n,s,c),n.child)}function Ep(e,n,s,i,c){if(At(s)){var p=!0;Si(n)}else p=!1;if(rs(n,c),n.stateNode===null)Bi(e,n),hp(n,s,i),sc(n,s,i,c),i=!0;else if(e===null){var S=n.stateNode,P=n.memoizedProps;S.props=P;var I=S.context,$=s.contextType;typeof $=="object"&&$!==null?$=Jt($):($=At(s)?lo:vt.current,$=Xo(n,$));var Z=s.getDerivedStateFromProps,ne=typeof Z=="function"||typeof S.getSnapshotBeforeUpdate=="function";ne||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P!==i||I!==$)&&pp(n,S,i,$),Mr=!1;var J=n.memoizedState;S.state=J,Ti(n,i,S,c),I=n.memoizedState,P!==i||J!==I||Ot.current||Mr?(typeof Z=="function"&&(oc(n,s,Z,i),I=n.memoizedState),(P=Mr||fp(n,s,P,i,J,I,$))?(ne||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(n.flags|=4194308)):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=i,n.memoizedState=I),S.props=i,S.state=I,S.context=$,i=P):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),i=!1)}else{S=n.stateNode,Uh(e,n),P=n.memoizedProps,$=n.type===n.elementType?P:fn(n.type,P),S.props=$,ne=n.pendingProps,J=S.context,I=s.contextType,typeof I=="object"&&I!==null?I=Jt(I):(I=At(s)?lo:vt.current,I=Xo(n,I));var de=s.getDerivedStateFromProps;(Z=typeof de=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P!==ne||J!==I)&&pp(n,S,i,I),Mr=!1,J=n.memoizedState,S.state=J,Ti(n,i,S,c);var he=n.memoizedState;P!==ne||J!==he||Ot.current||Mr?(typeof de=="function"&&(oc(n,s,de,i),he=n.memoizedState),($=Mr||fp(n,s,$,i,J,he,I)||!1)?(Z||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(i,he,I),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(i,he,I)),typeof S.componentDidUpdate=="function"&&(n.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof S.componentDidUpdate!="function"||P===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||P===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=i,n.memoizedState=he),S.props=i,S.state=he,S.context=I,i=$):(typeof S.componentDidUpdate!="function"||P===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||P===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),i=!1)}return uc(e,n,s,i,p,c)}function uc(e,n,s,i,c,p){kp(e,n);var S=(n.flags&128)!==0;if(!i&&!S)return c&&Mh(n,s,!1),er(e,n,p);i=n.stateNode,Yx.current=n;var P=S&&typeof s.getDerivedStateFromError!="function"?null:i.render();return n.flags|=1,e!==null&&S?(n.child=ts(n,e.child,null,p),n.child=ts(n,null,P,p)):Pt(e,n,P,p),n.memoizedState=i.state,c&&Mh(n,s,!0),n.child}function Np(e){var n=e.stateNode;n.pendingContext?jh(e,n.pendingContext,n.pendingContext!==n.context):n.context&&jh(e,n.context,!1),Ku(e,n.containerInfo)}function Pp(e,n,s,i,c){return es(),Fu(c),n.flags|=256,Pt(e,n,s,i),n.child}var cc={dehydrated:null,treeContext:null,retryLane:0};function dc(e){return{baseLanes:e,cachePool:null,transitions:null}}function jp(e,n,s){var i=n.pendingProps,c=Ge.current,p=!1,S=(n.flags&128)!==0,P;if((P=S)||(P=e!==null&&e.memoizedState===null?!1:(c&2)!==0),P?(p=!0,n.flags&=-129):(e===null||e.memoizedState!==null)&&(c|=1),Be(Ge,c&1),e===null)return zu(n),e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((n.mode&1)===0?n.lanes=1:e.data==="$!"?n.lanes=8:n.lanes=1073741824,null):(S=i.children,e=i.fallback,p?(i=n.mode,p=n.child,S={mode:"hidden",children:S},(i&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=S):p=Ji(S,i,0,null),e=xo(e,i,s,null),p.return=n,e.return=n,p.sibling=e,n.child=p,n.child.memoizedState=dc(s),n.memoizedState=cc,e):fc(n,S));if(c=e.memoizedState,c!==null&&(P=c.dehydrated,P!==null))return Xx(e,n,S,i,P,c,s);if(p){p=i.fallback,S=n.mode,c=e.child,P=c.sibling;var I={mode:"hidden",children:i.children};return(S&1)===0&&n.child!==c?(i=n.child,i.childLanes=0,i.pendingProps=I,n.deletions=null):(i=Dr(c,I),i.subtreeFlags=c.subtreeFlags&14680064),P!==null?p=Dr(P,p):(p=xo(p,S,s,null),p.flags|=2),p.return=n,i.return=n,i.sibling=p,n.child=i,i=p,p=n.child,S=e.child.memoizedState,S=S===null?dc(s):{baseLanes:S.baseLanes|s,cachePool:null,transitions:S.transitions},p.memoizedState=S,p.childLanes=e.childLanes&~s,n.memoizedState=cc,i}return p=e.child,e=p.sibling,i=Dr(p,{mode:"visible",children:i.children}),(n.mode&1)===0&&(i.lanes=s),i.return=n,i.sibling=null,e!==null&&(s=n.deletions,s===null?(n.deletions=[e],n.flags|=16):s.push(e)),n.child=i,n.memoizedState=null,i}function fc(e,n){return n=Ji({mode:"visible",children:n},e.mode,0,null),n.return=e,e.child=n}function Fi(e,n,s,i){return i!==null&&Fu(i),ts(n,e.child,null,s),e=fc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function Xx(e,n,s,i,c,p,S){if(s)return n.flags&256?(n.flags&=-257,i=ac(Error(o(422))),Fi(e,n,S,i)):n.memoizedState!==null?(n.child=e.child,n.flags|=128,null):(p=i.fallback,c=n.mode,i=Ji({mode:"visible",children:i.children},c,0,null),p=xo(p,c,S,null),p.flags|=2,i.return=n,p.return=n,i.sibling=p,n.child=i,(n.mode&1)!==0&&ts(n,e.child,null,S),n.child.memoizedState=dc(S),n.memoizedState=cc,p);if((n.mode&1)===0)return Fi(e,n,S,null);if(c.data==="$!"){if(i=c.nextSibling&&c.nextSibling.dataset,i)var P=i.dgst;return i=P,p=Error(o(419)),i=ac(p,i,void 0),Fi(e,n,S,i)}if(P=(S&e.childLanes)!==0,Lt||P){if(i=ct,i!==null){switch(S&-S){case 4:c=2;break;case 16:c=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:c=32;break;case 536870912:c=268435456;break;default:c=0}c=(c&(i.suspendedLanes|S))!==0?0:c,c!==0&&c!==p.retryLane&&(p.retryLane=c,Jn(e,c),mn(i,e,c,-1))}return jc(),i=ac(Error(o(421))),Fi(e,n,S,i)}return c.data==="$?"?(n.flags|=128,n.child=e.child,n=cw.bind(null,e),c._reactRetry=n,null):(e=p.treeContext,Ht=Nr(c.nextSibling),Wt=n,Qe=!0,dn=null,e!==null&&(Yt[Xt++]=Yn,Yt[Xt++]=Xn,Yt[Xt++]=uo,Yn=e.id,Xn=e.overflow,uo=n),n=fc(n,i.children),n.flags|=4096,n)}function Rp(e,n,s){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n),Wu(e.return,n,s)}function hc(e,n,s,i,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:c}:(p.isBackwards=n,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=s,p.tailMode=c)}function Mp(e,n,s){var i=n.pendingProps,c=i.revealOrder,p=i.tail;if(Pt(e,n,i.children,s),i=Ge.current,(i&2)!==0)i=i&1|2,n.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rp(e,s,n);else if(e.tag===19)Rp(e,s,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Be(Ge,i),(n.mode&1)===0)n.memoizedState=null;else switch(c){case"forwards":for(s=n.child,c=null;s!==null;)e=s.alternate,e!==null&&Ii(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=n.child,n.child=null):(c=s.sibling,s.sibling=null),hc(n,!1,c,s,p);break;case"backwards":for(s=null,c=n.child,n.child=null;c!==null;){if(e=c.alternate,e!==null&&Ii(e)===null){n.child=c;break}e=c.sibling,c.sibling=s,s=c,c=e}hc(n,!0,s,null,p);break;case"together":hc(n,!1,null,null,void 0);break;default:n.memoizedState=null}return n.child}function Bi(e,n){(n.mode&1)===0&&e!==null&&(e.alternate=null,n.alternate=null,n.flags|=2)}function er(e,n,s){if(e!==null&&(n.dependencies=e.dependencies),mo|=n.lanes,(s&n.childLanes)===0)return null;if(e!==null&&n.child!==e.child)throw Error(o(153));if(n.child!==null){for(e=n.child,s=Dr(e,e.pendingProps),n.child=s,s.return=n;e.sibling!==null;)e=e.sibling,s=s.sibling=Dr(e,e.pendingProps),s.return=n;s.sibling=null}return n.child}function Jx(e,n,s){switch(n.tag){case 3:Np(n),es();break;case 5:Hh(n);break;case 1:At(n.type)&&Si(n);break;case 4:Ku(n,n.stateNode.containerInfo);break;case 10:var i=n.type._context,c=n.memoizedProps.value;Be(ji,i._currentValue),i._currentValue=c;break;case 13:if(i=n.memoizedState,i!==null)return i.dehydrated!==null?(Be(Ge,Ge.current&1),n.flags|=128,null):(s&n.child.childLanes)!==0?jp(e,n,s):(Be(Ge,Ge.current&1),e=er(e,n,s),e!==null?e.sibling:null);Be(Ge,Ge.current&1);break;case 19:if(i=(s&n.childLanes)!==0,(e.flags&128)!==0){if(i)return Mp(e,n,s);n.flags|=128}if(c=n.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Be(Ge,Ge.current),i)break;return null;case 22:case 23:return n.lanes=0,Cp(e,n,s)}return er(e,n,s)}var Tp,pc,Ip,Op;Tp=function(e,n){for(var s=n.child;s!==null;){if(s.tag===5||s.tag===6)e.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return;s=s.return}s.sibling.return=s.return,s=s.sibling}},pc=function(){},Ip=function(e,n,s,i){var c=e.memoizedProps;if(c!==i){e=n.stateNode,ho(Ln.current);var p=null;switch(s){case"input":c=yt(e,c),i=yt(e,i),p=[];break;case"select":c=ee({},c,{value:void 0}),i=ee({},i,{value:void 0}),p=[];break;case"textarea":c=Do(e,c),i=Do(e,i),p=[];break;default:typeof c.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=xi)}Mn(s,i);var S;s=null;for($ in c)if(!i.hasOwnProperty($)&&c.hasOwnProperty($)&&c[$]!=null)if($==="style"){var P=c[$];for(S in P)P.hasOwnProperty(S)&&(s||(s={}),s[S]="")}else $!=="dangerouslySetInnerHTML"&&$!=="children"&&$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&$!=="autoFocus"&&(l.hasOwnProperty($)?p||(p=[]):(p=p||[]).push($,null));for($ in i){var I=i[$];if(P=c!=null?c[$]:void 0,i.hasOwnProperty($)&&I!==P&&(I!=null||P!=null))if($==="style")if(P){for(S in P)!P.hasOwnProperty(S)||I&&I.hasOwnProperty(S)||(s||(s={}),s[S]="");for(S in I)I.hasOwnProperty(S)&&P[S]!==I[S]&&(s||(s={}),s[S]=I[S])}else s||(p||(p=[]),p.push($,s)),s=I;else $==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,P=P?P.__html:void 0,I!=null&&P!==I&&(p=p||[]).push($,I)):$==="children"?typeof I!="string"&&typeof I!="number"||(p=p||[]).push($,""+I):$!=="suppressContentEditableWarning"&&$!=="suppressHydrationWarning"&&(l.hasOwnProperty($)?(I!=null&&$==="onScroll"&&$e("scroll",e),p||P===I||(p=[])):(p=p||[]).push($,I))}s&&(p=p||[]).push("style",s);var $=p;(n.updateQueue=$)&&(n.flags|=4)}},Op=function(e,n,s,i){s!==i&&(n.flags|=4)};function va(e,n){if(!Qe)switch(e.tailMode){case"hidden":n=e.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function wt(e){var n=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(n)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags&14680064,i|=c.flags&14680064,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=s,n}function Zx(e,n,s){var i=n.pendingProps;switch(_u(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wt(n),null;case 1:return At(n.type)&&bi(),wt(n),null;case 3:return i=n.stateNode,os(),We(Ot),We(vt),Gu(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ni(n)?n.flags|=4:e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,dn!==null&&(Ec(dn),dn=null))),pc(e,n),wt(n),null;case 5:Qu(n);var c=ho(ha.current);if(s=n.type,e!==null&&n.stateNode!=null)Ip(e,n,s,i,c),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!i){if(n.stateNode===null)throw Error(o(166));return wt(n),null}if(e=ho(Ln.current),Ni(n)){i=n.stateNode,s=n.type;var p=n.memoizedProps;switch(i[An]=n,i[la]=p,e=(n.mode&1)!==0,s){case"dialog":$e("cancel",i),$e("close",i);break;case"iframe":case"object":case"embed":$e("load",i);break;case"video":case"audio":for(c=0;c<sa.length;c++)$e(sa[c],i);break;case"source":$e("error",i);break;case"img":case"image":case"link":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"input":En(i,p),$e("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!p.multiple},$e("invalid",i);break;case"textarea":Pn(i,p),$e("invalid",i)}Mn(s,p),c=null;for(var S in p)if(p.hasOwnProperty(S)){var P=p[S];S==="children"?typeof P=="string"?i.textContent!==P&&(p.suppressHydrationWarning!==!0&&vi(i.textContent,P,e),c=["children",P]):typeof P=="number"&&i.textContent!==""+P&&(p.suppressHydrationWarning!==!0&&vi(i.textContent,P,e),c=["children",""+P]):l.hasOwnProperty(S)&&P!=null&&S==="onScroll"&&$e("scroll",i)}switch(s){case"input":Me(i),yr(i,p,!0);break;case"textarea":Me(i),Qa(i);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(i.onclick=xi)}i=c,n.updateQueue=i,i!==null&&(n.flags|=4)}else{S=c.nodeType===9?c:c.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Et(s)),e==="http://www.w3.org/1999/xhtml"?s==="script"?(e=S.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=S.createElement(s,{is:i.is}):(e=S.createElement(s),s==="select"&&(S=e,i.multiple?S.multiple=!0:i.size&&(S.size=i.size))):e=S.createElementNS(e,s),e[An]=n,e[la]=i,Tp(e,n,!1,!1),n.stateNode=e;e:{switch(S=$s(s,i),s){case"dialog":$e("cancel",e),$e("close",e),c=i;break;case"iframe":case"object":case"embed":$e("load",e),c=i;break;case"video":case"audio":for(c=0;c<sa.length;c++)$e(sa[c],e);c=i;break;case"source":$e("error",e),c=i;break;case"img":case"image":case"link":$e("error",e),$e("load",e),c=i;break;case"details":$e("toggle",e),c=i;break;case"input":En(e,i),c=yt(e,i),$e("invalid",e);break;case"option":c=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},c=ee({},i,{value:void 0}),$e("invalid",e);break;case"textarea":Pn(e,i),c=Do(e,i),$e("invalid",e);break;default:c=i}Mn(s,c),P=c;for(p in P)if(P.hasOwnProperty(p)){var I=P[p];p==="style"?Qn(e,I):p==="dangerouslySetInnerHTML"?(I=I?I.__html:void 0,I!=null&&qa(e,I)):p==="children"?typeof I=="string"?(s!=="textarea"||I!=="")&&Rn(e,I):typeof I=="number"&&Rn(e,""+I):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(l.hasOwnProperty(p)?I!=null&&p==="onScroll"&&$e("scroll",e):I!=null&&N(e,p,I,S))}switch(s){case"input":Me(e),yr(e,i,!1);break;case"textarea":Me(e),Qa(e);break;case"option":i.value!=null&&e.setAttribute("value",""+ge(i.value));break;case"select":e.multiple=!!i.multiple,p=i.value,p!=null?Gt(e,!!i.multiple,p,!1):i.defaultValue!=null&&Gt(e,!!i.multiple,i.defaultValue,!0);break;default:typeof c.onClick=="function"&&(e.onclick=xi)}switch(s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(n.flags|=4)}n.ref!==null&&(n.flags|=512,n.flags|=2097152)}return wt(n),null;case 6:if(e&&n.stateNode!=null)Op(e,n,e.memoizedProps,i);else{if(typeof i!="string"&&n.stateNode===null)throw Error(o(166));if(s=ho(ha.current),ho(Ln.current),Ni(n)){if(i=n.stateNode,s=n.memoizedProps,i[An]=n,(p=i.nodeValue!==s)&&(e=Wt,e!==null))switch(e.tag){case 3:vi(i.nodeValue,s,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vi(i.nodeValue,s,(e.mode&1)!==0)}p&&(n.flags|=4)}else i=(s.nodeType===9?s:s.ownerDocument).createTextNode(i),i[An]=n,n.stateNode=i}return wt(n),null;case 13:if(We(Ge),i=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Qe&&Ht!==null&&(n.mode&1)!==0&&(n.flags&128)===0)_h(),es(),n.flags|=98560,p=!1;else if(p=Ni(n),i!==null&&i.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[An]=n}else es(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;wt(n),p=!1}else dn!==null&&(Ec(dn),dn=null),p=!0;if(!p)return n.flags&65536?n:null}return(n.flags&128)!==0?(n.lanes=s,n):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(n.child.flags|=8192,(n.mode&1)!==0&&(e===null||(Ge.current&1)!==0?it===0&&(it=3):jc())),n.updateQueue!==null&&(n.flags|=4),wt(n),null);case 4:return os(),pc(e,n),e===null&&aa(n.stateNode.containerInfo),wt(n),null;case 10:return $u(n.type._context),wt(n),null;case 17:return At(n.type)&&bi(),wt(n),null;case 19:if(We(Ge),p=n.memoizedState,p===null)return wt(n),null;if(i=(n.flags&128)!==0,S=p.rendering,S===null)if(i)va(p,!1);else{if(it!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(S=Ii(e),S!==null){for(n.flags|=128,va(p,!1),i=S.updateQueue,i!==null&&(n.updateQueue=i,n.flags|=4),n.subtreeFlags=0,i=s,s=n.child;s!==null;)p=s,e=i,p.flags&=14680066,S=p.alternate,S===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=S.childLanes,p.lanes=S.lanes,p.child=S.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=S.memoizedProps,p.memoizedState=S.memoizedState,p.updateQueue=S.updateQueue,p.type=S.type,e=S.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),s=s.sibling;return Be(Ge,Ge.current&1|2),n.child}e=e.sibling}p.tail!==null&&et()>ls&&(n.flags|=128,i=!0,va(p,!1),n.lanes=4194304)}else{if(!i)if(e=Ii(S),e!==null){if(n.flags|=128,i=!0,s=e.updateQueue,s!==null&&(n.updateQueue=s,n.flags|=4),va(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Qe)return wt(n),null}else 2*et()-p.renderingStartTime>ls&&s!==1073741824&&(n.flags|=128,i=!0,va(p,!1),n.lanes=4194304);p.isBackwards?(S.sibling=n.child,n.child=S):(s=p.last,s!==null?s.sibling=S:n.child=S,p.last=S)}return p.tail!==null?(n=p.tail,p.rendering=n,p.tail=n.sibling,p.renderingStartTime=et(),n.sibling=null,s=Ge.current,Be(Ge,i?s&1|2:s&1),n):(wt(n),null);case 22:case 23:return Pc(),i=n.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(n.flags|=8192),i&&(n.mode&1)!==0?(Vt&1073741824)!==0&&(wt(n),n.subtreeFlags&6&&(n.flags|=8192)):wt(n),null;case 24:return null;case 25:return null}throw Error(o(156,n.tag))}function ew(e,n){switch(_u(n),n.tag){case 1:return At(n.type)&&bi(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return os(),We(Ot),We(vt),Gu(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 5:return Qu(n),null;case 13:if(We(Ge),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(o(340));es()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return We(Ge),null;case 4:return os(),null;case 10:return $u(n.type._context),null;case 22:case 23:return Pc(),null;case 24:return null;default:return null}}var Ui=!1,bt=!1,tw=typeof WeakSet=="function"?WeakSet:Set,fe=null;function as(e,n){var s=e.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(i){Xe(e,n,i)}else s.current=null}function mc(e,n,s){try{s()}catch(i){Xe(e,n,i)}}var Ap=!1;function nw(e,n){if(Pu=ii,e=fh(),xu(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var c=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{s.nodeType,p.nodeType}catch{s=null;break e}var S=0,P=-1,I=-1,$=0,Z=0,ne=e,J=null;t:for(;;){for(var de;ne!==s||c!==0&&ne.nodeType!==3||(P=S+c),ne!==p||i!==0&&ne.nodeType!==3||(I=S+i),ne.nodeType===3&&(S+=ne.nodeValue.length),(de=ne.firstChild)!==null;)J=ne,ne=de;for(;;){if(ne===e)break t;if(J===s&&++$===c&&(P=S),J===p&&++Z===i&&(I=S),(de=ne.nextSibling)!==null)break;ne=J,J=ne.parentNode}ne=de}s=P===-1||I===-1?null:{start:P,end:I}}else s=null}s=s||{start:0,end:0}}else s=null;for(ju={focusedElem:e,selectionRange:s},ii=!1,fe=n;fe!==null;)if(n=fe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,fe=e;else for(;fe!==null;){n=fe;try{var he=n.alternate;if((n.flags&1024)!==0)switch(n.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var pe=he.memoizedProps,tt=he.memoizedState,D=n.stateNode,A=D.getSnapshotBeforeUpdate(n.elementType===n.type?pe:fn(n.type,pe),tt);D.__reactInternalSnapshotBeforeUpdate=A}break;case 3:var z=n.stateNode.containerInfo;z.nodeType===1?z.textContent="":z.nodeType===9&&z.documentElement&&z.removeChild(z.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(oe){Xe(n,n.return,oe)}if(e=n.sibling,e!==null){e.return=n.return,fe=e;break}fe=n.return}return he=Ap,Ap=!1,he}function xa(e,n,s){var i=n.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var c=i=i.next;do{if((c.tag&e)===e){var p=c.destroy;c.destroy=void 0,p!==void 0&&mc(n,s,p)}c=c.next}while(c!==i)}}function $i(e,n){if(n=n.updateQueue,n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var i=s.create;s.destroy=i()}s=s.next}while(s!==n)}}function gc(e){var n=e.ref;if(n!==null){var s=e.stateNode;switch(e.tag){case 5:e=s;break;default:e=s}typeof n=="function"?n(e):n.current=e}}function Lp(e){var n=e.alternate;n!==null&&(e.alternate=null,Lp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&(delete n[An],delete n[la],delete n[Iu],delete n[zx],delete n[Fx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _p(e){return e.tag===5||e.tag===3||e.tag===4}function Dp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_p(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function yc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.nodeType===8?s.parentNode.insertBefore(e,n):s.insertBefore(e,n):(s.nodeType===8?(n=s.parentNode,n.insertBefore(e,s)):(n=s,n.appendChild(e)),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=xi));else if(i!==4&&(e=e.child,e!==null))for(yc(e,n,s),e=e.sibling;e!==null;)yc(e,n,s),e=e.sibling}function vc(e,n,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,n?s.insertBefore(e,n):s.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(vc(e,n,s),e=e.sibling;e!==null;)vc(e,n,s),e=e.sibling}var pt=null,hn=!1;function Ir(e,n,s){for(s=s.child;s!==null;)zp(e,n,s),s=s.sibling}function zp(e,n,s){if(On&&typeof On.onCommitFiberUnmount=="function")try{On.onCommitFiberUnmount(ti,s)}catch{}switch(s.tag){case 5:bt||as(s,n);case 6:var i=pt,c=hn;pt=null,Ir(e,n,s),pt=i,hn=c,pt!==null&&(hn?(e=pt,s=s.stateNode,e.nodeType===8?e.parentNode.removeChild(s):e.removeChild(s)):pt.removeChild(s.stateNode));break;case 18:pt!==null&&(hn?(e=pt,s=s.stateNode,e.nodeType===8?Tu(e.parentNode,s):e.nodeType===1&&Tu(e,s),Xs(e)):Tu(pt,s.stateNode));break;case 4:i=pt,c=hn,pt=s.stateNode.containerInfo,hn=!0,Ir(e,n,s),pt=i,hn=c;break;case 0:case 11:case 14:case 15:if(!bt&&(i=s.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){c=i=i.next;do{var p=c,S=p.destroy;p=p.tag,S!==void 0&&((p&2)!==0||(p&4)!==0)&&mc(s,n,S),c=c.next}while(c!==i)}Ir(e,n,s);break;case 1:if(!bt&&(as(s,n),i=s.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=s.memoizedProps,i.state=s.memoizedState,i.componentWillUnmount()}catch(P){Xe(s,n,P)}Ir(e,n,s);break;case 21:Ir(e,n,s);break;case 22:s.mode&1?(bt=(i=bt)||s.memoizedState!==null,Ir(e,n,s),bt=i):Ir(e,n,s);break;default:Ir(e,n,s)}}function Fp(e){var n=e.updateQueue;if(n!==null){e.updateQueue=null;var s=e.stateNode;s===null&&(s=e.stateNode=new tw),n.forEach(function(i){var c=dw.bind(null,e,i);s.has(i)||(s.add(i),i.then(c,c))})}}function pn(e,n){var s=n.deletions;if(s!==null)for(var i=0;i<s.length;i++){var c=s[i];try{var p=e,S=n,P=S;e:for(;P!==null;){switch(P.tag){case 5:pt=P.stateNode,hn=!1;break e;case 3:pt=P.stateNode.containerInfo,hn=!0;break e;case 4:pt=P.stateNode.containerInfo,hn=!0;break e}P=P.return}if(pt===null)throw Error(o(160));zp(p,S,c),pt=null,hn=!1;var I=c.alternate;I!==null&&(I.return=null),c.return=null}catch($){Xe(c,n,$)}}if(n.subtreeFlags&12854)for(n=n.child;n!==null;)Bp(n,e),n=n.sibling}function Bp(e,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(pn(n,e),Dn(e),i&4){try{xa(3,e,e.return),$i(3,e)}catch(pe){Xe(e,e.return,pe)}try{xa(5,e,e.return)}catch(pe){Xe(e,e.return,pe)}}break;case 1:pn(n,e),Dn(e),i&512&&s!==null&&as(s,s.return);break;case 5:if(pn(n,e),Dn(e),i&512&&s!==null&&as(s,s.return),e.flags&32){var c=e.stateNode;try{Rn(c,"")}catch(pe){Xe(e,e.return,pe)}}if(i&4&&(c=e.stateNode,c!=null)){var p=e.memoizedProps,S=s!==null?s.memoizedProps:p,P=e.type,I=e.updateQueue;if(e.updateQueue=null,I!==null)try{P==="input"&&p.type==="radio"&&p.name!=null&&on(c,p),$s(P,S);var $=$s(P,p);for(S=0;S<I.length;S+=2){var Z=I[S],ne=I[S+1];Z==="style"?Qn(c,ne):Z==="dangerouslySetInnerHTML"?qa(c,ne):Z==="children"?Rn(c,ne):N(c,Z,ne,$)}switch(P){case"input":sn(c,p);break;case"textarea":Ka(c,p);break;case"select":var J=c._wrapperState.wasMultiple;c._wrapperState.wasMultiple=!!p.multiple;var de=p.value;de!=null?Gt(c,!!p.multiple,de,!1):J!==!!p.multiple&&(p.defaultValue!=null?Gt(c,!!p.multiple,p.defaultValue,!0):Gt(c,!!p.multiple,p.multiple?[]:"",!1))}c[la]=p}catch(pe){Xe(e,e.return,pe)}}break;case 6:if(pn(n,e),Dn(e),i&4){if(e.stateNode===null)throw Error(o(162));c=e.stateNode,p=e.memoizedProps;try{c.nodeValue=p}catch(pe){Xe(e,e.return,pe)}}break;case 3:if(pn(n,e),Dn(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Xs(n.containerInfo)}catch(pe){Xe(e,e.return,pe)}break;case 4:pn(n,e),Dn(e);break;case 13:pn(n,e),Dn(e),c=e.child,c.flags&8192&&(p=c.memoizedState!==null,c.stateNode.isHidden=p,!p||c.alternate!==null&&c.alternate.memoizedState!==null||(bc=et())),i&4&&Fp(e);break;case 22:if(Z=s!==null&&s.memoizedState!==null,e.mode&1?(bt=($=bt)||Z,pn(n,e),bt=$):pn(n,e),Dn(e),i&8192){if($=e.memoizedState!==null,(e.stateNode.isHidden=$)&&!Z&&(e.mode&1)!==0)for(fe=e,Z=e.child;Z!==null;){for(ne=fe=Z;fe!==null;){switch(J=fe,de=J.child,J.tag){case 0:case 11:case 14:case 15:xa(4,J,J.return);break;case 1:as(J,J.return);var he=J.stateNode;if(typeof he.componentWillUnmount=="function"){i=J,s=J.return;try{n=i,he.props=n.memoizedProps,he.state=n.memoizedState,he.componentWillUnmount()}catch(pe){Xe(i,s,pe)}}break;case 5:as(J,J.return);break;case 22:if(J.memoizedState!==null){Wp(ne);continue}}de!==null?(de.return=J,fe=de):Wp(ne)}Z=Z.sibling}e:for(Z=null,ne=e;;){if(ne.tag===5){if(Z===null){Z=ne;try{c=ne.stateNode,$?(p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(P=ne.stateNode,I=ne.memoizedProps.style,S=I!=null&&I.hasOwnProperty("display")?I.display:null,P.style.display=Fo("display",S))}catch(pe){Xe(e,e.return,pe)}}}else if(ne.tag===6){if(Z===null)try{ne.stateNode.nodeValue=$?"":ne.memoizedProps}catch(pe){Xe(e,e.return,pe)}}else if((ne.tag!==22&&ne.tag!==23||ne.memoizedState===null||ne===e)&&ne.child!==null){ne.child.return=ne,ne=ne.child;continue}if(ne===e)break e;for(;ne.sibling===null;){if(ne.return===null||ne.return===e)break e;Z===ne&&(Z=null),ne=ne.return}Z===ne&&(Z=null),ne.sibling.return=ne.return,ne=ne.sibling}}break;case 19:pn(n,e),Dn(e),i&4&&Fp(e);break;case 21:break;default:pn(n,e),Dn(e)}}function Dn(e){var n=e.flags;if(n&2){try{e:{for(var s=e.return;s!==null;){if(_p(s)){var i=s;break e}s=s.return}throw Error(o(160))}switch(i.tag){case 5:var c=i.stateNode;i.flags&32&&(Rn(c,""),i.flags&=-33);var p=Dp(e);vc(e,p,c);break;case 3:case 4:var S=i.stateNode.containerInfo,P=Dp(e);yc(e,P,S);break;default:throw Error(o(161))}}catch(I){Xe(e,e.return,I)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function rw(e,n,s){fe=e,Up(e)}function Up(e,n,s){for(var i=(e.mode&1)!==0;fe!==null;){var c=fe,p=c.child;if(c.tag===22&&i){var S=c.memoizedState!==null||Ui;if(!S){var P=c.alternate,I=P!==null&&P.memoizedState!==null||bt;P=Ui;var $=bt;if(Ui=S,(bt=I)&&!$)for(fe=c;fe!==null;)S=fe,I=S.child,S.tag===22&&S.memoizedState!==null?Hp(c):I!==null?(I.return=S,fe=I):Hp(c);for(;p!==null;)fe=p,Up(p),p=p.sibling;fe=c,Ui=P,bt=$}$p(e)}else(c.subtreeFlags&8772)!==0&&p!==null?(p.return=c,fe=p):$p(e)}}function $p(e){for(;fe!==null;){var n=fe;if((n.flags&8772)!==0){var s=n.alternate;try{if((n.flags&8772)!==0)switch(n.tag){case 0:case 11:case 15:bt||$i(5,n);break;case 1:var i=n.stateNode;if(n.flags&4&&!bt)if(s===null)i.componentDidMount();else{var c=n.elementType===n.type?s.memoizedProps:fn(n.type,s.memoizedProps);i.componentDidUpdate(c,s.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var p=n.updateQueue;p!==null&&Wh(n,p,i);break;case 3:var S=n.updateQueue;if(S!==null){if(s=null,n.child!==null)switch(n.child.tag){case 5:s=n.child.stateNode;break;case 1:s=n.child.stateNode}Wh(n,S,s)}break;case 5:var P=n.stateNode;if(s===null&&n.flags&4){s=P;var I=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":I.autoFocus&&s.focus();break;case"img":I.src&&(s.src=I.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(n.memoizedState===null){var $=n.alternate;if($!==null){var Z=$.memoizedState;if(Z!==null){var ne=Z.dehydrated;ne!==null&&Xs(ne)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(o(163))}bt||n.flags&512&&gc(n)}catch(J){Xe(n,n.return,J)}}if(n===e){fe=null;break}if(s=n.sibling,s!==null){s.return=n.return,fe=s;break}fe=n.return}}function Wp(e){for(;fe!==null;){var n=fe;if(n===e){fe=null;break}var s=n.sibling;if(s!==null){s.return=n.return,fe=s;break}fe=n.return}}function Hp(e){for(;fe!==null;){var n=fe;try{switch(n.tag){case 0:case 11:case 15:var s=n.return;try{$i(4,n)}catch(I){Xe(n,s,I)}break;case 1:var i=n.stateNode;if(typeof i.componentDidMount=="function"){var c=n.return;try{i.componentDidMount()}catch(I){Xe(n,c,I)}}var p=n.return;try{gc(n)}catch(I){Xe(n,p,I)}break;case 5:var S=n.return;try{gc(n)}catch(I){Xe(n,S,I)}}}catch(I){Xe(n,n.return,I)}if(n===e){fe=null;break}var P=n.sibling;if(P!==null){P.return=n.return,fe=P;break}fe=n.return}}var ow=Math.ceil,Wi=T.ReactCurrentDispatcher,xc=T.ReactCurrentOwner,en=T.ReactCurrentBatchConfig,Ae=0,ct=null,ot=null,mt=0,Vt=0,is=Pr(0),it=0,wa=null,mo=0,Hi=0,wc=0,ba=null,_t=null,bc=0,ls=1/0,tr=null,Vi=!1,Sc=null,Or=null,Ki=!1,Ar=null,Qi=0,Sa=0,Cc=null,qi=-1,Gi=0;function jt(){return(Ae&6)!==0?et():qi!==-1?qi:qi=et()}function Lr(e){return(e.mode&1)===0?1:(Ae&2)!==0&&mt!==0?mt&-mt:Ux.transition!==null?(Gi===0&&(Gi=Df()),Gi):(e=ze,e!==0||(e=window.event,e=e===void 0?16:Kf(e.type)),e)}function mn(e,n,s,i){if(50<Sa)throw Sa=0,Cc=null,Error(o(185));Ks(e,s,i),((Ae&2)===0||e!==ct)&&(e===ct&&((Ae&2)===0&&(Hi|=s),it===4&&_r(e,mt)),Dt(e,i),s===1&&Ae===0&&(n.mode&1)===0&&(ls=et()+500,Ci&&Rr()))}function Dt(e,n){var s=e.callbackNode;U0(e,n);var i=oi(e,e===ct?mt:0);if(i===0)s!==null&&Af(s),e.callbackNode=null,e.callbackPriority=0;else if(n=i&-i,e.callbackPriority!==n){if(s!=null&&Af(s),n===1)e.tag===0?Bx(Kp.bind(null,e)):Th(Kp.bind(null,e)),_x(function(){(Ae&6)===0&&Rr()}),s=null;else{switch(zf(i)){case 1:s=nu;break;case 4:s=Lf;break;case 16:s=ei;break;case 536870912:s=_f;break;default:s=ei}s=em(s,Vp.bind(null,e))}e.callbackPriority=n,e.callbackNode=s}}function Vp(e,n){if(qi=-1,Gi=0,(Ae&6)!==0)throw Error(o(327));var s=e.callbackNode;if(us()&&e.callbackNode!==s)return null;var i=oi(e,e===ct?mt:0);if(i===0)return null;if((i&30)!==0||(i&e.expiredLanes)!==0||n)n=Yi(e,i);else{n=i;var c=Ae;Ae|=2;var p=qp();(ct!==e||mt!==n)&&(tr=null,ls=et()+500,yo(e,n));do try{iw();break}catch(P){Qp(e,P)}while(!0);Uu(),Wi.current=p,Ae=c,ot!==null?n=0:(ct=null,mt=0,n=it)}if(n!==0){if(n===2&&(c=ru(e),c!==0&&(i=c,n=kc(e,c))),n===1)throw s=wa,yo(e,0),_r(e,i),Dt(e,et()),s;if(n===6)_r(e,i);else{if(c=e.current.alternate,(i&30)===0&&!sw(c)&&(n=Yi(e,i),n===2&&(p=ru(e),p!==0&&(i=p,n=kc(e,p))),n===1))throw s=wa,yo(e,0),_r(e,i),Dt(e,et()),s;switch(e.finishedWork=c,e.finishedLanes=i,n){case 0:case 1:throw Error(o(345));case 2:vo(e,_t,tr);break;case 3:if(_r(e,i),(i&130023424)===i&&(n=bc+500-et(),10<n)){if(oi(e,0)!==0)break;if(c=e.suspendedLanes,(c&i)!==i){jt(),e.pingedLanes|=e.suspendedLanes&c;break}e.timeoutHandle=Mu(vo.bind(null,e,_t,tr),n);break}vo(e,_t,tr);break;case 4:if(_r(e,i),(i&4194240)===i)break;for(n=e.eventTimes,c=-1;0<i;){var S=31-un(i);p=1<<S,S=n[S],S>c&&(c=S),i&=~p}if(i=c,i=et()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*ow(i/1960))-i,10<i){e.timeoutHandle=Mu(vo.bind(null,e,_t,tr),i);break}vo(e,_t,tr);break;case 5:vo(e,_t,tr);break;default:throw Error(o(329))}}}return Dt(e,et()),e.callbackNode===s?Vp.bind(null,e):null}function kc(e,n){var s=ba;return e.current.memoizedState.isDehydrated&&(yo(e,n).flags|=256),e=Yi(e,n),e!==2&&(n=_t,_t=s,n!==null&&Ec(n)),e}function Ec(e){_t===null?_t=e:_t.push.apply(_t,e)}function sw(e){for(var n=e;;){if(n.flags&16384){var s=n.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var i=0;i<s.length;i++){var c=s[i],p=c.getSnapshot;c=c.value;try{if(!cn(p(),c))return!1}catch{return!1}}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function _r(e,n){for(n&=~wc,n&=~Hi,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var s=31-un(n),i=1<<s;e[s]=-1,n&=~i}}function Kp(e){if((Ae&6)!==0)throw Error(o(327));us();var n=oi(e,0);if((n&1)===0)return Dt(e,et()),null;var s=Yi(e,n);if(e.tag!==0&&s===2){var i=ru(e);i!==0&&(n=i,s=kc(e,i))}if(s===1)throw s=wa,yo(e,0),_r(e,n),Dt(e,et()),s;if(s===6)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,vo(e,_t,tr),Dt(e,et()),null}function Nc(e,n){var s=Ae;Ae|=1;try{return e(n)}finally{Ae=s,Ae===0&&(ls=et()+500,Ci&&Rr())}}function go(e){Ar!==null&&Ar.tag===0&&(Ae&6)===0&&us();var n=Ae;Ae|=1;var s=en.transition,i=ze;try{if(en.transition=null,ze=1,e)return e()}finally{ze=i,en.transition=s,Ae=n,(Ae&6)===0&&Rr()}}function Pc(){Vt=is.current,We(is)}function yo(e,n){e.finishedWork=null,e.finishedLanes=0;var s=e.timeoutHandle;if(s!==-1&&(e.timeoutHandle=-1,Lx(s)),ot!==null)for(s=ot.return;s!==null;){var i=s;switch(_u(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&bi();break;case 3:os(),We(Ot),We(vt),Gu();break;case 5:Qu(i);break;case 4:os();break;case 13:We(Ge);break;case 19:We(Ge);break;case 10:$u(i.type._context);break;case 22:case 23:Pc()}s=s.return}if(ct=e,ot=e=Dr(e.current,null),mt=Vt=n,it=0,wa=null,wc=Hi=mo=0,_t=ba=null,fo!==null){for(n=0;n<fo.length;n++)if(s=fo[n],i=s.interleaved,i!==null){s.interleaved=null;var c=i.next,p=s.pending;if(p!==null){var S=p.next;p.next=c,i.next=S}s.pending=i}fo=null}return e}function Qp(e,n){do{var s=ot;try{if(Uu(),Oi.current=Di,Ai){for(var i=Ye.memoizedState;i!==null;){var c=i.queue;c!==null&&(c.pending=null),i=i.next}Ai=!1}if(po=0,ut=at=Ye=null,pa=!1,ma=0,xc.current=null,s===null||s.return===null){it=1,wa=n,ot=null;break}e:{var p=e,S=s.return,P=s,I=n;if(n=mt,P.flags|=32768,I!==null&&typeof I=="object"&&typeof I.then=="function"){var $=I,Z=P,ne=Z.tag;if((Z.mode&1)===0&&(ne===0||ne===11||ne===15)){var J=Z.alternate;J?(Z.updateQueue=J.updateQueue,Z.memoizedState=J.memoizedState,Z.lanes=J.lanes):(Z.updateQueue=null,Z.memoizedState=null)}var de=vp(S);if(de!==null){de.flags&=-257,xp(de,S,P,p,n),de.mode&1&&yp(p,$,n),n=de,I=$;var he=n.updateQueue;if(he===null){var pe=new Set;pe.add(I),n.updateQueue=pe}else he.add(I);break e}else{if((n&1)===0){yp(p,$,n),jc();break e}I=Error(o(426))}}else if(Qe&&P.mode&1){var tt=vp(S);if(tt!==null){(tt.flags&65536)===0&&(tt.flags|=256),xp(tt,S,P,p,n),Fu(ss(I,P));break e}}p=I=ss(I,P),it!==4&&(it=2),ba===null?ba=[p]:ba.push(p),p=S;do{switch(p.tag){case 3:p.flags|=65536,n&=-n,p.lanes|=n;var D=mp(p,I,n);$h(p,D);break e;case 1:P=I;var A=p.type,z=p.stateNode;if((p.flags&128)===0&&(typeof A.getDerivedStateFromError=="function"||z!==null&&typeof z.componentDidCatch=="function"&&(Or===null||!Or.has(z)))){p.flags|=65536,n&=-n,p.lanes|=n;var oe=gp(p,P,n);$h(p,oe);break e}}p=p.return}while(p!==null)}Yp(s)}catch(me){n=me,ot===s&&s!==null&&(ot=s=s.return);continue}break}while(!0)}function qp(){var e=Wi.current;return Wi.current=Di,e===null?Di:e}function jc(){(it===0||it===3||it===2)&&(it=4),ct===null||(mo&268435455)===0&&(Hi&268435455)===0||_r(ct,mt)}function Yi(e,n){var s=Ae;Ae|=2;var i=qp();(ct!==e||mt!==n)&&(tr=null,yo(e,n));do try{aw();break}catch(c){Qp(e,c)}while(!0);if(Uu(),Ae=s,Wi.current=i,ot!==null)throw Error(o(261));return ct=null,mt=0,it}function aw(){for(;ot!==null;)Gp(ot)}function iw(){for(;ot!==null&&!I0();)Gp(ot)}function Gp(e){var n=Zp(e.alternate,e,Vt);e.memoizedProps=e.pendingProps,n===null?Yp(e):ot=n,xc.current=null}function Yp(e){var n=e;do{var s=n.alternate;if(e=n.return,(n.flags&32768)===0){if(s=Zx(s,n,Vt),s!==null){ot=s;return}}else{if(s=ew(s,n),s!==null){s.flags&=32767,ot=s;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{it=6,ot=null;return}}if(n=n.sibling,n!==null){ot=n;return}ot=n=e}while(n!==null);it===0&&(it=5)}function vo(e,n,s){var i=ze,c=en.transition;try{en.transition=null,ze=1,lw(e,n,s,i)}finally{en.transition=c,ze=i}return null}function lw(e,n,s,i){do us();while(Ar!==null);if((Ae&6)!==0)throw Error(o(327));s=e.finishedWork;var c=e.finishedLanes;if(s===null)return null;if(e.finishedWork=null,e.finishedLanes=0,s===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var p=s.lanes|s.childLanes;if($0(e,p),e===ct&&(ot=ct=null,mt=0),(s.subtreeFlags&2064)===0&&(s.flags&2064)===0||Ki||(Ki=!0,em(ei,function(){return us(),null})),p=(s.flags&15990)!==0,(s.subtreeFlags&15990)!==0||p){p=en.transition,en.transition=null;var S=ze;ze=1;var P=Ae;Ae|=4,xc.current=null,nw(e,s),Bp(s,e),jx(ju),ii=!!Pu,ju=Pu=null,e.current=s,rw(s),O0(),Ae=P,ze=S,en.transition=p}else e.current=s;if(Ki&&(Ki=!1,Ar=e,Qi=c),p=e.pendingLanes,p===0&&(Or=null),_0(s.stateNode),Dt(e,et()),n!==null)for(i=e.onRecoverableError,s=0;s<n.length;s++)c=n[s],i(c.value,{componentStack:c.stack,digest:c.digest});if(Vi)throw Vi=!1,e=Sc,Sc=null,e;return(Qi&1)!==0&&e.tag!==0&&us(),p=e.pendingLanes,(p&1)!==0?e===Cc?Sa++:(Sa=0,Cc=e):Sa=0,Rr(),null}function us(){if(Ar!==null){var e=zf(Qi),n=en.transition,s=ze;try{if(en.transition=null,ze=16>e?16:e,Ar===null)var i=!1;else{if(e=Ar,Ar=null,Qi=0,(Ae&6)!==0)throw Error(o(331));var c=Ae;for(Ae|=4,fe=e.current;fe!==null;){var p=fe,S=p.child;if((fe.flags&16)!==0){var P=p.deletions;if(P!==null){for(var I=0;I<P.length;I++){var $=P[I];for(fe=$;fe!==null;){var Z=fe;switch(Z.tag){case 0:case 11:case 15:xa(8,Z,p)}var ne=Z.child;if(ne!==null)ne.return=Z,fe=ne;else for(;fe!==null;){Z=fe;var J=Z.sibling,de=Z.return;if(Lp(Z),Z===$){fe=null;break}if(J!==null){J.return=de,fe=J;break}fe=de}}}var he=p.alternate;if(he!==null){var pe=he.child;if(pe!==null){he.child=null;do{var tt=pe.sibling;pe.sibling=null,pe=tt}while(pe!==null)}}fe=p}}if((p.subtreeFlags&2064)!==0&&S!==null)S.return=p,fe=S;else e:for(;fe!==null;){if(p=fe,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:xa(9,p,p.return)}var D=p.sibling;if(D!==null){D.return=p.return,fe=D;break e}fe=p.return}}var A=e.current;for(fe=A;fe!==null;){S=fe;var z=S.child;if((S.subtreeFlags&2064)!==0&&z!==null)z.return=S,fe=z;else e:for(S=A;fe!==null;){if(P=fe,(P.flags&2048)!==0)try{switch(P.tag){case 0:case 11:case 15:$i(9,P)}}catch(me){Xe(P,P.return,me)}if(P===S){fe=null;break e}var oe=P.sibling;if(oe!==null){oe.return=P.return,fe=oe;break e}fe=P.return}}if(Ae=c,Rr(),On&&typeof On.onPostCommitFiberRoot=="function")try{On.onPostCommitFiberRoot(ti,e)}catch{}i=!0}return i}finally{ze=s,en.transition=n}}return!1}function Xp(e,n,s){n=ss(s,n),n=mp(e,n,1),e=Tr(e,n,1),n=jt(),e!==null&&(Ks(e,1,n),Dt(e,n))}function Xe(e,n,s){if(e.tag===3)Xp(e,e,s);else for(;n!==null;){if(n.tag===3){Xp(n,e,s);break}else if(n.tag===1){var i=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Or===null||!Or.has(i))){e=ss(s,e),e=gp(n,e,1),n=Tr(n,e,1),e=jt(),n!==null&&(Ks(n,1,e),Dt(n,e));break}}n=n.return}}function uw(e,n,s){var i=e.pingCache;i!==null&&i.delete(n),n=jt(),e.pingedLanes|=e.suspendedLanes&s,ct===e&&(mt&s)===s&&(it===4||it===3&&(mt&130023424)===mt&&500>et()-bc?yo(e,0):wc|=s),Dt(e,n)}function Jp(e,n){n===0&&((e.mode&1)===0?n=1:(n=ri,ri<<=1,(ri&130023424)===0&&(ri=4194304)));var s=jt();e=Jn(e,n),e!==null&&(Ks(e,n,s),Dt(e,s))}function cw(e){var n=e.memoizedState,s=0;n!==null&&(s=n.retryLane),Jp(e,s)}function dw(e,n){var s=0;switch(e.tag){case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(o(314))}i!==null&&i.delete(n),Jp(e,s)}var Zp;Zp=function(e,n,s){if(e!==null)if(e.memoizedProps!==n.pendingProps||Ot.current)Lt=!0;else{if((e.lanes&s)===0&&(n.flags&128)===0)return Lt=!1,Jx(e,n,s);Lt=(e.flags&131072)!==0}else Lt=!1,Qe&&(n.flags&1048576)!==0&&Ih(n,Ei,n.index);switch(n.lanes=0,n.tag){case 2:var i=n.type;Bi(e,n),e=n.pendingProps;var c=Xo(n,vt.current);rs(n,s),c=Ju(null,n,i,e,c,s);var p=Zu();return n.flags|=1,typeof c=="object"&&c!==null&&typeof c.render=="function"&&c.$$typeof===void 0?(n.tag=1,n.memoizedState=null,n.updateQueue=null,At(i)?(p=!0,Si(n)):p=!1,n.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,Vu(n),c.updater=zi,n.stateNode=c,c._reactInternals=n,sc(n,i,e,s),n=uc(null,n,i,!0,p,s)):(n.tag=0,Qe&&p&&Lu(n),Pt(null,n,c,s),n=n.child),n;case 16:i=n.elementType;e:{switch(Bi(e,n),e=n.pendingProps,c=i._init,i=c(i._payload),n.type=i,c=n.tag=hw(i),e=fn(i,e),c){case 0:n=lc(null,n,i,e,s);break e;case 1:n=Ep(null,n,i,e,s);break e;case 11:n=wp(null,n,i,e,s);break e;case 14:n=bp(null,n,i,fn(i.type,e),s);break e}throw Error(o(306,i,""))}return n;case 0:return i=n.type,c=n.pendingProps,c=n.elementType===i?c:fn(i,c),lc(e,n,i,c,s);case 1:return i=n.type,c=n.pendingProps,c=n.elementType===i?c:fn(i,c),Ep(e,n,i,c,s);case 3:e:{if(Np(n),e===null)throw Error(o(387));i=n.pendingProps,p=n.memoizedState,c=p.element,Uh(e,n),Ti(n,i,null,s);var S=n.memoizedState;if(i=S.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},n.updateQueue.baseState=p,n.memoizedState=p,n.flags&256){c=ss(Error(o(423)),n),n=Pp(e,n,i,s,c);break e}else if(i!==c){c=ss(Error(o(424)),n),n=Pp(e,n,i,s,c);break e}else for(Ht=Nr(n.stateNode.containerInfo.firstChild),Wt=n,Qe=!0,dn=null,s=Fh(n,null,i,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(es(),i===c){n=er(e,n,s);break e}Pt(e,n,i,s)}n=n.child}return n;case 5:return Hh(n),e===null&&zu(n),i=n.type,c=n.pendingProps,p=e!==null?e.memoizedProps:null,S=c.children,Ru(i,c)?S=null:p!==null&&Ru(i,p)&&(n.flags|=32),kp(e,n),Pt(e,n,S,s),n.child;case 6:return e===null&&zu(n),null;case 13:return jp(e,n,s);case 4:return Ku(n,n.stateNode.containerInfo),i=n.pendingProps,e===null?n.child=ts(n,null,i,s):Pt(e,n,i,s),n.child;case 11:return i=n.type,c=n.pendingProps,c=n.elementType===i?c:fn(i,c),wp(e,n,i,c,s);case 7:return Pt(e,n,n.pendingProps,s),n.child;case 8:return Pt(e,n,n.pendingProps.children,s),n.child;case 12:return Pt(e,n,n.pendingProps.children,s),n.child;case 10:e:{if(i=n.type._context,c=n.pendingProps,p=n.memoizedProps,S=c.value,Be(ji,i._currentValue),i._currentValue=S,p!==null)if(cn(p.value,S)){if(p.children===c.children&&!Ot.current){n=er(e,n,s);break e}}else for(p=n.child,p!==null&&(p.return=n);p!==null;){var P=p.dependencies;if(P!==null){S=p.child;for(var I=P.firstContext;I!==null;){if(I.context===i){if(p.tag===1){I=Zn(-1,s&-s),I.tag=2;var $=p.updateQueue;if($!==null){$=$.shared;var Z=$.pending;Z===null?I.next=I:(I.next=Z.next,Z.next=I),$.pending=I}}p.lanes|=s,I=p.alternate,I!==null&&(I.lanes|=s),Wu(p.return,s,n),P.lanes|=s;break}I=I.next}}else if(p.tag===10)S=p.type===n.type?null:p.child;else if(p.tag===18){if(S=p.return,S===null)throw Error(o(341));S.lanes|=s,P=S.alternate,P!==null&&(P.lanes|=s),Wu(S,s,n),S=p.sibling}else S=p.child;if(S!==null)S.return=p;else for(S=p;S!==null;){if(S===n){S=null;break}if(p=S.sibling,p!==null){p.return=S.return,S=p;break}S=S.return}p=S}Pt(e,n,c.children,s),n=n.child}return n;case 9:return c=n.type,i=n.pendingProps.children,rs(n,s),c=Jt(c),i=i(c),n.flags|=1,Pt(e,n,i,s),n.child;case 14:return i=n.type,c=fn(i,n.pendingProps),c=fn(i.type,c),bp(e,n,i,c,s);case 15:return Sp(e,n,n.type,n.pendingProps,s);case 17:return i=n.type,c=n.pendingProps,c=n.elementType===i?c:fn(i,c),Bi(e,n),n.tag=1,At(i)?(e=!0,Si(n)):e=!1,rs(n,s),hp(n,i,c),sc(n,i,c,s),uc(null,n,i,!0,e,s);case 19:return Mp(e,n,s);case 22:return Cp(e,n,s)}throw Error(o(156,n.tag))};function em(e,n){return Of(e,n)}function fw(e,n,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(e,n,s,i){return new fw(e,n,s,i)}function Rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hw(e){if(typeof e=="function")return Rc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===L)return 11;if(e===te)return 14}return 2}function Dr(e,n){var s=e.alternate;return s===null?(s=tn(e.tag,n,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=n,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&14680064,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,n=e.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s}function Xi(e,n,s,i,c,p){var S=2;if(i=e,typeof e=="function")Rc(e)&&(S=1);else if(typeof e=="string")S=5;else e:switch(e){case W:return xo(s.children,c,p,n);case X:S=8,c|=8;break;case H:return e=tn(12,s,n,c|2),e.elementType=H,e.lanes=p,e;case B:return e=tn(13,s,n,c),e.elementType=B,e.lanes=p,e;case Q:return e=tn(19,s,n,c),e.elementType=Q,e.lanes=p,e;case ie:return Ji(s,c,p,n);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:S=10;break e;case _:S=9;break e;case L:S=11;break e;case te:S=14;break e;case ae:S=16,i=null;break e}throw Error(o(130,e==null?e:typeof e,""))}return n=tn(S,s,n,c),n.elementType=e,n.type=i,n.lanes=p,n}function xo(e,n,s,i){return e=tn(7,e,i,n),e.lanes=s,e}function Ji(e,n,s,i){return e=tn(22,e,i,n),e.elementType=ie,e.lanes=s,e.stateNode={isHidden:!1},e}function Mc(e,n,s){return e=tn(6,e,null,n),e.lanes=s,e}function Tc(e,n,s){return n=tn(4,e.children!==null?e.children:[],e.key,n),n.lanes=s,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function pw(e,n,s,i,c){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ou(0),this.expirationTimes=ou(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.identifierPrefix=i,this.onRecoverableError=c,this.mutableSourceEagerHydrationData=null}function Ic(e,n,s,i,c,p,S,P,I){return e=new pw(e,n,s,P,I),n===1?(n=1,p===!0&&(n|=8)):n=0,p=tn(3,null,null,n),e.current=p,p.stateNode=e,p.memoizedState={element:i,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vu(p),e}function mw(e,n,s){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:V,key:i==null?null:""+i,children:e,containerInfo:n,implementation:s}}function tm(e){if(!e)return jr;e=e._reactInternals;e:{if(ao(e)!==e||e.tag!==1)throw Error(o(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(At(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(n!==null);throw Error(o(171))}if(e.tag===1){var s=e.type;if(At(s))return Rh(e,s,n)}return n}function nm(e,n,s,i,c,p,S,P,I){return e=Ic(s,i,!0,e,c,p,S,P,I),e.context=tm(null),s=e.current,i=jt(),c=Lr(s),p=Zn(i,c),p.callback=n??null,Tr(s,p,c),e.current.lanes=c,Ks(e,c,i),Dt(e,i),e}function Zi(e,n,s,i){var c=n.current,p=jt(),S=Lr(c);return s=tm(s),n.context===null?n.context=s:n.pendingContext=s,n=Zn(p,S),n.payload={element:e},i=i===void 0?null:i,i!==null&&(n.callback=i),e=Tr(c,n,S),e!==null&&(mn(e,c,S,p),Mi(e,c,S)),S}function el(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function rm(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<n?s:n}}function Oc(e,n){rm(e,n),(e=e.alternate)&&rm(e,n)}function gw(){return null}var om=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ac(e){this._internalRoot=e}tl.prototype.render=Ac.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(o(409));Zi(e,n,null,null)},tl.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;go(function(){Zi(null,e,null,null)}),n[qn]=null}};function tl(e){this._internalRoot=e}tl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Uf();e={blockedOn:null,target:e,priority:n};for(var s=0;s<Cr.length&&n!==0&&n<Cr[s].priority;s++);Cr.splice(s,0,e),s===0&&Hf(e)}};function Lc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function nl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function sm(){}function yw(e,n,s,i,c){if(c){if(typeof i=="function"){var p=i;i=function(){var $=el(S);p.call($)}}var S=nm(n,i,e,0,null,!1,!1,"",sm);return e._reactRootContainer=S,e[qn]=S.current,aa(e.nodeType===8?e.parentNode:e),go(),S}for(;c=e.lastChild;)e.removeChild(c);if(typeof i=="function"){var P=i;i=function(){var $=el(I);P.call($)}}var I=Ic(e,0,!1,null,null,!1,!1,"",sm);return e._reactRootContainer=I,e[qn]=I.current,aa(e.nodeType===8?e.parentNode:e),go(function(){Zi(n,I,s,i)}),I}function rl(e,n,s,i,c){var p=s._reactRootContainer;if(p){var S=p;if(typeof c=="function"){var P=c;c=function(){var I=el(S);P.call(I)}}Zi(n,S,e,c)}else S=yw(s,n,e,c,i);return el(S)}Ff=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var s=Vs(n.pendingLanes);s!==0&&(su(n,s|1),Dt(n,et()),(Ae&6)===0&&(ls=et()+500,Rr()))}break;case 13:go(function(){var i=Jn(e,1);if(i!==null){var c=jt();mn(i,e,1,c)}}),Oc(e,1)}},au=function(e){if(e.tag===13){var n=Jn(e,134217728);if(n!==null){var s=jt();mn(n,e,134217728,s)}Oc(e,134217728)}},Bf=function(e){if(e.tag===13){var n=Lr(e),s=Jn(e,n);if(s!==null){var i=jt();mn(s,e,n,i)}Oc(e,n)}},Uf=function(){return ze},$f=function(e,n){var s=ze;try{return ze=e,n()}finally{ze=s}},Uo=function(e,n,s){switch(n){case"input":if(sn(e,s),n=s.name,s.type==="radio"&&n!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<s.length;n++){var i=s[n];if(i!==e&&i.form===e.form){var c=wi(i);if(!c)throw Error(o(90));Ie(i),sn(i,c)}}}break;case"textarea":Ka(e,s);break;case"select":n=s.value,n!=null&&Gt(e,!!s.multiple,n,!1)}},_e=Nc,Fe=go;var vw={usingClientEntryPoint:!1,Events:[ua,Go,wi,Xa,Ee,Nc]},Ca={findFiberByHostInstance:io,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},xw={bundleType:Ca.bundleType,version:Ca.version,rendererPackageName:Ca.rendererPackageName,rendererConfig:Ca.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:T.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Tf(e),e===null?null:e.stateNode},findFiberByHostInstance:Ca.findFiberByHostInstance||gw,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ol=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ol.isDisabled&&ol.supportsFiber)try{ti=ol.inject(xw),On=ol}catch{}}return zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vw,zt.createPortal=function(e,n){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lc(n))throw Error(o(200));return mw(e,n,null,s)},zt.createRoot=function(e,n){if(!Lc(e))throw Error(o(299));var s=!1,i="",c=om;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),n=Ic(e,1,!1,null,null,s,!1,i,c),e[qn]=n.current,aa(e.nodeType===8?e.parentNode:e),new Ac(n)},zt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=Tf(n),e=e===null?null:e.stateNode,e},zt.flushSync=function(e){return go(e)},zt.hydrate=function(e,n,s){if(!nl(n))throw Error(o(200));return rl(null,e,n,!0,s)},zt.hydrateRoot=function(e,n,s){if(!Lc(e))throw Error(o(405));var i=s!=null&&s.hydratedSources||null,c=!1,p="",S=om;if(s!=null&&(s.unstable_strictMode===!0&&(c=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onRecoverableError!==void 0&&(S=s.onRecoverableError)),n=nm(n,null,e,1,s??null,c,!1,p,S),e[qn]=n.current,aa(e),i)for(e=0;e<i.length;e++)s=i[e],c=s._getVersion,c=c(s._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[s,c]:n.mutableSourceEagerHydrationData.push(s,c);return new tl(n)},zt.render=function(e,n,s){if(!nl(n))throw Error(o(200));return rl(null,e,n,!1,s)},zt.unmountComponentAtNode=function(e){if(!nl(e))throw Error(o(40));return e._reactRootContainer?(go(function(){rl(null,null,e,!1,function(){e._reactRootContainer=null,e[qn]=null})}),!0):!1},zt.unstable_batchedUpdates=Nc,zt.unstable_renderSubtreeIntoContainer=function(e,n,s,i){if(!nl(s))throw Error(o(200));if(e==null||e._reactInternals===void 0)throw Error(o(38));return rl(e,n,s,!1,i)},zt.version="18.3.1-next-f1338f8080-20240426",zt}var pm;function Dg(){if(pm)return Fc.exports;pm=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Fc.exports=Pw(),Fc.exports}var mm;function jw(){if(mm)return al;mm=1;var t=Dg();return al.createRoot=t.createRoot,al.hydrateRoot=t.hydrateRoot,al}var Rw=jw();/**
41
- * react-router v7.13.0
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */var gm="popstate";function Mw(t={}){function r(a,l){let{pathname:u,search:f,hash:h}=a.location;return nd("",{pathname:u,search:f,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function o(a,l){return typeof l=="string"?l:Ta(l)}return Iw(r,o,null,t)}function qe(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function bn(t,r){if(!t){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Tw(){return Math.random().toString(36).substring(2,10)}function ym(t,r){return{usr:t.state,key:t.key,idx:r}}function nd(t,r,o=null,a){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof r=="string"?Is(r):r,state:o,key:r&&r.key||a||Tw()}}function Ta({pathname:t="/",search:r="",hash:o=""}){return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function Is(t){let r={};if(t){let o=t.indexOf("#");o>=0&&(r.hash=t.substring(o),t=t.substring(0,o));let a=t.indexOf("?");a>=0&&(r.search=t.substring(a),t=t.substring(0,a)),t&&(r.pathname=t)}return r}function Iw(t,r,o,a={}){let{window:l=document.defaultView,v5Compat:u=!1}=a,f=l.history,h="POP",m=null,g=x();g==null&&(g=0,f.replaceState({...f.state,idx:g},""));function x(){return(f.state||{idx:null}).idx}function b(){h="POP";let k=x(),j=k==null?null:k-g;g=k,m&&m({action:h,location:w.location,delta:j})}function C(k,j){h="PUSH";let R=nd(w.location,k,j);g=x()+1;let N=ym(R,g),T=w.createHref(R);try{f.pushState(N,"",T)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;l.location.assign(T)}u&&m&&m({action:h,location:w.location,delta:1})}function v(k,j){h="REPLACE";let R=nd(w.location,k,j);g=x();let N=ym(R,g),T=w.createHref(R);f.replaceState(N,"",T),u&&m&&m({action:h,location:w.location,delta:0})}function E(k){return Ow(k)}let w={get action(){return h},get location(){return t(l,f)},listen(k){if(m)throw new Error("A history only accepts one active listener");return l.addEventListener(gm,b),m=k,()=>{l.removeEventListener(gm,b),m=null}},createHref(k){return r(l,k)},createURL:E,encodeLocation(k){let j=E(k);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:C,replace:v,go(k){return f.go(k)}};return w}function Ow(t,r=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),qe(o,"No window.location.(origin|href) available to create URL");let a=typeof t=="string"?t:Ta(t);return a=a.replace(/ $/,"%20"),!r&&a.startsWith("//")&&(a=o+a),new URL(a,o)}function zg(t,r,o="/"){return Aw(t,r,o,!1)}function Aw(t,r,o,a){let l=typeof r=="string"?Is(r):r,u=fr(l.pathname||"/",o);if(u==null)return null;let f=Fg(t);Lw(f);let h=null;for(let m=0;h==null&&m<f.length;++m){let g=Kw(u);h=Hw(f[m],g,a)}return h}function Fg(t,r=[],o=[],a="",l=!1){let u=(f,h,m=l,g)=>{let x={relativePath:g===void 0?f.path||"":g,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(a)&&m)return;qe(x.relativePath.startsWith(a),`Absolute route path "${x.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(a.length)}let b=cr([a,x.relativePath]),C=o.concat(x);f.children&&f.children.length>0&&(qe(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),Fg(f.children,r,C,b,m)),!(f.path==null&&!f.index)&&r.push({path:b,score:$w(b,f.index),routesMeta:C})};return t.forEach((f,h)=>{var m;if(f.path===""||!((m=f.path)!=null&&m.includes("?")))u(f,h);else for(let g of Bg(f.path))u(f,h,!0,g)}),r}function Bg(t){let r=t.split("/");if(r.length===0)return[];let[o,...a]=r,l=o.endsWith("?"),u=o.replace(/\?$/,"");if(a.length===0)return l?[u,""]:[u];let f=Bg(a.join("/")),h=[];return h.push(...f.map(m=>m===""?u:[u,m].join("/"))),l&&h.push(...f),h.map(m=>t.startsWith("/")&&m===""?"/":m)}function Lw(t){t.sort((r,o)=>r.score!==o.score?o.score-r.score:Ww(r.routesMeta.map(a=>a.childrenIndex),o.routesMeta.map(a=>a.childrenIndex)))}var _w=/^:[\w-]+$/,Dw=3,zw=2,Fw=1,Bw=10,Uw=-2,vm=t=>t==="*";function $w(t,r){let o=t.split("/"),a=o.length;return o.some(vm)&&(a+=Uw),r&&(a+=zw),o.filter(l=>!vm(l)).reduce((l,u)=>l+(_w.test(u)?Dw:u===""?Fw:Bw),a)}function Ww(t,r){return t.length===r.length&&t.slice(0,-1).every((a,l)=>a===r[l])?t[t.length-1]-r[r.length-1]:0}function Hw(t,r,o=!1){let{routesMeta:a}=t,l={},u="/",f=[];for(let h=0;h<a.length;++h){let m=a[h],g=h===a.length-1,x=u==="/"?r:r.slice(u.length)||"/",b=Rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:g},x),C=m.route;if(!b&&g&&o&&!a[a.length-1].route.index&&(b=Rl({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},x)),!b)return null;Object.assign(l,b.params),f.push({params:l,pathname:cr([u,b.pathname]),pathnameBase:Yw(cr([u,b.pathnameBase])),route:C}),b.pathnameBase!=="/"&&(u=cr([u,b.pathnameBase]))}return f}function Rl(t,r){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[o,a]=Vw(t.path,t.caseSensitive,t.end),l=r.match(o);if(!l)return null;let u=l[0],f=u.replace(/(.)\/+$/,"$1"),h=l.slice(1);return{params:a.reduce((g,{paramName:x,isOptional:b},C)=>{if(x==="*"){let E=h[C]||"";f=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const v=h[C];return b&&!v?g[x]=void 0:g[x]=(v||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:f,pattern:t}}function Vw(t,r=!1,o=!0){bn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,m)=>(a.push({paramName:h,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,r?void 0:"i"),a]}function Kw(t){try{return t.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return bn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),t}}function fr(t,r){if(r==="/")return t;if(!t.toLowerCase().startsWith(r.toLowerCase()))return null;let o=r.endsWith("/")?r.length-1:r.length,a=t.charAt(o);return a&&a!=="/"?null:t.slice(o)||"/"}var Qw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function qw(t,r="/"){let{pathname:o,search:a="",hash:l=""}=typeof t=="string"?Is(t):t,u;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?u=xm(o.substring(1),"/"):u=xm(o,r)):u=r,{pathname:u,search:Xw(a),hash:Jw(l)}}function xm(t,r){let o=r.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?o.length>1&&o.pop():l!=="."&&o.push(l)}),o.length>1?o.join("/"):"/"}function $c(t,r,o,a){return`Cannot include a '${t}' character in a manually specified \`to.${r}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Gw(t){return t.filter((r,o)=>o===0||r.route.path&&r.route.path.length>0)}function Fd(t){let r=Gw(t);return r.map((o,a)=>a===r.length-1?o.pathname:o.pathnameBase)}function Bd(t,r,o,a=!1){let l;typeof t=="string"?l=Is(t):(l={...t},qe(!l.pathname||!l.pathname.includes("?"),$c("?","pathname","search",l)),qe(!l.pathname||!l.pathname.includes("#"),$c("#","pathname","hash",l)),qe(!l.search||!l.search.includes("#"),$c("#","search","hash",l)));let u=t===""||l.pathname==="",f=u?"/":l.pathname,h;if(f==null)h=o;else{let b=r.length-1;if(!a&&f.startsWith("..")){let C=f.split("/");for(;C[0]==="..";)C.shift(),b-=1;l.pathname=C.join("/")}h=b>=0?r[b]:"/"}let m=qw(l,h),g=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&o.endsWith("/");return!m.pathname.endsWith("/")&&(g||x)&&(m.pathname+="/"),m}var cr=t=>t.join("/").replace(/\/\/+/g,"/"),Yw=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Xw=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Jw=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Zw=class{constructor(t,r,o,a=!1){this.status=t,this.statusText=r||"",this.internal=a,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function e1(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function t1(t){return t.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ug=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function $g(t,r){let o=t;if(typeof o!="string"||!Qw.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let a=o,l=!1;if(Ug)try{let u=new URL(window.location.href),f=o.startsWith("//")?new URL(u.protocol+o):new URL(o),h=fr(f.pathname,r);f.origin===u.origin&&h!=null?o=h+f.search+f.hash:l=!0}catch{bn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:l,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Wg=["POST","PUT","PATCH","DELETE"];new Set(Wg);var n1=["GET",...Wg];new Set(n1);var Os=y.createContext(null);Os.displayName="DataRouter";var Ul=y.createContext(null);Ul.displayName="DataRouterState";var r1=y.createContext(!1),Hg=y.createContext({isTransitioning:!1});Hg.displayName="ViewTransition";var o1=y.createContext(new Map);o1.displayName="Fetchers";var s1=y.createContext(null);s1.displayName="Await";var qt=y.createContext(null);qt.displayName="Navigation";var Ua=y.createContext(null);Ua.displayName="Location";var Vn=y.createContext({outlet:null,matches:[],isDataRoute:!1});Vn.displayName="Route";var Ud=y.createContext(null);Ud.displayName="RouteError";var Vg="REACT_ROUTER_ERROR",a1="REDIRECT",i1="ROUTE_ERROR_RESPONSE";function l1(t){if(t.startsWith(`${Vg}:${a1}:{`))try{let r=JSON.parse(t.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function u1(t){if(t.startsWith(`${Vg}:${i1}:{`))try{let r=JSON.parse(t.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Zw(r.status,r.statusText,r.data)}catch{}}function c1(t,{relative:r}={}){qe(As(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:a}=y.useContext(qt),{hash:l,pathname:u,search:f}=$a(t,{relative:r}),h=u;return o!=="/"&&(h=u==="/"?o:cr([o,u])),a.createHref({pathname:h,search:f,hash:l})}function As(){return y.useContext(Ua)!=null}function mr(){return qe(As(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ua).location}var Kg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qg(t){y.useContext(qt).static||y.useLayoutEffect(t)}function qg(){let{isDataRoute:t}=y.useContext(Vn);return t?C1():d1()}function d1(){qe(As(),"useNavigate() may be used only in the context of a <Router> component.");let t=y.useContext(Os),{basename:r,navigator:o}=y.useContext(qt),{matches:a}=y.useContext(Vn),{pathname:l}=mr(),u=JSON.stringify(Fd(a)),f=y.useRef(!1);return Qg(()=>{f.current=!0}),y.useCallback((m,g={})=>{if(bn(f.current,Kg),!f.current)return;if(typeof m=="number"){o.go(m);return}let x=Bd(m,JSON.parse(u),l,g.relative==="path");t==null&&r!=="/"&&(x.pathname=x.pathname==="/"?r:cr([r,x.pathname])),(g.replace?o.replace:o.push)(x,g.state,g)},[r,o,u,l,t])}y.createContext(null);function $a(t,{relative:r}={}){let{matches:o}=y.useContext(Vn),{pathname:a}=mr(),l=JSON.stringify(Fd(o));return y.useMemo(()=>Bd(t,JSON.parse(l),a,r==="path"),[t,l,a,r])}function f1(t,r){return Gg(t,r)}function Gg(t,r,o,a,l){var R;qe(As(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=y.useContext(qt),{matches:f}=y.useContext(Vn),h=f[f.length-1],m=h?h.params:{},g=h?h.pathname:"/",x=h?h.pathnameBase:"/",b=h&&h.route;{let N=b&&b.path||"";Xg(g,!b||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
50
-
51
- Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let C=mr(),v;if(r){let N=typeof r=="string"?Is(r):r;qe(x==="/"||((R=N.pathname)==null?void 0:R.startsWith(x)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${x}" but pathname "${N.pathname}" was given in the \`location\` prop.`),v=N}else v=C;let E=v.pathname||"/",w=E;if(x!=="/"){let N=x.replace(/^\//,"").split("/");w="/"+E.replace(/^\//,"").split("/").slice(N.length).join("/")}let k=zg(t,{pathname:w});bn(b||k!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),bn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=y1(k&&k.map(N=>Object.assign({},N,{params:Object.assign({},m,N.params),pathname:cr([x,u.encodeLocation?u.encodeLocation(N.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?x:cr([x,u.encodeLocation?u.encodeLocation(N.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),f,o,a,l);return r&&j?y.createElement(Ua.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},j):j}function h1(){let t=S1(),r=e1(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),o=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:a},u={padding:"2px 4px",backgroundColor:a},f=null;return console.error("Error handled by React Router default ErrorBoundary:",t),f=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:u},"ErrorBoundary")," or"," ",y.createElement("code",{style:u},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},r),o?y.createElement("pre",{style:l},o):null,f)}var p1=y.createElement(h1,null),Yg=class extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){this.props.onError?this.props.onError(t,r):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const o=u1(t.digest);o&&(t=o)}let r=t!==void 0?y.createElement(Vn.Provider,{value:this.props.routeContext},y.createElement(Ud.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?y.createElement(m1,{error:t},r):r}};Yg.contextType=r1;var Wc=new WeakMap;function m1({children:t,error:r}){let{basename:o}=y.useContext(qt);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let a=l1(r.digest);if(a){let l=Wc.get(r);if(l)throw l;let u=$g(a.location,o);if(Ug&&!Wc.get(r))if(u.isExternal||a.reloadDocument)window.location.href=u.absoluteURL||u.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:a.replace}));throw Wc.set(r,f),f}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u.absoluteURL||u.to}`})}}return t}function g1({routeContext:t,match:r,children:o}){let a=y.useContext(Os);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),y.createElement(Vn.Provider,{value:t},o)}function y1(t,r=[],o=null,a=null,l=null){if(t==null){if(!o)return null;if(o.errors)t=o.matches;else if(r.length===0&&!o.initialized&&o.matches.length>0)t=o.matches;else return null}let u=t,f=o==null?void 0:o.errors;if(f!=null){let x=u.findIndex(b=>b.route.id&&(f==null?void 0:f[b.route.id])!==void 0);qe(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let h=!1,m=-1;if(o)for(let x=0;x<u.length;x++){let b=u[x];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=x),b.route.id){let{loaderData:C,errors:v}=o,E=b.route.loader&&!C.hasOwnProperty(b.route.id)&&(!v||v[b.route.id]===void 0);if(b.route.lazy||E){h=!0,m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}let g=o&&a?(x,b)=>{var C,v;a(x,{location:o.location,params:((v=(C=o.matches)==null?void 0:C[0])==null?void 0:v.params)??{},unstable_pattern:t1(o.matches),errorInfo:b})}:void 0;return u.reduceRight((x,b,C)=>{let v,E=!1,w=null,k=null;o&&(v=f&&b.route.id?f[b.route.id]:void 0,w=b.route.errorElement||p1,h&&(m<0&&C===0?(Xg("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,k=null):m===C&&(E=!0,k=b.route.hydrateFallbackElement||null)));let j=r.concat(u.slice(0,C+1)),R=()=>{let N;return v?N=w:E?N=k:b.route.Component?N=y.createElement(b.route.Component,null):b.route.element?N=b.route.element:N=x,y.createElement(g1,{match:b,routeContext:{outlet:x,matches:j,isDataRoute:o!=null},children:N})};return o&&(b.route.ErrorBoundary||b.route.errorElement||C===0)?y.createElement(Yg,{location:o.location,revalidation:o.revalidation,component:w,error:v,children:R(),routeContext:{outlet:null,matches:j,isDataRoute:!0},onError:g}):R()},null)}function $d(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function v1(t){let r=y.useContext(Os);return qe(r,$d(t)),r}function x1(t){let r=y.useContext(Ul);return qe(r,$d(t)),r}function w1(t){let r=y.useContext(Vn);return qe(r,$d(t)),r}function Wd(t){let r=w1(t),o=r.matches[r.matches.length-1];return qe(o.route.id,`${t} can only be used on routes that contain a unique "id"`),o.route.id}function b1(){return Wd("useRouteId")}function S1(){var a;let t=y.useContext(Ud),r=x1("useRouteError"),o=Wd("useRouteError");return t!==void 0?t:(a=r.errors)==null?void 0:a[o]}function C1(){let{router:t}=v1("useNavigate"),r=Wd("useNavigate"),o=y.useRef(!1);return Qg(()=>{o.current=!0}),y.useCallback(async(l,u={})=>{bn(o.current,Kg),o.current&&(typeof l=="number"?await t.navigate(l):await t.navigate(l,{fromRouteId:r,...u}))},[t,r])}var wm={};function Xg(t,r,o){!r&&!wm[t]&&(wm[t]=!0,bn(!1,o))}y.memo(k1);function k1({routes:t,future:r,state:o,onError:a}){return Gg(t,void 0,o,a,r)}function bm({to:t,replace:r,state:o,relative:a}){qe(As(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=y.useContext(qt);bn(!l,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:u}=y.useContext(Vn),{pathname:f}=mr(),h=qg(),m=Bd(t,Fd(u),f,a==="path"),g=JSON.stringify(m);return y.useEffect(()=>{h(JSON.parse(g),{replace:r,state:o,relative:a})},[h,g,a,r,o]),null}function rr(t){qe(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function E1({basename:t="/",children:r=null,location:o,navigationType:a="POP",navigator:l,static:u=!1,unstable_useTransitions:f}){qe(!As(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=t.replace(/^\/*/,"/"),m=y.useMemo(()=>({basename:h,navigator:l,static:u,unstable_useTransitions:f,future:{}}),[h,l,u,f]);typeof o=="string"&&(o=Is(o));let{pathname:g="/",search:x="",hash:b="",state:C=null,key:v="default"}=o,E=y.useMemo(()=>{let w=fr(g,h);return w==null?null:{location:{pathname:w,search:x,hash:b,state:C,key:v},navigationType:a}},[h,g,x,b,C,v,a]);return bn(E!=null,`<Router basename="${h}"> is not able to match the URL "${g}${x}${b}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:y.createElement(qt.Provider,{value:m},y.createElement(Ua.Provider,{children:r,value:E}))}function N1({children:t,location:r}){return f1(rd(t),r)}function rd(t,r=[]){let o=[];return y.Children.forEach(t,(a,l)=>{if(!y.isValidElement(a))return;let u=[...r,l];if(a.type===y.Fragment){o.push.apply(o,rd(a.props.children,u));return}qe(a.type===rr,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),qe(!a.props.index||!a.props.children,"An index route cannot have child routes.");let f={id:a.props.id||u.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(f.children=rd(a.props.children,u)),o.push(f)}),o}var vl="get",xl="application/x-www-form-urlencoded";function $l(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function P1(t){return $l(t)&&t.tagName.toLowerCase()==="button"}function j1(t){return $l(t)&&t.tagName.toLowerCase()==="form"}function R1(t){return $l(t)&&t.tagName.toLowerCase()==="input"}function M1(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function T1(t,r){return t.button===0&&(!r||r==="_self")&&!M1(t)}var il=null;function I1(){if(il===null)try{new FormData(document.createElement("form"),0),il=!1}catch{il=!0}return il}var O1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Hc(t){return t!=null&&!O1.has(t)?(bn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${xl}"`),null):t}function A1(t,r){let o,a,l,u,f;if(j1(t)){let h=t.getAttribute("action");a=h?fr(h,r):null,o=t.getAttribute("method")||vl,l=Hc(t.getAttribute("enctype"))||xl,u=new FormData(t)}else if(P1(t)||R1(t)&&(t.type==="submit"||t.type==="image")){let h=t.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||h.getAttribute("action");if(a=m?fr(m,r):null,o=t.getAttribute("formmethod")||h.getAttribute("method")||vl,l=Hc(t.getAttribute("formenctype"))||Hc(h.getAttribute("enctype"))||xl,u=new FormData(h,t),!I1()){let{name:g,type:x,value:b}=t;if(x==="image"){let C=g?`${g}.`:"";u.append(`${C}x`,"0"),u.append(`${C}y`,"0")}else g&&u.append(g,b)}}else{if($l(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=vl,a=null,l=xl,f=t}return u&&l==="text/plain"&&(f=u,u=void 0),{action:a,method:o.toLowerCase(),encType:l,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Hd(t,r){if(t===!1||t===null||typeof t>"u")throw new Error(r)}function L1(t,r,o,a){let l=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return o?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:r&&fr(l.pathname,r)==="/"?l.pathname=`${r.replace(/\/$/,"")}/_root.${a}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${a}`,l}async function _1(t,r){if(t.id in r)return r[t.id];try{let o=await import(t.module);return r[t.id]=o,o}catch(o){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function D1(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function z1(t,r,o){let a=await Promise.all(t.map(async l=>{let u=r.routes[l.route.id];if(u){let f=await _1(u,o);return f.links?f.links():[]}return[]}));return $1(a.flat(1).filter(D1).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function Sm(t,r,o,a,l,u){let f=(m,g)=>o[g]?m.route.id!==o[g].route.id:!0,h=(m,g)=>{var x;return o[g].pathname!==m.pathname||((x=o[g].route.path)==null?void 0:x.endsWith("*"))&&o[g].params["*"]!==m.params["*"]};return u==="assets"?r.filter((m,g)=>f(m,g)||h(m,g)):u==="data"?r.filter((m,g)=>{var b;let x=a.routes[m.route.id];if(!x||!x.hasLoader)return!1;if(f(m,g)||h(m,g))return!0;if(m.route.shouldRevalidate){let C=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof C=="boolean")return C}return!0}):[]}function F1(t,r,{includeHydrateFallback:o}={}){return B1(t.map(a=>{let l=r.routes[a.route.id];if(!l)return[];let u=[l.module];return l.clientActionModule&&(u=u.concat(l.clientActionModule)),l.clientLoaderModule&&(u=u.concat(l.clientLoaderModule)),o&&l.hydrateFallbackModule&&(u=u.concat(l.hydrateFallbackModule)),l.imports&&(u=u.concat(l.imports)),u}).flat(1))}function B1(t){return[...new Set(t)]}function U1(t){let r={},o=Object.keys(t).sort();for(let a of o)r[a]=t[a];return r}function $1(t,r){let o=new Set;return new Set(r),t.reduce((a,l)=>{let u=JSON.stringify(U1(l));return o.has(u)||(o.add(u),a.push({key:u,link:l})),a},[])}function Jg(){let t=y.useContext(Os);return Hd(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function W1(){let t=y.useContext(Ul);return Hd(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Vd=y.createContext(void 0);Vd.displayName="FrameworkContext";function Zg(){let t=y.useContext(Vd);return Hd(t,"You must render this element inside a <HydratedRouter> element"),t}function H1(t,r){let o=y.useContext(Vd),[a,l]=y.useState(!1),[u,f]=y.useState(!1),{onFocus:h,onBlur:m,onMouseEnter:g,onMouseLeave:x,onTouchStart:b}=r,C=y.useRef(null);y.useEffect(()=>{if(t==="render"&&f(!0),t==="viewport"){let w=j=>{j.forEach(R=>{f(R.isIntersecting)})},k=new IntersectionObserver(w,{threshold:.5});return C.current&&k.observe(C.current),()=>{k.disconnect()}}},[t]),y.useEffect(()=>{if(a){let w=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(w)}}},[a]);let v=()=>{l(!0)},E=()=>{l(!1),f(!1)};return o?t!=="intent"?[u,C,{}]:[u,C,{onFocus:Ea(h,v),onBlur:Ea(m,E),onMouseEnter:Ea(g,v),onMouseLeave:Ea(x,E),onTouchStart:Ea(b,v)}]:[!1,C,{}]}function Ea(t,r){return o=>{t&&t(o),o.defaultPrevented||r(o)}}function V1({page:t,...r}){let{router:o}=Jg(),a=y.useMemo(()=>zg(o.routes,t,o.basename),[o.routes,t,o.basename]);return a?y.createElement(Q1,{page:t,matches:a,...r}):null}function K1(t){let{manifest:r,routeModules:o}=Zg(),[a,l]=y.useState([]);return y.useEffect(()=>{let u=!1;return z1(t,r,o).then(f=>{u||l(f)}),()=>{u=!0}},[t,r,o]),a}function Q1({page:t,matches:r,...o}){let a=mr(),{future:l,manifest:u,routeModules:f}=Zg(),{basename:h}=Jg(),{loaderData:m,matches:g}=W1(),x=y.useMemo(()=>Sm(t,r,g,u,a,"data"),[t,r,g,u,a]),b=y.useMemo(()=>Sm(t,r,g,u,a,"assets"),[t,r,g,u,a]),C=y.useMemo(()=>{if(t===a.pathname+a.search+a.hash)return[];let w=new Set,k=!1;if(r.forEach(R=>{var T;let N=u.routes[R.route.id];!N||!N.hasLoader||(!x.some(U=>U.route.id===R.route.id)&&R.route.id in m&&((T=f[R.route.id])!=null&&T.shouldRevalidate)||N.hasClientLoader?k=!0:w.add(R.route.id))}),w.size===0)return[];let j=L1(t,h,l.unstable_trailingSlashAwareDataRequests,"data");return k&&w.size>0&&j.searchParams.set("_routes",r.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[j.pathname+j.search]},[h,l.unstable_trailingSlashAwareDataRequests,m,a,u,x,r,t,f]),v=y.useMemo(()=>F1(b,u),[b,u]),E=K1(b);return y.createElement(y.Fragment,null,C.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...o})),v.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...o})),E.map(({key:w,link:k})=>y.createElement("link",{key:w,nonce:o.nonce,...k,crossOrigin:k.crossOrigin??o.crossOrigin})))}function q1(...t){return r=>{t.forEach(o=>{typeof o=="function"?o(r):o!=null&&(o.current=r)})}}var G1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{G1&&(window.__reactRouterVersion="7.13.0")}catch{}function Y1({basename:t,children:r,unstable_useTransitions:o,window:a}){let l=y.useRef();l.current==null&&(l.current=Mw({window:a,v5Compat:!0}));let u=l.current,[f,h]=y.useState({action:u.action,location:u.location}),m=y.useCallback(g=>{o===!1?h(g):y.startTransition(()=>h(g))},[o]);return y.useLayoutEffect(()=>u.listen(m),[u,m]),y.createElement(E1,{basename:t,children:r,location:f.location,navigationType:f.action,navigator:u,unstable_useTransitions:o})}var ey=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ty=y.forwardRef(function({onClick:r,discover:o="render",prefetch:a="none",relative:l,reloadDocument:u,replace:f,state:h,target:m,to:g,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:C,...v},E){let{basename:w,unstable_useTransitions:k}=y.useContext(qt),j=typeof g=="string"&&ey.test(g),R=$g(g,w);g=R.to;let N=c1(g,{relative:l}),[T,U,V]=H1(a,v),W=Z1(g,{replace:f,state:h,target:m,preventScrollReset:x,relative:l,viewTransition:b,unstable_defaultShouldRevalidate:C,unstable_useTransitions:k});function X(G){r&&r(G),G.defaultPrevented||W(G)}let H=y.createElement("a",{...v,...V,href:R.absoluteURL||N,onClick:R.isExternal||u?r:X,ref:q1(E,U),target:m,"data-discover":!j&&o==="render"?"true":void 0});return T&&!j?y.createElement(y.Fragment,null,H,y.createElement(V1,{page:N})):H});ty.displayName="Link";var ny=y.forwardRef(function({"aria-current":r="page",caseSensitive:o=!1,className:a="",end:l=!1,style:u,to:f,viewTransition:h,children:m,...g},x){let b=$a(f,{relative:g.relative}),C=mr(),v=y.useContext(Ul),{navigator:E,basename:w}=y.useContext(qt),k=v!=null&&ob(b)&&h===!0,j=E.encodeLocation?E.encodeLocation(b).pathname:b.pathname,R=C.pathname,N=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;o||(R=R.toLowerCase(),N=N?N.toLowerCase():null,j=j.toLowerCase()),N&&w&&(N=fr(N,w)||N);const T=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let U=R===j||!l&&R.startsWith(j)&&R.charAt(T)==="/",V=N!=null&&(N===j||!l&&N.startsWith(j)&&N.charAt(j.length)==="/"),W={isActive:U,isPending:V,isTransitioning:k},X=U?r:void 0,H;typeof a=="function"?H=a(W):H=[a,U?"active":null,V?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let G=typeof u=="function"?u(W):u;return y.createElement(ty,{...g,"aria-current":X,className:H,ref:x,style:G,to:f,viewTransition:h},typeof m=="function"?m(W):m)});ny.displayName="NavLink";var X1=y.forwardRef(({discover:t="render",fetcherKey:r,navigate:o,reloadDocument:a,replace:l,state:u,method:f=vl,action:h,onSubmit:m,relative:g,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:C,...v},E)=>{let{unstable_useTransitions:w}=y.useContext(qt),k=nb(),j=rb(h,{relative:g}),R=f.toLowerCase()==="get"?"get":"post",N=typeof h=="string"&&ey.test(h),T=U=>{if(m&&m(U),U.defaultPrevented)return;U.preventDefault();let V=U.nativeEvent.submitter,W=(V==null?void 0:V.getAttribute("formmethod"))||f,X=()=>k(V||U.currentTarget,{fetcherKey:r,method:W,navigate:o,replace:l,state:u,relative:g,preventScrollReset:x,viewTransition:b,unstable_defaultShouldRevalidate:C});w&&o!==!1?y.startTransition(()=>X()):X()};return y.createElement("form",{ref:E,method:R,action:j,onSubmit:a?m:T,...v,"data-discover":!N&&t==="render"?"true":void 0})});X1.displayName="Form";function J1(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ry(t){let r=y.useContext(Os);return qe(r,J1(t)),r}function Z1(t,{target:r,replace:o,state:a,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:m}={}){let g=qg(),x=mr(),b=$a(t,{relative:u});return y.useCallback(C=>{if(T1(C,r)){C.preventDefault();let v=o!==void 0?o:Ta(x)===Ta(b),E=()=>g(t,{replace:v,state:a,preventScrollReset:l,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});m?y.startTransition(()=>E()):E()}},[x,g,b,o,a,r,t,l,u,f,h,m])}var eb=0,tb=()=>`__${String(++eb)}__`;function nb(){let{router:t}=ry("useSubmit"),{basename:r}=y.useContext(qt),o=b1(),a=t.fetch,l=t.navigate;return y.useCallback(async(u,f={})=>{let{action:h,method:m,encType:g,formData:x,body:b}=A1(u,r);if(f.navigate===!1){let C=f.fetcherKey||tb();await a(C,o,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:b,formMethod:f.method||m,formEncType:f.encType||g,flushSync:f.flushSync})}else await l(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:b,formMethod:f.method||m,formEncType:f.encType||g,replace:f.replace,state:f.state,fromRouteId:o,flushSync:f.flushSync,viewTransition:f.viewTransition})},[a,l,r,o])}function rb(t,{relative:r}={}){let{basename:o}=y.useContext(qt),a=y.useContext(Vn);qe(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),u={...$a(t||".",{relative:r})},f=mr();if(t==null){u.search=f.search;let h=new URLSearchParams(u.search),m=h.getAll("index");if(m.some(x=>x==="")){h.delete("index"),m.filter(b=>b).forEach(b=>h.append("index",b));let x=h.toString();u.search=x?`?${x}`:""}}return(!t||t===".")&&l.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(u.pathname=u.pathname==="/"?o:cr([o,u.pathname])),Ta(u)}function ob(t,{relative:r}={}){let o=y.useContext(Hg);qe(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=ry("useViewTransitionState"),l=$a(t,{relative:r});if(!o.isTransitioning)return!1;let u=fr(o.currentLocation.pathname,a)||o.currentLocation.pathname,f=fr(o.nextLocation.pathname,a)||o.nextLocation.pathname;return Rl(l.pathname,f)!=null||Rl(l.pathname,u)!=null}var Wa=Dg();const oy=Lg(Wa);var Ls=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sb={setTimeout:(t,r)=>setTimeout(t,r),clearTimeout:t=>clearTimeout(t),setInterval:(t,r)=>setInterval(t,r),clearInterval:t=>clearInterval(t)},Wr,Dd,kg,ab=(kg=class{constructor(){ye(this,Wr,sb);ye(this,Dd,!1)}setTimeoutProvider(t){ue(this,Wr,t)}setTimeout(t,r){return M(this,Wr).setTimeout(t,r)}clearTimeout(t){M(this,Wr).clearTimeout(t)}setInterval(t,r){return M(this,Wr).setInterval(t,r)}clearInterval(t){M(this,Wr).clearInterval(t)}},Wr=new WeakMap,Dd=new WeakMap,kg),wo=new ab;function ib(t){setTimeout(t,0)}var Mo=typeof window>"u"||"Deno"in globalThis;function Mt(){}function lb(t,r){return typeof t=="function"?t(r):t}function od(t){return typeof t=="number"&&t>=0&&t!==1/0}function sy(t,r){return Math.max(t+(r||0)-Date.now(),0)}function Jr(t,r){return typeof t=="function"?t(r):t}function rn(t,r){return typeof t=="function"?t(r):t}function Cm(t,r){const{type:o="all",exact:a,fetchStatus:l,predicate:u,queryKey:f,stale:h}=t;if(f){if(a){if(r.queryHash!==Kd(f,r.options))return!1}else if(!Ia(r.queryKey,f))return!1}if(o!=="all"){const m=r.isActive();if(o==="active"&&!m||o==="inactive"&&m)return!1}return!(typeof h=="boolean"&&r.isStale()!==h||l&&l!==r.state.fetchStatus||u&&!u(r))}function km(t,r){const{exact:o,status:a,predicate:l,mutationKey:u}=t;if(u){if(!r.options.mutationKey)return!1;if(o){if(To(r.options.mutationKey)!==To(u))return!1}else if(!Ia(r.options.mutationKey,u))return!1}return!(a&&r.state.status!==a||l&&!l(r))}function Kd(t,r){return((r==null?void 0:r.queryKeyHashFn)||To)(t)}function To(t){return JSON.stringify(t,(r,o)=>sd(o)?Object.keys(o).sort().reduce((a,l)=>(a[l]=o[l],a),{}):o)}function Ia(t,r){return t===r?!0:typeof t!=typeof r?!1:t&&r&&typeof t=="object"&&typeof r=="object"?Object.keys(r).every(o=>Ia(t[o],r[o])):!1}var ub=Object.prototype.hasOwnProperty;function ay(t,r,o=0){if(t===r)return t;if(o>500)return r;const a=Em(t)&&Em(r);if(!a&&!(sd(t)&&sd(r)))return r;const u=(a?t:Object.keys(t)).length,f=a?r:Object.keys(r),h=f.length,m=a?new Array(h):{};let g=0;for(let x=0;x<h;x++){const b=a?x:f[x],C=t[b],v=r[b];if(C===v){m[b]=C,(a?x<u:ub.call(t,b))&&g++;continue}if(C===null||v===null||typeof C!="object"||typeof v!="object"){m[b]=v;continue}const E=ay(C,v,o+1);m[b]=E,E===C&&g++}return u===h&&g===u?t:m}function Ml(t,r){if(!r||Object.keys(t).length!==Object.keys(r).length)return!1;for(const o in t)if(t[o]!==r[o])return!1;return!0}function Em(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function sd(t){if(!Nm(t))return!1;const r=t.constructor;if(r===void 0)return!0;const o=r.prototype;return!(!Nm(o)||!o.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Nm(t){return Object.prototype.toString.call(t)==="[object Object]"}function cb(t){return new Promise(r=>{wo.setTimeout(r,t)})}function ad(t,r,o){return typeof o.structuralSharing=="function"?o.structuralSharing(t,r):o.structuralSharing!==!1?ay(t,r):r}function db(t,r,o=0){const a=[...t,r];return o&&a.length>o?a.slice(1):a}function fb(t,r,o=0){const a=[r,...t];return o&&a.length>o?a.slice(0,-1):a}var Qd=Symbol();function iy(t,r){return!t.queryFn&&(r!=null&&r.initialPromise)?()=>r.initialPromise:!t.queryFn||t.queryFn===Qd?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function qd(t,r){return typeof t=="function"?t(...r):!!t}function hb(t,r,o){let a=!1,l;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(l??(l=r()),a||(a=!0,l.aborted?o():l.addEventListener("abort",o,{once:!0})),l)}),t}var bo,Hr,xs,Eg,pb=(Eg=class extends Ls{constructor(){super();ye(this,bo);ye(this,Hr);ye(this,xs);ue(this,xs,r=>{if(!Mo&&window.addEventListener){const o=()=>r();return window.addEventListener("visibilitychange",o,!1),()=>{window.removeEventListener("visibilitychange",o)}}})}onSubscribe(){M(this,Hr)||this.setEventListener(M(this,xs))}onUnsubscribe(){var r;this.hasListeners()||((r=M(this,Hr))==null||r.call(this),ue(this,Hr,void 0))}setEventListener(r){var o;ue(this,xs,r),(o=M(this,Hr))==null||o.call(this),ue(this,Hr,r(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(r){M(this,bo)!==r&&(ue(this,bo,r),this.onFocus())}onFocus(){const r=this.isFocused();this.listeners.forEach(o=>{o(r)})}isFocused(){var r;return typeof M(this,bo)=="boolean"?M(this,bo):((r=globalThis.document)==null?void 0:r.visibilityState)!=="hidden"}},bo=new WeakMap,Hr=new WeakMap,xs=new WeakMap,Eg),Gd=new pb;function id(){let t,r;const o=new Promise((l,u)=>{t=l,r=u});o.status="pending",o.catch(()=>{});function a(l){Object.assign(o,l),delete o.resolve,delete o.reject}return o.resolve=l=>{a({status:"fulfilled",value:l}),t(l)},o.reject=l=>{a({status:"rejected",reason:l}),r(l)},o}var mb=ib;function gb(){let t=[],r=0,o=h=>{h()},a=h=>{h()},l=mb;const u=h=>{r?t.push(h):l(()=>{o(h)})},f=()=>{const h=t;t=[],h.length&&l(()=>{a(()=>{h.forEach(m=>{o(m)})})})};return{batch:h=>{let m;r++;try{m=h()}finally{r--,r||f()}return m},batchCalls:h=>(...m)=>{u(()=>{h(...m)})},schedule:u,setNotifyFunction:h=>{o=h},setBatchNotifyFunction:h=>{a=h},setScheduler:h=>{l=h}}}var lt=gb(),ws,Vr,bs,Ng,yb=(Ng=class extends Ls{constructor(){super();ye(this,ws,!0);ye(this,Vr);ye(this,bs);ue(this,bs,r=>{if(!Mo&&window.addEventListener){const o=()=>r(!0),a=()=>r(!1);return window.addEventListener("online",o,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",o),window.removeEventListener("offline",a)}}})}onSubscribe(){M(this,Vr)||this.setEventListener(M(this,bs))}onUnsubscribe(){var r;this.hasListeners()||((r=M(this,Vr))==null||r.call(this),ue(this,Vr,void 0))}setEventListener(r){var o;ue(this,bs,r),(o=M(this,Vr))==null||o.call(this),ue(this,Vr,r(this.setOnline.bind(this)))}setOnline(r){M(this,ws)!==r&&(ue(this,ws,r),this.listeners.forEach(a=>{a(r)}))}isOnline(){return M(this,ws)}},ws=new WeakMap,Vr=new WeakMap,bs=new WeakMap,Ng),Tl=new yb;function vb(t){return Math.min(1e3*2**t,3e4)}function ly(t){return(t??"online")==="online"?Tl.isOnline():!0}var ld=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function uy(t){let r=!1,o=0,a;const l=id(),u=()=>l.status!=="pending",f=w=>{var k;if(!u()){const j=new ld(w);C(j),(k=t.onCancel)==null||k.call(t,j)}},h=()=>{r=!0},m=()=>{r=!1},g=()=>Gd.isFocused()&&(t.networkMode==="always"||Tl.isOnline())&&t.canRun(),x=()=>ly(t.networkMode)&&t.canRun(),b=w=>{u()||(a==null||a(),l.resolve(w))},C=w=>{u()||(a==null||a(),l.reject(w))},v=()=>new Promise(w=>{var k;a=j=>{(u()||g())&&w(j)},(k=t.onPause)==null||k.call(t)}).then(()=>{var w;a=void 0,u()||(w=t.onContinue)==null||w.call(t)}),E=()=>{if(u())return;let w;const k=o===0?t.initialPromise:void 0;try{w=k??t.fn()}catch(j){w=Promise.reject(j)}Promise.resolve(w).then(b).catch(j=>{var V;if(u())return;const R=t.retry??(Mo?0:3),N=t.retryDelay??vb,T=typeof N=="function"?N(o,j):N,U=R===!0||typeof R=="number"&&o<R||typeof R=="function"&&R(o,j);if(r||!U){C(j);return}o++,(V=t.onFail)==null||V.call(t,o,j),cb(T).then(()=>g()?void 0:v()).then(()=>{r?C(j):E()})})};return{promise:l,status:()=>l.status,cancel:f,continue:()=>(a==null||a(),l),cancelRetry:h,continueRetry:m,canStart:x,start:()=>(x()?E():v().then(E),l)}}var So,Pg,cy=(Pg=class{constructor(){ye(this,So)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),od(this.gcTime)&&ue(this,So,wo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Mo?1/0:300*1e3))}clearGcTimeout(){M(this,So)&&(wo.clearTimeout(M(this,So)),ue(this,So,void 0))}},So=new WeakMap,Pg),Co,Ss,nn,ko,ft,_a,Eo,xn,or,jg,xb=(jg=class extends cy{constructor(r){super();ye(this,xn);ye(this,Co);ye(this,Ss);ye(this,nn);ye(this,ko);ye(this,ft);ye(this,_a);ye(this,Eo);ue(this,Eo,!1),ue(this,_a,r.defaultOptions),this.setOptions(r.options),this.observers=[],ue(this,ko,r.client),ue(this,nn,M(this,ko).getQueryCache()),this.queryKey=r.queryKey,this.queryHash=r.queryHash,ue(this,Co,jm(this.options)),this.state=r.state??M(this,Co),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var r;return(r=M(this,ft))==null?void 0:r.promise}setOptions(r){if(this.options={...M(this,_a),...r},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const o=jm(this.options);o.data!==void 0&&(this.setState(Pm(o.data,o.dataUpdatedAt)),ue(this,Co,o))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,nn).remove(this)}setData(r,o){const a=ad(this.state.data,r,this.options);return Re(this,xn,or).call(this,{data:a,type:"success",dataUpdatedAt:o==null?void 0:o.updatedAt,manual:o==null?void 0:o.manual}),a}setState(r,o){Re(this,xn,or).call(this,{type:"setState",state:r,setStateOptions:o})}cancel(r){var a,l;const o=(a=M(this,ft))==null?void 0:a.promise;return(l=M(this,ft))==null||l.cancel(r),o?o.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,Co))}isActive(){return this.observers.some(r=>rn(r.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qd||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(r=>Jr(r.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(r=>r.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(r=0){return this.state.data===void 0?!0:r==="static"?!1:this.state.isInvalidated?!0:!sy(this.state.dataUpdatedAt,r)}onFocus(){var o;const r=this.observers.find(a=>a.shouldFetchOnWindowFocus());r==null||r.refetch({cancelRefetch:!1}),(o=M(this,ft))==null||o.continue()}onOnline(){var o;const r=this.observers.find(a=>a.shouldFetchOnReconnect());r==null||r.refetch({cancelRefetch:!1}),(o=M(this,ft))==null||o.continue()}addObserver(r){this.observers.includes(r)||(this.observers.push(r),this.clearGcTimeout(),M(this,nn).notify({type:"observerAdded",query:this,observer:r}))}removeObserver(r){this.observers.includes(r)&&(this.observers=this.observers.filter(o=>o!==r),this.observers.length||(M(this,ft)&&(M(this,Eo)?M(this,ft).cancel({revert:!0}):M(this,ft).cancelRetry()),this.scheduleGc()),M(this,nn).notify({type:"observerRemoved",query:this,observer:r}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Re(this,xn,or).call(this,{type:"invalidate"})}async fetch(r,o){var m,g,x,b,C,v,E,w,k,j,R,N;if(this.state.fetchStatus!=="idle"&&((m=M(this,ft))==null?void 0:m.status())!=="rejected"){if(this.state.data!==void 0&&(o!=null&&o.cancelRefetch))this.cancel({silent:!0});else if(M(this,ft))return M(this,ft).continueRetry(),M(this,ft).promise}if(r&&this.setOptions(r),!this.options.queryFn){const T=this.observers.find(U=>U.options.queryFn);T&&this.setOptions(T.options)}const a=new AbortController,l=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(ue(this,Eo,!0),a.signal)})},u=()=>{const T=iy(this.options,o),V=(()=>{const W={client:M(this,ko),queryKey:this.queryKey,meta:this.meta};return l(W),W})();return ue(this,Eo,!1),this.options.persister?this.options.persister(T,V,this):T(V)},h=(()=>{const T={fetchOptions:o,options:this.options,queryKey:this.queryKey,client:M(this,ko),state:this.state,fetchFn:u};return l(T),T})();(g=this.options.behavior)==null||g.onFetch(h,this),ue(this,Ss,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((x=h.fetchOptions)==null?void 0:x.meta))&&Re(this,xn,or).call(this,{type:"fetch",meta:(b=h.fetchOptions)==null?void 0:b.meta}),ue(this,ft,uy({initialPromise:o==null?void 0:o.initialPromise,fn:h.fetchFn,onCancel:T=>{T instanceof ld&&T.revert&&this.setState({...M(this,Ss),fetchStatus:"idle"}),a.abort()},onFail:(T,U)=>{Re(this,xn,or).call(this,{type:"failed",failureCount:T,error:U})},onPause:()=>{Re(this,xn,or).call(this,{type:"pause"})},onContinue:()=>{Re(this,xn,or).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const T=await M(this,ft).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(v=(C=M(this,nn).config).onSuccess)==null||v.call(C,T,this),(w=(E=M(this,nn).config).onSettled)==null||w.call(E,T,this.state.error,this),T}catch(T){if(T instanceof ld){if(T.silent)return M(this,ft).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw Re(this,xn,or).call(this,{type:"error",error:T}),(j=(k=M(this,nn).config).onError)==null||j.call(k,T,this),(N=(R=M(this,nn).config).onSettled)==null||N.call(R,this.state.data,T,this),T}finally{this.scheduleGc()}}},Co=new WeakMap,Ss=new WeakMap,nn=new WeakMap,ko=new WeakMap,ft=new WeakMap,_a=new WeakMap,Eo=new WeakMap,xn=new WeakSet,or=function(r){const o=a=>{switch(r.type){case"failed":return{...a,fetchFailureCount:r.failureCount,fetchFailureReason:r.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...dy(a.data,this.options),fetchMeta:r.meta??null};case"success":const l={...a,...Pm(r.data,r.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!r.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,Ss,r.manual?l:void 0),l;case"error":const u=r.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...r.state}}};this.state=o(this.state),lt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),M(this,nn).notify({query:this,type:"updated",action:r})})},jg);function dy(t,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ly(r.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Pm(t,r){return{data:t,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function jm(t){const r=typeof t.initialData=="function"?t.initialData():t.initialData,o=r!==void 0,a=o?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:o?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:o?"success":"pending",fetchStatus:"idle"}}var Ft,Oe,Da,Rt,No,Cs,sr,Kr,za,ks,Es,Po,jo,Qr,Ns,De,ja,ud,cd,dd,fd,hd,pd,md,fy,Rg,wb=(Rg=class extends Ls{constructor(r,o){super();ye(this,De);ye(this,Ft);ye(this,Oe);ye(this,Da);ye(this,Rt);ye(this,No);ye(this,Cs);ye(this,sr);ye(this,Kr);ye(this,za);ye(this,ks);ye(this,Es);ye(this,Po);ye(this,jo);ye(this,Qr);ye(this,Ns,new Set);this.options=o,ue(this,Ft,r),ue(this,Kr,null),ue(this,sr,id()),this.bindMethods(),this.setOptions(o)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(M(this,Oe).addObserver(this),Rm(M(this,Oe),this.options)?Re(this,De,ja).call(this):this.updateResult(),Re(this,De,fd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gd(M(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gd(M(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Re(this,De,hd).call(this),Re(this,De,pd).call(this),M(this,Oe).removeObserver(this)}setOptions(r){const o=this.options,a=M(this,Oe);if(this.options=M(this,Ft).defaultQueryOptions(r),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof rn(this.options.enabled,M(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Re(this,De,md).call(this),M(this,Oe).setOptions(this.options),o._defaulted&&!Ml(this.options,o)&&M(this,Ft).getQueryCache().notify({type:"observerOptionsUpdated",query:M(this,Oe),observer:this});const l=this.hasListeners();l&&Mm(M(this,Oe),a,this.options,o)&&Re(this,De,ja).call(this),this.updateResult(),l&&(M(this,Oe)!==a||rn(this.options.enabled,M(this,Oe))!==rn(o.enabled,M(this,Oe))||Jr(this.options.staleTime,M(this,Oe))!==Jr(o.staleTime,M(this,Oe)))&&Re(this,De,ud).call(this);const u=Re(this,De,cd).call(this);l&&(M(this,Oe)!==a||rn(this.options.enabled,M(this,Oe))!==rn(o.enabled,M(this,Oe))||u!==M(this,Qr))&&Re(this,De,dd).call(this,u)}getOptimisticResult(r){const o=M(this,Ft).getQueryCache().build(M(this,Ft),r),a=this.createResult(o,r);return Sb(this,a)&&(ue(this,Rt,a),ue(this,Cs,this.options),ue(this,No,M(this,Oe).state)),a}getCurrentResult(){return M(this,Rt)}trackResult(r,o){return new Proxy(r,{get:(a,l)=>(this.trackProp(l),o==null||o(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&M(this,sr).status==="pending"&&M(this,sr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(r){M(this,Ns).add(r)}getCurrentQuery(){return M(this,Oe)}refetch({...r}={}){return this.fetch({...r})}fetchOptimistic(r){const o=M(this,Ft).defaultQueryOptions(r),a=M(this,Ft).getQueryCache().build(M(this,Ft),o);return a.fetch().then(()=>this.createResult(a,o))}fetch(r){return Re(this,De,ja).call(this,{...r,cancelRefetch:r.cancelRefetch??!0}).then(()=>(this.updateResult(),M(this,Rt)))}createResult(r,o){var H;const a=M(this,Oe),l=this.options,u=M(this,Rt),f=M(this,No),h=M(this,Cs),g=r!==a?r.state:M(this,Da),{state:x}=r;let b={...x},C=!1,v;if(o._optimisticResults){const G=this.hasListeners(),_=!G&&Rm(r,o),L=G&&Mm(r,a,o,l);(_||L)&&(b={...b,...dy(x.data,r.options)}),o._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:E,errorUpdatedAt:w,status:k}=b;v=b.data;let j=!1;if(o.placeholderData!==void 0&&v===void 0&&k==="pending"){let G;u!=null&&u.isPlaceholderData&&o.placeholderData===(h==null?void 0:h.placeholderData)?(G=u.data,j=!0):G=typeof o.placeholderData=="function"?o.placeholderData((H=M(this,Es))==null?void 0:H.state.data,M(this,Es)):o.placeholderData,G!==void 0&&(k="success",v=ad(u==null?void 0:u.data,G,o),C=!0)}if(o.select&&v!==void 0&&!j)if(u&&v===(f==null?void 0:f.data)&&o.select===M(this,za))v=M(this,ks);else try{ue(this,za,o.select),v=o.select(v),v=ad(u==null?void 0:u.data,v,o),ue(this,ks,v),ue(this,Kr,null)}catch(G){ue(this,Kr,G)}M(this,Kr)&&(E=M(this,Kr),v=M(this,ks),w=Date.now(),k="error");const R=b.fetchStatus==="fetching",N=k==="pending",T=k==="error",U=N&&R,V=v!==void 0,X={status:k,fetchStatus:b.fetchStatus,isPending:N,isSuccess:k==="success",isError:T,isInitialLoading:U,isLoading:U,data:v,dataUpdatedAt:b.dataUpdatedAt,error:E,errorUpdatedAt:w,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:b.dataUpdateCount>0||b.errorUpdateCount>0,isFetchedAfterMount:b.dataUpdateCount>g.dataUpdateCount||b.errorUpdateCount>g.errorUpdateCount,isFetching:R,isRefetching:R&&!N,isLoadingError:T&&!V,isPaused:b.fetchStatus==="paused",isPlaceholderData:C,isRefetchError:T&&V,isStale:Yd(r,o),refetch:this.refetch,promise:M(this,sr),isEnabled:rn(o.enabled,r)!==!1};if(this.options.experimental_prefetchInRender){const G=X.data!==void 0,_=X.status==="error"&&!G,L=te=>{_?te.reject(X.error):G&&te.resolve(X.data)},B=()=>{const te=ue(this,sr,X.promise=id());L(te)},Q=M(this,sr);switch(Q.status){case"pending":r.queryHash===a.queryHash&&L(Q);break;case"fulfilled":(_||X.data!==Q.value)&&B();break;case"rejected":(!_||X.error!==Q.reason)&&B();break}}return X}updateResult(){const r=M(this,Rt),o=this.createResult(M(this,Oe),this.options);if(ue(this,No,M(this,Oe).state),ue(this,Cs,this.options),M(this,No).data!==void 0&&ue(this,Es,M(this,Oe)),Ml(o,r))return;ue(this,Rt,o);const a=()=>{if(!r)return!0;const{notifyOnChangeProps:l}=this.options,u=typeof l=="function"?l():l;if(u==="all"||!u&&!M(this,Ns).size)return!0;const f=new Set(u??M(this,Ns));return this.options.throwOnError&&f.add("error"),Object.keys(M(this,Rt)).some(h=>{const m=h;return M(this,Rt)[m]!==r[m]&&f.has(m)})};Re(this,De,fy).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Re(this,De,fd).call(this)}},Ft=new WeakMap,Oe=new WeakMap,Da=new WeakMap,Rt=new WeakMap,No=new WeakMap,Cs=new WeakMap,sr=new WeakMap,Kr=new WeakMap,za=new WeakMap,ks=new WeakMap,Es=new WeakMap,Po=new WeakMap,jo=new WeakMap,Qr=new WeakMap,Ns=new WeakMap,De=new WeakSet,ja=function(r){Re(this,De,md).call(this);let o=M(this,Oe).fetch(this.options,r);return r!=null&&r.throwOnError||(o=o.catch(Mt)),o},ud=function(){Re(this,De,hd).call(this);const r=Jr(this.options.staleTime,M(this,Oe));if(Mo||M(this,Rt).isStale||!od(r))return;const a=sy(M(this,Rt).dataUpdatedAt,r)+1;ue(this,Po,wo.setTimeout(()=>{M(this,Rt).isStale||this.updateResult()},a))},cd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(M(this,Oe)):this.options.refetchInterval)??!1},dd=function(r){Re(this,De,pd).call(this),ue(this,Qr,r),!(Mo||rn(this.options.enabled,M(this,Oe))===!1||!od(M(this,Qr))||M(this,Qr)===0)&&ue(this,jo,wo.setInterval(()=>{(this.options.refetchIntervalInBackground||Gd.isFocused())&&Re(this,De,ja).call(this)},M(this,Qr)))},fd=function(){Re(this,De,ud).call(this),Re(this,De,dd).call(this,Re(this,De,cd).call(this))},hd=function(){M(this,Po)&&(wo.clearTimeout(M(this,Po)),ue(this,Po,void 0))},pd=function(){M(this,jo)&&(wo.clearInterval(M(this,jo)),ue(this,jo,void 0))},md=function(){const r=M(this,Ft).getQueryCache().build(M(this,Ft),this.options);if(r===M(this,Oe))return;const o=M(this,Oe);ue(this,Oe,r),ue(this,Da,r.state),this.hasListeners()&&(o==null||o.removeObserver(this),r.addObserver(this))},fy=function(r){lt.batch(()=>{r.listeners&&this.listeners.forEach(o=>{o(M(this,Rt))}),M(this,Ft).getQueryCache().notify({query:M(this,Oe),type:"observerResultsUpdated"})})},Rg);function bb(t,r){return rn(r.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&r.retryOnMount===!1)}function Rm(t,r){return bb(t,r)||t.state.data!==void 0&&gd(t,r,r.refetchOnMount)}function gd(t,r,o){if(rn(r.enabled,t)!==!1&&Jr(r.staleTime,t)!=="static"){const a=typeof o=="function"?o(t):o;return a==="always"||a!==!1&&Yd(t,r)}return!1}function Mm(t,r,o,a){return(t!==r||rn(a.enabled,t)===!1)&&(!o.suspense||t.state.status!=="error")&&Yd(t,o)}function Yd(t,r){return rn(r.enabled,t)!==!1&&t.isStaleByTime(Jr(r.staleTime,t))}function Sb(t,r){return!Ml(t.getCurrentResult(),r)}function Tm(t){return{onFetch:(r,o)=>{var x,b,C,v,E;const a=r.options,l=(C=(b=(x=r.fetchOptions)==null?void 0:x.meta)==null?void 0:b.fetchMore)==null?void 0:C.direction,u=((v=r.state.data)==null?void 0:v.pages)||[],f=((E=r.state.data)==null?void 0:E.pageParams)||[];let h={pages:[],pageParams:[]},m=0;const g=async()=>{let w=!1;const k=N=>{hb(N,()=>r.signal,()=>w=!0)},j=iy(r.options,r.fetchOptions),R=async(N,T,U)=>{if(w)return Promise.reject();if(T==null&&N.pages.length)return Promise.resolve(N);const W=(()=>{const _={client:r.client,queryKey:r.queryKey,pageParam:T,direction:U?"backward":"forward",meta:r.options.meta};return k(_),_})(),X=await j(W),{maxPages:H}=r.options,G=U?fb:db;return{pages:G(N.pages,X,H),pageParams:G(N.pageParams,T,H)}};if(l&&u.length){const N=l==="backward",T=N?Cb:Im,U={pages:u,pageParams:f},V=T(a,U);h=await R(U,V,N)}else{const N=t??u.length;do{const T=m===0?f[0]??a.initialPageParam:Im(a,h);if(m>0&&T==null)break;h=await R(h,T),m++}while(m<N)}return h};r.options.persister?r.fetchFn=()=>{var w,k;return(k=(w=r.options).persister)==null?void 0:k.call(w,g,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},o)}:r.fetchFn=g}}}function Im(t,{pages:r,pageParams:o}){const a=r.length-1;return r.length>0?t.getNextPageParam(r[a],r,o[a],o):void 0}function Cb(t,{pages:r,pageParams:o}){var a;return r.length>0?(a=t.getPreviousPageParam)==null?void 0:a.call(t,r[0],r,o[0],o):void 0}var Fa,zn,St,Ro,Fn,Ur,Mg,kb=(Mg=class extends cy{constructor(r){super();ye(this,Fn);ye(this,Fa);ye(this,zn);ye(this,St);ye(this,Ro);ue(this,Fa,r.client),this.mutationId=r.mutationId,ue(this,St,r.mutationCache),ue(this,zn,[]),this.state=r.state||hy(),this.setOptions(r.options),this.scheduleGc()}setOptions(r){this.options=r,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(r){M(this,zn).includes(r)||(M(this,zn).push(r),this.clearGcTimeout(),M(this,St).notify({type:"observerAdded",mutation:this,observer:r}))}removeObserver(r){ue(this,zn,M(this,zn).filter(o=>o!==r)),this.scheduleGc(),M(this,St).notify({type:"observerRemoved",mutation:this,observer:r})}optionalRemove(){M(this,zn).length||(this.state.status==="pending"?this.scheduleGc():M(this,St).remove(this))}continue(){var r;return((r=M(this,Ro))==null?void 0:r.continue())??this.execute(this.state.variables)}async execute(r){var f,h,m,g,x,b,C,v,E,w,k,j,R,N,T,U,V,W;const o=()=>{Re(this,Fn,Ur).call(this,{type:"continue"})},a={client:M(this,Fa),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,Ro,uy({fn:()=>this.options.mutationFn?this.options.mutationFn(r,a):Promise.reject(new Error("No mutationFn found")),onFail:(X,H)=>{Re(this,Fn,Ur).call(this,{type:"failed",failureCount:X,error:H})},onPause:()=>{Re(this,Fn,Ur).call(this,{type:"pause"})},onContinue:o,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,St).canRun(this)}));const l=this.state.status==="pending",u=!M(this,Ro).canStart();try{if(l)o();else{Re(this,Fn,Ur).call(this,{type:"pending",variables:r,isPaused:u}),M(this,St).config.onMutate&&await M(this,St).config.onMutate(r,this,a);const H=await((h=(f=this.options).onMutate)==null?void 0:h.call(f,r,a));H!==this.state.context&&Re(this,Fn,Ur).call(this,{type:"pending",context:H,variables:r,isPaused:u})}const X=await M(this,Ro).start();return await((g=(m=M(this,St).config).onSuccess)==null?void 0:g.call(m,X,r,this.state.context,this,a)),await((b=(x=this.options).onSuccess)==null?void 0:b.call(x,X,r,this.state.context,a)),await((v=(C=M(this,St).config).onSettled)==null?void 0:v.call(C,X,null,this.state.variables,this.state.context,this,a)),await((w=(E=this.options).onSettled)==null?void 0:w.call(E,X,null,r,this.state.context,a)),Re(this,Fn,Ur).call(this,{type:"success",data:X}),X}catch(X){try{await((j=(k=M(this,St).config).onError)==null?void 0:j.call(k,X,r,this.state.context,this,a))}catch(H){Promise.reject(H)}try{await((N=(R=this.options).onError)==null?void 0:N.call(R,X,r,this.state.context,a))}catch(H){Promise.reject(H)}try{await((U=(T=M(this,St).config).onSettled)==null?void 0:U.call(T,void 0,X,this.state.variables,this.state.context,this,a))}catch(H){Promise.reject(H)}try{await((W=(V=this.options).onSettled)==null?void 0:W.call(V,void 0,X,r,this.state.context,a))}catch(H){Promise.reject(H)}throw Re(this,Fn,Ur).call(this,{type:"error",error:X}),X}finally{M(this,St).runNext(this)}}},Fa=new WeakMap,zn=new WeakMap,St=new WeakMap,Ro=new WeakMap,Fn=new WeakSet,Ur=function(r){const o=a=>{switch(r.type){case"failed":return{...a,failureCount:r.failureCount,failureReason:r.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:r.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:r.isPaused,status:"pending",variables:r.variables,submittedAt:Date.now()};case"success":return{...a,data:r.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:r.error,failureCount:a.failureCount+1,failureReason:r.error,isPaused:!1,status:"error"}}};this.state=o(this.state),lt.batch(()=>{M(this,zn).forEach(a=>{a.onMutationUpdate(r)}),M(this,St).notify({mutation:this,type:"updated",action:r})})},Mg);function hy(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ar,wn,Ba,Tg,Eb=(Tg=class extends Ls{constructor(r={}){super();ye(this,ar);ye(this,wn);ye(this,Ba);this.config=r,ue(this,ar,new Set),ue(this,wn,new Map),ue(this,Ba,0)}build(r,o,a){const l=new kb({client:r,mutationCache:this,mutationId:++sl(this,Ba)._,options:r.defaultMutationOptions(o),state:a});return this.add(l),l}add(r){M(this,ar).add(r);const o=ll(r);if(typeof o=="string"){const a=M(this,wn).get(o);a?a.push(r):M(this,wn).set(o,[r])}this.notify({type:"added",mutation:r})}remove(r){if(M(this,ar).delete(r)){const o=ll(r);if(typeof o=="string"){const a=M(this,wn).get(o);if(a)if(a.length>1){const l=a.indexOf(r);l!==-1&&a.splice(l,1)}else a[0]===r&&M(this,wn).delete(o)}}this.notify({type:"removed",mutation:r})}canRun(r){const o=ll(r);if(typeof o=="string"){const a=M(this,wn).get(o),l=a==null?void 0:a.find(u=>u.state.status==="pending");return!l||l===r}else return!0}runNext(r){var a;const o=ll(r);if(typeof o=="string"){const l=(a=M(this,wn).get(o))==null?void 0:a.find(u=>u!==r&&u.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{M(this,ar).forEach(r=>{this.notify({type:"removed",mutation:r})}),M(this,ar).clear(),M(this,wn).clear()})}getAll(){return Array.from(M(this,ar))}find(r){const o={exact:!0,...r};return this.getAll().find(a=>km(o,a))}findAll(r={}){return this.getAll().filter(o=>km(r,o))}notify(r){lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}resumePausedMutations(){const r=this.getAll().filter(o=>o.state.isPaused);return lt.batch(()=>Promise.all(r.map(o=>o.continue().catch(Mt))))}},ar=new WeakMap,wn=new WeakMap,Ba=new WeakMap,Tg);function ll(t){var r;return(r=t.options.scope)==null?void 0:r.id}var ir,qr,Bt,lr,dr,wl,yd,Ig,Nb=(Ig=class extends Ls{constructor(o,a){super();ye(this,dr);ye(this,ir);ye(this,qr);ye(this,Bt);ye(this,lr);ue(this,ir,o),this.setOptions(a),this.bindMethods(),Re(this,dr,wl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(o){var l;const a=this.options;this.options=M(this,ir).defaultMutationOptions(o),Ml(this.options,a)||M(this,ir).getMutationCache().notify({type:"observerOptionsUpdated",mutation:M(this,Bt),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&To(a.mutationKey)!==To(this.options.mutationKey)?this.reset():((l=M(this,Bt))==null?void 0:l.state.status)==="pending"&&M(this,Bt).setOptions(this.options)}onUnsubscribe(){var o;this.hasListeners()||(o=M(this,Bt))==null||o.removeObserver(this)}onMutationUpdate(o){Re(this,dr,wl).call(this),Re(this,dr,yd).call(this,o)}getCurrentResult(){return M(this,qr)}reset(){var o;(o=M(this,Bt))==null||o.removeObserver(this),ue(this,Bt,void 0),Re(this,dr,wl).call(this),Re(this,dr,yd).call(this)}mutate(o,a){var l;return ue(this,lr,a),(l=M(this,Bt))==null||l.removeObserver(this),ue(this,Bt,M(this,ir).getMutationCache().build(M(this,ir),this.options)),M(this,Bt).addObserver(this),M(this,Bt).execute(o)}},ir=new WeakMap,qr=new WeakMap,Bt=new WeakMap,lr=new WeakMap,dr=new WeakSet,wl=function(){var a;const o=((a=M(this,Bt))==null?void 0:a.state)??hy();ue(this,qr,{...o,isPending:o.status==="pending",isSuccess:o.status==="success",isError:o.status==="error",isIdle:o.status==="idle",mutate:this.mutate,reset:this.reset})},yd=function(o){lt.batch(()=>{var a,l,u,f,h,m,g,x;if(M(this,lr)&&this.hasListeners()){const b=M(this,qr).variables,C=M(this,qr).context,v={client:M(this,ir),meta:this.options.meta,mutationKey:this.options.mutationKey};if((o==null?void 0:o.type)==="success"){try{(l=(a=M(this,lr)).onSuccess)==null||l.call(a,o.data,b,C,v)}catch(E){Promise.reject(E)}try{(f=(u=M(this,lr)).onSettled)==null||f.call(u,o.data,null,b,C,v)}catch(E){Promise.reject(E)}}else if((o==null?void 0:o.type)==="error"){try{(m=(h=M(this,lr)).onError)==null||m.call(h,o.error,b,C,v)}catch(E){Promise.reject(E)}try{(x=(g=M(this,lr)).onSettled)==null||x.call(g,void 0,o.error,b,C,v)}catch(E){Promise.reject(E)}}}this.listeners.forEach(b=>{b(M(this,qr))})})},Ig),Bn,Og,Pb=(Og=class extends Ls{constructor(r={}){super();ye(this,Bn);this.config=r,ue(this,Bn,new Map)}build(r,o,a){const l=o.queryKey,u=o.queryHash??Kd(l,o);let f=this.get(u);return f||(f=new xb({client:r,queryKey:l,queryHash:u,options:r.defaultQueryOptions(o),state:a,defaultOptions:r.getQueryDefaults(l)}),this.add(f)),f}add(r){M(this,Bn).has(r.queryHash)||(M(this,Bn).set(r.queryHash,r),this.notify({type:"added",query:r}))}remove(r){const o=M(this,Bn).get(r.queryHash);o&&(r.destroy(),o===r&&M(this,Bn).delete(r.queryHash),this.notify({type:"removed",query:r}))}clear(){lt.batch(()=>{this.getAll().forEach(r=>{this.remove(r)})})}get(r){return M(this,Bn).get(r)}getAll(){return[...M(this,Bn).values()]}find(r){const o={exact:!0,...r};return this.getAll().find(a=>Cm(o,a))}findAll(r={}){const o=this.getAll();return Object.keys(r).length>0?o.filter(a=>Cm(r,a)):o}notify(r){lt.batch(()=>{this.listeners.forEach(o=>{o(r)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(r=>{r.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(r=>{r.onOnline()})})}},Bn=new WeakMap,Og),Je,Gr,Yr,Ps,js,Xr,Rs,Ms,Ag,jb=(Ag=class{constructor(t={}){ye(this,Je);ye(this,Gr);ye(this,Yr);ye(this,Ps);ye(this,js);ye(this,Xr);ye(this,Rs);ye(this,Ms);ue(this,Je,t.queryCache||new Pb),ue(this,Gr,t.mutationCache||new Eb),ue(this,Yr,t.defaultOptions||{}),ue(this,Ps,new Map),ue(this,js,new Map),ue(this,Xr,0)}mount(){sl(this,Xr)._++,M(this,Xr)===1&&(ue(this,Rs,Gd.subscribe(async t=>{t&&(await this.resumePausedMutations(),M(this,Je).onFocus())})),ue(this,Ms,Tl.subscribe(async t=>{t&&(await this.resumePausedMutations(),M(this,Je).onOnline())})))}unmount(){var t,r;sl(this,Xr)._--,M(this,Xr)===0&&((t=M(this,Rs))==null||t.call(this),ue(this,Rs,void 0),(r=M(this,Ms))==null||r.call(this),ue(this,Ms,void 0))}isFetching(t){return M(this,Je).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return M(this,Gr).findAll({...t,status:"pending"}).length}getQueryData(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=M(this,Je).get(r.queryHash))==null?void 0:o.state.data}ensureQueryData(t){const r=this.defaultQueryOptions(t),o=M(this,Je).build(this,r),a=o.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&o.isStaleByTime(Jr(r.staleTime,o))&&this.prefetchQuery(r),Promise.resolve(a))}getQueriesData(t){return M(this,Je).findAll(t).map(({queryKey:r,state:o})=>{const a=o.data;return[r,a]})}setQueryData(t,r,o){const a=this.defaultQueryOptions({queryKey:t}),l=M(this,Je).get(a.queryHash),u=l==null?void 0:l.state.data,f=lb(r,u);if(f!==void 0)return M(this,Je).build(this,a).setData(f,{...o,manual:!0})}setQueriesData(t,r,o){return lt.batch(()=>M(this,Je).findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,r,o)]))}getQueryState(t){var o;const r=this.defaultQueryOptions({queryKey:t});return(o=M(this,Je).get(r.queryHash))==null?void 0:o.state}removeQueries(t){const r=M(this,Je);lt.batch(()=>{r.findAll(t).forEach(o=>{r.remove(o)})})}resetQueries(t,r){const o=M(this,Je);return lt.batch(()=>(o.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},r)))}cancelQueries(t,r={}){const o={revert:!0,...r},a=lt.batch(()=>M(this,Je).findAll(t).map(l=>l.cancel(o)));return Promise.all(a).then(Mt).catch(Mt)}invalidateQueries(t,r={}){return lt.batch(()=>(M(this,Je).findAll(t).forEach(o=>{o.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},r)))}refetchQueries(t,r={}){const o={...r,cancelRefetch:r.cancelRefetch??!0},a=lt.batch(()=>M(this,Je).findAll(t).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,o);return o.throwOnError||(u=u.catch(Mt)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(a).then(Mt)}fetchQuery(t){const r=this.defaultQueryOptions(t);r.retry===void 0&&(r.retry=!1);const o=M(this,Je).build(this,r);return o.isStaleByTime(Jr(r.staleTime,o))?o.fetch(r):Promise.resolve(o.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Mt).catch(Mt)}fetchInfiniteQuery(t){return t.behavior=Tm(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Mt).catch(Mt)}ensureInfiniteQueryData(t){return t.behavior=Tm(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Tl.isOnline()?M(this,Gr).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Je)}getMutationCache(){return M(this,Gr)}getDefaultOptions(){return M(this,Yr)}setDefaultOptions(t){ue(this,Yr,t)}setQueryDefaults(t,r){M(this,Ps).set(To(t),{queryKey:t,defaultOptions:r})}getQueryDefaults(t){const r=[...M(this,Ps).values()],o={};return r.forEach(a=>{Ia(t,a.queryKey)&&Object.assign(o,a.defaultOptions)}),o}setMutationDefaults(t,r){M(this,js).set(To(t),{mutationKey:t,defaultOptions:r})}getMutationDefaults(t){const r=[...M(this,js).values()],o={};return r.forEach(a=>{Ia(t,a.mutationKey)&&Object.assign(o,a.defaultOptions)}),o}defaultQueryOptions(t){if(t._defaulted)return t;const r={...M(this,Yr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return r.queryHash||(r.queryHash=Kd(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Qd&&(r.enabled=!1),r}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...M(this,Yr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){M(this,Je).clear(),M(this,Gr).clear()}},Je=new WeakMap,Gr=new WeakMap,Yr=new WeakMap,Ps=new WeakMap,js=new WeakMap,Xr=new WeakMap,Rs=new WeakMap,Ms=new WeakMap,Ag),py=y.createContext(void 0),gr=t=>{const r=y.useContext(py);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},Rb=({client:t,children:r})=>(y.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(py.Provider,{value:t,children:r})),my=y.createContext(!1),Mb=()=>y.useContext(my);my.Provider;function Tb(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Ib=y.createContext(Tb()),Ob=()=>y.useContext(Ib),Ab=(t,r,o)=>{const a=o!=null&&o.state.error&&typeof t.throwOnError=="function"?qd(t.throwOnError,[o.state.error,o]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||a)&&(r.isReset()||(t.retryOnMount=!1))},Lb=t=>{y.useEffect(()=>{t.clearReset()},[t])},_b=({result:t,errorResetBoundary:r,throwOnError:o,query:a,suspense:l})=>t.isError&&!r.isReset()&&!t.isFetching&&a&&(l&&t.data===void 0||qd(o,[t.error,a])),Db=t=>{if(t.suspense){const o=l=>l==="static"?l:Math.max(l??1e3,1e3),a=t.staleTime;t.staleTime=typeof a=="function"?(...l)=>o(a(...l)):o(a),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},zb=(t,r)=>t.isLoading&&t.isFetching&&!r,Fb=(t,r)=>(t==null?void 0:t.suspense)&&r.isPending,Om=(t,r,o)=>r.fetchOptimistic(t).catch(()=>{o.clearReset()});function Bb(t,r,o){var C,v,E,w;const a=Mb(),l=Ob(),u=gr(),f=u.defaultQueryOptions(t);(v=(C=u.getDefaultOptions().queries)==null?void 0:C._experimental_beforeQuery)==null||v.call(C,f);const h=u.getQueryCache().get(f.queryHash);f._optimisticResults=a?"isRestoring":"optimistic",Db(f),Ab(f,l,h),Lb(l);const m=!u.getQueryCache().get(f.queryHash),[g]=y.useState(()=>new r(u,f)),x=g.getOptimisticResult(f),b=!a&&t.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(k=>{const j=b?g.subscribe(lt.batchCalls(k)):Mt;return g.updateResult(),j},[g,b]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),y.useEffect(()=>{g.setOptions(f)},[f,g]),Fb(f,x))throw Om(f,g,l);if(_b({result:x,errorResetBoundary:l,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw x.error;if((w=(E=u.getDefaultOptions().queries)==null?void 0:E._experimental_afterQuery)==null||w.call(E,f,x),f.experimental_prefetchInRender&&!Mo&&zb(x,a)){const k=m?Om(f,g,l):h==null?void 0:h.promise;k==null||k.catch(Mt).finally(()=>{g.updateResult()})}return f.notifyOnChangeProps?x:g.trackResult(x)}function to(t,r){return Bb(t,wb)}function no(t,r){const o=gr(),[a]=y.useState(()=>new Nb(o,t));y.useEffect(()=>{a.setOptions(t)},[a,t]);const l=y.useSyncExternalStore(y.useCallback(f=>a.subscribe(lt.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),u=y.useCallback((f,h)=>{a.mutate(f,h).catch(Mt)},[a]);if(l.error&&qd(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function gy(t){var r,o,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(r=0;r<l;r++)t[r]&&(o=gy(t[r]))&&(a&&(a+=" "),a+=o)}else for(o in t)t[o]&&(a&&(a+=" "),a+=o);return a}function yy(){for(var t,r,o=0,a="",l=arguments.length;o<l;o++)(t=arguments[o])&&(r=gy(t))&&(a&&(a+=" "),a+=r);return a}const Xd="-",Ub=t=>{const r=Wb(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:f=>{const h=f.split(Xd);return h[0]===""&&h.length!==1&&h.shift(),vy(h,r)||$b(f)},getConflictingClassGroupIds:(f,h)=>{const m=o[f]||[];return h&&a[f]?[...m,...a[f]]:m}}},vy=(t,r)=>{var f;if(t.length===0)return r.classGroupId;const o=t[0],a=r.nextPart.get(o),l=a?vy(t.slice(1),a):void 0;if(l)return l;if(r.validators.length===0)return;const u=t.join(Xd);return(f=r.validators.find(({validator:h})=>h(u)))==null?void 0:f.classGroupId},Am=/^\[(.+)\]$/,$b=t=>{if(Am.test(t)){const r=Am.exec(t)[1],o=r==null?void 0:r.substring(0,r.indexOf(":"));if(o)return"arbitrary.."+o}},Wb=t=>{const{theme:r,prefix:o}=t,a={nextPart:new Map,validators:[]};return Vb(Object.entries(t.classGroups),o).forEach(([u,f])=>{vd(f,a,u,r)}),a},vd=(t,r,o,a)=>{t.forEach(l=>{if(typeof l=="string"){const u=l===""?r:Lm(r,l);u.classGroupId=o;return}if(typeof l=="function"){if(Hb(l)){vd(l(a),r,o,a);return}r.validators.push({validator:l,classGroupId:o});return}Object.entries(l).forEach(([u,f])=>{vd(f,Lm(r,u),o,a)})})},Lm=(t,r)=>{let o=t;return r.split(Xd).forEach(a=>{o.nextPart.has(a)||o.nextPart.set(a,{nextPart:new Map,validators:[]}),o=o.nextPart.get(a)}),o},Hb=t=>t.isThemeGetter,Vb=(t,r)=>r?t.map(([o,a])=>{const l=a.map(u=>typeof u=="string"?r+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,h])=>[r+f,h])):u);return[o,l]}):t,Kb=t=>{if(t<1)return{get:()=>{},set:()=>{}};let r=0,o=new Map,a=new Map;const l=(u,f)=>{o.set(u,f),r++,r>t&&(r=0,a=o,o=new Map)};return{get(u){let f=o.get(u);if(f!==void 0)return f;if((f=a.get(u))!==void 0)return l(u,f),f},set(u,f){o.has(u)?o.set(u,f):l(u,f)}}},xy="!",Qb=t=>{const{separator:r,experimentalParseClassName:o}=t,a=r.length===1,l=r[0],u=r.length,f=h=>{const m=[];let g=0,x=0,b;for(let k=0;k<h.length;k++){let j=h[k];if(g===0){if(j===l&&(a||h.slice(k,k+u)===r)){m.push(h.slice(x,k)),x=k+u;continue}if(j==="/"){b=k;continue}}j==="["?g++:j==="]"&&g--}const C=m.length===0?h:h.substring(x),v=C.startsWith(xy),E=v?C.substring(1):C,w=b&&b>x?b-x:void 0;return{modifiers:m,hasImportantModifier:v,baseClassName:E,maybePostfixModifierPosition:w}};return o?h=>o({className:h,parseClassName:f}):f},qb=t=>{if(t.length<=1)return t;const r=[];let o=[];return t.forEach(a=>{a[0]==="["?(r.push(...o.sort(),a),o=[]):o.push(a)}),r.push(...o.sort()),r},Gb=t=>({cache:Kb(t.cacheSize),parseClassName:Qb(t),...Ub(t)}),Yb=/\s+/,Xb=(t,r)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:l}=r,u=[],f=t.trim().split(Yb);let h="";for(let m=f.length-1;m>=0;m-=1){const g=f[m],{modifiers:x,hasImportantModifier:b,baseClassName:C,maybePostfixModifierPosition:v}=o(g);let E=!!v,w=a(E?C.substring(0,v):C);if(!w){if(!E){h=g+(h.length>0?" "+h:h);continue}if(w=a(C),!w){h=g+(h.length>0?" "+h:h);continue}E=!1}const k=qb(x).join(":"),j=b?k+xy:k,R=j+w;if(u.includes(R))continue;u.push(R);const N=l(w,E);for(let T=0;T<N.length;++T){const U=N[T];u.push(j+U)}h=g+(h.length>0?" "+h:h)}return h};function Jb(){let t=0,r,o,a="";for(;t<arguments.length;)(r=arguments[t++])&&(o=wy(r))&&(a&&(a+=" "),a+=o);return a}const wy=t=>{if(typeof t=="string")return t;let r,o="";for(let a=0;a<t.length;a++)t[a]&&(r=wy(t[a]))&&(o&&(o+=" "),o+=r);return o};function Zb(t,...r){let o,a,l,u=f;function f(m){const g=r.reduce((x,b)=>b(x),t());return o=Gb(g),a=o.cache.get,l=o.cache.set,u=h,h(m)}function h(m){const g=a(m);if(g)return g;const x=Xb(m,o);return l(m,x),x}return function(){return u(Jb.apply(null,arguments))}}const He=t=>{const r=o=>o[t]||[];return r.isThemeGetter=!0,r},by=/^\[(?:([a-z-]+):)?(.+)\]$/i,eS=/^\d+\/\d+$/,tS=new Set(["px","full","screen"]),nS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rS=/\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$/,oS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nr=t=>hs(t)||tS.has(t)||eS.test(t),Fr=t=>_s(t,"length",pS),hs=t=>!!t&&!Number.isNaN(Number(t)),Vc=t=>_s(t,"number",hs),Na=t=>!!t&&Number.isInteger(Number(t)),iS=t=>t.endsWith("%")&&hs(t.slice(0,-1)),je=t=>by.test(t),Br=t=>nS.test(t),lS=new Set(["length","size","percentage"]),uS=t=>_s(t,lS,Sy),cS=t=>_s(t,"position",Sy),dS=new Set(["image","url"]),fS=t=>_s(t,dS,gS),hS=t=>_s(t,"",mS),Pa=()=>!0,_s=(t,r,o)=>{const a=by.exec(t);return a?a[1]?typeof r=="string"?a[1]===r:r.has(a[1]):o(a[2]):!1},pS=t=>rS.test(t)&&!oS.test(t),Sy=()=>!1,mS=t=>sS.test(t),gS=t=>aS.test(t),yS=()=>{const t=He("colors"),r=He("spacing"),o=He("blur"),a=He("brightness"),l=He("borderColor"),u=He("borderRadius"),f=He("borderSpacing"),h=He("borderWidth"),m=He("contrast"),g=He("grayscale"),x=He("hueRotate"),b=He("invert"),C=He("gap"),v=He("gradientColorStops"),E=He("gradientColorStopPositions"),w=He("inset"),k=He("margin"),j=He("opacity"),R=He("padding"),N=He("saturate"),T=He("scale"),U=He("sepia"),V=He("skew"),W=He("space"),X=He("translate"),H=()=>["auto","contain","none"],G=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",je,r],L=()=>[je,r],B=()=>["",nr,Fr],Q=()=>["auto",hs,je],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ae=()=>["solid","dashed","dotted","double","none"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",je],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[hs,je];return{cacheSize:500,separator:":",theme:{colors:[Pa],spacing:[nr,Fr],blur:["none","",Br,je],brightness:O(),borderColor:[t],borderRadius:["none","","full",Br,je],borderSpacing:L(),borderWidth:B(),contrast:O(),grayscale:q(),hueRotate:O(),invert:q(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[iS,Fr],inset:_(),margin:_(),opacity:O(),padding:L(),saturate:O(),scale:O(),sepia:q(),skew:O(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",je]}],container:["container"],columns:[{columns:[Br]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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(),je]}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:H()}],"overscroll-x":[{"overscroll-x":H()}],"overscroll-y":[{"overscroll-y":H()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Na,je]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",je]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Na,je]}],"grid-cols":[{"grid-cols":[Pa]}],"col-start-end":[{col:["auto",{span:["full",Na,je]},je]}],"col-start":[{"col-start":Q()}],"col-end":[{"col-end":Q()}],"grid-rows":[{"grid-rows":[Pa]}],"row-start-end":[{row:["auto",{span:[Na,je]},je]}],"row-start":[{"row-start":Q()}],"row-end":[{"row-end":Q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",je]}],gap:[{gap:[C]}],"gap-x":[{"gap-x":[C]}],"gap-y":[{"gap-y":[C]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[R]}],px:[{px:[R]}],py:[{py:[R]}],ps:[{ps:[R]}],pe:[{pe:[R]}],pt:[{pt:[R]}],pr:[{pr:[R]}],pb:[{pb:[R]}],pl:[{pl:[R]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[W]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[W]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",je,r]}],"min-w":[{"min-w":[je,r,"min","max","fit"]}],"max-w":[{"max-w":[je,r,"none","full","min","max","fit","prose",{screen:[Br]},Br]}],h:[{h:[je,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[je,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[je,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[je,r,"auto","min","max","fit"]}],"font-size":[{text:["base",Br,Fr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Vc]}],"font-family":[{font:[Pa]}],"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",je]}],"line-clamp":[{"line-clamp":["none",hs,Vc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nr,je]}],"list-image":[{"list-image":["none",je]}],"list-style-type":[{list:["none","disc","decimal",je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nr,Fr]}],"underline-offset":[{"underline-offset":["auto",nr,je]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je]}],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",je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),cS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fS]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[j]}],"border-style":[{border:[...ae(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[j]}],"divide-style":[{divide:ae()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...ae()]}],"outline-offset":[{"outline-offset":[nr,je]}],"outline-w":[{outline:[nr,Fr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[nr,Fr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Br,hS]}],"shadow-color":[{shadow:[Pa]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...ie(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ie()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[a]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",Br,je]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[b]}],saturate:[{saturate:[N]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[a]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[j]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",je]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",je]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[Na,je]}],"translate-x":[{"translate-x":[X]}],"translate-y":[{"translate-y":[X]}],"skew-x":[{"skew-x":[V]}],"skew-y":[{"skew-y":[V]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",je]}],accent:[{accent:["auto",t]}],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",je]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",je]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[nr,Fr,Vc]}],stroke:[{stroke:[t,"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"]}}},vS=Zb(yS);function ve(...t){return vS(yy(t))}const _m={model:{zh:"模型",en:"Model"},providers:{zh:"提供商",en:"Providers"},channels:{zh:"渠道",en:"Channels"},enabled:{zh:"启用",en:"Enabled"},disabled:{zh:"禁用",en:"Disabled"},save:{zh:"保存",en:"Save"},cancel:{zh:"取消",en:"Cancel"},delete:{zh:"删除",en:"Delete"},add:{zh:"添加",en:"Add"},edit:{zh:"编辑",en:"Edit"},loading:{zh:"加载中...",en:"Loading..."},success:{zh:"成功",en:"Success"},error:{zh:"错误",en:"Error"},modelName:{zh:"模型",en:"Model"},workspace:{zh:"工作空间",en:"Workspace"},maxTokens:{zh:"最大 Token 数",en:"Max Tokens"},maxToolIterations:{zh:"最大工具迭代次数",en:"Max Tool Iterations"},apiKey:{zh:"API 密钥",en:"API Key"},apiBase:{zh:"API Base",en:"API Base"},extraHeaders:{zh:"额外请求头",en:"Extra Headers"},wireApi:{zh:"请求接口",en:"Wire API"},wireApiAuto:{zh:"自动(优先 Chat,必要时 Responses)",en:"Auto (Chat with fallback)"},wireApiChat:{zh:"Chat Completions",en:"Chat Completions"},wireApiResponses:{zh:"Responses",en:"Responses"},apiKeySet:{zh:"已设置",en:"Set"},apiKeyNotSet:{zh:"未设置",en:"Not Set"},showKey:{zh:"显示密钥",en:"Show Key"},hideKey:{zh:"隐藏密钥",en:"Hide Key"},allowFrom:{zh:"允许来源",en:"Allow From"},token:{zh:"Token",en:"Token"},botToken:{zh:"Bot Token",en:"Bot Token"},appToken:{zh:"App Token",en:"App Token"},appId:{zh:"App ID",en:"App ID"},corpId:{zh:"企业 ID",en:"Corp ID"},agentId:{zh:"应用 Agent ID",en:"Agent ID"},appSecret:{zh:"App Secret",en:"App Secret"},markdownSupport:{zh:"Markdown 支持",en:"Markdown Support"},clientId:{zh:"Client ID",en:"Client ID"},clientSecret:{zh:"Client Secret",en:"Client Secret"},encryptKey:{zh:"加密密钥",en:"Encrypt Key"},verificationToken:{zh:"验证令牌",en:"Verification Token"},bridgeUrl:{zh:"桥接 URL",en:"Bridge URL"},gatewayUrl:{zh:"网关 URL",en:"Gateway URL"},proxy:{zh:"代理",en:"Proxy"},intents:{zh:"Intents",en:"Intents"},mode:{zh:"模式",en:"Mode"},webhookPath:{zh:"Webhook 路径",en:"Webhook Path"},callbackPort:{zh:"回调端口",en:"Callback Port"},callbackPath:{zh:"回调路径",en:"Callback Path"},groupPolicy:{zh:"群组策略",en:"Group Policy"},consentGranted:{zh:"同意条款",en:"Consent Granted"},imapHost:{zh:"IMAP 服务器",en:"IMAP Host"},imapPort:{zh:"IMAP 端口",en:"IMAP Port"},imapUsername:{zh:"IMAP 用户名",en:"IMAP Username"},imapPassword:{zh:"IMAP 密码",en:"IMAP Password"},imapMailbox:{zh:"IMAP 邮箱",en:"IMAP Mailbox"},imapUseSsl:{zh:"IMAP 使用 SSL",en:"IMAP Use SSL"},smtpHost:{zh:"SMTP 服务器",en:"SMTP Host"},smtpPort:{zh:"SMTP 端口",en:"SMTP Port"},smtpUsername:{zh:"SMTP 用户名",en:"SMTP Username"},smtpPassword:{zh:"SMTP 密码",en:"SMTP Password"},smtpUseTls:{zh:"SMTP 使用 TLS",en:"SMTP Use TLS"},smtpUseSsl:{zh:"SMTP 使用 SSL",en:"SMTP Use SSL"},fromAddress:{zh:"发件地址",en:"From Address"},autoReplyEnabled:{zh:"自动回复已启用",en:"Auto Reply Enabled"},pollIntervalSeconds:{zh:"轮询间隔(秒)",en:"Poll Interval (s)"},markSeen:{zh:"标记为已读",en:"Mark Seen"},maxBodyChars:{zh:"最大正文字符数",en:"Max Body Chars"},subjectPrefix:{zh:"主题前缀",en:"Subject Prefix"},baseUrl:{zh:"Base URL",en:"Base URL"},socketUrl:{zh:"Socket URL",en:"Socket URL"},socketPath:{zh:"Socket 路径",en:"Socket Path"},socketDisableMsgpack:{zh:"禁用 Msgpack",en:"Disable Msgpack"},socketReconnectDelayMs:{zh:"重连延迟(ms)",en:"Reconnect Delay (ms)"},socketMaxReconnectDelayMs:{zh:"最大重连延迟(ms)",en:"Max Reconnect Delay (ms)"},socketConnectTimeoutMs:{zh:"连接超时(ms)",en:"Connect Timeout (ms)"},refreshIntervalMs:{zh:"刷新间隔(ms)",en:"Refresh Interval (ms)"},watchTimeoutMs:{zh:"监视超时(ms)",en:"Watch Timeout (ms)"},watchLimit:{zh:"监视限制",en:"Watch Limit"},retryDelayMs:{zh:"重试延迟(ms)",en:"Retry Delay (ms)"},maxRetryAttempts:{zh:"最大重试次数",en:"Max Retry Attempts"},clawToken:{zh:"Claw Token",en:"Claw Token"},agentUserId:{zh:"代理用户ID",en:"Agent User ID"},sessions:{zh:"会话",en:"Sessions"},panels:{zh:"面板",en:"Panels"},mentionRequireInGroups:{zh:"群组中需要@",en:"Require Mention in Groups"},groups:{zh:"群组",en:"Groups"},replyDelayMode:{zh:"回复延迟模式",en:"Reply Delay Mode"},replyDelayMs:{zh:"回复延迟(ms)",en:"Reply Delay (ms)"},secret:{zh:"密钥",en:"Secret"},sessionsPageTitle:{zh:"会话管理",en:"Sessions"},sessionsPageDescription:{zh:"管理会话:筛选、按渠道分组、查看历史、改标签/偏好模型、清空和删除。",en:"Manage sessions: filter, group by channel, inspect history, edit metadata, clear, and delete."},sessionsFiltersTitle:{zh:"筛选",en:"Filters"},sessionsFiltersDescription:{zh:"按关键词、活跃窗口和分组方式筛选会话。",en:"Filter sessions by query, activity window, and grouping mode."},sessionsSearchPlaceholder:{zh:"搜索 key 或标签",en:"Search session key or label"},sessionsActiveMinutesPlaceholder:{zh:"活跃分钟(0=不限)",en:"Active minutes (0 = no limit)"},sessionsLimitPlaceholder:{zh:"展示上限",en:"Limit"},sessionsGroupModeLabel:{zh:"分组方式",en:"Grouping"},sessionsGroupModeAll:{zh:"不分组 / 全部",en:"All (No grouping)"},sessionsGroupModeByChannel:{zh:"按渠道分组",en:"Group by channel"},sessionsListTitle:{zh:"会话列表",en:"Session list"},sessionsTotalLabel:{zh:"总数",en:"Total"},sessionsCurrentLabel:{zh:"当前展示",en:"Showing"},sessionsLoading:{zh:"加载会话中...",en:"Loading sessions..."},sessionsEmpty:{zh:"暂无会话。",en:"No sessions yet."},sessionsKeyLabel:{zh:"键",en:"Key"},sessionsChannelLabel:{zh:"渠道",en:"Channel"},sessionsMessagesLabel:{zh:"消息数",en:"Messages"},sessionsUpdatedLabel:{zh:"更新时间",en:"Updated"},sessionsLastRoleLabel:{zh:"最后角色",en:"Last Role"},sessionsLabelPlaceholder:{zh:"会话标签(可选)",en:"Session label (optional)"},sessionsModelPlaceholder:{zh:"偏好模型(可选)",en:"Preferred model (optional)"},sessionsShowHistory:{zh:"查看历史",en:"View history"},sessionsHideHistory:{zh:"隐藏历史",en:"Hide history"},sessionsSaveMeta:{zh:"保存元信息",en:"Save metadata"},sessionsClearHistory:{zh:"清空历史",en:"Clear history"},sessionsDeleteConfirm:{zh:"确认删除会话",en:"Delete session"},sessionsHistoryTitle:{zh:"历史",en:"History"},sessionsHistoryDescription:{zh:"最近 200 条消息(展示窗口)。",en:"Latest 200 messages (display window)."},sessionsHistoryLoading:{zh:"加载历史中...",en:"Loading history..."},sessionsApplyingChanges:{zh:"正在应用会话变更...",en:"Applying session changes..."},sessionsUnknownChannel:{zh:"未知渠道",en:"Unknown channel"},saveVerifyConnect:{zh:"保存并验证 / 连接",en:"Save & Verify / Connect"},connected:{zh:"已连接",en:"Connected"},disconnected:{zh:"未连接",en:"Disconnected"},connecting:{zh:"连接中...",en:"Connecting..."},feishuConnecting:{zh:"验证 / 连接中...",en:"Verifying / connecting..."},configSaved:{zh:"配置已保存",en:"Configuration saved"},configSavedApplied:{zh:"配置已保存并已应用",en:"Configuration saved and applied"},configSaveFailed:{zh:"保存配置失败",en:"Failed to save configuration"},configReloaded:{zh:"配置已重载",en:"Configuration reloaded"},configReloadFailed:{zh:"重载配置失败",en:"Failed to reload configuration"},feishuVerifySuccess:{zh:"验证成功,请到飞书开放平台完成事件订阅与发布后再开始使用。",en:"Verified. Please finish Feishu event subscription and app publishing before using."},feishuVerifyFailed:{zh:"验证失败",en:"Verification failed"},enterTag:{zh:"输入后按回车...",en:"Type and press Enter..."},headerName:{zh:"Header 名称",en:"Header Name"},headerValue:{zh:"Header 值",en:"Header Value"},docBrowserTitle:{zh:"帮助文档",en:"Help Docs"},docBrowserSearchPlaceholder:{zh:"搜索,也可以输入文档地址直接打开",en:"Search, or enter a doc URL to open"},docBrowserOpenExternal:{zh:"文档中心打开",en:"Open in Docs"},docBrowserFloatMode:{zh:"悬浮窗口",en:"Float Window"},docBrowserDockMode:{zh:"固定到侧栏",en:"Dock to Sidebar"},docBrowserClose:{zh:"关闭",en:"Close"},docBrowserHelp:{zh:"帮助文档",en:"Help Docs"}};function Y(t,r="en"){var o,a;return((o=_m[t])==null?void 0:o[r])||((a=_m[t])==null?void 0:a.en)||t}/**
52
- * @license lucide-react v0.462.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const xS=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cy=(...t)=>t.filter((r,o,a)=>!!r&&r.trim()!==""&&a.indexOf(r)===o).join(" ").trim();/**
57
- * @license lucide-react v0.462.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */var wS={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"};/**
62
- * @license lucide-react v0.462.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const bS=y.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:l="",children:u,iconNode:f,...h},m)=>y.createElement("svg",{ref:m,...wS,width:r,height:r,stroke:t,strokeWidth:a?Number(o)*24/Number(r):o,className:Cy("lucide",l),...h},[...f.map(([g,x])=>y.createElement(g,x)),...Array.isArray(u)?u:[u]]));/**
67
- * @license lucide-react v0.462.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const Pe=(t,r)=>{const o=y.forwardRef(({className:a,...l},u)=>y.createElement(bS,{ref:u,iconNode:r,className:Cy(`lucide-${xS(t)}`,a),...l}));return o.displayName=`${t}`,o};/**
72
- * @license lucide-react v0.462.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const SS=Pe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
77
- * @license lucide-react v0.462.0 - ISC
78
- *
79
- * This source code is licensed under the ISC license.
80
- * See the LICENSE file in the root directory of this source tree.
81
- */const Jd=Pe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
82
- * @license lucide-react v0.462.0 - ISC
83
- *
84
- * This source code is licensed under the ISC license.
85
- * See the LICENSE file in the root directory of this source tree.
86
- */const CS=Pe("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
87
- * @license lucide-react v0.462.0 - ISC
88
- *
89
- * This source code is licensed under the ISC license.
90
- * See the LICENSE file in the root directory of this source tree.
91
- */const ky=Pe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
92
- * @license lucide-react v0.462.0 - ISC
93
- *
94
- * This source code is licensed under the ISC license.
95
- * See the LICENSE file in the root directory of this source tree.
96
- */const kS=Pe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
97
- * @license lucide-react v0.462.0 - ISC
98
- *
99
- * This source code is licensed under the ISC license.
100
- * See the LICENSE file in the root directory of this source tree.
101
- */const Ey=Pe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
102
- * @license lucide-react v0.462.0 - ISC
103
- *
104
- * This source code is licensed under the ISC license.
105
- * See the LICENSE file in the root directory of this source tree.
106
- */const Ny=Pe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
107
- * @license lucide-react v0.462.0 - ISC
108
- *
109
- * This source code is licensed under the ISC license.
110
- * See the LICENSE file in the root directory of this source tree.
111
- */const ES=Pe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
112
- * @license lucide-react v0.462.0 - ISC
113
- *
114
- * This source code is licensed under the ISC license.
115
- * See the LICENSE file in the root directory of this source tree.
116
- */const NS=Pe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
117
- * @license lucide-react v0.462.0 - ISC
118
- *
119
- * This source code is licensed under the ISC license.
120
- * See the LICENSE file in the root directory of this source tree.
121
- */const PS=Pe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
122
- * @license lucide-react v0.462.0 - ISC
123
- *
124
- * This source code is licensed under the ISC license.
125
- * See the LICENSE file in the root directory of this source tree.
126
- */const jS=Pe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
127
- * @license lucide-react v0.462.0 - ISC
128
- *
129
- * This source code is licensed under the ISC license.
130
- * See the LICENSE file in the root directory of this source tree.
131
- */const Py=Pe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
132
- * @license lucide-react v0.462.0 - ISC
133
- *
134
- * This source code is licensed under the ISC license.
135
- * See the LICENSE file in the root directory of this source tree.
136
- */const RS=Pe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
137
- * @license lucide-react v0.462.0 - ISC
138
- *
139
- * This source code is licensed under the ISC license.
140
- * See the LICENSE file in the root directory of this source tree.
141
- */const MS=Pe("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"}]]);/**
142
- * @license lucide-react v0.462.0 - ISC
143
- *
144
- * This source code is licensed under the ISC license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */const TS=Pe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
147
- * @license lucide-react v0.462.0 - ISC
148
- *
149
- * This source code is licensed under the ISC license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const IS=Pe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
152
- * @license lucide-react v0.462.0 - ISC
153
- *
154
- * This source code is licensed under the ISC license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */const jy=Pe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
157
- * @license lucide-react v0.462.0 - ISC
158
- *
159
- * This source code is licensed under the ISC license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */const OS=Pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
162
- * @license lucide-react v0.462.0 - ISC
163
- *
164
- * This source code is licensed under the ISC license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */const Il=Pe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
167
- * @license lucide-react v0.462.0 - ISC
168
- *
169
- * This source code is licensed under the ISC license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */const AS=Pe("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
172
- * @license lucide-react v0.462.0 - ISC
173
- *
174
- * This source code is licensed under the ISC license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */const Dm=Pe("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
177
- * @license lucide-react v0.462.0 - ISC
178
- *
179
- * This source code is licensed under the ISC license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */const Ol=Pe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
182
- * @license lucide-react v0.462.0 - ISC
183
- *
184
- * This source code is licensed under the ISC license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */const LS=Pe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
187
- * @license lucide-react v0.462.0 - ISC
188
- *
189
- * This source code is licensed under the ISC license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */const Zd=Pe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
192
- * @license lucide-react v0.462.0 - ISC
193
- *
194
- * This source code is licensed under the ISC license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */const _S=Pe("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
197
- * @license lucide-react v0.462.0 - ISC
198
- *
199
- * This source code is licensed under the ISC license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */const ps=Pe("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
202
- * @license lucide-react v0.462.0 - ISC
203
- *
204
- * This source code is licensed under the ISC license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */const ef=Pe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
207
- * @license lucide-react v0.462.0 - ISC
208
- *
209
- * This source code is licensed under the ISC license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */const DS=Pe("PackageSearch",[["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}],["circle",{cx:"18.5",cy:"15.5",r:"2.5",key:"b5zd12"}],["path",{d:"M20.27 17.27 22 19",key:"1l4muz"}]]);/**
212
- * @license lucide-react v0.462.0 - ISC
213
- *
214
- * This source code is licensed under the ISC license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */const zS=Pe("PanelRightOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]]);/**
217
- * @license lucide-react v0.462.0 - ISC
218
- *
219
- * This source code is licensed under the ISC license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */const xd=Pe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
222
- * @license lucide-react v0.462.0 - ISC
223
- *
224
- * This source code is licensed under the ISC license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */const FS=Pe("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
227
- * @license lucide-react v0.462.0 - ISC
228
- *
229
- * This source code is licensed under the ISC license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */const zm=Pe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
232
- * @license lucide-react v0.462.0 - ISC
233
- *
234
- * This source code is licensed under the ISC license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */const BS=Pe("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
237
- * @license lucide-react v0.462.0 - ISC
238
- *
239
- * This source code is licensed under the ISC license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */const Ry=Pe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
242
- * @license lucide-react v0.462.0 - ISC
243
- *
244
- * This source code is licensed under the ISC license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */const tf=Pe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
247
- * @license lucide-react v0.462.0 - ISC
248
- *
249
- * This source code is licensed under the ISC license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */const US=Pe("Slack",[["rect",{width:"3",height:"8",x:"13",y:"2",rx:"1.5",key:"diqz80"}],["path",{d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5",key:"183iwg"}],["rect",{width:"3",height:"8",x:"8",y:"14",rx:"1.5",key:"hqg7r1"}],["path",{d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5",key:"76g71w"}],["rect",{width:"8",height:"3",x:"14",y:"13",rx:"1.5",key:"1kmz0a"}],["path",{d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5",key:"jc4sz0"}],["rect",{width:"8",height:"3",x:"2",y:"8",rx:"1.5",key:"1omvl4"}],["path",{d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5",key:"16f3cl"}]]);/**
252
- * @license lucide-react v0.462.0 - ISC
253
- *
254
- * This source code is licensed under the ISC license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */const $S=Pe("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
257
- * @license lucide-react v0.462.0 - ISC
258
- *
259
- * This source code is licensed under the ISC license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */const nf=Pe("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
262
- * @license lucide-react v0.462.0 - ISC
263
- *
264
- * This source code is licensed under the ISC license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */const My=Pe("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
267
- * @license lucide-react v0.462.0 - ISC
268
- *
269
- * This source code is licensed under the ISC license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */const WS=Pe("ToggleLeft",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
272
- * @license lucide-react v0.462.0 - ISC
273
- *
274
- * This source code is licensed under the ISC license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */const wd=Pe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
277
- * @license lucide-react v0.462.0 - ISC
278
- *
279
- * This source code is licensed under the ISC license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */const HS=Pe("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"}]]);/**
282
- * @license lucide-react v0.462.0 - ISC
283
- *
284
- * This source code is licensed under the ISC license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */const rf=Pe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
287
- * @license lucide-react v0.462.0 - ISC
288
- *
289
- * This source code is licensed under the ISC license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */const VS=Pe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Fm="docs.nextclaw.io",bd="nextclaw-docs.pages.dev",KS=new Set([Fm,`www.${Fm}`,bd,`www.${bd}`]),Ma=`https://${bd}`,Ty=y.createContext(null);function Wl(){const t=y.useContext(Ty);if(!t)throw new Error("useDocBrowser must be used within DocBrowserProvider");return t}function QS(t){try{const r=new URL(t,window.location.origin);return KS.has(r.hostname)}catch{return!1}}function qS({children:t}){const[r,o]=y.useState({isOpen:!1,mode:"docked",currentUrl:`${Ma}/guide/getting-started`,history:[`${Ma}/guide/getting-started`],historyIndex:0}),a=y.useCallback(v=>{const E=v||r.currentUrl||`${Ma}/guide/getting-started`;o(w=>({...w,isOpen:!0,currentUrl:E,history:[...w.history.slice(0,w.historyIndex+1),E],historyIndex:w.historyIndex+1}))},[r.currentUrl]),l=y.useCallback(()=>{o(v=>({...v,isOpen:!1}))},[]),u=y.useCallback(()=>{o(v=>({...v,mode:v.mode==="floating"?"docked":"floating"}))},[]),f=y.useCallback(v=>{o(E=>({...E,mode:v}))},[]),h=y.useCallback(v=>{o(E=>({...E,currentUrl:v,history:[...E.history.slice(0,E.historyIndex+1),v],historyIndex:E.historyIndex+1}))},[]),m=y.useCallback(()=>{o(v=>{if(v.historyIndex<=0)return v;const E=v.historyIndex-1;return{...v,historyIndex:E,currentUrl:v.history[E]}})},[]),g=y.useCallback(()=>{o(v=>{if(v.historyIndex>=v.history.length-1)return v;const E=v.historyIndex+1;return{...v,historyIndex:E,currentUrl:v.history[E]}})},[]),x=r.historyIndex>0,b=r.historyIndex<r.history.length-1,C=y.useMemo(()=>({...r,open:a,close:l,toggleMode:u,setMode:f,navigate:h,goBack:m,goForward:g,canGoBack:x,canGoForward:b}),[r,a,l,u,f,h,m,g,x,b]);return d.jsx(Ty.Provider,{value:C,children:t})}function Bm(){const{isOpen:t,mode:r,currentUrl:o,close:a,toggleMode:l,goBack:u,goForward:f,canGoBack:h,canGoForward:m,navigate:g}=Wl(),[x,b]=y.useState(""),[C,v]=y.useState(!1),[E,w]=y.useState({x:120,y:80}),[k,j]=y.useState({w:480,h:600}),[R,N]=y.useState(420),T=y.useRef(null),U=y.useRef(null),V=y.useRef(null);y.useEffect(()=>{try{const B=new URL(o);b(B.pathname)}catch{b(o)}},[o]);const W=y.useCallback(B=>{B.preventDefault();const Q=x.trim();Q&&(Q.startsWith("/")?g(`${Ma}${Q}`):Q.startsWith("http")?g(Q):g(`${Ma}/${Q}`))},[x,g]),X=y.useCallback(B=>{r==="floating"&&(v(!0),T.current={startX:B.clientX,startY:B.clientY,startPosX:E.x,startPosY:E.y})},[r,E]);y.useEffect(()=>{if(!C)return;const B=te=>{T.current&&w({x:T.current.startPosX+(te.clientX-T.current.startX),y:T.current.startPosY+(te.clientY-T.current.startY)})},Q=()=>{v(!1),T.current=null};return window.addEventListener("mousemove",B),window.addEventListener("mouseup",Q),()=>{window.removeEventListener("mousemove",B),window.removeEventListener("mouseup",Q)}},[C]);const H=y.useCallback(B=>{B.preventDefault(),B.stopPropagation(),U.current={startX:B.clientX,startY:B.clientY,startW:k.w,startH:k.h};const Q=ae=>{U.current&&j({w:Math.max(360,U.current.startW+(ae.clientX-U.current.startX)),h:Math.max(400,U.current.startH+(ae.clientY-U.current.startY))})},te=()=>{U.current=null,window.removeEventListener("mousemove",Q),window.removeEventListener("mouseup",te)};window.addEventListener("mousemove",Q),window.addEventListener("mouseup",te)},[k]),G=y.useCallback(B=>{B.preventDefault(),B.stopPropagation(),V.current={startX:B.clientX,startW:R};const Q=ae=>{if(!V.current)return;const ie=V.current.startX-ae.clientX;N(Math.max(320,Math.min(800,V.current.startW+ie)))},te=()=>{V.current=null,window.removeEventListener("mousemove",Q),window.removeEventListener("mouseup",te)};window.addEventListener("mousemove",Q),window.addEventListener("mouseup",te)},[R]);if(!t)return null;const _=r==="docked";return d.jsxs("div",{className:ve("flex flex-col bg-white overflow-hidden relative",_?"h-full border-l border-gray-200 shrink-0":"rounded-2xl shadow-2xl border border-gray-200"),style:_?{width:R}:{position:"fixed",left:E.x,top:E.y,width:k.w,height:k.h,zIndex:9999},children:[_&&d.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:G}),d.jsxs("div",{className:ve("flex items-center justify-between px-4 py-2.5 bg-gray-50 border-b border-gray-200 shrink-0 select-none",!_&&"cursor-grab active:cursor-grabbing"),onMouseDown:_?void 0:X,children:[d.jsxs("div",{className:"flex items-center gap-2.5",children:[d.jsx(ky,{className:"w-4 h-4 text-primary"}),d.jsx("span",{className:"text-sm font-semibold text-gray-900",children:Y("docBrowserTitle")})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{onClick:l,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:Y(_?"docBrowserFloatMode":"docBrowserDockMode"),children:_?d.jsx(_S,{className:"w-3.5 h-3.5"}):d.jsx(zS,{className:"w-3.5 h-3.5"})}),d.jsx("button",{onClick:a,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:Y("docBrowserClose"),children:d.jsx(rf,{className:"w-3.5 h-3.5"})})]})]}),d.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0",children:[d.jsx("button",{onClick:u,disabled:!h,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:d.jsx(SS,{className:"w-4 h-4"})}),d.jsx("button",{onClick:f,disabled:!m,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:d.jsx(Jd,{className:"w-4 h-4"})}),d.jsxs("form",{onSubmit:W,className:"flex-1 relative",children:[d.jsx(Ry,{className:"w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),d.jsx("input",{type:"text",value:x,onChange:B=>b(B.target.value),placeholder:Y("docBrowserSearchPlaceholder"),className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400"})]})]}),d.jsx("div",{className:"flex-1 relative overflow-hidden",children:d.jsx("iframe",{src:o,className:"absolute inset-0 w-full h-full border-0",title:"NextClaw Documentation",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",allow:"clipboard-read; clipboard-write"})}),d.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0",children:d.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors",children:[Y("docBrowserOpenExternal"),d.jsx(Py,{className:"w-3 h-3"})]})}),!_&&d.jsx("div",{className:"absolute bottom-0 right-0 w-5 h-5 cursor-se-resize flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors",onMouseDown:H,children:d.jsx(OS,{className:"w-3 h-3 rotate-[-45deg]"})})]})}function GS(){const t=Wl();y.useEffect(()=>{const r=o=>{const a=o.target.closest("a[href]");if(!a)return;const l=a.getAttribute("href")||"";QS(l)&&(o.ctrlKey||o.metaKey||o.shiftKey||(o.preventDefault(),o.stopPropagation(),t.open(l)))};return document.addEventListener("click",r,!0),()=>document.removeEventListener("click",r,!0)},[t])}const YS=[{target:"/model",label:"Models",icon:PS},{target:"/providers",label:"Providers",icon:nf},{target:"/channels",label:"Channels",icon:ef},{target:"/runtime",label:"Routing & Runtime",icon:IS},{target:"/sessions",label:Y("sessions"),icon:AS},{target:"/marketplace",label:"Marketplace",icon:My}];function XS(){const t=Wl();return d.jsxs("aside",{className:"w-[240px] bg-white border-r border-gray-200 flex flex-col h-full py-6 px-4",children:[d.jsx("div",{className:"px-3 mb-8",children:d.jsxs("div",{className:"flex items-center gap-2.5 group cursor-pointer",children:[d.jsx("div",{className:"h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center transition-transform duration-fast group-hover:scale-110",children:d.jsx("img",{src:"/logo.svg",alt:"NextClaw",className:"h-full w-full object-contain"})}),d.jsx("span",{className:"text-[15px] font-bold bg-gradient-to-r from-primary to-indigo-500 bg-clip-text text-transparent tracking-[-0.02em]",children:"NextClaw"})]})}),d.jsx("nav",{className:"flex-1",children:d.jsx("ul",{className:"space-y-1",children:YS.map(r=>{const o=r.icon;return d.jsx("li",{children:d.jsx(ny,{to:r.target,className:({isActive:a})=>ve("group w-full flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-base",a?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-100/80 hover:text-gray-900"),children:({isActive:a})=>d.jsxs(d.Fragment,{children:[d.jsx(o,{className:ve("h-4 w-4 transition-transform duration-fast group-hover:scale-110",a?"text-primary":"text-gray-500")}),d.jsx("span",{className:"flex-1 text-left",children:r.label})]})})},r.target)})})}),d.jsx("div",{className:"pt-2 border-t border-gray-100 mt-2",children:d.jsxs("button",{onClick:()=>t.open(),className:ve("w-full flex items-center gap-3 px-4 py-2.5 rounded-lg text-sm font-medium transition-all duration-base",t.isOpen?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-100/80 hover:text-gray-900"),children:[d.jsx(ky,{className:ve("h-4 w-4",t.isOpen?"text-primary":"text-gray-500")}),d.jsx("span",{className:"flex-1 text-left",children:Y("docBrowserHelp")})]})})]})}function JS({children:t}){const{isOpen:r,mode:o}=Wl();return GS(),d.jsxs("div",{className:"h-screen flex bg-white font-sans text-foreground",children:[d.jsx(XS,{}),d.jsxs("div",{className:"flex-1 flex min-w-0 overflow-hidden relative",children:[d.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-gray-50 overflow-hidden",children:d.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar p-10",children:d.jsx("div",{className:"max-w-6xl mx-auto animate-fade-in h-full",children:t})})}),r&&o==="docked"&&d.jsx(Bm,{})]}),r&&o==="floating"&&d.jsx(Bm,{})]})}function ZS({children:t}){return d.jsx(qS,{children:d.jsx(JS,{children:t})})}const Um=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$m=yy,e2=(t,r)=>o=>{var a;if((r==null?void 0:r.variants)==null)return $m(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:l,defaultVariants:u}=r,f=Object.keys(l).map(g=>{const x=o==null?void 0:o[g],b=u==null?void 0:u[g];if(x===null)return null;const C=Um(x)||Um(b);return l[g][C]}),h=o&&Object.entries(o).reduce((g,x)=>{let[b,C]=x;return C===void 0||(g[b]=C),g},{}),m=r==null||(a=r.compoundVariants)===null||a===void 0?void 0:a.reduce((g,x)=>{let{class:b,className:C,...v}=x;return Object.entries(v).every(E=>{let[w,k]=E;return Array.isArray(k)?k.includes({...u,...h}[w]):{...u,...h}[w]===k})?[...g,b,C]:g},[]);return $m(t,f,m,o==null?void 0:o.class,o==null?void 0:o.className)},t2=e2("inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-all duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-secondary hover:text-secondary-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-gray-200",ghost:"hover:bg-secondary hover:text-secondary-foreground",link:"text-primary underline-offset-4 hover:underline",primary:"bg-primary text-primary-foreground hover:bg-primary-600 active:bg-primary-700 shadow-sm",subtle:"bg-secondary text-secondary-foreground hover:bg-gray-200","primary-outline":"border-2 border-primary text-primary hover:bg-primary hover:text-primary-foreground"},size:{default:"h-10 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-12 rounded-xl px-6 text-base",xl:"h-14 rounded-xl px-8 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),st=y.forwardRef(({className:t,variant:r,size:o,...a},l)=>d.jsx("button",{className:ve(t2({variant:r,size:o,className:t})),ref:l,...a}));st.displayName="Button";const ms=y.forwardRef(({className:t,hover:r=!0,...o},a)=>d.jsx("div",{ref:a,className:ve("rounded-xl border border-gray-200 bg-white text-card-foreground shadow-card transition-all duration-base",r&&"hover:shadow-card-hover hover:border-gray-300",t),...o}));ms.displayName="Card";const bl=y.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("flex flex-col space-y-2 p-6",t),...r}));bl.displayName="CardHeader";const Sl=y.forwardRef(({className:t,...r},o)=>d.jsx("h3",{ref:o,className:ve("text-lg font-semibold leading-tight tracking-tight text-gray-900",t),...r}));Sl.displayName="CardTitle";const Cl=y.forwardRef(({className:t,...r},o)=>d.jsx("p",{ref:o,className:ve("text-sm text-gray-500 leading-relaxed",t),...r}));Cl.displayName="CardDescription";const kl=y.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("p-6 pt-0",t),...r}));kl.displayName="CardContent";const n2=y.forwardRef(({className:t,...r},o)=>d.jsx("div",{ref:o,className:ve("flex items-center justify-between p-6 pt-0",t),...r}));n2.displayName="CardFooter";const Ve=y.forwardRef(({className:t,type:r,...o},a)=>d.jsx("input",{type:r,className:ve("flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-400 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...o}));Ve.displayName="Input";const ur=y.forwardRef(({className:t,...r},o)=>d.jsx("label",{ref:o,className:ve("text-sm font-medium leading-none text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t),...r}));ur.displayName="Label";function gn({className:t,...r}){return d.jsx("div",{className:ve("animate-pulse rounded-md bg-slate-200",t),...r})}const r2="http://127.0.0.1:18791",El=(()=>{var t;return typeof window<"u"&&((t=window.location)!=null&&t.origin)?window.location.origin:r2})();async function ul(t,r={}){const o=`${El}${t}`,a=await fetch(o,{headers:{"Content-Type":"application/json",...r.headers},...r}),l=await a.text();let u=null;if(l)try{u=JSON.parse(l)}catch{}if(!u){const f=l?l.slice(0,200):"";return{ok:!1,error:{code:"INVALID_RESPONSE",message:`Non-JSON response (${a.status} ${a.statusText})${f?`: ${f}`:""}`}}}return a.ok,u}const kt={get:t=>ul(t,{method:"GET"}),put:(t,r)=>ul(t,{method:"PUT",body:JSON.stringify(r)}),post:(t,r)=>ul(t,{method:"POST",body:JSON.stringify(r)}),delete:t=>ul(t,{method:"DELETE"})};async function o2(){const t=await kt.get("/api/config");if(!t.ok)throw new Error(t.error.message);return t.data}async function s2(){const t=await kt.get("/api/config/meta");if(!t.ok)throw new Error(t.error.message);return t.data}async function a2(){const t=await kt.get("/api/config/schema");if(!t.ok)throw new Error(t.error.message);return t.data}async function i2(t){const r=await kt.put("/api/config/model",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function l2(t,r){const o=await kt.put(`/api/config/providers/${t}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function u2(t,r){const o=await kt.put(`/api/config/channels/${t}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function c2(t){const r=await kt.put("/api/config/runtime",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function d2(t,r){const o=await kt.post(`/api/config/actions/${t}/execute`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function f2(t){var l;const r=new URLSearchParams;(l=t==null?void 0:t.q)!=null&&l.trim()&&r.set("q",t.q.trim()),typeof(t==null?void 0:t.limit)=="number"&&Number.isFinite(t.limit)&&r.set("limit",String(Math.max(0,Math.trunc(t.limit)))),typeof(t==null?void 0:t.activeMinutes)=="number"&&Number.isFinite(t.activeMinutes)&&r.set("activeMinutes",String(Math.max(0,Math.trunc(t.activeMinutes))));const o=r.toString(),a=await kt.get(o?"/api/sessions?"+o:"/api/sessions");if(!a.ok)throw new Error(a.error.message);return a.data}async function h2(t,r=200){const o=await kt.get(`/api/sessions/${encodeURIComponent(t)}/history?limit=${Math.max(1,Math.trunc(r))}`);if(!o.ok)throw new Error(o.error.message);return o.data}async function p2(t,r){const o=await kt.put(`/api/sessions/${encodeURIComponent(t)}`,r);if(!o.ok)throw new Error(o.error.message);return o.data}async function m2(t){const r=await kt.delete(`/api/sessions/${encodeURIComponent(t)}`);if(!r.ok)throw new Error(r.error.message);return r.data}var g2=t=>{switch(t){case"success":return x2;case"info":return b2;case"warning":return w2;case"error":return S2;default:return null}},y2=Array(12).fill(0),v2=({visible:t,className:r})=>se.createElement("div",{className:["sonner-loading-wrapper",r].filter(Boolean).join(" "),"data-visible":t},se.createElement("div",{className:"sonner-spinner"},y2.map((o,a)=>se.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),x2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),w2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),b2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),S2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},se.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),C2=se.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},se.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),se.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),k2=()=>{let[t,r]=se.useState(document.hidden);return se.useEffect(()=>{let o=()=>{r(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},Sd=1,E2=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;let{message:o,...a}=t,l=typeof(t==null?void 0:t.id)=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Sd++,u=this.toasts.find(h=>h.id===l),f=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(h=>h.id===l?(this.publish({...h,...t,id:l,title:o}),{...h,...t,id:l,dismissible:f,title:o}):h):this.addToast({title:o,...a,dismissible:f,id:l}),l},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(r=>{this.subscribers.forEach(o=>o({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:t,dismiss:!0})),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let o;r.loading!==void 0&&(o=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let a=t instanceof Promise?t:t(),l=o!==void 0,u,f=a.then(async m=>{if(u=["resolve",m],se.isValidElement(m))l=!1,this.create({id:o,type:"default",message:m});else if(P2(m)&&!m.ok){l=!1;let g=typeof r.error=="function"?await r.error(`HTTP error! status: ${m.status}`):r.error,x=typeof r.description=="function"?await r.description(`HTTP error! status: ${m.status}`):r.description;this.create({id:o,type:"error",message:g,description:x})}else if(r.success!==void 0){l=!1;let g=typeof r.success=="function"?await r.success(m):r.success,x=typeof r.description=="function"?await r.description(m):r.description;this.create({id:o,type:"success",message:g,description:x})}}).catch(async m=>{if(u=["reject",m],r.error!==void 0){l=!1;let g=typeof r.error=="function"?await r.error(m):r.error,x=typeof r.description=="function"?await r.description(m):r.description;this.create({id:o,type:"error",message:g,description:x})}}).finally(()=>{var m;l&&(this.dismiss(o),o=void 0),(m=r.finally)==null||m.call(r)}),h=()=>new Promise((m,g)=>f.then(()=>u[0]==="reject"?g(u[1]):m(u[1])).catch(g));return typeof o!="string"&&typeof o!="number"?{unwrap:h}:Object.assign(o,{unwrap:h})},this.custom=(t,r)=>{let o=(r==null?void 0:r.id)||Sd++;return this.create({jsx:t(o),id:o,...r}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ut=new E2,N2=(t,r)=>{let o=(r==null?void 0:r.id)||Sd++;return Ut.addToast({title:t,...r,id:o}),o},P2=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",j2=N2,R2=()=>Ut.toasts,M2=()=>Ut.getActiveToasts(),nt=Object.assign(j2,{success:Ut.success,info:Ut.info,warning:Ut.warning,error:Ut.error,custom:Ut.custom,message:Ut.message,promise:Ut.promise,dismiss:Ut.dismiss,loading:Ut.loading},{getHistory:R2,getToasts:M2});function T2(t,{insertAt:r}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",r==="top"&&o.firstChild?o.insertBefore(a,o.firstChild):o.appendChild(a),a.styleSheet?a.styleSheet.cssText=t:a.appendChild(document.createTextNode(t))}T2(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
292
- `);function cl(t){return t.label!==void 0}var I2=3,O2="32px",A2="16px",Wm=4e3,L2=356,_2=14,D2=20,z2=200;function yn(...t){return t.filter(Boolean).join(" ")}function F2(t){let[r,o]=t.split("-"),a=[];return r&&a.push(r),o&&a.push(o),a}var B2=t=>{var r,o,a,l,u,f,h,m,g,x,b;let{invert:C,toast:v,unstyled:E,interacting:w,setHeights:k,visibleToasts:j,heights:R,index:N,toasts:T,expanded:U,removeToast:V,defaultRichColors:W,closeButton:X,style:H,cancelButtonStyle:G,actionButtonStyle:_,className:L="",descriptionClassName:B="",duration:Q,position:te,gap:ae,loadingIcon:ie,expandByDefault:F,classNames:q,icons:ee,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:K}=t,[le,ce]=se.useState(null),[xe,Se]=se.useState(null),[re,ge]=se.useState(!1),[Ce,Ne]=se.useState(!1),[Me,Ie]=se.useState(!1),[Ze,yt]=se.useState(!1),[En,on]=se.useState(!1),[sn,yr]=se.useState(0),[Nn,vr]=se.useState(0),Gt=se.useRef(v.duration||Q||Wm),Do=se.useRef(null),Pn=se.useRef(null),Ka=N===0,Qa=N+1<=j,Et=v.type,jn=v.dismissible!==!1,zo=v.className||"",qa=v.descriptionClassName||"",Rn=se.useMemo(()=>R.findIndex(Ee=>Ee.toastId===v.id)||0,[R,v.id]),so=se.useMemo(()=>{var Ee;return(Ee=v.closeButton)!=null?Ee:X},[v.closeButton,X]),Ga=se.useMemo(()=>v.duration||Q||Wm,[v.duration,Q]),Fo=se.useRef(0),Qn=se.useRef(0),Ya=se.useRef(0),Mn=se.useRef(null),[$s,Ws]=te.split("-"),Bo=se.useMemo(()=>R.reduce((Ee,_e,Fe)=>Fe>=Rn?Ee:Ee+_e.height,0),[R,Rn]),Uo=k2(),xr=v.invert||C,Tn=Et==="loading";Qn.current=se.useMemo(()=>Rn*ae+Bo,[Rn,Bo]),se.useEffect(()=>{Gt.current=Ga},[Ga]),se.useEffect(()=>{ge(!0)},[]),se.useEffect(()=>{let Ee=Pn.current;if(Ee){let _e=Ee.getBoundingClientRect().height;return vr(_e),k(Fe=>[{toastId:v.id,height:_e,position:v.position},...Fe]),()=>k(Fe=>Fe.filter(Nt=>Nt.toastId!==v.id))}},[k,v.id]),se.useLayoutEffect(()=>{if(!re)return;let Ee=Pn.current,_e=Ee.style.height;Ee.style.height="auto";let Fe=Ee.getBoundingClientRect().height;Ee.style.height=_e,vr(Fe),k(Nt=>Nt.find(Tt=>Tt.toastId===v.id)?Nt.map(Tt=>Tt.toastId===v.id?{...Tt,height:Fe}:Tt):[{toastId:v.id,height:Fe,position:v.position},...Nt])},[re,v.title,v.description,k,v.id]);let an=se.useCallback(()=>{Ne(!0),yr(Qn.current),k(Ee=>Ee.filter(_e=>_e.toastId!==v.id)),setTimeout(()=>{V(v)},z2)},[v,V,k,Qn]);se.useEffect(()=>{if(v.promise&&Et==="loading"||v.duration===1/0||v.type==="loading")return;let Ee;return U||w||K&&Uo?(()=>{if(Ya.current<Fo.current){let _e=new Date().getTime()-Fo.current;Gt.current=Gt.current-_e}Ya.current=new Date().getTime()})():Gt.current!==1/0&&(Fo.current=new Date().getTime(),Ee=setTimeout(()=>{var _e;(_e=v.onAutoClose)==null||_e.call(v,v),an()},Gt.current)),()=>clearTimeout(Ee)},[U,w,v,Et,K,Uo,an]),se.useEffect(()=>{v.delete&&an()},[an,v.delete]);function Xa(){var Ee,_e,Fe;return ee!=null&&ee.loading?se.createElement("div",{className:yn(q==null?void 0:q.loader,(Ee=v==null?void 0:v.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":Et==="loading"},ee.loading):ie?se.createElement("div",{className:yn(q==null?void 0:q.loader,(_e=v==null?void 0:v.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":Et==="loading"},ie):se.createElement(v2,{className:yn(q==null?void 0:q.loader,(Fe=v==null?void 0:v.classNames)==null?void 0:Fe.loader),visible:Et==="loading"})}return se.createElement("li",{tabIndex:0,ref:Pn,className:yn(L,zo,q==null?void 0:q.toast,(r=v==null?void 0:v.classNames)==null?void 0:r.toast,q==null?void 0:q.default,q==null?void 0:q[Et],(o=v==null?void 0:v.classNames)==null?void 0:o[Et]),"data-sonner-toast":"","data-rich-colors":(a=v.richColors)!=null?a:W,"data-styled":!(v.jsx||v.unstyled||E),"data-mounted":re,"data-promise":!!v.promise,"data-swiped":En,"data-removed":Ce,"data-visible":Qa,"data-y-position":$s,"data-x-position":Ws,"data-index":N,"data-front":Ka,"data-swiping":Me,"data-dismissible":jn,"data-type":Et,"data-invert":xr,"data-swipe-out":Ze,"data-swipe-direction":xe,"data-expanded":!!(U||F&&re),style:{"--index":N,"--toasts-before":N,"--z-index":T.length-N,"--offset":`${Ce?sn:Qn.current}px`,"--initial-height":F?"auto":`${Nn}px`,...H,...v.style},onDragEnd:()=>{Ie(!1),ce(null),Mn.current=null},onPointerDown:Ee=>{Tn||!jn||(Do.current=new Date,yr(Qn.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Ie(!0),Mn.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,_e,Fe,Nt;if(Ze||!jn)return;Mn.current=null;let Tt=Number(((Ee=Pn.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),It=Number(((_e=Pn.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ln=new Date().getTime()-((Fe=Do.current)==null?void 0:Fe.getTime()),ht=le==="x"?Tt:It,In=Math.abs(ht)/ln;if(Math.abs(ht)>=D2||In>.11){yr(Qn.current),(Nt=v.onDismiss)==null||Nt.call(v,v),Se(le==="x"?Tt>0?"right":"left":It>0?"down":"up"),an(),yt(!0),on(!1);return}Ie(!1),ce(null)},onPointerMove:Ee=>{var _e,Fe,Nt,Tt;if(!Mn.current||!jn||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;let It=Ee.clientY-Mn.current.y,ln=Ee.clientX-Mn.current.x,ht=(Fe=t.swipeDirections)!=null?Fe:F2(te);!le&&(Math.abs(ln)>1||Math.abs(It)>1)&&ce(Math.abs(ln)>Math.abs(It)?"x":"y");let In={x:0,y:0};le==="y"?(ht.includes("top")||ht.includes("bottom"))&&(ht.includes("top")&&It<0||ht.includes("bottom")&&It>0)&&(In.y=It):le==="x"&&(ht.includes("left")||ht.includes("right"))&&(ht.includes("left")&&ln<0||ht.includes("right")&&ln>0)&&(In.x=ln),(Math.abs(In.x)>0||Math.abs(In.y)>0)&&on(!0),(Nt=Pn.current)==null||Nt.style.setProperty("--swipe-amount-x",`${In.x}px`),(Tt=Pn.current)==null||Tt.style.setProperty("--swipe-amount-y",`${In.y}px`)}},so&&!v.jsx?se.createElement("button",{"aria-label":O,"data-disabled":Tn,"data-close-button":!0,onClick:Tn||!jn?()=>{}:()=>{var Ee;an(),(Ee=v.onDismiss)==null||Ee.call(v,v)},className:yn(q==null?void 0:q.closeButton,(l=v==null?void 0:v.classNames)==null?void 0:l.closeButton)},(u=ee==null?void 0:ee.close)!=null?u:C2):null,v.jsx||y.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:se.createElement(se.Fragment,null,Et||v.icon||v.promise?se.createElement("div",{"data-icon":"",className:yn(q==null?void 0:q.icon,(f=v==null?void 0:v.classNames)==null?void 0:f.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||Xa():null,v.type!=="loading"?v.icon||(ee==null?void 0:ee[Et])||g2(Et):null):null,se.createElement("div",{"data-content":"",className:yn(q==null?void 0:q.content,(h=v==null?void 0:v.classNames)==null?void 0:h.content)},se.createElement("div",{"data-title":"",className:yn(q==null?void 0:q.title,(m=v==null?void 0:v.classNames)==null?void 0:m.title)},typeof v.title=="function"?v.title():v.title),v.description?se.createElement("div",{"data-description":"",className:yn(B,qa,q==null?void 0:q.description,(g=v==null?void 0:v.classNames)==null?void 0:g.description)},typeof v.description=="function"?v.description():v.description):null),y.isValidElement(v.cancel)?v.cancel:v.cancel&&cl(v.cancel)?se.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||G,onClick:Ee=>{var _e,Fe;cl(v.cancel)&&jn&&((Fe=(_e=v.cancel).onClick)==null||Fe.call(_e,Ee),an())},className:yn(q==null?void 0:q.cancelButton,(x=v==null?void 0:v.classNames)==null?void 0:x.cancelButton)},v.cancel.label):null,y.isValidElement(v.action)?v.action:v.action&&cl(v.action)?se.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||_,onClick:Ee=>{var _e,Fe;cl(v.action)&&((Fe=(_e=v.action).onClick)==null||Fe.call(_e,Ee),!Ee.defaultPrevented&&an())},className:yn(q==null?void 0:q.actionButton,(b=v==null?void 0:v.classNames)==null?void 0:b.actionButton)},v.action.label):null))};function Hm(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function U2(t,r){let o={};return[t,r].forEach((a,l)=>{let u=l===1,f=u?"--mobile-offset":"--offset",h=u?A2:O2;function m(g){["top","right","bottom","left"].forEach(x=>{o[`${f}-${x}`]=typeof g=="number"?`${g}px`:g})}typeof a=="number"||typeof a=="string"?m(a):typeof a=="object"?["top","right","bottom","left"].forEach(g=>{a[g]===void 0?o[`${f}-${g}`]=h:o[`${f}-${g}`]=typeof a[g]=="number"?`${a[g]}px`:a[g]}):m(h)}),o}var $2=y.forwardRef(function(t,r){let{invert:o,position:a="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:f,className:h,offset:m,mobileOffset:g,theme:x="light",richColors:b,duration:C,style:v,visibleToasts:E=I2,toastOptions:w,dir:k=Hm(),gap:j=_2,loadingIcon:R,icons:N,containerAriaLabel:T="Notifications",pauseWhenPageIsHidden:U}=t,[V,W]=se.useState([]),X=se.useMemo(()=>Array.from(new Set([a].concat(V.filter(K=>K.position).map(K=>K.position)))),[V,a]),[H,G]=se.useState([]),[_,L]=se.useState(!1),[B,Q]=se.useState(!1),[te,ae]=se.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),ie=se.useRef(null),F=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),q=se.useRef(null),ee=se.useRef(!1),O=se.useCallback(K=>{W(le=>{var ce;return(ce=le.find(xe=>xe.id===K.id))!=null&&ce.delete||Ut.dismiss(K.id),le.filter(({id:xe})=>xe!==K.id)})},[]);return se.useEffect(()=>Ut.subscribe(K=>{if(K.dismiss){W(le=>le.map(ce=>ce.id===K.id?{...ce,delete:!0}:ce));return}setTimeout(()=>{oy.flushSync(()=>{W(le=>{let ce=le.findIndex(xe=>xe.id===K.id);return ce!==-1?[...le.slice(0,ce),{...le[ce],...K},...le.slice(ce+1)]:[K,...le]})})})}),[]),se.useEffect(()=>{if(x!=="system"){ae(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?ae("dark"):ae("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:le})=>{ae(le?"dark":"light")})}catch{K.addListener(({matches:ce})=>{try{ae(ce?"dark":"light")}catch(xe){console.error(xe)}})}},[x]),se.useEffect(()=>{V.length<=1&&L(!1)},[V]),se.useEffect(()=>{let K=le=>{var ce,xe;l.every(Se=>le[Se]||le.code===Se)&&(L(!0),(ce=ie.current)==null||ce.focus()),le.code==="Escape"&&(document.activeElement===ie.current||(xe=ie.current)!=null&&xe.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[l]),se.useEffect(()=>{if(ie.current)return()=>{q.current&&(q.current.focus({preventScroll:!0}),q.current=null,ee.current=!1)}},[ie.current]),se.createElement("section",{ref:r,"aria-label":`${T} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},X.map((K,le)=>{var ce;let[xe,Se]=K.split("-");return V.length?se.createElement("ol",{key:K,dir:k==="auto"?Hm():k,tabIndex:-1,ref:ie,className:h,"data-sonner-toaster":!0,"data-theme":te,"data-y-position":xe,"data-lifted":_&&V.length>1&&!u,"data-x-position":Se,style:{"--front-toast-height":`${((ce=H[0])==null?void 0:ce.height)||0}px`,"--width":`${L2}px`,"--gap":`${j}px`,...v,...U2(m,g)},onBlur:re=>{ee.current&&!re.currentTarget.contains(re.relatedTarget)&&(ee.current=!1,q.current&&(q.current.focus({preventScroll:!0}),q.current=null))},onFocus:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||ee.current||(ee.current=!0,q.current=re.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{B||L(!1)},onDragEnd:()=>L(!1),onPointerDown:re=>{re.target instanceof HTMLElement&&re.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},V.filter(re=>!re.position&&le===0||re.position===K).map((re,ge)=>{var Ce,Ne;return se.createElement(B2,{key:re.id,icons:N,index:ge,toast:re,defaultRichColors:b,duration:(Ce=w==null?void 0:w.duration)!=null?Ce:C,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:o,visibleToasts:E,closeButton:(Ne=w==null?void 0:w.closeButton)!=null?Ne:f,interacting:B,position:K,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,removeToast:O,toasts:V.filter(Me=>Me.position==re.position),heights:H.filter(Me=>Me.position==re.position),setHeights:G,expandByDefault:u,gap:j,loadingIcon:R,expanded:_,pauseWhenPageIsHidden:U,swipeDirections:t.swipeDirections})})):null}))});function Ds(){return to({queryKey:["config"],queryFn:o2,staleTime:3e4,refetchOnWindowFocus:!0})}function of(){return to({queryKey:["config-meta"],queryFn:s2,staleTime:1/0})}function zs(){return to({queryKey:["config-schema"],queryFn:a2,staleTime:1/0})}function W2(){const t=gr();return no({mutationFn:i2,onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),nt.success(Y("configSaved"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function H2(){const t=gr();return no({mutationFn:({provider:r,data:o})=>l2(r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),nt.success(Y("configSaved"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function V2(){const t=gr();return no({mutationFn:({channel:r,data:o})=>u2(r,o),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),nt.success(Y("configSavedApplied"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function K2(){const t=gr();return no({mutationFn:({data:r})=>c2(r),onSuccess:()=>{t.invalidateQueries({queryKey:["config"]}),nt.success(Y("configSavedApplied"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function Q2(){return no({mutationFn:({actionId:t,data:r})=>d2(t,r),onError:t=>{nt.error(Y("error")+": "+t.message)}})}function q2(t){return to({queryKey:["sessions",t],queryFn:()=>f2(t),staleTime:1e4})}function G2(t,r=200){return to({queryKey:["session-history",t,r],queryFn:()=>h2(t,r),enabled:!!t,staleTime:5e3})}function Y2(){const t=gr();return no({mutationFn:({key:r,data:o})=>p2(r,o),onSuccess:(r,o)=>{t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["session-history",o.key]}),nt.success(Y("configSavedApplied"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function X2(){const t=gr();return no({mutationFn:({key:r})=>m2(r),onSuccess:()=>{t.invalidateQueries({queryKey:["sessions"]}),t.invalidateQueries({queryKey:["session-history"]}),nt.success(Y("configSavedApplied"))},onError:r=>{nt.error(Y("configSaveFailed")+": "+r.message)}})}function J2(t){return Array.isArray(t)?t.filter(r=>typeof r=="string").join("."):t}function gt(t,r){if(!r)return;const o=J2(t),a=r[o];if(a)return a;const l=o.split(".");for(const[u,f]of Object.entries(r)){if(!u.includes("*"))continue;const h=u.split(".");if(h.length!==l.length)continue;let m=!0;for(let g=0;g<l.length;g+=1)if(h[g]!=="*"&&h[g]!==l[g]){m=!1;break}if(m)return f}}function Z2(){const{data:t,isLoading:r}=Ds(),{data:o}=zs(),a=W2(),[l,u]=y.useState(""),[f,h]=y.useState(""),[m,g]=y.useState(8192),x=o==null?void 0:o.uiHints,b=gt("agents.defaults.model",x),C=gt("agents.defaults.workspace",x),v=gt("agents.defaults.maxTokens",x);y.useEffect(()=>{var w;(w=t==null?void 0:t.agents)!=null&&w.defaults&&(u(t.agents.defaults.model||""),h(t.agents.defaults.workspace||""),g(t.agents.defaults.maxTokens||8192))},[t]);const E=w=>{w.preventDefault(),a.mutate({model:l,maxTokens:m})};return r?d.jsxs("div",{className:"max-w-2xl space-y-6",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(gn,{className:"h-8 w-32"}),d.jsx(gn,{className:"h-4 w-48"})]}),d.jsxs(ms,{className:"rounded-2xl border-gray-200 p-6",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[d.jsx(gn,{className:"h-12 w-12 rounded-xl"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(gn,{className:"h-5 w-24"}),d.jsx(gn,{className:"h-3 w-32"})]})]}),d.jsx(gn,{className:"h-4 w-20 mb-2"}),d.jsx(gn,{className:"h-10 w-full rounded-xl"})]}),d.jsxs(ms,{className:"rounded-2xl border-gray-200 p-6",children:[d.jsx(gn,{className:"h-5 w-24 mb-2"}),d.jsx(gn,{className:"h-3 w-40 mb-6"}),d.jsx("div",{className:"space-y-6",children:d.jsxs("div",{children:[d.jsx(gn,{className:"h-4 w-28 mb-3"}),d.jsx(gn,{className:"h-2 w-full rounded-full"})]})})]})]}):d.jsxs("div",{className:"max-w-4xl animate-fade-in pb-20",children:[d.jsxs("div",{className:"mb-10",children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Model Configuration"}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Configure default AI model and runtime limits"})]}),d.jsxs("form",{onSubmit:E,className:"space-y-8",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx(nf,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Default Model"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(ur,{htmlFor:"model",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(b==null?void 0:b.label)??"Model Name"}),d.jsx(Ve,{id:"model",value:l,onChange:w=>u(w.target.value),placeholder:(b==null?void 0:b.placeholder)??"minimax/MiniMax-M2.1",className:"h-12 px-4 rounded-xl"}),d.jsx("p",{className:"text-xs text-gray-400",children:(b==null?void 0:b.help)??"Examples: minimax/MiniMax-M2.5 · minimax/MiniMax-M2.1 · openrouter/anthropic/claude-3.5-sonnet · openrouter/openai/gpt-4o-mini"})]})]}),d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx(TS,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Workspace"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(ur,{htmlFor:"workspace",className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(C==null?void 0:C.label)??"Default Path"}),d.jsx(Ve,{id:"workspace",value:f,onChange:w=>h(w.target.value),placeholder:(C==null?void 0:C.placeholder)??"/path/to/workspace",className:"h-12 px-4 rounded-xl"})]})]})]}),d.jsxs("div",{className:"p-8 rounded-2xl bg-white border border-gray-200 shadow-card",children:[d.jsxs("div",{className:"flex items-center gap-4 mb-10",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center text-white",children:d.jsx($S,{className:"h-5 w-5"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900",children:"Generation Parameters"})]}),d.jsx("div",{className:"grid grid-cols-1 gap-12",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex justify-between items-center mb-2",children:[d.jsx(ur,{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:(v==null?void 0:v.label)??"Max Tokens"}),d.jsx("span",{className:"text-sm font-semibold text-gray-900",children:m.toLocaleString()})]}),d.jsx("input",{type:"range",min:"1000",max:"32000",step:"1000",value:m,onChange:w=>g(parseInt(w.target.value)),className:"w-full h-1 bg-gray-200 rounded-full appearance-none cursor-pointer accent-primary"})]})})]}),d.jsx("div",{className:"flex justify-end pt-4",children:d.jsx(st,{type:"submit",disabled:a.isPending,size:"lg",children:a.isPending?d.jsx(LS,{className:"h-5 w-5 animate-spin"}):"Save Changes"})})]})]})}const Vm=t=>{let r;const o=new Set,a=(g,x)=>{const b=typeof g=="function"?g(r):g;if(!Object.is(b,r)){const C=r;r=x??(typeof b!="object"||b===null)?b:Object.assign({},r,b),o.forEach(v=>v(r,C))}},l=()=>r,h={setState:a,getState:l,getInitialState:()=>m,subscribe:g=>(o.add(g),()=>o.delete(g))},m=r=t(a,l,h);return h},eC=(t=>t?Vm(t):Vm),tC=t=>t;function nC(t,r=tC){const o=se.useSyncExternalStore(t.subscribe,se.useCallback(()=>r(t.getState()),[t,r]),se.useCallback(()=>r(t.getInitialState()),[t,r]));return se.useDebugValue(o),o}const Km=t=>{const r=eC(t),o=a=>nC(r,a);return Object.assign(o,r),o},rC=(t=>t?Km(t):Km),Ha=rC(t=>({connectionStatus:"disconnected",setConnectionStatus:r=>t({connectionStatus:r}),providerModal:{open:!1},openProviderModal:r=>t({providerModal:{open:!0,provider:r}}),closeProviderModal:()=>t({providerModal:{open:!1}}),channelModal:{open:!1},openChannelModal:r=>t({channelModal:{open:!0,channel:r}}),closeChannelModal:()=>t({channelModal:{open:!1}})}));function Ke(t,r,{checkForDefaultPrevented:o=!0}={}){return function(l){if(t==null||t(l),o===!1||!l.defaultPrevented)return r==null?void 0:r(l)}}function Qm(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function Iy(...t){return r=>{let o=!1;const a=t.map(l=>{const u=Qm(l,r);return!o&&typeof u=="function"&&(o=!0),u});if(o)return()=>{for(let l=0;l<a.length;l++){const u=a[l];typeof u=="function"?u():Qm(t[l],null)}}}}function rt(...t){return y.useCallback(Iy(...t),t)}function oC(t,r){const o=y.createContext(r),a=u=>{const{children:f,...h}=u,m=y.useMemo(()=>h,Object.values(h));return d.jsx(o.Provider,{value:m,children:f})};a.displayName=t+"Provider";function l(u){const f=y.useContext(o);if(f)return f;if(r!==void 0)return r;throw new Error(`\`${u}\` must be used within \`${t}\``)}return[a,l]}function Hl(t,r=[]){let o=[];function a(u,f){const h=y.createContext(f),m=o.length;o=[...o,f];const g=b=>{var j;const{scope:C,children:v,...E}=b,w=((j=C==null?void 0:C[t])==null?void 0:j[m])||h,k=y.useMemo(()=>E,Object.values(E));return d.jsx(w.Provider,{value:k,children:v})};g.displayName=u+"Provider";function x(b,C){var w;const v=((w=C==null?void 0:C[t])==null?void 0:w[m])||h,E=y.useContext(v);if(E)return E;if(f!==void 0)return f;throw new Error(`\`${b}\` must be used within \`${u}\``)}return[g,x]}const l=()=>{const u=o.map(f=>y.createContext(f));return function(h){const m=(h==null?void 0:h[t])||u;return y.useMemo(()=>({[`__scope${t}`]:{...h,[t]:m}}),[h,m])}};return l.scopeName=t,[a,sC(l,...r)]}function sC(...t){const r=t[0];if(t.length===1)return r;const o=()=>{const a=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const f=a.reduce((h,{useScope:m,scopeName:g})=>{const b=m(u)[`__scope${g}`];return{...h,...b}},{});return y.useMemo(()=>({[`__scope${r.scopeName}`]:f}),[f])}};return o.scopeName=r.scopeName,o}var Ct=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},aC=_g[" useId ".trim().toString()]||(()=>{}),iC=0;function gs(t){const[r,o]=y.useState(aC());return Ct(()=>{o(a=>a??String(iC++))},[t]),r?`radix-${r}`:""}var lC=_g[" useInsertionEffect ".trim().toString()]||Ct;function Cd({prop:t,defaultProp:r,onChange:o=()=>{},caller:a}){const[l,u,f]=uC({defaultProp:r,onChange:o}),h=t!==void 0,m=h?t:l;{const x=y.useRef(t!==void 0);y.useEffect(()=>{const b=x.current;b!==h&&console.warn(`${a} is changing from ${b?"controlled":"uncontrolled"} to ${h?"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.`),x.current=h},[h,a])}const g=y.useCallback(x=>{var b;if(h){const C=cC(x)?x(t):x;C!==t&&((b=f.current)==null||b.call(f,C))}else u(x)},[h,t,u,f]);return[m,g]}function uC({defaultProp:t,onChange:r}){const[o,a]=y.useState(t),l=y.useRef(o),u=y.useRef(r);return lC(()=>{u.current=r},[r]),y.useEffect(()=>{var f;l.current!==o&&((f=u.current)==null||f.call(u,o),l.current=o)},[o,l]),[o,a,u]}function cC(t){return typeof t=="function"}function Oa(t){const r=dC(t),o=y.forwardRef((a,l)=>{const{children:u,...f}=a,h=y.Children.toArray(u),m=h.find(hC);if(m){const g=m.props.children,x=h.map(b=>b===m?y.Children.count(g)>1?y.Children.only(null):y.isValidElement(g)?g.props.children:null:b);return d.jsx(r,{...f,ref:l,children:y.isValidElement(g)?y.cloneElement(g,void 0,x):null})}return d.jsx(r,{...f,ref:l,children:u})});return o.displayName=`${t}.Slot`,o}function dC(t){const r=y.forwardRef((o,a)=>{const{children:l,...u}=o;if(y.isValidElement(l)){const f=mC(l),h=pC(u,l.props);return l.type!==y.Fragment&&(h.ref=a?Iy(a,f):f),y.cloneElement(l,h)}return y.Children.count(l)>1?y.Children.only(null):null});return r.displayName=`${t}.SlotClone`,r}var fC=Symbol("radix.slottable");function hC(t){return y.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===fC}function pC(t,r){const o={...r};for(const a in r){const l=t[a],u=r[a];/^on[A-Z]/.test(a)?l&&u?o[a]=(...h)=>{const m=u(...h);return l(...h),m}:l&&(o[a]=l):a==="style"?o[a]={...l,...u}:a==="className"&&(o[a]=[l,u].filter(Boolean).join(" "))}return{...t,...o}}function mC(t){var a,l;let r=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var gC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=gC.reduce((t,r)=>{const o=Oa(`Primitive.${r}`),a=y.forwardRef((l,u)=>{const{asChild:f,...h}=l,m=f?o:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(m,{...h,ref:u})});return a.displayName=`Primitive.${r}`,{...t,[r]:a}},{});function yC(t,r){t&&Wa.flushSync(()=>t.dispatchEvent(r))}function Io(t){const r=y.useRef(t);return y.useEffect(()=>{r.current=t}),y.useMemo(()=>(...o)=>{var a;return(a=r.current)==null?void 0:a.call(r,...o)},[])}function vC(t,r=globalThis==null?void 0:globalThis.document){const o=Io(t);y.useEffect(()=>{const a=l=>{l.key==="Escape"&&o(l)};return r.addEventListener("keydown",a,{capture:!0}),()=>r.removeEventListener("keydown",a,{capture:!0})},[o,r])}var xC="DismissableLayer",kd="dismissableLayer.update",wC="dismissableLayer.pointerDownOutside",bC="dismissableLayer.focusOutside",qm,Oy=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sf=y.forwardRef((t,r)=>{const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,onDismiss:h,...m}=t,g=y.useContext(Oy),[x,b]=y.useState(null),C=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),E=rt(r,W=>b(W)),w=Array.from(g.layers),[k]=[...g.layersWithOutsidePointerEventsDisabled].slice(-1),j=w.indexOf(k),R=x?w.indexOf(x):-1,N=g.layersWithOutsidePointerEventsDisabled.size>0,T=R>=j,U=kC(W=>{const X=W.target,H=[...g.branches].some(G=>G.contains(X));!T||H||(l==null||l(W),f==null||f(W),W.defaultPrevented||h==null||h())},C),V=EC(W=>{const X=W.target;[...g.branches].some(G=>G.contains(X))||(u==null||u(W),f==null||f(W),W.defaultPrevented||h==null||h())},C);return vC(W=>{R===g.layers.size-1&&(a==null||a(W),!W.defaultPrevented&&h&&(W.preventDefault(),h()))},C),y.useEffect(()=>{if(x)return o&&(g.layersWithOutsidePointerEventsDisabled.size===0&&(qm=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),g.layersWithOutsidePointerEventsDisabled.add(x)),g.layers.add(x),Gm(),()=>{o&&g.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=qm)}},[x,C,o,g]),y.useEffect(()=>()=>{x&&(g.layers.delete(x),g.layersWithOutsidePointerEventsDisabled.delete(x),Gm())},[x,g]),y.useEffect(()=>{const W=()=>v({});return document.addEventListener(kd,W),()=>document.removeEventListener(kd,W)},[]),d.jsx(Ue.div,{...m,ref:E,style:{pointerEvents:N?T?"auto":"none":void 0,...t.style},onFocusCapture:Ke(t.onFocusCapture,V.onFocusCapture),onBlurCapture:Ke(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:Ke(t.onPointerDownCapture,U.onPointerDownCapture)})});sf.displayName=xC;var SC="DismissableLayerBranch",CC=y.forwardRef((t,r)=>{const o=y.useContext(Oy),a=y.useRef(null),l=rt(r,a);return y.useEffect(()=>{const u=a.current;if(u)return o.branches.add(u),()=>{o.branches.delete(u)}},[o.branches]),d.jsx(Ue.div,{...t,ref:l})});CC.displayName=SC;function kC(t,r=globalThis==null?void 0:globalThis.document){const o=Io(t),a=y.useRef(!1),l=y.useRef(()=>{});return y.useEffect(()=>{const u=h=>{if(h.target&&!a.current){let m=function(){Ay(wC,o,g,{discrete:!0})};const g={originalEvent:h};h.pointerType==="touch"?(r.removeEventListener("click",l.current),l.current=m,r.addEventListener("click",l.current,{once:!0})):m()}else r.removeEventListener("click",l.current);a.current=!1},f=window.setTimeout(()=>{r.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(f),r.removeEventListener("pointerdown",u),r.removeEventListener("click",l.current)}},[r,o]),{onPointerDownCapture:()=>a.current=!0}}function EC(t,r=globalThis==null?void 0:globalThis.document){const o=Io(t),a=y.useRef(!1);return y.useEffect(()=>{const l=u=>{u.target&&!a.current&&Ay(bC,o,{originalEvent:u},{discrete:!1})};return r.addEventListener("focusin",l),()=>r.removeEventListener("focusin",l)},[r,o]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Gm(){const t=new CustomEvent(kd);document.dispatchEvent(t)}function Ay(t,r,o,{discrete:a}){const l=o.originalEvent.target,u=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:o});r&&l.addEventListener(t,r,{once:!0}),a?yC(l,u):l.dispatchEvent(u)}var Kc="focusScope.autoFocusOnMount",Qc="focusScope.autoFocusOnUnmount",Ym={bubbles:!1,cancelable:!0},NC="FocusScope",af=y.forwardRef((t,r)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...f}=t,[h,m]=y.useState(null),g=Io(l),x=Io(u),b=y.useRef(null),C=rt(r,w=>m(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(a){let w=function(N){if(v.paused||!h)return;const T=N.target;h.contains(T)?b.current=T:$r(b.current,{select:!0})},k=function(N){if(v.paused||!h)return;const T=N.relatedTarget;T!==null&&(h.contains(T)||$r(b.current,{select:!0}))},j=function(N){if(document.activeElement===document.body)for(const U of N)U.removedNodes.length>0&&$r(h)};document.addEventListener("focusin",w),document.addEventListener("focusout",k);const R=new MutationObserver(j);return h&&R.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",k),R.disconnect()}}},[a,h,v.paused]),y.useEffect(()=>{if(h){Jm.add(v);const w=document.activeElement;if(!h.contains(w)){const j=new CustomEvent(Kc,Ym);h.addEventListener(Kc,g),h.dispatchEvent(j),j.defaultPrevented||(PC(IC(Ly(h)),{select:!0}),document.activeElement===w&&$r(h))}return()=>{h.removeEventListener(Kc,g),setTimeout(()=>{const j=new CustomEvent(Qc,Ym);h.addEventListener(Qc,x),h.dispatchEvent(j),j.defaultPrevented||$r(w??document.body,{select:!0}),h.removeEventListener(Qc,x),Jm.remove(v)},0)}}},[h,g,x,v]);const E=y.useCallback(w=>{if(!o&&!a||v.paused)return;const k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,j=document.activeElement;if(k&&j){const R=w.currentTarget,[N,T]=jC(R);N&&T?!w.shiftKey&&j===T?(w.preventDefault(),o&&$r(N,{select:!0})):w.shiftKey&&j===N&&(w.preventDefault(),o&&$r(T,{select:!0})):j===R&&w.preventDefault()}},[o,a,v.paused]);return d.jsx(Ue.div,{tabIndex:-1,...f,ref:C,onKeyDown:E})});af.displayName=NC;function PC(t,{select:r=!1}={}){const o=document.activeElement;for(const a of t)if($r(a,{select:r}),document.activeElement!==o)return}function jC(t){const r=Ly(t),o=Xm(r,t),a=Xm(r.reverse(),t);return[o,a]}function Ly(t){const r=[],o=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;o.nextNode();)r.push(o.currentNode);return r}function Xm(t,r){for(const o of t)if(!RC(o,{upTo:r}))return o}function RC(t,{upTo:r}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(r!==void 0&&t===r)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function MC(t){return t instanceof HTMLInputElement&&"select"in t}function $r(t,{select:r=!1}={}){if(t&&t.focus){const o=document.activeElement;t.focus({preventScroll:!0}),t!==o&&MC(t)&&r&&t.select()}}var Jm=TC();function TC(){let t=[];return{add(r){const o=t[0];r!==o&&(o==null||o.pause()),t=Zm(t,r),t.unshift(r)},remove(r){var o;t=Zm(t,r),(o=t[0])==null||o.resume()}}}function Zm(t,r){const o=[...t],a=o.indexOf(r);return a!==-1&&o.splice(a,1),o}function IC(t){return t.filter(r=>r.tagName!=="A")}var OC="Portal",lf=y.forwardRef((t,r)=>{var h;const{container:o,...a}=t,[l,u]=y.useState(!1);Ct(()=>u(!0),[]);const f=o||l&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return f?oy.createPortal(d.jsx(Ue.div,{...a,ref:r}),f):null});lf.displayName=OC;function AC(t,r){return y.useReducer((o,a)=>r[o][a]??o,t)}var Vl=t=>{const{present:r,children:o}=t,a=LC(r),l=typeof o=="function"?o({present:a.isPresent}):y.Children.only(o),u=rt(a.ref,_C(l));return typeof o=="function"||a.isPresent?y.cloneElement(l,{ref:u}):null};Vl.displayName="Presence";function LC(t){const[r,o]=y.useState(),a=y.useRef(null),l=y.useRef(t),u=y.useRef("none"),f=t?"mounted":"unmounted",[h,m]=AC(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const g=dl(a.current);u.current=h==="mounted"?g:"none"},[h]),Ct(()=>{const g=a.current,x=l.current;if(x!==t){const C=u.current,v=dl(g);t?m("MOUNT"):v==="none"||(g==null?void 0:g.display)==="none"?m("UNMOUNT"):m(x&&C!==v?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,m]),Ct(()=>{if(r){let g;const x=r.ownerDocument.defaultView??window,b=v=>{const w=dl(a.current).includes(CSS.escape(v.animationName));if(v.target===r&&w&&(m("ANIMATION_END"),!l.current)){const k=r.style.animationFillMode;r.style.animationFillMode="forwards",g=x.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=k)})}},C=v=>{v.target===r&&(u.current=dl(a.current))};return r.addEventListener("animationstart",C),r.addEventListener("animationcancel",b),r.addEventListener("animationend",b),()=>{x.clearTimeout(g),r.removeEventListener("animationstart",C),r.removeEventListener("animationcancel",b),r.removeEventListener("animationend",b)}}else m("ANIMATION_END")},[r,m]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:y.useCallback(g=>{a.current=g?getComputedStyle(g):null,o(g)},[])}}function dl(t){return(t==null?void 0:t.animationName)||"none"}function _C(t){var a,l;let r=(a=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:a.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?t.ref:(r=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o?t.props.ref:t.props.ref||t.ref)}var qc=0;function _y(){y.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??eg()),document.body.insertAdjacentElement("beforeend",t[1]??eg()),qc++,()=>{qc===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),qc--}},[])}function eg(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Un=function(){return Un=Object.assign||function(r){for(var o,a=1,l=arguments.length;a<l;a++){o=arguments[a];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(r[u]=o[u])}return r},Un.apply(this,arguments)};function Dy(t,r){var o={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&r.indexOf(a)<0&&(o[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,a=Object.getOwnPropertySymbols(t);l<a.length;l++)r.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(t,a[l])&&(o[a[l]]=t[a[l]]);return o}function DC(t,r,o){if(o||arguments.length===2)for(var a=0,l=r.length,u;a<l;a++)(u||!(a in r))&&(u||(u=Array.prototype.slice.call(r,0,a)),u[a]=r[a]);return t.concat(u||Array.prototype.slice.call(r))}var Nl="right-scroll-bar-position",Pl="width-before-scroll-bar",zC="with-scroll-bars-hidden",FC="--removed-body-scroll-bar-size";function Gc(t,r){return typeof t=="function"?t(r):t&&(t.current=r),t}function BC(t,r){var o=y.useState(function(){return{value:t,callback:r,facade:{get current(){return o.value},set current(a){var l=o.value;l!==a&&(o.value=a,o.callback(a,l))}}}})[0];return o.callback=r,o.facade}var UC=typeof window<"u"?y.useLayoutEffect:y.useEffect,tg=new WeakMap;function $C(t,r){var o=BC(null,function(a){return t.forEach(function(l){return Gc(l,a)})});return UC(function(){var a=tg.get(o);if(a){var l=new Set(a),u=new Set(t),f=o.current;l.forEach(function(h){u.has(h)||Gc(h,null)}),u.forEach(function(h){l.has(h)||Gc(h,f)})}tg.set(o,t)},[t]),o}function WC(t){return t}function HC(t,r){r===void 0&&(r=WC);var o=[],a=!1,l={read:function(){if(a)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:t},useMedium:function(u){var f=r(u,a);return o.push(f),function(){o=o.filter(function(h){return h!==f})}},assignSyncMedium:function(u){for(a=!0;o.length;){var f=o;o=[],f.forEach(u)}o={push:function(h){return u(h)},filter:function(){return o}}},assignMedium:function(u){a=!0;var f=[];if(o.length){var h=o;o=[],h.forEach(u),f=o}var m=function(){var x=f;f=[],x.forEach(u)},g=function(){return Promise.resolve().then(m)};g(),o={push:function(x){f.push(x),g()},filter:function(x){return f=f.filter(x),o}}}};return l}function VC(t){t===void 0&&(t={});var r=HC(null);return r.options=Un({async:!0,ssr:!1},t),r}var zy=function(t){var r=t.sideCar,o=Dy(t,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var a=r.read();if(!a)throw new Error("Sidecar medium not found");return y.createElement(a,Un({},o))};zy.isSideCarExport=!0;function KC(t,r){return t.useMedium(r),zy}var Fy=VC(),Yc=function(){},Kl=y.forwardRef(function(t,r){var o=y.useRef(null),a=y.useState({onScrollCapture:Yc,onWheelCapture:Yc,onTouchMoveCapture:Yc}),l=a[0],u=a[1],f=t.forwardProps,h=t.children,m=t.className,g=t.removeScrollBar,x=t.enabled,b=t.shards,C=t.sideCar,v=t.noRelative,E=t.noIsolation,w=t.inert,k=t.allowPinchZoom,j=t.as,R=j===void 0?"div":j,N=t.gapMode,T=Dy(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),U=C,V=$C([o,r]),W=Un(Un({},T),l);return y.createElement(y.Fragment,null,x&&y.createElement(U,{sideCar:Fy,removeScrollBar:g,shards:b,noRelative:v,noIsolation:E,inert:w,setCallbacks:u,allowPinchZoom:!!k,lockRef:o,gapMode:N}),f?y.cloneElement(y.Children.only(h),Un(Un({},W),{ref:V})):y.createElement(R,Un({},W,{className:m,ref:V}),h))});Kl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Kl.classNames={fullWidth:Pl,zeroRight:Nl};var QC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qC(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var r=QC();return r&&t.setAttribute("nonce",r),t}function GC(t,r){t.styleSheet?t.styleSheet.cssText=r:t.appendChild(document.createTextNode(r))}function YC(t){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(t)}var XC=function(){var t=0,r=null;return{add:function(o){t==0&&(r=qC())&&(GC(r,o),YC(r)),t++},remove:function(){t--,!t&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},JC=function(){var t=XC();return function(r,o){y.useEffect(function(){return t.add(r),function(){t.remove()}},[r&&o])}},By=function(){var t=JC(),r=function(o){var a=o.styles,l=o.dynamic;return t(a,l),null};return r},ZC={left:0,top:0,right:0,gap:0},Xc=function(t){return parseInt(t||"",10)||0},ek=function(t){var r=window.getComputedStyle(document.body),o=r[t==="padding"?"paddingLeft":"marginLeft"],a=r[t==="padding"?"paddingTop":"marginTop"],l=r[t==="padding"?"paddingRight":"marginRight"];return[Xc(o),Xc(a),Xc(l)]},tk=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return ZC;var r=ek(t),o=document.documentElement.clientWidth,a=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,a-o+r[2]-r[0])}},nk=By(),ys="data-scroll-locked",rk=function(t,r,o,a){var l=t.left,u=t.top,f=t.right,h=t.gap;return o===void 0&&(o="margin"),`
293
- .`.concat(zC,` {
294
- overflow: hidden `).concat(a,`;
295
- padding-right: `).concat(h,"px ").concat(a,`;
296
- }
297
- body[`).concat(ys,`] {
298
- overflow: hidden `).concat(a,`;
299
- overscroll-behavior: contain;
300
- `).concat([r&&"position: relative ".concat(a,";"),o==="margin"&&`
301
- padding-left: `.concat(l,`px;
302
- padding-top: `).concat(u,`px;
303
- padding-right: `).concat(f,`px;
304
- margin-left:0;
305
- margin-top:0;
306
- margin-right: `).concat(h,"px ").concat(a,`;
307
- `),o==="padding"&&"padding-right: ".concat(h,"px ").concat(a,";")].filter(Boolean).join(""),`
308
- }
309
-
310
- .`).concat(Nl,` {
311
- right: `).concat(h,"px ").concat(a,`;
312
- }
313
-
314
- .`).concat(Pl,` {
315
- margin-right: `).concat(h,"px ").concat(a,`;
316
- }
317
-
318
- .`).concat(Nl," .").concat(Nl,` {
319
- right: 0 `).concat(a,`;
320
- }
321
-
322
- .`).concat(Pl," .").concat(Pl,` {
323
- margin-right: 0 `).concat(a,`;
324
- }
325
-
326
- body[`).concat(ys,`] {
327
- `).concat(FC,": ").concat(h,`px;
328
- }
329
- `)},ng=function(){var t=parseInt(document.body.getAttribute(ys)||"0",10);return isFinite(t)?t:0},ok=function(){y.useEffect(function(){return document.body.setAttribute(ys,(ng()+1).toString()),function(){var t=ng()-1;t<=0?document.body.removeAttribute(ys):document.body.setAttribute(ys,t.toString())}},[])},sk=function(t){var r=t.noRelative,o=t.noImportant,a=t.gapMode,l=a===void 0?"margin":a;ok();var u=y.useMemo(function(){return tk(l)},[l]);return y.createElement(nk,{styles:rk(u,!r,l,o?"":"!important")})},Ed=!1;if(typeof window<"u")try{var fl=Object.defineProperty({},"passive",{get:function(){return Ed=!0,!0}});window.addEventListener("test",fl,fl),window.removeEventListener("test",fl,fl)}catch{Ed=!1}var cs=Ed?{passive:!1}:!1,ak=function(t){return t.tagName==="TEXTAREA"},Uy=function(t,r){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return o[r]!=="hidden"&&!(o.overflowY===o.overflowX&&!ak(t)&&o[r]==="visible")},ik=function(t){return Uy(t,"overflowY")},lk=function(t){return Uy(t,"overflowX")},rg=function(t,r){var o=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var l=$y(t,a);if(l){var u=Wy(t,a),f=u[1],h=u[2];if(f>h)return!0}a=a.parentNode}while(a&&a!==o.body);return!1},uk=function(t){var r=t.scrollTop,o=t.scrollHeight,a=t.clientHeight;return[r,o,a]},ck=function(t){var r=t.scrollLeft,o=t.scrollWidth,a=t.clientWidth;return[r,o,a]},$y=function(t,r){return t==="v"?ik(r):lk(r)},Wy=function(t,r){return t==="v"?uk(r):ck(r)},dk=function(t,r){return t==="h"&&r==="rtl"?-1:1},fk=function(t,r,o,a,l){var u=dk(t,window.getComputedStyle(r).direction),f=u*a,h=o.target,m=r.contains(h),g=!1,x=f>0,b=0,C=0;do{if(!h)break;var v=Wy(t,h),E=v[0],w=v[1],k=v[2],j=w-k-u*E;(E||j)&&$y(t,h)&&(b+=j,C+=E);var R=h.parentNode;h=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!m&&h!==document.body||m&&(r.contains(h)||r===h));return(x&&Math.abs(b)<1||!x&&Math.abs(C)<1)&&(g=!0),g},hl=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},og=function(t){return[t.deltaX,t.deltaY]},sg=function(t){return t&&"current"in t?t.current:t},hk=function(t,r){return t[0]===r[0]&&t[1]===r[1]},pk=function(t){return`
330
- .block-interactivity-`.concat(t,` {pointer-events: none;}
331
- .allow-interactivity-`).concat(t,` {pointer-events: all;}
332
- `)},mk=0,ds=[];function gk(t){var r=y.useRef([]),o=y.useRef([0,0]),a=y.useRef(),l=y.useState(mk++)[0],u=y.useState(By)[0],f=y.useRef(t);y.useEffect(function(){f.current=t},[t]),y.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var w=DC([t.lockRef.current],(t.shards||[]).map(sg),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var h=y.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!f.current.allowPinchZoom;var j=hl(w),R=o.current,N="deltaX"in w?w.deltaX:R[0]-j[0],T="deltaY"in w?w.deltaY:R[1]-j[1],U,V=w.target,W=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in w&&W==="h"&&V.type==="range")return!1;var X=window.getSelection(),H=X&&X.anchorNode,G=H?H===V||H.contains(V):!1;if(G)return!1;var _=rg(W,V);if(!_)return!0;if(_?U=W:(U=W==="v"?"h":"v",_=rg(W,V)),!_)return!1;if(!a.current&&"changedTouches"in w&&(N||T)&&(a.current=U),!U)return!0;var L=a.current||U;return fk(L,k,w,L==="h"?N:T)},[]),m=y.useCallback(function(w){var k=w;if(!(!ds.length||ds[ds.length-1]!==u)){var j="deltaY"in k?og(k):hl(k),R=r.current.filter(function(U){return U.name===k.type&&(U.target===k.target||k.target===U.shadowParent)&&hk(U.delta,j)})[0];if(R&&R.should){k.cancelable&&k.preventDefault();return}if(!R){var N=(f.current.shards||[]).map(sg).filter(Boolean).filter(function(U){return U.contains(k.target)}),T=N.length>0?h(k,N[0]):!f.current.noIsolation;T&&k.cancelable&&k.preventDefault()}}},[]),g=y.useCallback(function(w,k,j,R){var N={name:w,delta:k,target:j,should:R,shadowParent:yk(j)};r.current.push(N),setTimeout(function(){r.current=r.current.filter(function(T){return T!==N})},1)},[]),x=y.useCallback(function(w){o.current=hl(w),a.current=void 0},[]),b=y.useCallback(function(w){g(w.type,og(w),w.target,h(w,t.lockRef.current))},[]),C=y.useCallback(function(w){g(w.type,hl(w),w.target,h(w,t.lockRef.current))},[]);y.useEffect(function(){return ds.push(u),t.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:C}),document.addEventListener("wheel",m,cs),document.addEventListener("touchmove",m,cs),document.addEventListener("touchstart",x,cs),function(){ds=ds.filter(function(w){return w!==u}),document.removeEventListener("wheel",m,cs),document.removeEventListener("touchmove",m,cs),document.removeEventListener("touchstart",x,cs)}},[]);var v=t.removeScrollBar,E=t.inert;return y.createElement(y.Fragment,null,E?y.createElement(u,{styles:pk(l)}):null,v?y.createElement(sk,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function yk(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const vk=KC(Fy,gk);var uf=y.forwardRef(function(t,r){return y.createElement(Kl,Un({},t,{ref:r,sideCar:vk}))});uf.classNames=Kl.classNames;var xk=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},fs=new WeakMap,pl=new WeakMap,ml={},Jc=0,Hy=function(t){return t&&(t.host||Hy(t.parentNode))},wk=function(t,r){return r.map(function(o){if(t.contains(o))return o;var a=Hy(o);return a&&t.contains(a)?a:(console.error("aria-hidden",o,"in not contained inside",t,". Doing nothing"),null)}).filter(function(o){return!!o})},bk=function(t,r,o,a){var l=wk(r,Array.isArray(t)?t:[t]);ml[o]||(ml[o]=new WeakMap);var u=ml[o],f=[],h=new Set,m=new Set(l),g=function(b){!b||h.has(b)||(h.add(b),g(b.parentNode))};l.forEach(g);var x=function(b){!b||m.has(b)||Array.prototype.forEach.call(b.children,function(C){if(h.has(C))x(C);else try{var v=C.getAttribute(a),E=v!==null&&v!=="false",w=(fs.get(C)||0)+1,k=(u.get(C)||0)+1;fs.set(C,w),u.set(C,k),f.push(C),w===1&&E&&pl.set(C,!0),k===1&&C.setAttribute(o,"true"),E||C.setAttribute(a,"true")}catch(j){console.error("aria-hidden: cannot operate on ",C,j)}})};return x(r),h.clear(),Jc++,function(){f.forEach(function(b){var C=fs.get(b)-1,v=u.get(b)-1;fs.set(b,C),u.set(b,v),C||(pl.has(b)||b.removeAttribute(a),pl.delete(b)),v||b.removeAttribute(o)}),Jc--,Jc||(fs=new WeakMap,fs=new WeakMap,pl=new WeakMap,ml={})}},Vy=function(t,r,o){o===void 0&&(o="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),l=xk(t);return l?(a.push.apply(a,Array.from(l.querySelectorAll("[aria-live], script"))),bk(a,l,o,"aria-hidden")):function(){return null}},Ql="Dialog",[Ky]=Hl(Ql),[Sk,kn]=Ky(Ql),Qy=t=>{const{__scopeDialog:r,children:o,open:a,defaultOpen:l,onOpenChange:u,modal:f=!0}=t,h=y.useRef(null),m=y.useRef(null),[g,x]=Cd({prop:a,defaultProp:l??!1,onChange:u,caller:Ql});return d.jsx(Sk,{scope:r,triggerRef:h,contentRef:m,contentId:gs(),titleId:gs(),descriptionId:gs(),open:g,onOpenChange:x,onOpenToggle:y.useCallback(()=>x(b=>!b),[x]),modal:f,children:o})};Qy.displayName=Ql;var qy="DialogTrigger",Ck=y.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=kn(qy,o),u=rt(r,l.triggerRef);return d.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":ff(l.open),...a,ref:u,onClick:Ke(t.onClick,l.onOpenToggle)})});Ck.displayName=qy;var cf="DialogPortal",[kk,Gy]=Ky(cf,{forceMount:void 0}),Yy=t=>{const{__scopeDialog:r,forceMount:o,children:a,container:l}=t,u=kn(cf,r);return d.jsx(kk,{scope:r,forceMount:o,children:y.Children.map(a,f=>d.jsx(Vl,{present:o||u.open,children:d.jsx(lf,{asChild:!0,container:l,children:f})}))})};Yy.displayName=cf;var Al="DialogOverlay",Xy=y.forwardRef((t,r)=>{const o=Gy(Al,t.__scopeDialog),{forceMount:a=o.forceMount,...l}=t,u=kn(Al,t.__scopeDialog);return u.modal?d.jsx(Vl,{present:a||u.open,children:d.jsx(Nk,{...l,ref:r})}):null});Xy.displayName=Al;var Ek=Oa("DialogOverlay.RemoveScroll"),Nk=y.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=kn(Al,o);return d.jsx(uf,{as:Ek,allowPinchZoom:!0,shards:[l.contentRef],children:d.jsx(Ue.div,{"data-state":ff(l.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Oo="DialogContent",Jy=y.forwardRef((t,r)=>{const o=Gy(Oo,t.__scopeDialog),{forceMount:a=o.forceMount,...l}=t,u=kn(Oo,t.__scopeDialog);return d.jsx(Vl,{present:a||u.open,children:u.modal?d.jsx(Pk,{...l,ref:r}):d.jsx(jk,{...l,ref:r})})});Jy.displayName=Oo;var Pk=y.forwardRef((t,r)=>{const o=kn(Oo,t.__scopeDialog),a=y.useRef(null),l=rt(r,o.contentRef,a);return y.useEffect(()=>{const u=a.current;if(u)return Vy(u)},[]),d.jsx(Zy,{...t,ref:l,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ke(t.onCloseAutoFocus,u=>{var f;u.preventDefault(),(f=o.triggerRef.current)==null||f.focus()}),onPointerDownOutside:Ke(t.onPointerDownOutside,u=>{const f=u.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&u.preventDefault()}),onFocusOutside:Ke(t.onFocusOutside,u=>u.preventDefault())})}),jk=y.forwardRef((t,r)=>{const o=kn(Oo,t.__scopeDialog),a=y.useRef(!1),l=y.useRef(!1);return d.jsx(Zy,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{var f,h;(f=t.onCloseAutoFocus)==null||f.call(t,u),u.defaultPrevented||(a.current||(h=o.triggerRef.current)==null||h.focus(),u.preventDefault()),a.current=!1,l.current=!1},onInteractOutside:u=>{var m,g;(m=t.onInteractOutside)==null||m.call(t,u),u.defaultPrevented||(a.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=u.target;((g=o.triggerRef.current)==null?void 0:g.contains(f))&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),Zy=y.forwardRef((t,r)=>{const{__scopeDialog:o,trapFocus:a,onOpenAutoFocus:l,onCloseAutoFocus:u,...f}=t,h=kn(Oo,o),m=y.useRef(null),g=rt(r,m);return _y(),d.jsxs(d.Fragment,{children:[d.jsx(af,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:l,onUnmountAutoFocus:u,children:d.jsx(sf,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":ff(h.open),...f,ref:g,onDismiss:()=>h.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Rk,{titleId:h.titleId}),d.jsx(Tk,{contentRef:m,descriptionId:h.descriptionId})]})]})}),df="DialogTitle",ev=y.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=kn(df,o);return d.jsx(Ue.h2,{id:l.titleId,...a,ref:r})});ev.displayName=df;var tv="DialogDescription",nv=y.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=kn(tv,o);return d.jsx(Ue.p,{id:l.descriptionId,...a,ref:r})});nv.displayName=tv;var rv="DialogClose",ov=y.forwardRef((t,r)=>{const{__scopeDialog:o,...a}=t,l=kn(rv,o);return d.jsx(Ue.button,{type:"button",...a,ref:r,onClick:Ke(t.onClick,()=>l.onOpenChange(!1))})});ov.displayName=rv;function ff(t){return t?"open":"closed"}var sv="DialogTitleWarning",[IP,av]=oC(sv,{contentName:Oo,titleName:df,docsSlug:"dialog"}),Rk=({titleId:t})=>{const r=av(sv),o=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
333
-
334
- If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
335
-
336
- For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(o))},[o,t]),null},Mk="DialogDescriptionWarning",Tk=({contentRef:t,descriptionId:r})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${av(Mk).contentName}}.`;return y.useEffect(()=>{var u;const l=(u=t.current)==null?void 0:u.getAttribute("aria-describedby");r&&l&&(document.getElementById(r)||console.warn(a))},[a,t,r]),null},Ik=Qy,Ok=Yy,iv=Xy,lv=Jy,uv=ev,cv=nv,Ak=ov;const dv=Ik,Lk=Ok,fv=y.forwardRef(({className:t,...r},o)=>d.jsx(iv,{ref:o,className:ve("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));fv.displayName=iv.displayName;const hf=y.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(Lk,{children:[d.jsx(fv,{}),d.jsxs(lv,{ref:a,className:ve("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200 bg-white p-6 shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-xl",t),...o,children:[r,d.jsxs(Ak,{className:"absolute right-4 top-4 rounded-lg p-1 opacity-70 ring-offset-white transition-all duration-fast hover:opacity-100 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none",children:[d.jsx(rf,{className:"h-4 w-4 text-gray-500"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hf.displayName=lv.displayName;const pf=({className:t,...r})=>d.jsx("div",{className:ve("flex flex-col space-y-2 text-center sm:text-left",t),...r});pf.displayName="DialogHeader";const mf=({className:t,...r})=>d.jsx("div",{className:ve("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3",t),...r});mf.displayName="DialogFooter";const gf=y.forwardRef(({className:t,...r},o)=>d.jsx(uv,{ref:o,className:ve("text-lg font-semibold leading-tight tracking-tight text-gray-900",t),...r}));gf.displayName=uv.displayName;const yf=y.forwardRef(({className:t,...r},o)=>d.jsx(cv,{ref:o,className:ve("text-sm text-gray-500 leading-relaxed",t),...r}));yf.displayName=cv.displayName;function _k({maskedValue:t,isSet:r,className:o,...a}){const[l,u]=y.useState(!1);return d.jsxs("div",{className:"relative",children:[d.jsx(Ve,{type:l?"text":"password",className:ve("pr-20",o),placeholder:r?`${Y("apiKeySet")} (Unchanged)`:"",...a}),d.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:(r||t)&&d.jsx(st,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>u(!l),children:l?d.jsx(RS,{className:"h-4 w-4"}):d.jsx(MS,{className:"h-4 w-4"})})})]})}function Dk({value:t,onChange:r,className:o}){const a=t?Object.entries(t):[],l=(h,m,g)=>{const x=[...a];x[h]=[m,g],r(Object.fromEntries(x))},u=()=>{r({...t,"":""})},f=h=>{const m=a.filter((g,x)=>x!==h);r(Object.fromEntries(m))};return d.jsxs("div",{className:ve("space-y-2",o),children:[a.map(([h,m],g)=>d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ve,{type:"text",value:h,onChange:x=>l(g,x.target.value,m),placeholder:Y("headerName"),className:"flex-1"}),d.jsx(Ve,{type:"text",value:m,onChange:x=>l(g,h,x.target.value),placeholder:Y("headerValue"),className:"flex-1"}),d.jsx(st,{type:"button",variant:"ghost",size:"icon",onClick:()=>f(g),children:d.jsx(wd,{className:"h-4 w-4 text-red-500"})})]},g)),d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:u,children:[d.jsx(xd,{className:"h-4 w-4 mr-2"}),Y("add")]})]})}function zk(){const{providerModal:t,closeProviderModal:r}=Ha(),{data:o}=Ds(),{data:a}=of(),{data:l}=zs(),u=H2(),[f,h]=y.useState(""),[m,g]=y.useState(""),[x,b]=y.useState(null),[C,v]=y.useState("auto"),E=t.provider,w=a==null?void 0:a.providers.find(W=>W.name===E),k=E?o==null?void 0:o.providers[E]:null,j=l==null?void 0:l.uiHints,R=E?gt(`providers.${E}.apiKey`,j):void 0,N=E?gt(`providers.${E}.apiBase`,j):void 0,T=E?gt(`providers.${E}.extraHeaders`,j):void 0,U=E?gt(`providers.${E}.wireApi`,j):void 0;y.useEffect(()=>{if(k){g(k.apiBase||(w==null?void 0:w.defaultApiBase)||""),b(k.extraHeaders||null),h("");const W=k.wireApi||(w==null?void 0:w.defaultWireApi)||"auto";v(W)}},[k,w]);const V=W=>{W.preventDefault();const X={};if(f!==""&&(X.apiKey=f),m&&m!==(w==null?void 0:w.defaultApiBase)&&(X.apiBase=m),x&&Object.keys(x).length>0&&(X.extraHeaders=x),w!=null&&w.supportsWireApi){const H=(k==null?void 0:k.wireApi)||w.defaultWireApi||"auto";C!==H&&(X.wireApi=C)}E&&u.mutate({provider:E,data:X},{onSuccess:()=>r()})};return d.jsx(dv,{open:t.open,onOpenChange:r,children:d.jsxs(hf,{className:"sm:max-w-[500px]",children:[d.jsx(pf,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"h-10 w-10 rounded-xl bg-primary flex items-center justify-center",children:d.jsx(Ol,{className:"h-5 w-5 text-white"})}),d.jsxs("div",{children:[d.jsx(gf,{children:(w==null?void 0:w.displayName)||E}),d.jsx(yf,{children:"Configure API keys and parameters for AI provider"})]})]})}),d.jsxs("form",{onSubmit:V,className:"flex flex-col pt-2",children:[d.jsxs("div",{className:"space-y-5 max-h-[60vh] overflow-y-auto pr-1",children:[d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(ur,{htmlFor:"apiKey",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Ol,{className:"h-3.5 w-3.5 text-gray-500"}),(R==null?void 0:R.label)??Y("apiKey")]}),d.jsx(_k,{id:"apiKey",value:f,isSet:k==null?void 0:k.apiKeySet,onChange:W=>h(W.target.value),placeholder:k!=null&&k.apiKeySet?Y("apiKeySet"):(R==null?void 0:R.placeholder)??"Enter API Key",className:"rounded-xl"})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(ur,{htmlFor:"apiBase",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(jy,{className:"h-3.5 w-3.5 text-gray-500"}),(N==null?void 0:N.label)??Y("apiBase")]}),d.jsx(Ve,{id:"apiBase",type:"text",value:m,onChange:W=>g(W.target.value),placeholder:(w==null?void 0:w.defaultApiBase)||(N==null?void 0:N.placeholder)||"https://api.example.com",className:"rounded-xl"}),(N==null?void 0:N.help)&&d.jsx("p",{className:"text-xs text-gray-500",children:N.help})]}),(w==null?void 0:w.supportsWireApi)&&d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(ur,{htmlFor:"wireApi",className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Il,{className:"h-3.5 w-3.5 text-gray-500"}),(U==null?void 0:U.label)??Y("wireApi")]}),d.jsx("select",{id:"wireApi",value:C,onChange:W=>v(W.target.value),className:"flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",children:(w.wireApiOptions||["auto","chat","responses"]).map(W=>d.jsx("option",{value:W,children:Y(W==="chat"?"wireApiChat":W==="responses"?"wireApiResponses":"wireApiAuto")},W))})]}),d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(ur,{className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[d.jsx(Il,{className:"h-3.5 w-3.5 text-gray-500"}),(T==null?void 0:T.label)??Y("extraHeaders")]}),d.jsx(Dk,{value:x,onChange:b})]})]}),d.jsxs(mf,{className:"pt-4 flex-shrink-0",children:[d.jsx(st,{type:"button",variant:"outline",onClick:r,children:Y("cancel")}),d.jsx(st,{type:"submit",disabled:u.isPending,children:u.isPending?"Saving...":Y("save")})]})]})]})})}function vf({tabs:t,activeTab:r,onChange:o,className:a}){return d.jsx("div",{className:ve("flex items-center gap-8 border-b border-gray-200 mb-8",a),children:t.map(l=>{const u=r===l.id;return d.jsxs("button",{onClick:()=>o(l.id),className:ve("relative pb-4 text-[15px] font-semibold transition-all duration-fast flex items-center gap-2",u?"text-primary":"text-gray-500 hover:text-gray-700"),children:[l.label,l.count!==void 0&&d.jsx("span",{className:"text-[11px] font-medium text-gray-400",children:l.count.toLocaleString()}),u&&d.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 bg-primary animate-in fade-in slide-in-from-left-2 duration-300"})]},l.id)})})}function hv({name:t,src:r,className:o,imgClassName:a,fallback:l}){const[u,f]=y.useState(!1),h=!!r&&!u;return d.jsx("div",{className:ve("flex items-center justify-center",o),children:h?d.jsx("img",{src:r,alt:`${t} logo`,className:ve("h-6 w-6 object-contain",a),onError:()=>f(!0),draggable:!1}):l??d.jsx("span",{className:"text-lg font-bold uppercase",children:t.slice(0,1)})})}const Fk={openrouter:"openrouter.svg",aihubmix:"aihubmix.png",anthropic:"anthropic.svg",openai:"openai.svg",gemini:"gemini.svg",deepseek:"deepseek.png",zhipu:"zhipu.svg",dashscope:"dashscope.png",moonshot:"moonshot.png",minimax:"minimax.svg",vllm:"vllm.svg",groq:"groq.svg"},Bk={telegram:"telegram.svg",slack:"slack.svg",discord:"discord.svg",whatsapp:"whatsapp.svg",qq:"qq.svg",feishu:"feishu.svg",dingtalk:"dingtalk.svg",wecom:"wecom.svg",mochat:"mochat.svg",email:"email.svg"};function pv(t,r){const o=r.toLowerCase(),a=t[o];return a?`/logos/${a}`:null}function Uk(t){return pv(Fk,t)}function $k(t){return pv(Bk,t)}function Wk(){const{data:t}=Ds(),{data:r}=of(),{data:o}=zs(),{openProviderModal:a}=Ha(),[l,u]=y.useState("installed"),f=o==null?void 0:o.uiHints;if(!t||!r)return d.jsx("div",{className:"p-8",children:"Loading..."});const h=[{id:"installed",label:"Configured",count:t.providers?Object.keys(t.providers).filter(g=>t.providers[g].apiKeySet).length:0},{id:"all",label:"All Providers"}],m=l==="installed"?r.providers.filter(g=>{var x;return(x=t.providers[g.name])==null?void 0:x.apiKeySet}):r.providers;return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsx("div",{className:"flex items-center justify-between mb-8",children:d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"AI Providers"})}),d.jsx(vf,{tabs:h,activeTab:l,onChange:u}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:m.map(g=>{const x=t.providers[g.name],b=x==null?void 0:x.apiKeySet,C=gt(`providers.${g.name}`,f),v=(C==null?void 0:C.help)||"Configure AI services for your agents";return d.jsxs("div",{className:ve("group relative flex-col p-5 rounded-2xl border transition-all duration-base cursor-pointer","hover:shadow-card-hover hover:-translate-y-0.5",b?"bg-white border-gray-200 shadow-sm":"bg-white border-transparent shadow-sm hover:border-gray-200"),onClick:()=>a(g.name),children:[d.jsxs("div",{className:"flex items-start justify-between mb-4",children:[d.jsx(hv,{name:g.name,src:Uk(g.name),className:ve("h-12 w-12 rounded-xl border transition-all",b?"bg-white border-primary":"bg-white border-gray-200 group-hover:border-gray-300"),imgClassName:"h-7 w-7",fallback:d.jsx("span",{className:ve("text-lg font-bold uppercase",b?"text-gray-900":"text-gray-500"),children:g.name[0]})}),b?d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 text-emerald-600",children:[d.jsx(Ey,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Ready"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-100 text-gray-500",children:[d.jsx(tf,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Setup"})]})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-1",children:g.displayName||g.name}),d.jsx("p",{className:"text-[12px] text-gray-500 leading-relaxed line-clamp-2",children:v})]}),d.jsx("div",{className:"mt-4 pt-3",children:d.jsxs("span",{className:"inline-flex items-center gap-1 text-[13px] font-semibold text-gray-600 group-hover:text-primary transition-colors cursor-pointer",children:[b?"Configure":"Add Provider",d.jsx(Jd,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]})})]},g.name)})}),m.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx("div",{className:"h-16 w-16 flex items-center justify-center rounded-2xl bg-gray-100 mb-4",children:d.jsx(Ol,{className:"h-8 w-8 text-gray-400"})}),d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-2",children:"No providers configured"}),d.jsx("p",{className:"text-[13px] text-gray-500 max-w-sm",children:"Add an AI provider to start using the platform. Click on any provider to configure it."})]}),d.jsx(zk,{})]})}const xf=y.forwardRef(({className:t,checked:r=!1,onCheckedChange:o,...a},l)=>d.jsx("button",{type:"button",role:"switch","aria-checked":r,ref:l,className:ve("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",r?"bg-primary":"bg-gray-200 hover:bg-gray-300",t),onClick:()=>o==null?void 0:o(!r),...a,children:d.jsx("span",{className:ve("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast",r?"translate-x-5":"translate-x-0")})}));xf.displayName="Switch";function Hk({value:t,onChange:r,className:o,placeholder:a="Type and press Enter..."}){const[l,u]=y.useState(""),f=m=>{m.key==="Enter"&&l.trim()?(m.preventDefault(),r([...t,l.trim()]),u("")):m.key==="Backspace"&&!l&&t.length>0&&r(t.slice(0,-1))},h=m=>{r(t.filter((g,x)=>x!==m))};return d.jsxs("div",{className:ve("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",o),children:[t.map((m,g)=>d.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[m,d.jsx("button",{type:"button",onClick:()=>h(g),className:"hover:text-red-300 transition-colors",children:d.jsx(rf,{className:"h-3 w-3"})})]},g)),d.jsx("input",{type:"text",value:l,onChange:m=>u(m.target.value),onKeyDown:f,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:a})]})}const ag=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],ig=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],Vk=t=>t.includes("token")||t.includes("secret")||t.includes("password")?d.jsx(Ol,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("url")||t.includes("host")?d.jsx(jy,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("email")||t.includes("mail")?d.jsx(Zd,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("id")||t.includes("from")?d.jsx(Il,{className:"h-3.5 w-3.5 text-gray-500"}):t==="enabled"||t==="consentGranted"?d.jsx(WS,{className:"h-3.5 w-3.5 text-gray-500"}):d.jsx(tf,{className:"h-3.5 w-3.5 text-gray-500"}),Kk={telegram:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"token",type:"password",label:Y("botToken")},{name:"allowFrom",type:"tags",label:Y("allowFrom")},{name:"proxy",type:"text",label:Y("proxy")},{name:"accountId",type:"text",label:"Account ID"},{name:"dmPolicy",type:"select",label:"DM Policy",options:ag},{name:"groupPolicy",type:"select",label:"Group Policy",options:ig},{name:"groupAllowFrom",type:"tags",label:"Group Allow From"},{name:"requireMention",type:"boolean",label:"Require Mention"},{name:"mentionPatterns",type:"tags",label:"Mention Patterns"},{name:"groups",type:"json",label:"Group Rules (JSON)"}],discord:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"token",type:"password",label:Y("botToken")},{name:"allowBots",type:"boolean",label:"Allow Bot Messages"},{name:"allowFrom",type:"tags",label:Y("allowFrom")},{name:"gatewayUrl",type:"text",label:Y("gatewayUrl")},{name:"intents",type:"number",label:Y("intents")},{name:"proxy",type:"text",label:Y("proxy")},{name:"mediaMaxMb",type:"number",label:"Attachment Max Size (MB)"},{name:"accountId",type:"text",label:"Account ID"},{name:"dmPolicy",type:"select",label:"DM Policy",options:ag},{name:"groupPolicy",type:"select",label:"Group Policy",options:ig},{name:"groupAllowFrom",type:"tags",label:"Group Allow From"},{name:"requireMention",type:"boolean",label:"Require Mention"},{name:"mentionPatterns",type:"tags",label:"Mention Patterns"},{name:"groups",type:"json",label:"Group Rules (JSON)"}],whatsapp:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"bridgeUrl",type:"text",label:Y("bridgeUrl")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"appId",type:"text",label:Y("appId")},{name:"appSecret",type:"password",label:Y("appSecret")},{name:"encryptKey",type:"password",label:Y("encryptKey")},{name:"verificationToken",type:"password",label:Y("verificationToken")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"clientId",type:"text",label:Y("clientId")},{name:"clientSecret",type:"password",label:Y("clientSecret")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"corpId",type:"text",label:Y("corpId")},{name:"agentId",type:"text",label:Y("agentId")},{name:"secret",type:"password",label:Y("secret")},{name:"token",type:"password",label:Y("token")},{name:"callbackPort",type:"number",label:Y("callbackPort")},{name:"callbackPath",type:"text",label:Y("callbackPath")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"mode",type:"text",label:Y("mode")},{name:"webhookPath",type:"text",label:Y("webhookPath")},{name:"allowBots",type:"boolean",label:"Allow Bot Messages"},{name:"botToken",type:"password",label:Y("botToken")},{name:"appToken",type:"password",label:Y("appToken")}],email:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"consentGranted",type:"boolean",label:Y("consentGranted")},{name:"imapHost",type:"text",label:Y("imapHost")},{name:"imapPort",type:"number",label:Y("imapPort")},{name:"imapUsername",type:"text",label:Y("imapUsername")},{name:"imapPassword",type:"password",label:Y("imapPassword")},{name:"fromAddress",type:"email",label:Y("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"baseUrl",type:"text",label:Y("baseUrl")},{name:"clawToken",type:"password",label:Y("clawToken")},{name:"agentUserId",type:"text",label:Y("agentUserId")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:Y("enabled")},{name:"appId",type:"text",label:Y("appId")},{name:"secret",type:"password",label:Y("appSecret")},{name:"markdownSupport",type:"boolean",label:Y("markdownSupport")},{name:"allowFrom",type:"tags",label:Y("allowFrom")}]},lg={telegram:ps,slack:ps,email:Zd,default:ps},ug={telegram:"from-sky-400 to-blue-500",slack:"from-purple-400 to-indigo-500",email:"from-rose-400 to-pink-500",default:"from-slate-400 to-gray-500"};function Ll(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function mv(t,r){const o={...t};for(const[a,l]of Object.entries(r)){const u=o[a];if(Ll(u)&&Ll(l)){o[a]=mv(u,l);continue}o[a]=l}return o}function Qk(t,r){const o=t.split("."),a={};let l=a;for(let u=0;u<o.length-1;u+=1){const f=o[u];l[f]={},l=l[f]}return l[o[o.length-1]]=r,a}function qk(){var H,G;const{channelModal:t,closeChannelModal:r}=Ha(),{data:o}=Ds(),{data:a}=zs(),l=V2(),u=Q2(),[f,h]=y.useState({}),[m,g]=y.useState({}),[x,b]=y.useState(null),C=t.channel,v=C?o==null?void 0:o.channels[C]:null,E=y.useMemo(()=>C?Kk[C]:[],[C]),w=a==null?void 0:a.uiHints,k=C?`channels.${C}`:null,j=((H=a==null?void 0:a.actions)==null?void 0:H.filter(_=>_.scope===k))??[],R=C&&(((G=gt(`channels.${C}`,w))==null?void 0:G.label)??C);y.useEffect(()=>{if(v){h({...v});const _={};E.filter(L=>L.type==="json").forEach(L=>{const B=v[L.name];_[L.name]=JSON.stringify(B??{},null,2)}),g(_)}else h({}),g({})},[v,C,E]);const N=(_,L)=>{h(B=>({...B,[_]:L}))},T=_=>{if(_.preventDefault(),!C)return;const L={...f};for(const B of E){if(B.type!=="json")continue;const Q=m[B.name]??"";try{L[B.name]=Q.trim()?JSON.parse(Q):{}}catch{nt.error(`Invalid JSON for ${B.name}`);return}}l.mutate({channel:C,data:L},{onSuccess:()=>r()})},U=_=>{if(!_||!C)return;const L=_.channels;if(!Ll(L))return;const B=L[C];Ll(B)&&h(Q=>mv(Q,B))},V=async _=>{if(!(!C||!k)){b(_.id);try{let L={...f};_.saveBeforeRun&&(L={...L,..._.savePatch??{}},h(L),await l.mutateAsync({channel:C,data:L}));const B=await u.mutateAsync({actionId:_.id,data:{scope:k,draftConfig:Qk(k,L)}});U(B.patch),B.ok?nt.success(B.message||Y("success")):nt.error(B.message||Y("error"))}catch(L){const B=L instanceof Error?L.message:String(L);nt.error(`${Y("error")}: ${B}`)}finally{b(null)}}},W=lg[C||""]||lg.default,X=ug[C||""]||ug.default;return d.jsx(dv,{open:t.open,onOpenChange:r,children:d.jsxs(hf,{className:"sm:max-w-[550px] max-h-[85vh] overflow-hidden flex flex-col",children:[d.jsx(pf,{children:d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:`h-10 w-10 rounded-xl bg-gradient-to-br ${X} flex items-center justify-center`,children:d.jsx(W,{className:"h-5 w-5 text-white"})}),d.jsxs("div",{children:[d.jsx(gf,{className:"capitalize",children:R}),d.jsx(yf,{children:"Configure message channel parameters"})]})]})}),d.jsxs("form",{onSubmit:T,className:"flex flex-col flex-1 overflow-hidden",children:[d.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar py-2 pr-2 space-y-5",children:E.map(_=>{const L=C?gt(`channels.${C}.${_.name}`,w):void 0,B=(L==null?void 0:L.label)??_.label,Q=L==null?void 0:L.placeholder;return d.jsxs("div",{className:"space-y-2.5",children:[d.jsxs(ur,{htmlFor:_.name,className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[Vk(_.name),B]}),_.type==="boolean"&&d.jsxs("div",{className:"flex items-center justify-between p-3 rounded-xl bg-gray-50",children:[d.jsx("span",{className:"text-sm text-gray-500",children:f[_.name]?Y("enabled"):Y("disabled")}),d.jsx(xf,{id:_.name,checked:f[_.name]||!1,onCheckedChange:te=>N(_.name,te),className:"data-[state=checked]:bg-emerald-500"})]}),(_.type==="text"||_.type==="email")&&d.jsx(Ve,{id:_.name,type:_.type,value:f[_.name]||"",onChange:te=>N(_.name,te.target.value),placeholder:Q,className:"rounded-xl"}),_.type==="password"&&d.jsx(Ve,{id:_.name,type:"password",value:f[_.name]||"",onChange:te=>N(_.name,te.target.value),placeholder:Q??"Leave blank to keep unchanged",className:"rounded-xl"}),_.type==="number"&&d.jsx(Ve,{id:_.name,type:"number",value:f[_.name]||0,onChange:te=>N(_.name,parseInt(te.target.value)||0),placeholder:Q,className:"rounded-xl"}),_.type==="tags"&&d.jsx(Hk,{value:f[_.name]||[],onChange:te=>N(_.name,te)}),_.type==="select"&&d.jsx("select",{id:_.name,value:f[_.name]||"",onChange:te=>N(_.name,te.target.value),className:"flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm",children:(_.options??[]).map(te=>d.jsx("option",{value:te.value,children:te.label},te.value))}),_.type==="json"&&d.jsx("textarea",{id:_.name,value:m[_.name]??"{}",onChange:te=>g(ae=>({...ae,[_.name]:te.target.value})),className:"min-h-[120px] w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},_.name)})}),d.jsxs(mf,{className:"pt-4 flex-shrink-0",children:[d.jsx(st,{type:"button",variant:"outline",onClick:r,children:Y("cancel")}),d.jsx(st,{type:"submit",disabled:l.isPending||!!x,children:l.isPending?"Saving...":Y("save")}),j.filter(_=>_.trigger==="manual").map(_=>d.jsx(st,{type:"button",onClick:()=>V(_),disabled:l.isPending||!!x,variant:"secondary",children:x===_.id?Y("connecting"):_.title},_.id))]})]})]})})}const cg={telegram:ps,slack:US,email:Zd,webhook:CS,default:ef},Gk={telegram:"Connect with Telegram bots for instant messaging",slack:"Integrate with Slack workspaces for team collaboration",email:"Send and receive messages via email protocols",webhook:"Receive HTTP webhooks for custom integrations",discord:"Connect Discord bots to your community servers",feishu:"Enterprise messaging and collaboration platform"};function Yk(){const{data:t}=Ds(),{data:r}=of(),{data:o}=zs(),{openChannelModal:a}=Ha(),[l,u]=y.useState("active"),f=o==null?void 0:o.uiHints;if(!t||!r)return d.jsx("div",{className:"p-8 text-gray-400",children:"Loading channels..."});const h=[{id:"active",label:"Enabled",count:r.channels.filter(g=>{var x;return(x=t.channels[g.name])==null?void 0:x.enabled}).length},{id:"all",label:"All Channels",count:r.channels.length}],m=r.channels.filter(g=>{var b;const x=((b=t.channels[g.name])==null?void 0:b.enabled)||!1;return l==="all"||x});return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsx("div",{className:"flex items-center justify-between mb-8",children:d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Message Channels"})}),d.jsx(vf,{tabs:h,activeTab:l,onChange:u}),d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:m.map(g=>{const x=t.channels[g.name],b=(x==null?void 0:x.enabled)||!1,C=cg[g.name]||cg.default,v=gt(`channels.${g.name}`,f),E=(v==null?void 0:v.help)||Gk[g.name]||"Configure this communication channel";return d.jsxs("div",{className:ve("group relative flex flex-col p-5 rounded-2xl border transition-all duration-base cursor-pointer","hover:shadow-card-hover hover:-translate-y-0.5",b?"bg-white border-gray-200 shadow-sm":"bg-white border-transparent shadow-sm hover:border-gray-200"),onClick:()=>a(g.name),children:[d.jsxs("div",{className:"flex items-start justify-between mb-4",children:[d.jsx(hv,{name:g.name,src:$k(g.name),className:ve("h-12 w-12 rounded-xl border transition-all",b?"bg-white border-primary":"bg-white border-gray-200 group-hover:border-gray-300"),imgClassName:"h-6 w-6",fallback:d.jsx(C,{className:"h-6 w-6"})}),b?d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-emerald-50 text-emerald-600",children:[d.jsx(VS,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Active"})]}):d.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 rounded-full bg-gray-100 text-gray-500",children:[d.jsx(FS,{className:"h-3.5 w-3.5"}),d.jsx("span",{className:"text-[11px] font-bold",children:"Inactive"})]})]}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-1",children:g.displayName||g.name}),d.jsx("p",{className:"text-[12px] text-gray-500 leading-relaxed line-clamp-2",children:E})]}),d.jsxs("div",{className:"mt-4 pt-3 flex items-center justify-between",children:[d.jsxs("span",{className:"inline-flex items-center gap-1 text-[13px] font-semibold text-gray-600 group-hover:text-primary transition-colors cursor-pointer",children:[b?"Configure":"Enable",d.jsx(Jd,{className:"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5"})]}),g.tutorialUrl&&d.jsx("a",{href:g.tutorialUrl,target:"_blank",rel:"noreferrer",onClick:w=>w.stopPropagation(),className:"flex items-center justify-center h-7 w-7 rounded-lg text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors",title:"View Guide",children:d.jsx(Py,{className:"h-3.5 w-3.5"})})]})]},g.name)})}),m.length===0&&d.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[d.jsx("div",{className:"h-16 w-16 flex items-center justify-center rounded-2xl bg-gray-100 mb-4",children:d.jsx(ef,{className:"h-8 w-8 text-gray-400"})}),d.jsx("h3",{className:"text-[15px] font-bold text-gray-900 mb-2",children:"No channels enabled"}),d.jsx("p",{className:"text-[13px] text-gray-500 max-w-sm",children:"Enable a messaging channel to start receiving messages. Click on any channel to configure it."})]}),d.jsx(qk,{})]})}const Xk=[{value:"main",label:"main"},{value:"per-peer",label:"per-peer"},{value:"per-channel-peer",label:"per-channel-peer"},{value:"per-account-channel-peer",label:"per-account-channel-peer"}];function Jk(){return{id:"",default:!1,workspace:"",model:"",maxTokens:void 0,contextTokens:void 0,maxToolIterations:void 0}}function Zk(){return{agentId:"",match:{channel:"",accountId:""}}}function Zc(t){const r=t.trim();if(!r)return;const o=Number.parseInt(r,10);return Number.isFinite(o)?o:void 0}function eE(){const{data:t,isLoading:r}=Ds(),{data:o}=zs(),a=K2(),[l,u]=y.useState([]),[f,h]=y.useState([]),[m,g]=y.useState("per-channel-peer"),[x,b]=y.useState(0),[C,v]=y.useState(2e5);y.useEffect(()=>{var H,G,_;t&&(u((t.agents.list??[]).map(L=>({id:L.id??"",default:!!L.default,workspace:L.workspace??"",model:L.model??"",maxTokens:L.maxTokens,contextTokens:L.contextTokens,maxToolIterations:L.maxToolIterations}))),h((t.bindings??[]).map(L=>{var B,Q,te;return{agentId:L.agentId??"",match:{channel:((B=L.match)==null?void 0:B.channel)??"",accountId:((Q=L.match)==null?void 0:Q.accountId)??"",peer:(te=L.match)!=null&&te.peer?{kind:L.match.peer.kind,id:L.match.peer.id}:void 0}}})),g(((H=t.session)==null?void 0:H.dmScope)??"per-channel-peer"),b(((_=(G=t.session)==null?void 0:G.agentToAgent)==null?void 0:_.maxPingPongTurns)??0),v(t.agents.defaults.contextTokens??2e5))},[t]);const E=o==null?void 0:o.uiHints,w=gt("session.dmScope",E),k=gt("session.agentToAgent.maxPingPongTurns",E),j=gt("agents.defaults.contextTokens",E),R=gt("agents.list.*.contextTokens",E),N=gt("agents.list",E),T=gt("bindings",E),U=y.useMemo(()=>{const H=new Set(["main"]);return l.forEach(G=>{const _=G.id.trim();_&&H.add(_)}),H},[l]),V=(H,G)=>{u(_=>_.map((L,B)=>B===H?{...L,...G}:L))},W=(H,G)=>{h(_=>_.map((L,B)=>B===H?G:L))},X=()=>{try{const H=l.map((L,B)=>{var ae,ie;const Q=L.id.trim();if(!Q)throw new Error(`agents.list[${B}].id is required`);const te={id:Q};return L.default&&(te.default=!0),(ae=L.workspace)!=null&&ae.trim()&&(te.workspace=L.workspace.trim()),(ie=L.model)!=null&&ie.trim()&&(te.model=L.model.trim()),typeof L.maxTokens=="number"&&(te.maxTokens=L.maxTokens),typeof L.contextTokens=="number"&&(te.contextTokens=Math.max(1e3,L.contextTokens)),typeof L.maxToolIterations=="number"&&(te.maxToolIterations=L.maxToolIterations),te}),G=H.map(L=>L.id).filter((L,B,Q)=>Q.indexOf(L)!==B);if(G.length>0){nt.error(`Duplicate agent id: ${G[0]}`);return}const _=f.map((L,B)=>{var ee,O,K,le;const Q=L.agentId.trim(),te=L.match.channel.trim(),ae=((ee=L.match.accountId)==null?void 0:ee.trim())??"",ie=(O=L.match.peer)==null?void 0:O.kind,F=((le=(K=L.match.peer)==null?void 0:K.id)==null?void 0:le.trim())??"";if(!Q)throw new Error(`bindings[${B}].agentId is required`);if(!U.has(Q))throw new Error(`bindings[${B}].agentId '${Q}' not found in agents.list/main`);if(!te)throw new Error(`bindings[${B}].match.channel is required`);const q={agentId:Q,match:{channel:te}};if(ae&&(q.match.accountId=ae),ie){if(!F)throw new Error(`bindings[${B}].match.peer.id is required when peer.kind is set`);q.match.peer={kind:ie,id:F}}return q});a.mutate({data:{agents:{defaults:{contextTokens:Math.max(1e3,C)},list:H},bindings:_,session:{dmScope:m,agentToAgent:{maxPingPongTurns:Math.min(5,Math.max(0,x))}}}})}catch(H){const G=H instanceof Error?H.message:String(H);nt.error(G)}};return r||!t?d.jsx("div",{className:"p-8 text-gray-400",children:"Loading runtime settings..."}):d.jsxs("div",{className:"space-y-6 pb-20 animate-fade-in",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Routing & Runtime"}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Align multi-agent routing with OpenClaw: bindings, agent pool, and DM scope."})]}),d.jsxs(ms,{children:[d.jsxs(bl,{children:[d.jsx(Sl,{children:(w==null?void 0:w.label)??"DM Scope"}),d.jsx(Cl,{children:(w==null?void 0:w.help)??"Control how direct-message sessions are isolated."})]}),d.jsxs(kl,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(j==null?void 0:j.label)??"Default Context Tokens"}),d.jsx(Ve,{type:"number",min:1e3,step:1e3,value:C,onChange:H=>v(Math.max(1e3,Number.parseInt(H.target.value,10)||1e3))}),d.jsx("p",{className:"text-xs text-gray-500",children:(j==null?void 0:j.help)??"Input context budget for agents when no per-agent override is set."})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(w==null?void 0:w.label)??"DM Scope"}),d.jsx("select",{value:m,onChange:H=>g(H.target.value),className:"flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm",children:Xk.map(H=>d.jsx("option",{value:H.value,children:H.label},H.value))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("label",{className:"text-sm font-medium text-gray-800",children:(k==null?void 0:k.label)??"Max Ping-Pong Turns"}),d.jsx(Ve,{type:"number",min:0,max:5,value:x,onChange:H=>b(Math.max(0,Number.parseInt(H.target.value,10)||0))}),d.jsx("p",{className:"text-xs text-gray-500",children:(k==null?void 0:k.help)??"Set to 0 to block automatic agent-to-agent ping-pong loops."})]})]})]}),d.jsxs(ms,{children:[d.jsxs(bl,{children:[d.jsx(Sl,{children:(N==null?void 0:N.label)??"Agent List"}),d.jsx(Cl,{children:(N==null?void 0:N.help)??"Run multiple fixed-role agents in one gateway process."})]}),d.jsxs(kl,{className:"space-y-3",children:[l.map((H,G)=>d.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[d.jsx(Ve,{value:H.id,onChange:_=>V(G,{id:_.target.value}),placeholder:"Agent ID (e.g. engineer)"}),d.jsx(Ve,{value:H.workspace??"",onChange:_=>V(G,{workspace:_.target.value}),placeholder:"Workspace override (optional)"}),d.jsx(Ve,{value:H.model??"",onChange:_=>V(G,{model:_.target.value}),placeholder:"Model override (optional)"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[d.jsx(Ve,{type:"number",min:1,value:H.maxTokens??"",onChange:_=>V(G,{maxTokens:Zc(_.target.value)}),placeholder:"Max tokens"}),d.jsx(Ve,{type:"number",min:1e3,step:1e3,value:H.contextTokens??"",onChange:_=>V(G,{contextTokens:Zc(_.target.value)}),placeholder:(R==null?void 0:R.label)??"Context tokens"}),d.jsx(Ve,{type:"number",min:1,value:H.maxToolIterations??"",onChange:_=>V(G,{maxToolIterations:Zc(_.target.value)}),placeholder:"Max tools"})]})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[d.jsx(xf,{checked:!!H.default,onCheckedChange:_=>{if(!_){V(G,{default:!1});return}u(L=>L.map((B,Q)=>({...B,default:Q===G})))}}),d.jsx("span",{children:"Default agent"})]}),d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:()=>u(_=>_.filter((L,B)=>B!==G)),children:[d.jsx(wd,{className:"h-4 w-4 mr-1"}),"Remove"]})]})]},`${G}-${H.id}`)),d.jsxs(st,{type:"button",variant:"outline",onClick:()=>u(H=>[...H,Jk()]),children:[d.jsx(xd,{className:"h-4 w-4 mr-2"}),"Add Agent"]})]})]}),d.jsxs(ms,{children:[d.jsxs(bl,{children:[d.jsx(Sl,{children:(T==null?void 0:T.label)??"Bindings"}),d.jsx(Cl,{children:(T==null?void 0:T.help)??"Route inbound message by channel + account + peer to target agent."})]}),d.jsxs(kl,{className:"space-y-3",children:[f.map((H,G)=>{var L,B;const _=((L=H.match.peer)==null?void 0:L.kind)??"";return d.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[d.jsx(Ve,{value:H.agentId,onChange:Q=>W(G,{...H,agentId:Q.target.value}),placeholder:"Target agent ID"}),d.jsx(Ve,{value:H.match.channel,onChange:Q=>W(G,{...H,match:{...H.match,channel:Q.target.value}}),placeholder:"Channel (e.g. discord)"}),d.jsx(Ve,{value:H.match.accountId??"",onChange:Q=>W(G,{...H,match:{...H.match,accountId:Q.target.value}}),placeholder:"Account ID (optional)"}),d.jsxs("select",{value:_,onChange:Q=>{var ae;const te=Q.target.value;if(!te){W(G,{...H,match:{...H.match,peer:void 0}});return}W(G,{...H,match:{...H.match,peer:{kind:te,id:((ae=H.match.peer)==null?void 0:ae.id)??""}}})},className:"flex h-10 w-full rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm",children:[d.jsx("option",{value:"",children:"Peer kind (optional)"}),d.jsx("option",{value:"direct",children:"direct"}),d.jsx("option",{value:"group",children:"group"}),d.jsx("option",{value:"channel",children:"channel"})]}),d.jsx(Ve,{value:((B=H.match.peer)==null?void 0:B.id)??"",onChange:Q=>W(G,{...H,match:{...H.match,peer:_?{kind:_,id:Q.target.value}:void 0}}),placeholder:"Peer ID (requires peer kind)"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(st,{type:"button",variant:"outline",size:"sm",onClick:()=>h(Q=>Q.filter((te,ae)=>ae!==G)),children:[d.jsx(wd,{className:"h-4 w-4 mr-1"}),"Remove"]})})]},`${G}-${H.agentId}`)}),d.jsxs(st,{type:"button",variant:"outline",onClick:()=>h(H=>[...H,Zk()]),children:[d.jsx(xd,{className:"h-4 w-4 mr-2"}),"Add Binding"]})]})]}),d.jsx("div",{className:"flex justify-end",children:d.jsxs(st,{type:"button",onClick:X,disabled:a.isPending,children:[d.jsx(BS,{className:"h-4 w-4 mr-2"}),a.isPending?"Saving...":"Save Runtime Settings"]})})]})}function dg(t,[r,o]){return Math.min(o,Math.max(r,t))}function tE(t){const r=t+"CollectionProvider",[o,a]=Hl(r),[l,u]=o(r,{collectionRef:{current:null},itemMap:new Map}),f=w=>{const{scope:k,children:j}=w,R=se.useRef(null),N=se.useRef(new Map).current;return d.jsx(l,{scope:k,itemMap:N,collectionRef:R,children:j})};f.displayName=r;const h=t+"CollectionSlot",m=Oa(h),g=se.forwardRef((w,k)=>{const{scope:j,children:R}=w,N=u(h,j),T=rt(k,N.collectionRef);return d.jsx(m,{ref:T,children:R})});g.displayName=h;const x=t+"CollectionItemSlot",b="data-radix-collection-item",C=Oa(x),v=se.forwardRef((w,k)=>{const{scope:j,children:R,...N}=w,T=se.useRef(null),U=rt(k,T),V=u(x,j);return se.useEffect(()=>(V.itemMap.set(T,{ref:T,...N}),()=>void V.itemMap.delete(T))),d.jsx(C,{[b]:"",ref:U,children:R})});v.displayName=x;function E(w){const k=u(t+"CollectionConsumer",w);return se.useCallback(()=>{const R=k.collectionRef.current;if(!R)return[];const N=Array.from(R.querySelectorAll(`[${b}]`));return Array.from(k.itemMap.values()).sort((V,W)=>N.indexOf(V.ref.current)-N.indexOf(W.ref.current))},[k.collectionRef,k.itemMap])}return[{Provider:f,Slot:g,ItemSlot:v},E,a]}var nE=y.createContext(void 0);function rE(t){const r=y.useContext(nE);return t||r||"ltr"}const oE=["top","right","bottom","left"],Zr=Math.min,Kt=Math.max,_l=Math.round,gl=Math.floor,Wn=t=>({x:t,y:t}),sE={left:"right",right:"left",bottom:"top",top:"bottom"},aE={start:"end",end:"start"};function Nd(t,r,o){return Kt(t,Zr(r,o))}function hr(t,r){return typeof t=="function"?t(r):t}function pr(t){return t.split("-")[0]}function Fs(t){return t.split("-")[1]}function wf(t){return t==="x"?"y":"x"}function bf(t){return t==="y"?"height":"width"}const iE=new Set(["top","bottom"]);function $n(t){return iE.has(pr(t))?"y":"x"}function Sf(t){return wf($n(t))}function lE(t,r,o){o===void 0&&(o=!1);const a=Fs(t),l=Sf(t),u=bf(l);let f=l==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return r.reference[u]>r.floating[u]&&(f=Dl(f)),[f,Dl(f)]}function uE(t){const r=Dl(t);return[Pd(t),r,Pd(r)]}function Pd(t){return t.replace(/start|end/g,r=>aE[r])}const fg=["left","right"],hg=["right","left"],cE=["top","bottom"],dE=["bottom","top"];function fE(t,r,o){switch(t){case"top":case"bottom":return o?r?hg:fg:r?fg:hg;case"left":case"right":return r?cE:dE;default:return[]}}function hE(t,r,o,a){const l=Fs(t);let u=fE(pr(t),o==="start",a);return l&&(u=u.map(f=>f+"-"+l),r&&(u=u.concat(u.map(Pd)))),u}function Dl(t){return t.replace(/left|right|bottom|top/g,r=>sE[r])}function pE(t){return{top:0,right:0,bottom:0,left:0,...t}}function gv(t){return typeof t!="number"?pE(t):{top:t,right:t,bottom:t,left:t}}function zl(t){const{x:r,y:o,width:a,height:l}=t;return{width:a,height:l,top:o,left:r,right:r+a,bottom:o+l,x:r,y:o}}function pg(t,r,o){let{reference:a,floating:l}=t;const u=$n(r),f=Sf(r),h=bf(f),m=pr(r),g=u==="y",x=a.x+a.width/2-l.width/2,b=a.y+a.height/2-l.height/2,C=a[h]/2-l[h]/2;let v;switch(m){case"top":v={x,y:a.y-l.height};break;case"bottom":v={x,y:a.y+a.height};break;case"right":v={x:a.x+a.width,y:b};break;case"left":v={x:a.x-l.width,y:b};break;default:v={x:a.x,y:a.y}}switch(Fs(r)){case"start":v[f]-=C*(o&&g?-1:1);break;case"end":v[f]+=C*(o&&g?-1:1);break}return v}async function mE(t,r){var o;r===void 0&&(r={});const{x:a,y:l,platform:u,rects:f,elements:h,strategy:m}=t,{boundary:g="clippingAncestors",rootBoundary:x="viewport",elementContext:b="floating",altBoundary:C=!1,padding:v=0}=hr(r,t),E=gv(v),k=h[C?b==="floating"?"reference":"floating":b],j=zl(await u.getClippingRect({element:(o=await(u.isElement==null?void 0:u.isElement(k)))==null||o?k:k.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(h.floating)),boundary:g,rootBoundary:x,strategy:m})),R=b==="floating"?{x:a,y:l,width:f.floating.width,height:f.floating.height}:f.reference,N=await(u.getOffsetParent==null?void 0:u.getOffsetParent(h.floating)),T=await(u.isElement==null?void 0:u.isElement(N))?await(u.getScale==null?void 0:u.getScale(N))||{x:1,y:1}:{x:1,y:1},U=zl(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:R,offsetParent:N,strategy:m}):R);return{top:(j.top-U.top+E.top)/T.y,bottom:(U.bottom-j.bottom+E.bottom)/T.y,left:(j.left-U.left+E.left)/T.x,right:(U.right-j.right+E.right)/T.x}}const gE=async(t,r,o)=>{const{placement:a="bottom",strategy:l="absolute",middleware:u=[],platform:f}=o,h=u.filter(Boolean),m=await(f.isRTL==null?void 0:f.isRTL(r));let g=await f.getElementRects({reference:t,floating:r,strategy:l}),{x,y:b}=pg(g,a,m),C=a,v={},E=0;for(let k=0;k<h.length;k++){var w;const{name:j,fn:R}=h[k],{x:N,y:T,data:U,reset:V}=await R({x,y:b,initialPlacement:a,placement:C,strategy:l,middlewareData:v,rects:g,platform:{...f,detectOverflow:(w=f.detectOverflow)!=null?w:mE},elements:{reference:t,floating:r}});x=N??x,b=T??b,v={...v,[j]:{...v[j],...U}},V&&E<=50&&(E++,typeof V=="object"&&(V.placement&&(C=V.placement),V.rects&&(g=V.rects===!0?await f.getElementRects({reference:t,floating:r,strategy:l}):V.rects),{x,y:b}=pg(g,C,m)),k=-1)}return{x,y:b,placement:C,strategy:l,middlewareData:v}},yE=t=>({name:"arrow",options:t,async fn(r){const{x:o,y:a,placement:l,rects:u,platform:f,elements:h,middlewareData:m}=r,{element:g,padding:x=0}=hr(t,r)||{};if(g==null)return{};const b=gv(x),C={x:o,y:a},v=Sf(l),E=bf(v),w=await f.getDimensions(g),k=v==="y",j=k?"top":"left",R=k?"bottom":"right",N=k?"clientHeight":"clientWidth",T=u.reference[E]+u.reference[v]-C[v]-u.floating[E],U=C[v]-u.reference[v],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(g));let W=V?V[N]:0;(!W||!await(f.isElement==null?void 0:f.isElement(V)))&&(W=h.floating[N]||u.floating[E]);const X=T/2-U/2,H=W/2-w[E]/2-1,G=Zr(b[j],H),_=Zr(b[R],H),L=G,B=W-w[E]-_,Q=W/2-w[E]/2+X,te=Nd(L,Q,B),ae=!m.arrow&&Fs(l)!=null&&Q!==te&&u.reference[E]/2-(Q<L?G:_)-w[E]/2<0,ie=ae?Q<L?Q-L:Q-B:0;return{[v]:C[v]+ie,data:{[v]:te,centerOffset:Q-te-ie,...ae&&{alignmentOffset:ie}},reset:ae}}}),vE=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(r){var o,a;const{placement:l,middlewareData:u,rects:f,initialPlacement:h,platform:m,elements:g}=r,{mainAxis:x=!0,crossAxis:b=!0,fallbackPlacements:C,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:w=!0,...k}=hr(t,r);if((o=u.arrow)!=null&&o.alignmentOffset)return{};const j=pr(l),R=$n(h),N=pr(h)===h,T=await(m.isRTL==null?void 0:m.isRTL(g.floating)),U=C||(N||!w?[Dl(h)]:uE(h)),V=E!=="none";!C&&V&&U.push(...hE(h,w,E,T));const W=[h,...U],X=await m.detectOverflow(r,k),H=[];let G=((a=u.flip)==null?void 0:a.overflows)||[];if(x&&H.push(X[j]),b){const Q=lE(l,f,T);H.push(X[Q[0]],X[Q[1]])}if(G=[...G,{placement:l,overflows:H}],!H.every(Q=>Q<=0)){var _,L;const Q=(((_=u.flip)==null?void 0:_.index)||0)+1,te=W[Q];if(te&&(!(b==="alignment"?R!==$n(te):!1)||G.every(F=>$n(F.placement)===R?F.overflows[0]>0:!0)))return{data:{index:Q,overflows:G},reset:{placement:te}};let ae=(L=G.filter(ie=>ie.overflows[0]<=0).sort((ie,F)=>ie.overflows[1]-F.overflows[1])[0])==null?void 0:L.placement;if(!ae)switch(v){case"bestFit":{var B;const ie=(B=G.filter(F=>{if(V){const q=$n(F.placement);return q===R||q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,ee)=>q+ee,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:B[0];ie&&(ae=ie);break}case"initialPlacement":ae=h;break}if(l!==ae)return{reset:{placement:ae}}}return{}}}};function mg(t,r){return{top:t.top-r.height,right:t.right-r.width,bottom:t.bottom-r.height,left:t.left-r.width}}function gg(t){return oE.some(r=>t[r]>=0)}const xE=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(r){const{rects:o,platform:a}=r,{strategy:l="referenceHidden",...u}=hr(t,r);switch(l){case"referenceHidden":{const f=await a.detectOverflow(r,{...u,elementContext:"reference"}),h=mg(f,o.reference);return{data:{referenceHiddenOffsets:h,referenceHidden:gg(h)}}}case"escaped":{const f=await a.detectOverflow(r,{...u,altBoundary:!0}),h=mg(f,o.floating);return{data:{escapedOffsets:h,escaped:gg(h)}}}default:return{}}}}},yv=new Set(["left","top"]);async function wE(t,r){const{placement:o,platform:a,elements:l}=t,u=await(a.isRTL==null?void 0:a.isRTL(l.floating)),f=pr(o),h=Fs(o),m=$n(o)==="y",g=yv.has(f)?-1:1,x=u&&m?-1:1,b=hr(r,t);let{mainAxis:C,crossAxis:v,alignmentAxis:E}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return h&&typeof E=="number"&&(v=h==="end"?E*-1:E),m?{x:v*x,y:C*g}:{x:C*g,y:v*x}}const bE=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(r){var o,a;const{x:l,y:u,placement:f,middlewareData:h}=r,m=await wE(r,t);return f===((o=h.offset)==null?void 0:o.placement)&&(a=h.arrow)!=null&&a.alignmentOffset?{}:{x:l+m.x,y:u+m.y,data:{...m,placement:f}}}}},SE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(r){const{x:o,y:a,placement:l,platform:u}=r,{mainAxis:f=!0,crossAxis:h=!1,limiter:m={fn:j=>{let{x:R,y:N}=j;return{x:R,y:N}}},...g}=hr(t,r),x={x:o,y:a},b=await u.detectOverflow(r,g),C=$n(pr(l)),v=wf(C);let E=x[v],w=x[C];if(f){const j=v==="y"?"top":"left",R=v==="y"?"bottom":"right",N=E+b[j],T=E-b[R];E=Nd(N,E,T)}if(h){const j=C==="y"?"top":"left",R=C==="y"?"bottom":"right",N=w+b[j],T=w-b[R];w=Nd(N,w,T)}const k=m.fn({...r,[v]:E,[C]:w});return{...k,data:{x:k.x-o,y:k.y-a,enabled:{[v]:f,[C]:h}}}}}},CE=function(t){return t===void 0&&(t={}),{options:t,fn(r){const{x:o,y:a,placement:l,rects:u,middlewareData:f}=r,{offset:h=0,mainAxis:m=!0,crossAxis:g=!0}=hr(t,r),x={x:o,y:a},b=$n(l),C=wf(b);let v=x[C],E=x[b];const w=hr(h,r),k=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(m){const N=C==="y"?"height":"width",T=u.reference[C]-u.floating[N]+k.mainAxis,U=u.reference[C]+u.reference[N]-k.mainAxis;v<T?v=T:v>U&&(v=U)}if(g){var j,R;const N=C==="y"?"width":"height",T=yv.has(pr(l)),U=u.reference[b]-u.floating[N]+(T&&((j=f.offset)==null?void 0:j[b])||0)+(T?0:k.crossAxis),V=u.reference[b]+u.reference[N]+(T?0:((R=f.offset)==null?void 0:R[b])||0)-(T?k.crossAxis:0);E<U?E=U:E>V&&(E=V)}return{[C]:v,[b]:E}}}},kE=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(r){var o,a;const{placement:l,rects:u,platform:f,elements:h}=r,{apply:m=()=>{},...g}=hr(t,r),x=await f.detectOverflow(r,g),b=pr(l),C=Fs(l),v=$n(l)==="y",{width:E,height:w}=u.floating;let k,j;b==="top"||b==="bottom"?(k=b,j=C===(await(f.isRTL==null?void 0:f.isRTL(h.floating))?"start":"end")?"left":"right"):(j=b,k=C==="end"?"top":"bottom");const R=w-x.top-x.bottom,N=E-x.left-x.right,T=Zr(w-x[k],R),U=Zr(E-x[j],N),V=!r.middlewareData.shift;let W=T,X=U;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&(X=N),(a=r.middlewareData.shift)!=null&&a.enabled.y&&(W=R),V&&!C){const G=Kt(x.left,0),_=Kt(x.right,0),L=Kt(x.top,0),B=Kt(x.bottom,0);v?X=E-2*(G!==0||_!==0?G+_:Kt(x.left,x.right)):W=w-2*(L!==0||B!==0?L+B:Kt(x.top,x.bottom))}await m({...r,availableWidth:X,availableHeight:W});const H=await f.getDimensions(h.floating);return E!==H.width||w!==H.height?{reset:{rects:!0}}:{}}}};function ql(){return typeof window<"u"}function Bs(t){return vv(t)?(t.nodeName||"").toLowerCase():"#document"}function Qt(t){var r;return(t==null||(r=t.ownerDocument)==null?void 0:r.defaultView)||window}function Kn(t){var r;return(r=(vv(t)?t.ownerDocument:t.document)||window.document)==null?void 0:r.documentElement}function vv(t){return ql()?t instanceof Node||t instanceof Qt(t).Node:!1}function Sn(t){return ql()?t instanceof Element||t instanceof Qt(t).Element:!1}function Hn(t){return ql()?t instanceof HTMLElement||t instanceof Qt(t).HTMLElement:!1}function yg(t){return!ql()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Qt(t).ShadowRoot}const EE=new Set(["inline","contents"]);function Va(t){const{overflow:r,overflowX:o,overflowY:a,display:l}=Cn(t);return/auto|scroll|overlay|hidden|clip/.test(r+a+o)&&!EE.has(l)}const NE=new Set(["table","td","th"]);function PE(t){return NE.has(Bs(t))}const jE=[":popover-open",":modal"];function Gl(t){return jE.some(r=>{try{return t.matches(r)}catch{return!1}})}const RE=["transform","translate","scale","rotate","perspective"],ME=["transform","translate","scale","rotate","perspective","filter"],TE=["paint","layout","strict","content"];function Cf(t){const r=kf(),o=Sn(t)?Cn(t):t;return RE.some(a=>o[a]?o[a]!=="none":!1)||(o.containerType?o.containerType!=="normal":!1)||!r&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!r&&(o.filter?o.filter!=="none":!1)||ME.some(a=>(o.willChange||"").includes(a))||TE.some(a=>(o.contain||"").includes(a))}function IE(t){let r=eo(t);for(;Hn(r)&&!Ts(r);){if(Cf(r))return r;if(Gl(r))return null;r=eo(r)}return null}function kf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const OE=new Set(["html","body","#document"]);function Ts(t){return OE.has(Bs(t))}function Cn(t){return Qt(t).getComputedStyle(t)}function Yl(t){return Sn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function eo(t){if(Bs(t)==="html")return t;const r=t.assignedSlot||t.parentNode||yg(t)&&t.host||Kn(t);return yg(r)?r.host:r}function xv(t){const r=eo(t);return Ts(r)?t.ownerDocument?t.ownerDocument.body:t.body:Hn(r)&&Va(r)?r:xv(r)}function Aa(t,r,o){var a;r===void 0&&(r=[]),o===void 0&&(o=!0);const l=xv(t),u=l===((a=t.ownerDocument)==null?void 0:a.body),f=Qt(l);if(u){const h=jd(f);return r.concat(f,f.visualViewport||[],Va(l)?l:[],h&&o?Aa(h):[])}return r.concat(l,Aa(l,[],o))}function jd(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function wv(t){const r=Cn(t);let o=parseFloat(r.width)||0,a=parseFloat(r.height)||0;const l=Hn(t),u=l?t.offsetWidth:o,f=l?t.offsetHeight:a,h=_l(o)!==u||_l(a)!==f;return h&&(o=u,a=f),{width:o,height:a,$:h}}function Ef(t){return Sn(t)?t:t.contextElement}function vs(t){const r=Ef(t);if(!Hn(r))return Wn(1);const o=r.getBoundingClientRect(),{width:a,height:l,$:u}=wv(r);let f=(u?_l(o.width):o.width)/a,h=(u?_l(o.height):o.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!h||!Number.isFinite(h))&&(h=1),{x:f,y:h}}const AE=Wn(0);function bv(t){const r=Qt(t);return!kf()||!r.visualViewport?AE:{x:r.visualViewport.offsetLeft,y:r.visualViewport.offsetTop}}function LE(t,r,o){return r===void 0&&(r=!1),!o||r&&o!==Qt(t)?!1:r}function Ao(t,r,o,a){r===void 0&&(r=!1),o===void 0&&(o=!1);const l=t.getBoundingClientRect(),u=Ef(t);let f=Wn(1);r&&(a?Sn(a)&&(f=vs(a)):f=vs(t));const h=LE(u,o,a)?bv(u):Wn(0);let m=(l.left+h.x)/f.x,g=(l.top+h.y)/f.y,x=l.width/f.x,b=l.height/f.y;if(u){const C=Qt(u),v=a&&Sn(a)?Qt(a):a;let E=C,w=jd(E);for(;w&&a&&v!==E;){const k=vs(w),j=w.getBoundingClientRect(),R=Cn(w),N=j.left+(w.clientLeft+parseFloat(R.paddingLeft))*k.x,T=j.top+(w.clientTop+parseFloat(R.paddingTop))*k.y;m*=k.x,g*=k.y,x*=k.x,b*=k.y,m+=N,g+=T,E=Qt(w),w=jd(E)}}return zl({width:x,height:b,x:m,y:g})}function Xl(t,r){const o=Yl(t).scrollLeft;return r?r.left+o:Ao(Kn(t)).left+o}function Sv(t,r){const o=t.getBoundingClientRect(),a=o.left+r.scrollLeft-Xl(t,o),l=o.top+r.scrollTop;return{x:a,y:l}}function _E(t){let{elements:r,rect:o,offsetParent:a,strategy:l}=t;const u=l==="fixed",f=Kn(a),h=r?Gl(r.floating):!1;if(a===f||h&&u)return o;let m={scrollLeft:0,scrollTop:0},g=Wn(1);const x=Wn(0),b=Hn(a);if((b||!b&&!u)&&((Bs(a)!=="body"||Va(f))&&(m=Yl(a)),Hn(a))){const v=Ao(a);g=vs(a),x.x=v.x+a.clientLeft,x.y=v.y+a.clientTop}const C=f&&!b&&!u?Sv(f,m):Wn(0);return{width:o.width*g.x,height:o.height*g.y,x:o.x*g.x-m.scrollLeft*g.x+x.x+C.x,y:o.y*g.y-m.scrollTop*g.y+x.y+C.y}}function DE(t){return Array.from(t.getClientRects())}function zE(t){const r=Kn(t),o=Yl(t),a=t.ownerDocument.body,l=Kt(r.scrollWidth,r.clientWidth,a.scrollWidth,a.clientWidth),u=Kt(r.scrollHeight,r.clientHeight,a.scrollHeight,a.clientHeight);let f=-o.scrollLeft+Xl(t);const h=-o.scrollTop;return Cn(a).direction==="rtl"&&(f+=Kt(r.clientWidth,a.clientWidth)-l),{width:l,height:u,x:f,y:h}}const vg=25;function FE(t,r){const o=Qt(t),a=Kn(t),l=o.visualViewport;let u=a.clientWidth,f=a.clientHeight,h=0,m=0;if(l){u=l.width,f=l.height;const x=kf();(!x||x&&r==="fixed")&&(h=l.offsetLeft,m=l.offsetTop)}const g=Xl(a);if(g<=0){const x=a.ownerDocument,b=x.body,C=getComputedStyle(b),v=x.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,E=Math.abs(a.clientWidth-b.clientWidth-v);E<=vg&&(u-=E)}else g<=vg&&(u+=g);return{width:u,height:f,x:h,y:m}}const BE=new Set(["absolute","fixed"]);function UE(t,r){const o=Ao(t,!0,r==="fixed"),a=o.top+t.clientTop,l=o.left+t.clientLeft,u=Hn(t)?vs(t):Wn(1),f=t.clientWidth*u.x,h=t.clientHeight*u.y,m=l*u.x,g=a*u.y;return{width:f,height:h,x:m,y:g}}function xg(t,r,o){let a;if(r==="viewport")a=FE(t,o);else if(r==="document")a=zE(Kn(t));else if(Sn(r))a=UE(r,o);else{const l=bv(t);a={x:r.x-l.x,y:r.y-l.y,width:r.width,height:r.height}}return zl(a)}function Cv(t,r){const o=eo(t);return o===r||!Sn(o)||Ts(o)?!1:Cn(o).position==="fixed"||Cv(o,r)}function $E(t,r){const o=r.get(t);if(o)return o;let a=Aa(t,[],!1).filter(h=>Sn(h)&&Bs(h)!=="body"),l=null;const u=Cn(t).position==="fixed";let f=u?eo(t):t;for(;Sn(f)&&!Ts(f);){const h=Cn(f),m=Cf(f);!m&&h.position==="fixed"&&(l=null),(u?!m&&!l:!m&&h.position==="static"&&!!l&&BE.has(l.position)||Va(f)&&!m&&Cv(t,f))?a=a.filter(x=>x!==f):l=h,f=eo(f)}return r.set(t,a),a}function WE(t){let{element:r,boundary:o,rootBoundary:a,strategy:l}=t;const f=[...o==="clippingAncestors"?Gl(r)?[]:$E(r,this._c):[].concat(o),a],h=f[0],m=f.reduce((g,x)=>{const b=xg(r,x,l);return g.top=Kt(b.top,g.top),g.right=Zr(b.right,g.right),g.bottom=Zr(b.bottom,g.bottom),g.left=Kt(b.left,g.left),g},xg(r,h,l));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function HE(t){const{width:r,height:o}=wv(t);return{width:r,height:o}}function VE(t,r,o){const a=Hn(r),l=Kn(r),u=o==="fixed",f=Ao(t,!0,u,r);let h={scrollLeft:0,scrollTop:0};const m=Wn(0);function g(){m.x=Xl(l)}if(a||!a&&!u)if((Bs(r)!=="body"||Va(l))&&(h=Yl(r)),a){const v=Ao(r,!0,u,r);m.x=v.x+r.clientLeft,m.y=v.y+r.clientTop}else l&&g();u&&!a&&l&&g();const x=l&&!a&&!u?Sv(l,h):Wn(0),b=f.left+h.scrollLeft-m.x-x.x,C=f.top+h.scrollTop-m.y-x.y;return{x:b,y:C,width:f.width,height:f.height}}function ed(t){return Cn(t).position==="static"}function wg(t,r){if(!Hn(t)||Cn(t).position==="fixed")return null;if(r)return r(t);let o=t.offsetParent;return Kn(t)===o&&(o=o.ownerDocument.body),o}function kv(t,r){const o=Qt(t);if(Gl(t))return o;if(!Hn(t)){let l=eo(t);for(;l&&!Ts(l);){if(Sn(l)&&!ed(l))return l;l=eo(l)}return o}let a=wg(t,r);for(;a&&PE(a)&&ed(a);)a=wg(a,r);return a&&Ts(a)&&ed(a)&&!Cf(a)?o:a||IE(t)||o}const KE=async function(t){const r=this.getOffsetParent||kv,o=this.getDimensions,a=await o(t.floating);return{reference:VE(t.reference,await r(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function QE(t){return Cn(t).direction==="rtl"}const qE={convertOffsetParentRelativeRectToViewportRelativeRect:_E,getDocumentElement:Kn,getClippingRect:WE,getOffsetParent:kv,getElementRects:KE,getClientRects:DE,getDimensions:HE,getScale:vs,isElement:Sn,isRTL:QE};function Ev(t,r){return t.x===r.x&&t.y===r.y&&t.width===r.width&&t.height===r.height}function GE(t,r){let o=null,a;const l=Kn(t);function u(){var h;clearTimeout(a),(h=o)==null||h.disconnect(),o=null}function f(h,m){h===void 0&&(h=!1),m===void 0&&(m=1),u();const g=t.getBoundingClientRect(),{left:x,top:b,width:C,height:v}=g;if(h||r(),!C||!v)return;const E=gl(b),w=gl(l.clientWidth-(x+C)),k=gl(l.clientHeight-(b+v)),j=gl(x),N={rootMargin:-E+"px "+-w+"px "+-k+"px "+-j+"px",threshold:Kt(0,Zr(1,m))||1};let T=!0;function U(V){const W=V[0].intersectionRatio;if(W!==m){if(!T)return f();W?f(!1,W):a=setTimeout(()=>{f(!1,1e-7)},1e3)}W===1&&!Ev(g,t.getBoundingClientRect())&&f(),T=!1}try{o=new IntersectionObserver(U,{...N,root:l.ownerDocument})}catch{o=new IntersectionObserver(U,N)}o.observe(t)}return f(!0),u}function YE(t,r,o,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:m=!1}=a,g=Ef(t),x=l||u?[...g?Aa(g):[],...Aa(r)]:[];x.forEach(j=>{l&&j.addEventListener("scroll",o,{passive:!0}),u&&j.addEventListener("resize",o)});const b=g&&h?GE(g,o):null;let C=-1,v=null;f&&(v=new ResizeObserver(j=>{let[R]=j;R&&R.target===g&&v&&(v.unobserve(r),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(r)})),o()}),g&&!m&&v.observe(g),v.observe(r));let E,w=m?Ao(t):null;m&&k();function k(){const j=Ao(t);w&&!Ev(w,j)&&o(),w=j,E=requestAnimationFrame(k)}return o(),()=>{var j;x.forEach(R=>{l&&R.removeEventListener("scroll",o),u&&R.removeEventListener("resize",o)}),b==null||b(),(j=v)==null||j.disconnect(),v=null,m&&cancelAnimationFrame(E)}}const XE=bE,JE=SE,ZE=vE,eN=kE,tN=xE,bg=yE,nN=CE,rN=(t,r,o)=>{const a=new Map,l={platform:qE,...o},u={...l.platform,_c:a};return gE(t,r,{...l,platform:u})};var oN=typeof document<"u",sN=function(){},jl=oN?y.useLayoutEffect:sN;function Fl(t,r){if(t===r)return!0;if(typeof t!=typeof r)return!1;if(typeof t=="function"&&t.toString()===r.toString())return!0;let o,a,l;if(t&&r&&typeof t=="object"){if(Array.isArray(t)){if(o=t.length,o!==r.length)return!1;for(a=o;a--!==0;)if(!Fl(t[a],r[a]))return!1;return!0}if(l=Object.keys(t),o=l.length,o!==Object.keys(r).length)return!1;for(a=o;a--!==0;)if(!{}.hasOwnProperty.call(r,l[a]))return!1;for(a=o;a--!==0;){const u=l[a];if(!(u==="_owner"&&t.$$typeof)&&!Fl(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}function Nv(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Sg(t,r){const o=Nv(t);return Math.round(r*o)/o}function td(t){const r=y.useRef(t);return jl(()=>{r.current=t}),r}function aN(t){t===void 0&&(t={});const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:l,elements:{reference:u,floating:f}={},transform:h=!0,whileElementsMounted:m,open:g}=t,[x,b]=y.useState({x:0,y:0,strategy:o,placement:r,middlewareData:{},isPositioned:!1}),[C,v]=y.useState(a);Fl(C,a)||v(a);const[E,w]=y.useState(null),[k,j]=y.useState(null),R=y.useCallback(F=>{F!==V.current&&(V.current=F,w(F))},[]),N=y.useCallback(F=>{F!==W.current&&(W.current=F,j(F))},[]),T=u||E,U=f||k,V=y.useRef(null),W=y.useRef(null),X=y.useRef(x),H=m!=null,G=td(m),_=td(l),L=td(g),B=y.useCallback(()=>{if(!V.current||!W.current)return;const F={placement:r,strategy:o,middleware:C};_.current&&(F.platform=_.current),rN(V.current,W.current,F).then(q=>{const ee={...q,isPositioned:L.current!==!1};Q.current&&!Fl(X.current,ee)&&(X.current=ee,Wa.flushSync(()=>{b(ee)}))})},[C,r,o,_,L]);jl(()=>{g===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,b(F=>({...F,isPositioned:!1})))},[g]);const Q=y.useRef(!1);jl(()=>(Q.current=!0,()=>{Q.current=!1}),[]),jl(()=>{if(T&&(V.current=T),U&&(W.current=U),T&&U){if(G.current)return G.current(T,U,B);B()}},[T,U,B,G,H]);const te=y.useMemo(()=>({reference:V,floating:W,setReference:R,setFloating:N}),[R,N]),ae=y.useMemo(()=>({reference:T,floating:U}),[T,U]),ie=y.useMemo(()=>{const F={position:o,left:0,top:0};if(!ae.floating)return F;const q=Sg(ae.floating,x.x),ee=Sg(ae.floating,x.y);return h?{...F,transform:"translate("+q+"px, "+ee+"px)",...Nv(ae.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:q,top:ee}},[o,h,ae.floating,x.x,x.y]);return y.useMemo(()=>({...x,update:B,refs:te,elements:ae,floatingStyles:ie}),[x,B,te,ae,ie])}const iN=t=>{function r(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:t,fn(o){const{element:a,padding:l}=typeof t=="function"?t(o):t;return a&&r(a)?a.current!=null?bg({element:a.current,padding:l}).fn(o):{}:a?bg({element:a,padding:l}).fn(o):{}}}},lN=(t,r)=>({...XE(t),options:[t,r]}),uN=(t,r)=>({...JE(t),options:[t,r]}),cN=(t,r)=>({...nN(t),options:[t,r]}),dN=(t,r)=>({...ZE(t),options:[t,r]}),fN=(t,r)=>({...eN(t),options:[t,r]}),hN=(t,r)=>({...tN(t),options:[t,r]}),pN=(t,r)=>({...iN(t),options:[t,r]});var mN="Arrow",Pv=y.forwardRef((t,r)=>{const{children:o,width:a=10,height:l=5,...u}=t;return d.jsx(Ue.svg,{...u,ref:r,width:a,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?o:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});Pv.displayName=mN;var gN=Pv;function yN(t){const[r,o]=y.useState(void 0);return Ct(()=>{if(t){o({width:t.offsetWidth,height:t.offsetHeight});const a=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let f,h;if("borderBoxSize"in u){const m=u.borderBoxSize,g=Array.isArray(m)?m[0]:m;f=g.inlineSize,h=g.blockSize}else f=t.offsetWidth,h=t.offsetHeight;o({width:f,height:h})});return a.observe(t,{box:"border-box"}),()=>a.unobserve(t)}else o(void 0)},[t]),r}var Nf="Popper",[jv,Rv]=Hl(Nf),[vN,Mv]=jv(Nf),Tv=t=>{const{__scopePopper:r,children:o}=t,[a,l]=y.useState(null);return d.jsx(vN,{scope:r,anchor:a,onAnchorChange:l,children:o})};Tv.displayName=Nf;var Iv="PopperAnchor",Ov=y.forwardRef((t,r)=>{const{__scopePopper:o,virtualRef:a,...l}=t,u=Mv(Iv,o),f=y.useRef(null),h=rt(r,f),m=y.useRef(null);return y.useEffect(()=>{const g=m.current;m.current=(a==null?void 0:a.current)||f.current,g!==m.current&&u.onAnchorChange(m.current)}),a?null:d.jsx(Ue.div,{...l,ref:h})});Ov.displayName=Iv;var Pf="PopperContent",[xN,wN]=jv(Pf),Av=y.forwardRef((t,r)=>{var re,ge,Ce,Ne,Me,Ie;const{__scopePopper:o,side:a="bottom",sideOffset:l=0,align:u="center",alignOffset:f=0,arrowPadding:h=0,avoidCollisions:m=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:C=!1,updatePositionStrategy:v="optimized",onPlaced:E,...w}=t,k=Mv(Pf,o),[j,R]=y.useState(null),N=rt(r,Ze=>R(Ze)),[T,U]=y.useState(null),V=yN(T),W=(V==null?void 0:V.width)??0,X=(V==null?void 0:V.height)??0,H=a+(u!=="center"?"-"+u:""),G=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},_=Array.isArray(g)?g:[g],L=_.length>0,B={padding:G,boundary:_.filter(SN),altBoundary:L},{refs:Q,floatingStyles:te,placement:ae,isPositioned:ie,middlewareData:F}=aN({strategy:"fixed",placement:H,whileElementsMounted:(...Ze)=>YE(...Ze,{animationFrame:v==="always"}),elements:{reference:k.anchor},middleware:[lN({mainAxis:l+X,alignmentAxis:f}),m&&uN({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?cN():void 0,...B}),m&&dN({...B}),fN({...B,apply:({elements:Ze,rects:yt,availableWidth:En,availableHeight:on})=>{const{width:sn,height:yr}=yt.reference,Nn=Ze.floating.style;Nn.setProperty("--radix-popper-available-width",`${En}px`),Nn.setProperty("--radix-popper-available-height",`${on}px`),Nn.setProperty("--radix-popper-anchor-width",`${sn}px`),Nn.setProperty("--radix-popper-anchor-height",`${yr}px`)}}),T&&pN({element:T,padding:h}),CN({arrowWidth:W,arrowHeight:X}),C&&hN({strategy:"referenceHidden",...B})]}),[q,ee]=Dv(ae),O=Io(E);Ct(()=>{ie&&(O==null||O())},[ie,O]);const K=(re=F.arrow)==null?void 0:re.x,le=(ge=F.arrow)==null?void 0:ge.y,ce=((Ce=F.arrow)==null?void 0:Ce.centerOffset)!==0,[xe,Se]=y.useState();return Ct(()=>{j&&Se(window.getComputedStyle(j).zIndex)},[j]),d.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:ie?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:xe,"--radix-popper-transform-origin":[(Ne=F.transformOrigin)==null?void 0:Ne.x,(Me=F.transformOrigin)==null?void 0:Me.y].join(" "),...((Ie=F.hide)==null?void 0:Ie.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:d.jsx(xN,{scope:o,placedSide:q,onArrowChange:U,arrowX:K,arrowY:le,shouldHideArrow:ce,children:d.jsx(Ue.div,{"data-side":q,"data-align":ee,...w,ref:N,style:{...w.style,animation:ie?void 0:"none"}})})})});Av.displayName=Pf;var Lv="PopperArrow",bN={top:"bottom",right:"left",bottom:"top",left:"right"},_v=y.forwardRef(function(r,o){const{__scopePopper:a,...l}=r,u=wN(Lv,a),f=bN[u.placedSide];return d.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:d.jsx(gN,{...l,ref:o,style:{...l.style,display:"block"}})})});_v.displayName=Lv;function SN(t){return t!==null}var CN=t=>({name:"transformOrigin",options:t,fn(r){var k,j,R;const{placement:o,rects:a,middlewareData:l}=r,f=((k=l.arrow)==null?void 0:k.centerOffset)!==0,h=f?0:t.arrowWidth,m=f?0:t.arrowHeight,[g,x]=Dv(o),b={start:"0%",center:"50%",end:"100%"}[x],C=(((j=l.arrow)==null?void 0:j.x)??0)+h/2,v=(((R=l.arrow)==null?void 0:R.y)??0)+m/2;let E="",w="";return g==="bottom"?(E=f?b:`${C}px`,w=`${-m}px`):g==="top"?(E=f?b:`${C}px`,w=`${a.floating.height+m}px`):g==="right"?(E=`${-m}px`,w=f?b:`${v}px`):g==="left"&&(E=`${a.floating.width+m}px`,w=f?b:`${v}px`),{data:{x:E,y:w}}}});function Dv(t){const[r,o="center"]=t.split("-");return[r,o]}var kN=Tv,EN=Ov,NN=Av,PN=_v;function jN(t){const r=y.useRef({value:t,previous:t});return y.useMemo(()=>(r.current.value!==t&&(r.current.previous=r.current.value,r.current.value=t),r.current.previous),[t])}var zv=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),RN="VisuallyHidden",MN=y.forwardRef((t,r)=>d.jsx(Ue.span,{...t,ref:r,style:{...zv,...t.style}}));MN.displayName=RN;var TN=[" ","Enter","ArrowUp","ArrowDown"],IN=[" ","Enter"],Lo="Select",[Jl,Zl,ON]=tE(Lo),[Us]=Hl(Lo,[ON,Rv]),eu=Rv(),[AN,ro]=Us(Lo),[LN,_N]=Us(Lo),Fv=t=>{const{__scopeSelect:r,children:o,open:a,defaultOpen:l,onOpenChange:u,value:f,defaultValue:h,onValueChange:m,dir:g,name:x,autoComplete:b,disabled:C,required:v,form:E}=t,w=eu(r),[k,j]=y.useState(null),[R,N]=y.useState(null),[T,U]=y.useState(!1),V=rE(g),[W,X]=Cd({prop:a,defaultProp:l??!1,onChange:u,caller:Lo}),[H,G]=Cd({prop:f,defaultProp:h,onChange:m,caller:Lo}),_=y.useRef(null),L=k?E||!!k.closest("form"):!0,[B,Q]=y.useState(new Set),te=Array.from(B).map(ae=>ae.props.value).join(";");return d.jsx(kN,{...w,children:d.jsxs(AN,{required:v,scope:r,trigger:k,onTriggerChange:j,valueNode:R,onValueNodeChange:N,valueNodeHasChildren:T,onValueNodeHasChildrenChange:U,contentId:gs(),value:H,onValueChange:G,open:W,onOpenChange:X,dir:V,triggerPointerDownPosRef:_,disabled:C,children:[d.jsx(Jl.Provider,{scope:r,children:d.jsx(LN,{scope:t.__scopeSelect,onNativeOptionAdd:y.useCallback(ae=>{Q(ie=>new Set(ie).add(ae))},[]),onNativeOptionRemove:y.useCallback(ae=>{Q(ie=>{const F=new Set(ie);return F.delete(ae),F})},[]),children:o})}),L?d.jsxs(u0,{"aria-hidden":!0,required:v,tabIndex:-1,name:x,autoComplete:b,value:H,onChange:ae=>G(ae.target.value),disabled:C,form:E,children:[H===void 0?d.jsx("option",{value:""}):null,Array.from(B)]},te):null]})})};Fv.displayName=Lo;var Bv="SelectTrigger",Uv=y.forwardRef((t,r)=>{const{__scopeSelect:o,disabled:a=!1,...l}=t,u=eu(o),f=ro(Bv,o),h=f.disabled||a,m=rt(r,f.onTriggerChange),g=Zl(o),x=y.useRef("touch"),[b,C,v]=d0(w=>{const k=g().filter(N=>!N.disabled),j=k.find(N=>N.value===f.value),R=f0(k,w,j);R!==void 0&&f.onValueChange(R.value)}),E=w=>{h||(f.onOpenChange(!0),v()),w&&(f.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return d.jsx(EN,{asChild:!0,...u,children:d.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:h,"data-disabled":h?"":void 0,"data-placeholder":c0(f.value)?"":void 0,...l,ref:m,onClick:Ke(l.onClick,w=>{w.currentTarget.focus(),x.current!=="mouse"&&E(w)}),onPointerDown:Ke(l.onPointerDown,w=>{x.current=w.pointerType;const k=w.target;k.hasPointerCapture(w.pointerId)&&k.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(E(w),w.preventDefault())}),onKeyDown:Ke(l.onKeyDown,w=>{const k=b.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&C(w.key),!(k&&w.key===" ")&&TN.includes(w.key)&&(E(),w.preventDefault())})})})});Uv.displayName=Bv;var $v="SelectValue",Wv=y.forwardRef((t,r)=>{const{__scopeSelect:o,className:a,style:l,children:u,placeholder:f="",...h}=t,m=ro($v,o),{onValueNodeHasChildrenChange:g}=m,x=u!==void 0,b=rt(r,m.onValueNodeChange);return Ct(()=>{g(x)},[g,x]),d.jsx(Ue.span,{...h,ref:b,style:{pointerEvents:"none"},children:c0(m.value)?d.jsx(d.Fragment,{children:f}):u})});Wv.displayName=$v;var DN="SelectIcon",Hv=y.forwardRef((t,r)=>{const{__scopeSelect:o,children:a,...l}=t;return d.jsx(Ue.span,{"aria-hidden":!0,...l,ref:r,children:a||"▼"})});Hv.displayName=DN;var zN="SelectPortal",Vv=t=>d.jsx(lf,{asChild:!0,...t});Vv.displayName=zN;var _o="SelectContent",Kv=y.forwardRef((t,r)=>{const o=ro(_o,t.__scopeSelect),[a,l]=y.useState();if(Ct(()=>{l(new DocumentFragment)},[]),!o.open){const u=a;return u?Wa.createPortal(d.jsx(Qv,{scope:t.__scopeSelect,children:d.jsx(Jl.Slot,{scope:t.__scopeSelect,children:d.jsx("div",{children:t.children})})}),u):null}return d.jsx(qv,{...t,ref:r})});Kv.displayName=_o;var vn=10,[Qv,oo]=Us(_o),FN="SelectContentImpl",BN=Oa("SelectContent.RemoveScroll"),qv=y.forwardRef((t,r)=>{const{__scopeSelect:o,position:a="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,side:h,sideOffset:m,align:g,alignOffset:x,arrowPadding:b,collisionBoundary:C,collisionPadding:v,sticky:E,hideWhenDetached:w,avoidCollisions:k,...j}=t,R=ro(_o,o),[N,T]=y.useState(null),[U,V]=y.useState(null),W=rt(r,re=>T(re)),[X,H]=y.useState(null),[G,_]=y.useState(null),L=Zl(o),[B,Q]=y.useState(!1),te=y.useRef(!1);y.useEffect(()=>{if(N)return Vy(N)},[N]),_y();const ae=y.useCallback(re=>{const[ge,...Ce]=L().map(Ie=>Ie.ref.current),[Ne]=Ce.slice(-1),Me=document.activeElement;for(const Ie of re)if(Ie===Me||(Ie==null||Ie.scrollIntoView({block:"nearest"}),Ie===ge&&U&&(U.scrollTop=0),Ie===Ne&&U&&(U.scrollTop=U.scrollHeight),Ie==null||Ie.focus(),document.activeElement!==Me))return},[L,U]),ie=y.useCallback(()=>ae([X,N]),[ae,X,N]);y.useEffect(()=>{B&&ie()},[B,ie]);const{onOpenChange:F,triggerPointerDownPosRef:q}=R;y.useEffect(()=>{if(N){let re={x:0,y:0};const ge=Ne=>{var Me,Ie;re={x:Math.abs(Math.round(Ne.pageX)-(((Me=q.current)==null?void 0:Me.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((Ie=q.current)==null?void 0:Ie.y)??0))}},Ce=Ne=>{re.x<=10&&re.y<=10?Ne.preventDefault():N.contains(Ne.target)||F(!1),document.removeEventListener("pointermove",ge),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",ge),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ge),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[N,F,q]),y.useEffect(()=>{const re=()=>F(!1);return window.addEventListener("blur",re),window.addEventListener("resize",re),()=>{window.removeEventListener("blur",re),window.removeEventListener("resize",re)}},[F]);const[ee,O]=d0(re=>{const ge=L().filter(Me=>!Me.disabled),Ce=ge.find(Me=>Me.ref.current===document.activeElement),Ne=f0(ge,re,Ce);Ne&&setTimeout(()=>Ne.ref.current.focus())}),K=y.useCallback((re,ge,Ce)=>{const Ne=!te.current&&!Ce;(R.value!==void 0&&R.value===ge||Ne)&&(H(re),Ne&&(te.current=!0))},[R.value]),le=y.useCallback(()=>N==null?void 0:N.focus(),[N]),ce=y.useCallback((re,ge,Ce)=>{const Ne=!te.current&&!Ce;(R.value!==void 0&&R.value===ge||Ne)&&_(re)},[R.value]),xe=a==="popper"?Rd:Gv,Se=xe===Rd?{side:h,sideOffset:m,align:g,alignOffset:x,arrowPadding:b,collisionBoundary:C,collisionPadding:v,sticky:E,hideWhenDetached:w,avoidCollisions:k}:{};return d.jsx(Qv,{scope:o,content:N,viewport:U,onViewportChange:V,itemRefCallback:K,selectedItem:X,onItemLeave:le,itemTextRefCallback:ce,focusSelectedItem:ie,selectedItemText:G,position:a,isPositioned:B,searchRef:ee,children:d.jsx(uf,{as:BN,allowPinchZoom:!0,children:d.jsx(af,{asChild:!0,trapped:R.open,onMountAutoFocus:re=>{re.preventDefault()},onUnmountAutoFocus:Ke(l,re=>{var ge;(ge=R.trigger)==null||ge.focus({preventScroll:!0}),re.preventDefault()}),children:d.jsx(sf,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:re=>re.preventDefault(),onDismiss:()=>R.onOpenChange(!1),children:d.jsx(xe,{role:"listbox",id:R.contentId,"data-state":R.open?"open":"closed",dir:R.dir,onContextMenu:re=>re.preventDefault(),...j,...Se,onPlaced:()=>Q(!0),ref:W,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ke(j.onKeyDown,re=>{const ge=re.ctrlKey||re.altKey||re.metaKey;if(re.key==="Tab"&&re.preventDefault(),!ge&&re.key.length===1&&O(re.key),["ArrowUp","ArrowDown","Home","End"].includes(re.key)){let Ne=L().filter(Me=>!Me.disabled).map(Me=>Me.ref.current);if(["ArrowUp","End"].includes(re.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(re.key)){const Me=re.target,Ie=Ne.indexOf(Me);Ne=Ne.slice(Ie+1)}setTimeout(()=>ae(Ne)),re.preventDefault()}})})})})})})});qv.displayName=FN;var UN="SelectItemAlignedPosition",Gv=y.forwardRef((t,r)=>{const{__scopeSelect:o,onPlaced:a,...l}=t,u=ro(_o,o),f=oo(_o,o),[h,m]=y.useState(null),[g,x]=y.useState(null),b=rt(r,W=>x(W)),C=Zl(o),v=y.useRef(!1),E=y.useRef(!0),{viewport:w,selectedItem:k,selectedItemText:j,focusSelectedItem:R}=f,N=y.useCallback(()=>{if(u.trigger&&u.valueNode&&h&&g&&w&&k&&j){const W=u.trigger.getBoundingClientRect(),X=g.getBoundingClientRect(),H=u.valueNode.getBoundingClientRect(),G=j.getBoundingClientRect();if(u.dir!=="rtl"){const Me=G.left-X.left,Ie=H.left-Me,Ze=W.left-Ie,yt=W.width+Ze,En=Math.max(yt,X.width),on=window.innerWidth-vn,sn=dg(Ie,[vn,Math.max(vn,on-En)]);h.style.minWidth=yt+"px",h.style.left=sn+"px"}else{const Me=X.right-G.right,Ie=window.innerWidth-H.right-Me,Ze=window.innerWidth-W.right-Ie,yt=W.width+Ze,En=Math.max(yt,X.width),on=window.innerWidth-vn,sn=dg(Ie,[vn,Math.max(vn,on-En)]);h.style.minWidth=yt+"px",h.style.right=sn+"px"}const _=C(),L=window.innerHeight-vn*2,B=w.scrollHeight,Q=window.getComputedStyle(g),te=parseInt(Q.borderTopWidth,10),ae=parseInt(Q.paddingTop,10),ie=parseInt(Q.borderBottomWidth,10),F=parseInt(Q.paddingBottom,10),q=te+ae+B+F+ie,ee=Math.min(k.offsetHeight*5,q),O=window.getComputedStyle(w),K=parseInt(O.paddingTop,10),le=parseInt(O.paddingBottom,10),ce=W.top+W.height/2-vn,xe=L-ce,Se=k.offsetHeight/2,re=k.offsetTop+Se,ge=te+ae+re,Ce=q-ge;if(ge<=ce){const Me=_.length>0&&k===_[_.length-1].ref.current;h.style.bottom="0px";const Ie=g.clientHeight-w.offsetTop-w.offsetHeight,Ze=Math.max(xe,Se+(Me?le:0)+Ie+ie),yt=ge+Ze;h.style.height=yt+"px"}else{const Me=_.length>0&&k===_[0].ref.current;h.style.top="0px";const Ze=Math.max(ce,te+w.offsetTop+(Me?K:0)+Se)+Ce;h.style.height=Ze+"px",w.scrollTop=ge-ce+w.offsetTop}h.style.margin=`${vn}px 0`,h.style.minHeight=ee+"px",h.style.maxHeight=L+"px",a==null||a(),requestAnimationFrame(()=>v.current=!0)}},[C,u.trigger,u.valueNode,h,g,w,k,j,u.dir,a]);Ct(()=>N(),[N]);const[T,U]=y.useState();Ct(()=>{g&&U(window.getComputedStyle(g).zIndex)},[g]);const V=y.useCallback(W=>{W&&E.current===!0&&(N(),R==null||R(),E.current=!1)},[N,R]);return d.jsx(WN,{scope:o,contentWrapper:h,shouldExpandOnScrollRef:v,onScrollButtonChange:V,children:d.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:d.jsx(Ue.div,{...l,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});Gv.displayName=UN;var $N="SelectPopperPosition",Rd=y.forwardRef((t,r)=>{const{__scopeSelect:o,align:a="start",collisionPadding:l=vn,...u}=t,f=eu(o);return d.jsx(NN,{...f,...u,ref:r,align:a,collisionPadding:l,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Rd.displayName=$N;var[WN,jf]=Us(_o,{}),Md="SelectViewport",Yv=y.forwardRef((t,r)=>{const{__scopeSelect:o,nonce:a,...l}=t,u=oo(Md,o),f=jf(Md,o),h=rt(r,u.onViewportChange),m=y.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),d.jsx(Jl.Slot,{scope:o,children:d.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:h,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:Ke(l.onScroll,g=>{const x=g.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:C}=f;if(C!=null&&C.current&&b){const v=Math.abs(m.current-x.scrollTop);if(v>0){const E=window.innerHeight-vn*2,w=parseFloat(b.style.minHeight),k=parseFloat(b.style.height),j=Math.max(w,k);if(j<E){const R=j+v,N=Math.min(E,R),T=R-N;b.style.height=N+"px",b.style.bottom==="0px"&&(x.scrollTop=T>0?T:0,b.style.justifyContent="flex-end")}}}m.current=x.scrollTop})})})]})});Yv.displayName=Md;var Xv="SelectGroup",[HN,VN]=Us(Xv),KN=y.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=gs();return d.jsx(HN,{scope:o,id:l,children:d.jsx(Ue.div,{role:"group","aria-labelledby":l,...a,ref:r})})});KN.displayName=Xv;var Jv="SelectLabel",Zv=y.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=VN(Jv,o);return d.jsx(Ue.div,{id:l.id,...a,ref:r})});Zv.displayName=Jv;var Bl="SelectItem",[QN,e0]=Us(Bl),t0=y.forwardRef((t,r)=>{const{__scopeSelect:o,value:a,disabled:l=!1,textValue:u,...f}=t,h=ro(Bl,o),m=oo(Bl,o),g=h.value===a,[x,b]=y.useState(u??""),[C,v]=y.useState(!1),E=rt(r,R=>{var N;return(N=m.itemRefCallback)==null?void 0:N.call(m,R,a,l)}),w=gs(),k=y.useRef("touch"),j=()=>{l||(h.onValueChange(a),h.onOpenChange(!1))};if(a==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(QN,{scope:o,value:a,disabled:l,textId:w,isSelected:g,onItemTextChange:y.useCallback(R=>{b(N=>N||((R==null?void 0:R.textContent)??"").trim())},[]),children:d.jsx(Jl.ItemSlot,{scope:o,value:a,disabled:l,textValue:x,children:d.jsx(Ue.div,{role:"option","aria-labelledby":w,"data-highlighted":C?"":void 0,"aria-selected":g&&C,"data-state":g?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:E,onFocus:Ke(f.onFocus,()=>v(!0)),onBlur:Ke(f.onBlur,()=>v(!1)),onClick:Ke(f.onClick,()=>{k.current!=="mouse"&&j()}),onPointerUp:Ke(f.onPointerUp,()=>{k.current==="mouse"&&j()}),onPointerDown:Ke(f.onPointerDown,R=>{k.current=R.pointerType}),onPointerMove:Ke(f.onPointerMove,R=>{var N;k.current=R.pointerType,l?(N=m.onItemLeave)==null||N.call(m):k.current==="mouse"&&R.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ke(f.onPointerLeave,R=>{var N;R.currentTarget===document.activeElement&&((N=m.onItemLeave)==null||N.call(m))}),onKeyDown:Ke(f.onKeyDown,R=>{var T;((T=m.searchRef)==null?void 0:T.current)!==""&&R.key===" "||(IN.includes(R.key)&&j(),R.key===" "&&R.preventDefault())})})})})});t0.displayName=Bl;var Ra="SelectItemText",n0=y.forwardRef((t,r)=>{const{__scopeSelect:o,className:a,style:l,...u}=t,f=ro(Ra,o),h=oo(Ra,o),m=e0(Ra,o),g=_N(Ra,o),[x,b]=y.useState(null),C=rt(r,j=>b(j),m.onItemTextChange,j=>{var R;return(R=h.itemTextRefCallback)==null?void 0:R.call(h,j,m.value,m.disabled)}),v=x==null?void 0:x.textContent,E=y.useMemo(()=>d.jsx("option",{value:m.value,disabled:m.disabled,children:v},m.value),[m.disabled,m.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:k}=g;return Ct(()=>(w(E),()=>k(E)),[w,k,E]),d.jsxs(d.Fragment,{children:[d.jsx(Ue.span,{id:m.textId,...u,ref:C}),m.isSelected&&f.valueNode&&!f.valueNodeHasChildren?Wa.createPortal(u.children,f.valueNode):null]})});n0.displayName=Ra;var r0="SelectItemIndicator",o0=y.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t;return e0(r0,o).isSelected?d.jsx(Ue.span,{"aria-hidden":!0,...a,ref:r}):null});o0.displayName=r0;var Td="SelectScrollUpButton",s0=y.forwardRef((t,r)=>{const o=oo(Td,t.__scopeSelect),a=jf(Td,t.__scopeSelect),[l,u]=y.useState(!1),f=rt(r,a.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let h=function(){const g=m.scrollTop>0;u(g)};const m=o.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[o.viewport,o.isPositioned]),l?d.jsx(i0,{...t,ref:f,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=o;h&&m&&(h.scrollTop=h.scrollTop-m.offsetHeight)}}):null});s0.displayName=Td;var Id="SelectScrollDownButton",a0=y.forwardRef((t,r)=>{const o=oo(Id,t.__scopeSelect),a=jf(Id,t.__scopeSelect),[l,u]=y.useState(!1),f=rt(r,a.onScrollButtonChange);return Ct(()=>{if(o.viewport&&o.isPositioned){let h=function(){const g=m.scrollHeight-m.clientHeight,x=Math.ceil(m.scrollTop)<g;u(x)};const m=o.viewport;return h(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[o.viewport,o.isPositioned]),l?d.jsx(i0,{...t,ref:f,onAutoScroll:()=>{const{viewport:h,selectedItem:m}=o;h&&m&&(h.scrollTop=h.scrollTop+m.offsetHeight)}}):null});a0.displayName=Id;var i0=y.forwardRef((t,r)=>{const{__scopeSelect:o,onAutoScroll:a,...l}=t,u=oo("SelectScrollButton",o),f=y.useRef(null),h=Zl(o),m=y.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return y.useEffect(()=>()=>m(),[m]),Ct(()=>{var x;const g=h().find(b=>b.ref.current===document.activeElement);(x=g==null?void 0:g.ref.current)==null||x.scrollIntoView({block:"nearest"})},[h]),d.jsx(Ue.div,{"aria-hidden":!0,...l,ref:r,style:{flexShrink:0,...l.style},onPointerDown:Ke(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(a,50))}),onPointerMove:Ke(l.onPointerMove,()=>{var g;(g=u.onItemLeave)==null||g.call(u),f.current===null&&(f.current=window.setInterval(a,50))}),onPointerLeave:Ke(l.onPointerLeave,()=>{m()})})}),qN="SelectSeparator",l0=y.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t;return d.jsx(Ue.div,{"aria-hidden":!0,...a,ref:r})});l0.displayName=qN;var Od="SelectArrow",GN=y.forwardRef((t,r)=>{const{__scopeSelect:o,...a}=t,l=eu(o),u=ro(Od,o),f=oo(Od,o);return u.open&&f.position==="popper"?d.jsx(PN,{...l,...a,ref:r}):null});GN.displayName=Od;var YN="SelectBubbleInput",u0=y.forwardRef(({__scopeSelect:t,value:r,...o},a)=>{const l=y.useRef(null),u=rt(a,l),f=jN(r);return y.useEffect(()=>{const h=l.current;if(!h)return;const m=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(m,"value").set;if(f!==r&&x){const b=new Event("change",{bubbles:!0});x.call(h,r),h.dispatchEvent(b)}},[f,r]),d.jsx(Ue.select,{...o,style:{...zv,...o.style},ref:u,defaultValue:r})});u0.displayName=YN;function c0(t){return t===""||t===void 0}function d0(t){const r=Io(t),o=y.useRef(""),a=y.useRef(0),l=y.useCallback(f=>{const h=o.current+f;r(h),(function m(g){o.current=g,window.clearTimeout(a.current),g!==""&&(a.current=window.setTimeout(()=>m(""),1e3))})(h)},[r]),u=y.useCallback(()=>{o.current="",window.clearTimeout(a.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(a.current),[]),[o,l,u]}function f0(t,r,o){const l=r.length>1&&Array.from(r).every(g=>g===r[0])?r[0]:r,u=o?t.indexOf(o):-1;let f=XN(t,Math.max(u,0));l.length===1&&(f=f.filter(g=>g!==o));const m=f.find(g=>g.textValue.toLowerCase().startsWith(l.toLowerCase()));return m!==o?m:void 0}function XN(t,r){return t.map((o,a)=>t[(r+a)%t.length])}var JN=Fv,h0=Uv,ZN=Wv,eP=Hv,tP=Vv,p0=Kv,nP=Yv,m0=Zv,g0=t0,rP=n0,oP=o0,y0=s0,v0=a0,x0=l0;const sP=JN,aP=ZN,w0=y.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(h0,{ref:a,className:ve("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-gray-200 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 bg-white",t),...o,children:[r,d.jsx(eP,{asChild:!0,children:d.jsx(Ny,{className:"h-4 w-4 opacity-50"})})]}));w0.displayName=h0.displayName;const b0=y.forwardRef(({className:t,...r},o)=>d.jsx(y0,{ref:o,className:ve("flex cursor-default items-center justify-center py-1",t),...r,children:d.jsx(ES,{className:"h-4 w-4"})}));b0.displayName=y0.displayName;const S0=y.forwardRef(({className:t,...r},o)=>d.jsx(v0,{ref:o,className:ve("flex cursor-default items-center justify-center py-1",t),...r,children:d.jsx(Ny,{className:"h-4 w-4"})}));S0.displayName=v0.displayName;const C0=y.forwardRef(({className:t,children:r,position:o="popper",...a},l)=>d.jsx(tP,{children:d.jsxs(p0,{ref:l,className:ve("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-white",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:o,...a,children:[d.jsx(b0,{}),d.jsx(nP,{className:ve("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),d.jsx(S0,{})]})}));C0.displayName=p0.displayName;const iP=y.forwardRef(({className:t,...r},o)=>d.jsx(m0,{ref:o,className:ve("px-2 py-1.5 text-sm font-semibold",t),...r}));iP.displayName=m0.displayName;const Ad=y.forwardRef(({className:t,children:r,...o},a)=>d.jsxs(g0,{ref:a,className:ve("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-gray-100 focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 hover:bg-gray-100",t),...o,children:[d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(oP,{children:d.jsx(Ey,{className:"h-4 w-4"})})}),d.jsx(rP,{children:r})]}));Ad.displayName=g0.displayName;const lP=y.forwardRef(({className:t,...r},o)=>d.jsx(x0,{ref:o,className:ve("-mx-1 my-1 h-px bg-muted",t),...r}));lP.displayName=x0.displayName;const La="__unknown_channel__";function k0(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function yl(t){const r=t.indexOf(":");return r<=0?La:t.slice(0,r).trim()||La}function Ld(t){return t===La?Y("sessionsUnknownChannel"):t}function uP({session:t,channel:r,isSelected:o,onSelect:a}){const l=Ld(r),u=t.label||t.key.split(":").pop()||t.key;return d.jsxs("button",{onClick:a,className:ve("w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group",o?"bg-brand-50 border border-brand-100/50":"bg-transparent border border-transparent hover:bg-gray-50/80"),children:[d.jsxs("div",{className:"flex items-start justify-between mb-1.5",children:[d.jsx("div",{className:ve("font-semibold truncate pr-2 flex-1 text-sm",o?"text-brand-800":"text-gray-900"),children:u}),d.jsx("div",{className:ve("text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize",o?"bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]":"bg-gray-100 text-gray-500"),children:l})]}),d.jsxs("div",{className:ve("flex items-center text-xs justify-between mt-2 font-medium",o?"text-brand-600/80":"text-gray-400"),children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx(NS,{className:"w-3.5 h-3.5 opacity-70"}),d.jsx("span",{className:"truncate max-w-[100px]",children:k0(t.updatedAt).split(" ")[0]})]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(ps,{className:"w-3.5 h-3.5 opacity-70"}),d.jsx("span",{children:t.messageCount})]})]})]})}function cP({message:t}){const r=t.role.toLowerCase()==="user";return d.jsx("div",{className:ve("flex w-full mb-6",r?"justify-end":"justify-start"),children:d.jsxs("div",{className:ve("max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm",r?"bg-primary text-white rounded-tr-sm":"bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50"),children:[d.jsx("div",{className:"shrink-0 pt-0.5",children:r?d.jsx(HS,{className:"w-4 h-4 text-primary-100"}):d.jsx(kS,{className:"w-4 h-4 text-gray-400"})}),d.jsxs("div",{className:"flex-1 space-y-1 overflow-x-hidden",children:[d.jsxs("div",{className:"flex items-baseline justify-between gap-4 mb-2",children:[d.jsx("span",{className:ve("font-semibold text-xs",r?"text-primary-50":"text-gray-900 capitalize"),children:t.role}),d.jsx("span",{className:ve("text-[10px]",r?"text-primary-200":"text-gray-400"),children:k0(t.timestamp)})]}),d.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-[15px]",children:t.content})]})]})})}function dP(){var G,_,L;const[t,r]=y.useState(""),[o]=y.useState(100),[a]=y.useState(0),[l,u]=y.useState(null),[f,h]=y.useState("all"),[m,g]=y.useState(""),[x,b]=y.useState(""),[C,v]=y.useState(!1),E=y.useMemo(()=>({q:t.trim()||void 0,limit:o,activeMinutes:a}),[t,o,a]),w=q2(E),k=G2(l,200),j=Y2(),R=X2(),N=y.useMemo(()=>{var B;return((B=w.data)==null?void 0:B.sessions)??[]},[(G=w.data)==null?void 0:G.sessions]),T=y.useMemo(()=>N.find(B=>B.key===l),[N,l]),U=y.useMemo(()=>{const B=new Set;for(const Q of N)B.add(yl(Q.key));return Array.from(B).sort((Q,te)=>Q===La?1:te===La?-1:Q.localeCompare(te))},[N]),V=y.useMemo(()=>f==="all"?N:N.filter(B=>yl(B.key)===f),[N,f]);y.useEffect(()=>{T?(g(T.label||""),b(T.preferredModel||"")):(g(""),b("")),v(!1)},[T]);const W=()=>{l&&(j.mutate({key:l,data:{label:m.trim()||null,preferredModel:x.trim()||null}}),v(!1))},X=()=>{l&&window.confirm(Y("sessionsClearHistory")+"?")&&j.mutate({key:l,data:{clearHistory:!0}})},H=()=>{l&&window.confirm(`${Y("sessionsDeleteConfirm")} ?`)&&R.mutate({key:l},{onSuccess:()=>u(null)})};return d.jsxs("div",{className:"h-[calc(100vh-80px)] w-full max-w-[1400px] mx-auto animate-fade-in flex flex-col pt-6 pb-2",children:[d.jsx("div",{className:"flex items-center justify-between mb-6 shrink-0",children:d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900 tracking-tight",children:Y("sessionsPageTitle")}),d.jsx("p",{className:"text-sm text-gray-500 mt-1",children:Y("sessionsPageDescription")})]})}),d.jsxs("div",{className:"flex-1 flex gap-6 min-h-0 relative",children:[d.jsxs("div",{className:"w-[320px] flex flex-col shrink-0 bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden",children:[d.jsxs("div",{className:"px-4 py-4 border-b border-gray-100 bg-white z-10 shrink-0 space-y-3",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("span",{className:"text-[11px] font-semibold text-gray-400 uppercase tracking-wider",children:[N.length," ",Y("sessionsListTitle")]}),d.jsx(st,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100",onClick:()=>w.refetch(),children:d.jsx(zm,{className:ve("h-3.5 w-3.5",w.isFetching&&"animate-spin")})})]}),d.jsxs(sP,{value:f,onValueChange:h,children:[d.jsx(w0,{className:"w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700",children:d.jsx(aP,{placeholder:"All Channels"})}),d.jsxs(C0,{className:"rounded-xl shadow-lg border-gray-100 max-w-[280px]",children:[d.jsx(Ad,{value:"all",className:"rounded-lg text-xs",children:"All Channels"}),U.map(B=>d.jsx(Ad,{value:B,className:"rounded-lg text-xs truncate pr-6",children:Ld(B)},B))]})]}),d.jsxs("div",{className:"relative w-full",children:[d.jsx(Ry,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),d.jsx(Ve,{value:t,onChange:B=>r(B.target.value),placeholder:Y("sessionsSearchPlaceholder"),className:"pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs"})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1 pb-10 custom-scrollbar relative",children:w.isLoading?d.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:Y("sessionsLoading")}):V.length===0?d.jsxs("div",{className:"text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4",children:[d.jsx(Dm,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),Y("sessionsEmpty")]}):V.map(B=>d.jsx(uP,{session:B,channel:yl(B.key),isSelected:l===B.key,onSelect:()=>u(B.key)},B.key))})]}),d.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200",children:[(j.isPending||R.isPending)&&d.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20",children:d.jsx("div",{className:"h-full bg-primary animate-pulse w-1/3 rounded-r-full"})}),l&&T?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"shrink-0 border-b border-gray-100 bg-white px-8 py-5 z-10 space-y-4",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("div",{className:"h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0",children:d.jsx(Il,{className:"h-6 w-6"})}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5",children:[d.jsx("h3",{className:"text-lg font-bold text-gray-900 tracking-tight",children:T.label||T.key.split(":").pop()||T.key}),d.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest",children:Ld(yl(T.key))})]}),d.jsx("div",{className:"text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70",title:l,children:l})]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsxs(st,{variant:"outline",size:"sm",onClick:()=>v(!C),className:ve("h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold",C?"bg-gray-100 text-gray-900":"hover:bg-gray-50 hover:text-gray-900"),children:[d.jsx(tf,{className:"w-3.5 h-3.5 mr-1.5"}),"Metadata"]}),d.jsx(st,{variant:"outline",size:"sm",onClick:X,className:"h-8.5 rounded-lg shadow-none hover:bg-gray-50 hover:text-gray-900 border-gray-200 text-xs font-semibold text-gray-500",children:Y("sessionsClearHistory")}),d.jsx(st,{variant:"outline",size:"sm",onClick:H,className:"h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500",children:Y("delete")})]})]}),C&&d.jsxs("div",{className:"flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in",children:[d.jsx(Ve,{placeholder:Y("sessionsLabelPlaceholder"),value:m,onChange:B=>g(B.target.value),className:"h-8 text-sm bg-white"}),d.jsx(Ve,{placeholder:Y("sessionsModelPlaceholder"),value:x,onChange:B=>b(B.target.value),className:"h-8 text-sm bg-white"}),d.jsx(st,{size:"sm",onClick:W,className:"h-8 px-4 shrink-0 shadow-none",disabled:j.isPending,children:Y("sessionsSaveMeta")})]})]}),d.jsxs("div",{className:`flex-1 overflow-y-auto p-6 relative
337
- [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full`,children:[k.isLoading&&d.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10",children:d.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[d.jsx(zm,{className:"w-6 h-6 text-primary animate-spin"}),d.jsx("span",{className:"text-sm font-medium text-gray-500",children:Y("sessionsHistoryLoading")})]})}),k.error&&d.jsx("div",{className:"text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm",children:k.error.message}),!k.isLoading&&((_=k.data)==null?void 0:_.messages.length)===0&&d.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[d.jsx(ps,{className:"w-12 h-12 mb-3 text-gray-300"}),d.jsx("p",{className:"text-sm",children:Y("sessionsEmpty")})]}),d.jsx("div",{className:"max-w-3xl mx-auto",children:(((L=k.data)==null?void 0:L.messages)??[]).map((B,Q)=>d.jsx(cP,{message:B},`${B.timestamp}-${Q}`))})]})]}):d.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white",children:[d.jsx("div",{className:"w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3",children:d.jsx(Dm,{className:"h-8 w-8 text-gray-300 -rotate-3"})}),d.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:"No Session Selected"}),d.jsx("p",{className:"text-sm text-center max-w-sm leading-relaxed",children:"Select a session from the list on the left to view its chat history and configure its metadata."})]})]})]})]})}async function fP(t={}){var l,u;const r=new URLSearchParams;(l=t.q)!=null&&l.trim()&&r.set("q",t.q.trim()),t.type&&r.set("type",t.type),(u=t.tag)!=null&&u.trim()&&r.set("tag",t.tag.trim()),t.sort&&r.set("sort",t.sort),typeof t.page=="number"&&Number.isFinite(t.page)&&r.set("page",String(Math.max(1,Math.trunc(t.page)))),typeof t.pageSize=="number"&&Number.isFinite(t.pageSize)&&r.set("pageSize",String(Math.max(1,Math.trunc(t.pageSize))));const o=r.toString(),a=await kt.get(o?`/api/marketplace/items?${o}`:"/api/marketplace/items");if(!a.ok)throw new Error(a.error.message);return a.data}async function hP(t={}){var l;const r=new URLSearchParams;(l=t.scene)!=null&&l.trim()&&r.set("scene",t.scene.trim()),typeof t.limit=="number"&&Number.isFinite(t.limit)&&r.set("limit",String(Math.max(1,Math.trunc(t.limit))));const o=r.toString(),a=await kt.get(o?`/api/marketplace/recommendations?${o}`:"/api/marketplace/recommendations");if(!a.ok)throw new Error(a.error.message);return a.data}async function pP(t){const r=await kt.post("/api/marketplace/install",t);if(!r.ok)throw new Error(r.error.message);return r.data}async function mP(){const t=await kt.get("/api/marketplace/installed");if(!t.ok)throw new Error(t.error.message);return t.data}function gP(t){return to({queryKey:["marketplace-items",t],queryFn:()=>fP(t),staleTime:15e3})}function yP(t){return to({queryKey:["marketplace-recommendations",t],queryFn:()=>hP(t),staleTime:3e4})}function vP(){return to({queryKey:["marketplace-installed"],queryFn:mP,staleTime:1e4})}function xP(){const t=gr();return no({mutationFn:r=>pP(r),onSuccess:r=>{t.invalidateQueries({queryKey:["marketplace-installed"]}),nt.success(r.message||`${r.type} installed`)},onError:r=>{nt.error(r.message||"Install failed")}})}const wP=12;function bP(t){return{plugin:new Set((t==null?void 0:t.pluginSpecs)??[]),skill:new Set((t==null?void 0:t.skillSpecs)??[])}}function _d(t,r){return t.type==="plugin"?r.plugin.has(t.install.spec):r.skill.has(t.install.spec)}function E0({type:t}){return d.jsx("span",{className:ve("text-[11px] uppercase px-2 py-1 rounded-full font-semibold",t==="plugin"?"bg-blue-50 text-blue-600":"bg-emerald-50 text-emerald-600"),children:t})}function N0(){return d.jsx("span",{className:"text-[11px] px-2 py-1 rounded-full font-semibold bg-indigo-50 text-indigo-600",children:"Installed"})}function SP(t){return d.jsx("div",{className:"bg-white border border-gray-200 rounded-2xl p-4 mb-5",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[d.jsxs("div",{className:"md:col-span-2 relative",children:[d.jsx(DS,{className:"h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2"}),d.jsx("input",{value:t.searchText,onChange:r=>t.onSearchTextChange(r.target.value),placeholder:"Search by name, slug, tags...",className:"w-full h-10 border border-gray-200 rounded-lg pl-9 pr-3 text-sm focus:outline-none focus:ring-2 focus:ring-primary/30"})]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs("select",{className:"flex-1 h-10 border border-gray-200 rounded-lg px-3 text-sm bg-white",value:t.typeFilter,onChange:r=>t.onTypeFilterChange(r.target.value),children:[d.jsx("option",{value:"all",children:"All"}),d.jsx("option",{value:"plugin",children:"Plugins"}),d.jsx("option",{value:"skill",children:"Skills"})]}),d.jsxs("select",{className:"flex-1 h-10 border border-gray-200 rounded-lg px-3 text-sm bg-white",value:t.sort,onChange:r=>t.onSortChange(r.target.value),children:[d.jsx("option",{value:"relevance",children:"Relevance"}),d.jsx("option",{value:"updated",children:"Recently Updated"}),d.jsx("option",{value:"downloads",children:"Downloads"})]})]})]})})}function P0(t){const r=t.installState.isPending&&t.installState.installingSpec===t.item.install.spec;return t.installed?d.jsx("button",{disabled:!0,className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg text-xs font-semibold bg-gray-100 text-gray-500 cursor-not-allowed",children:"Installed"}):d.jsxs("button",{onClick:()=>t.onInstall(t.item),disabled:t.installState.isPending,className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg text-xs font-semibold bg-gray-900 text-white hover:bg-black disabled:opacity-50",children:[d.jsx(jS,{className:"h-3.5 w-3.5"}),r?"Installing...":"Install"]})}function CP(t){return d.jsxs("section",{className:"mb-6",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[d.jsx(nf,{className:"h-4 w-4 text-amber-500"}),d.jsx("h3",{className:"text-[15px] font-bold text-gray-900",children:"Recommended"})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.items.map(r=>{const o=_d(r,t.installedSets);return d.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4",children:[d.jsxs("div",{className:"flex items-start justify-between gap-3",children:[d.jsxs("div",{children:[d.jsx("div",{className:"text-[14px] font-semibold text-gray-900",children:r.name}),d.jsx("div",{className:"text-[12px] text-gray-500 mt-0.5",children:r.summary})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(E0,{type:r.type}),o&&d.jsx(N0,{})]})]}),d.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[d.jsx("code",{className:"text-[11px] text-gray-500 bg-gray-100 rounded px-2 py-1",children:r.install.spec}),d.jsx(P0,{item:r,installed:o,installState:t.installState,onInstall:t.onInstall})]})]},r.id)}),t.loading&&d.jsx("div",{className:"text-[13px] text-gray-500",children:"Loading recommendations..."}),!t.loading&&t.items.length===0&&d.jsx("div",{className:"text-[13px] text-gray-500",children:"No recommendations yet."})]})]})}function kP(t){var o;const r=(o=t.item.metrics)==null?void 0:o.downloads30d;return d.jsxs("article",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-sm transition-shadow",children:[d.jsxs("div",{className:"flex items-start justify-between gap-2",children:[d.jsx("h4",{className:"text-[14px] font-semibold text-gray-900",children:t.item.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(E0,{type:t.item.type}),t.installed&&d.jsx(N0,{})]})]}),d.jsx("p",{className:"text-[12px] text-gray-500 mt-1 min-h-10",children:t.item.summary}),d.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:t.item.tags.slice(0,3).map(a=>d.jsx("span",{className:"text-[11px] px-2 py-0.5 rounded-full bg-gray-100 text-gray-600",children:a},`${t.item.id}-${a}`))}),d.jsxs("div",{className:"mt-3 text-[11px] text-gray-500",children:["By ",t.item.author]}),d.jsx("div",{className:"mt-1 text-[11px] text-gray-500",children:r?`${r} downloads / 30d`:"No metrics"}),d.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-100 flex items-center justify-between gap-2",children:[d.jsx("code",{className:"text-[11px] text-gray-500 bg-gray-100 rounded px-2 py-1 truncate",children:t.item.install.spec}),d.jsx(P0,{item:t.item,installed:t.installed,installState:t.installState,onInstall:t.onInstall})]})]})}function EP(t){return d.jsxs("div",{className:"mt-5 flex items-center justify-end gap-2",children:[d.jsx("button",{className:"h-8 px-3 rounded-lg border border-gray-200 text-sm text-gray-700 disabled:opacity-40",onClick:t.onPrev,disabled:t.page<=1||t.busy,children:"Prev"}),d.jsx("div",{className:"text-sm text-gray-600 min-w-20 text-center",children:t.totalPages===0?"0 / 0":`${t.page} / ${t.totalPages}`}),d.jsx("button",{className:"h-8 px-3 rounded-lg border border-gray-200 text-sm text-gray-700 disabled:opacity-40",onClick:t.onNext,disabled:t.totalPages===0||t.page>=t.totalPages||t.busy,children:"Next"})]})}function NP(){var L,B,Q,te,ae,ie;const[t,r]=y.useState(""),[o,a]=y.useState(""),[l,u]=y.useState("all"),[f,h]=y.useState("all"),[m,g]=y.useState("relevance"),[x,b]=y.useState(1);y.useEffect(()=>{const F=setTimeout(()=>{b(1),a(t.trim())},250);return()=>clearTimeout(F)},[t]);const C=vP(),w=gP({q:o||void 0,type:f==="all"?void 0:f,sort:m,page:l==="installed"?1:x,pageSize:l==="installed"?100:wP}),k=yP({scene:"default",limit:4}),j=xP(),R=bP(C.data),N=((L=w.data)==null?void 0:L.items)??[],T=l==="installed"?N.filter(F=>_d(F,R)):N,U=((B=k.data)==null?void 0:B.items)??[],V=l==="installed"?T.length:((Q=w.data)==null?void 0:Q.total)??0,W=l==="installed"?1:((te=w.data)==null?void 0:te.totalPages)??0,X=y.useMemo(()=>w.data?T.length===0?l==="installed"?"No installed items on this page":"No results":`Showing ${T.length} / ${V}`:"Loading...",[T.length,w.data,l,V]),H={isPending:j.isPending,installingSpec:(ae=j.variables)==null?void 0:ae.spec},G=[{id:"all",label:"Marketplace"},{id:"installed",label:"Installed",count:((ie=C.data)==null?void 0:ie.total)??0}],_=F=>{j.isPending||j.mutate({type:F.type,spec:F.install.spec})};return d.jsxs("div",{className:"animate-fade-in pb-20",children:[d.jsxs("div",{className:"flex items-center justify-between mb-6",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Marketplace"}),d.jsx("p",{className:"text-[13px] text-gray-500 mt-1",children:"Search, discover and install plugins/skills."})]}),d.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-indigo-50 text-indigo-600 text-xs font-semibold",children:[d.jsx(My,{className:"h-3.5 w-3.5"}),"Read-only Catalog"]})]}),d.jsx(vf,{tabs:G,activeTab:l,onChange:F=>{u(F),b(1)},className:"mb-5"}),d.jsx(SP,{searchText:t,typeFilter:f,sort:m,onSearchTextChange:r,onTypeFilterChange:F=>{b(1),h(F)},onSortChange:F=>{b(1),g(F)}}),d.jsx(CP,{items:U,loading:k.isLoading,installState:H,installedSets:R,onInstall:_}),d.jsxs("section",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("h3",{className:"text-[15px] font-bold text-gray-900",children:l==="installed"?"Installed Items":"All Items"}),d.jsx("span",{className:"text-[12px] text-gray-500",children:X})]}),w.isError&&d.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm",children:["Failed to load marketplace data: ",w.error.message]}),d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-3",children:T.map(F=>d.jsx(kP,{item:F,installed:_d(F,R),installState:H,onInstall:_},F.id))}),!w.isLoading&&!w.isError&&T.length===0&&d.jsx("div",{className:"text-[13px] text-gray-500 py-8 text-center",children:"No items found."})]}),l==="all"&&d.jsx(EP,{page:x,totalPages:W,busy:w.isFetching,onPrev:()=>b(F=>Math.max(1,F-1)),onNext:()=>b(F=>W>0?Math.min(W,F+1):F+1)})]})}class PP{constructor(r){this.url=r,this.ws=null,this.handlers=new Map,this.reconnectTimer=null,this.manualClose=!1}connect(){this.manualClose=!1,this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("WebSocket connected"),this.emit({type:"connection.open",payload:{}})},this.ws.onmessage=r=>{try{const o=JSON.parse(r.data);this.emit(o)}catch(o){console.error("Failed to parse WebSocket message:",o)}},this.ws.onclose=()=>{console.log("WebSocket disconnected"),this.manualClose||this.scheduleReconnect()},this.ws.onerror=r=>{console.error("WebSocket error:",r)}}on(r,o){this.handlers.has(r)||this.handlers.set(r,new Set),this.handlers.get(r).add(o)}off(r,o){var a;(a=this.handlers.get(r))==null||a.delete(o)}emit(r){const o=this.handlers.get(r.type);o==null||o.forEach(a=>a(r))}scheduleReconnect(){this.reconnectTimer||(this.reconnectTimer=window.setTimeout(()=>{this.reconnectTimer=null,this.connect()},3e3))}disconnect(){var r;this.manualClose=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),(r=this.ws)==null||r.close(),this.ws=null}}function jP(t){const[r,o]=y.useState(null),{setConnectionStatus:a}=Ha();return y.useEffect(()=>{const l=(()=>{const f=El==null?void 0:El.replace(/\/$/,"");if(!f)return"ws://127.0.0.1:18791/ws";try{const h=new URL(f,window.location.origin);return`${h.protocol==="https:"?"wss:":h.protocol==="http:"?"ws:":h.protocol}//${h.host}/ws`}catch{return f.startsWith("wss://")||f.startsWith("ws://")?`${f}/ws`:f.startsWith("https://")?`${f.replace(/^https:/,"wss:")}/ws`:f.startsWith("http://")?`${f.replace(/^http:/,"ws:")}/ws`:`${f}/ws`}})(),u=new PP(l);return u.on("connection.open",()=>{a("connected")}),u.on("config.updated",()=>{t&&t.invalidateQueries({queryKey:["config"]})}),u.on("error",f=>{f.type==="error"&&console.error("WebSocket error:",f.payload.message)}),u.connect(),o(u),()=>u.disconnect()},[a,t]),r}const Cg=new jb({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}});function RP(){jP(Cg);const t=mr();return d.jsxs(Rb,{client:Cg,children:[d.jsx(ZS,{children:d.jsx("div",{className:"animate-fade-in w-full h-full",children:d.jsxs(N1,{children:[d.jsx(rr,{path:"/model",element:d.jsx(Z2,{})}),d.jsx(rr,{path:"/providers",element:d.jsx(Wk,{})}),d.jsx(rr,{path:"/channels",element:d.jsx(Yk,{})}),d.jsx(rr,{path:"/runtime",element:d.jsx(eE,{})}),d.jsx(rr,{path:"/sessions",element:d.jsx(dP,{})}),d.jsx(rr,{path:"/marketplace",element:d.jsx(NP,{})}),d.jsx(rr,{path:"/",element:d.jsx(bm,{to:"/model",replace:!0})}),d.jsx(rr,{path:"*",element:d.jsx(bm,{to:"/model",replace:!0})})]})},t.pathname)}),d.jsx($2,{position:"top-right",richColors:!0})]})}Rw.createRoot(document.getElementById("root")).render(d.jsx(y.StrictMode,{children:d.jsx(Y1,{children:d.jsx(RP,{})})}));