(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const o of l)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(l){const o={};return l.integrity&&(o.integrity=l.integrity),l.referrerPolicy&&(o.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?o.credentials="include":l.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(l){if(l.ep)return;l.ep=!0;const o=n(l);fetch(l.href,o)}})();function Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _a={exports:{}},Zl={},Na={exports:{}},F={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var $r=Symbol.for("react.element"),Yd=Symbol.for("react.portal"),Zd=Symbol.for("react.fragment"),Jd=Symbol.for("react.strict_mode"),qd=Symbol.for("react.profiler"),bd=Symbol.for("react.provider"),ep=Symbol.for("react.context"),tp=Symbol.for("react.forward_ref"),np=Symbol.for("react.suspense"),rp=Symbol.for("react.memo"),lp=Symbol.for("react.lazy"),ts=Symbol.iterator;function op(e){return e===null||typeof e!="object"?null:(e=ts&&e[ts]||e["@@iterator"],typeof e=="function"?e:null)}var Ta={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ja=Object.assign,La={};function Hn(e,t,n){this.props=e,this.context=t,this.refs=La,this.updater=n||Ta}Hn.prototype.isReactComponent={};Hn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Hn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Oa(){}Oa.prototype=Hn.prototype;function Yi(e,t,n){this.props=e,this.context=t,this.refs=La,this.updater=n||Ta}var Zi=Yi.prototype=new Oa;Zi.constructor=Yi;ja(Zi,Hn.prototype);Zi.isPureReactComponent=!0;var ns=Array.isArray,Ra=Object.prototype.hasOwnProperty,Ji={current:null},Pa={key:!0,ref:!0,__self:!0,__source:!0};function Fa(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Ra.call(t,r)&&!Pa.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,A=C[I];if(0>>1;Il(tt,R))Pel(vt,tt)?(C[I]=vt,C[Pe]=R,I=Pe):(C[I]=tt,C[Re]=R,I=Re);else if(Pel(vt,R))C[I]=vt,C[Pe]=R,I=Pe;else break e}}return O}function l(C,O){var R=C.sortIndex-O.sortIndex;return R!==0?R:C.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],a=[],m=1,h=null,d=3,g=!1,w=!1,E=!1,L=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(C){for(var O=n(a);O!==null;){if(O.callback===null)r(a);else if(O.startTime<=C)r(a),O.sortIndex=O.expirationTime,t(s,O);else break;O=n(a)}}function x(C){if(E=!1,v(C),!w)if(n(s)!==null)w=!0,Oe(N);else{var O=n(a);O!==null&&Ye(x,O.startTime-C)}}function N(C,O){w=!1,E&&(E=!1,p(j),j=-1),g=!0;var R=d;try{for(v(O),h=n(s);h!==null&&(!(h.expirationTime>O)||C&&!ie());){var I=h.callback;if(typeof I=="function"){h.callback=null,d=h.priorityLevel;var A=I(h.expirationTime<=O);O=e.unstable_now(),typeof A=="function"?h.callback=A:h===n(s)&&r(s),v(O)}else r(s);h=n(s)}if(h!==null)var fe=!0;else{var Re=n(a);Re!==null&&Ye(x,Re.startTime-O),fe=!1}return fe}finally{h=null,d=R,g=!1}}var k=!1,_=null,j=-1,B=5,P=-1;function ie(){return!(e.unstable_now()-PC||125I?(C.sortIndex=R,t(a,C),n(s)===null&&C===n(a)&&(E?(p(j),j=-1):E=!0,Ye(x,R-I))):(C.sortIndex=A,t(s,C),w||g||(w=!0,Oe(N))),C},e.unstable_shouldYield=ie,e.unstable_wrapCallback=function(C){var O=d;return function(){var R=d;d=O;try{return C.apply(this,arguments)}finally{d=R}}}})(Ia);$a.exports=Ia;var vp=$a.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Da=y,Te=vp;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zo=Object.prototype.hasOwnProperty,yp=/^[: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]*$/,ls={},os={};function gp(e){return Zo.call(os,e)?!0:Zo.call(ls,e)?!1:yp.test(e)?os[e]=!0:(ls[e]=!0,!1)}function wp(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function xp(e,t,n,r){if(t===null||typeof t>"u"||wp(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ve(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var oe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){oe[e]=new ve(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];oe[t]=new ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){oe[e]=new ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){oe[e]=new ve(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){oe[e]=new ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){oe[e]=new ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){oe[e]=new ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){oe[e]=new ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){oe[e]=new ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var bi=/[\-:]([a-z])/g;function eu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(bi,eu);oe[t]=new ve(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(bi,eu);oe[t]=new ve(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(bi,eu);oe[t]=new ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){oe[e]=new ve(e,1,!1,e.toLowerCase(),null,!1,!1)});oe.xlinkHref=new ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){oe[e]=new ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function tu(e,t,n,r){var l=oe.hasOwnProperty(t)?oe[t]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` `+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{wo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?lr(e):""}function Sp(e){switch(e.tag){case 5:return lr(e.type);case 16:return lr("Lazy");case 13:return lr("Suspense");case 19:return lr("SuspenseList");case 0:case 2:case 15:return e=xo(e.type,!1),e;case 11:return e=xo(e.type.render,!1),e;case 1:return e=xo(e.type,!0),e;default:return""}}function ei(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 vn:return"Fragment";case hn:return"Portal";case Jo:return"Profiler";case nu:return"StrictMode";case qo:return"Suspense";case bo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ua:return(e.displayName||"Context")+".Consumer";case Ba:return(e._context.displayName||"Context")+".Provider";case ru:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case lu:return t=e.displayName||null,t!==null?t:ei(e.type)||"Memo";case wt:t=e._payload,e=e._init;try{return ei(e(t))}catch{}}return null}function Ep(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ei(t);case 8:return t===nu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function zt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Va(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kp(e){var t=Va(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kr(e){e._valueTracker||(e._valueTracker=kp(e))}function Wa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Va(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Sl(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 ti(e,t){var n=t.checked;return Y({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function us(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=zt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Qa(e,t){t=t.checked,t!=null&&tu(e,"checked",t,!1)}function ni(e,t){Qa(e,t);var n=zt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ri(e,t.type,n):t.hasOwnProperty("defaultValue")&&ri(e,t.type,zt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ss(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ri(e,t,n){(t!=="number"||Sl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var or=Array.isArray;function jn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Gr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function wr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ar={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},Cp=["Webkit","ms","Moz","O"];Object.keys(ar).forEach(function(e){Cp.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ar[t]=ar[e]})});function Ya(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ar.hasOwnProperty(e)&&ar[e]?(""+t).trim():t+"px"}function Za(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ya(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var _p=Y({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 ii(e,t){if(t){if(_p[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62))}}function ui(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var si=null;function ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ai=null,Ln=null,On=null;function fs(e){if(e=Ar(e)){if(typeof ai!="function")throw Error(S(280));var t=e.stateNode;t&&(t=to(t),ai(e.stateNode,e.type,t))}}function Ja(e){Ln?On?On.push(e):On=[e]:Ln=e}function qa(){if(Ln){var e=Ln,t=On;if(On=Ln=null,fs(e),t)for(e=0;e>>=0,e===0?32:31-($p(e)/Ip|0)|0}var Xr=64,Yr=4194304;function ir(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 _l(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=ir(u):(o&=i,o!==0&&(r=ir(o)))}else i=n&~l,i!==0?r=ir(i):o!==0&&(r=ir(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ir(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-We(t),e[t]=n}function Up(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=fr),xs=String.fromCharCode(32),Ss=!1;function gc(e,t){switch(e){case"keyup":return hm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function ym(e,t){switch(e){case"compositionend":return wc(t);case"keypress":return t.which!==32?null:(Ss=!0,xs);case"textInput":return e=t.data,e===xs&&Ss?null:e;default:return null}}function gm(e,t){if(yn)return e==="compositionend"||!pu&&gc(e,t)?(e=vc(),dl=cu=Ct=null,yn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_s(n)}}function kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cc(){for(var e=window,t=Sl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Sl(e.document)}return t}function mu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tm(e){var t=Cc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kc(n.ownerDocument.documentElement,n)){if(r!==null&&mu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Ns(n,o);var i=Ns(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,gn=null,hi=null,pr=null,vi=!1;function Ts(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vi||gn==null||gn!==Sl(r)||(r=gn,"selectionStart"in r&&mu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),pr&&_r(pr,r)||(pr=r,r=jl(hi,"onSelect"),0Sn||(e.current=Ei[Sn],Ei[Sn]=null,Sn--)}function U(e,t){Sn++,Ei[Sn]=e.current,e.current=t}var $t={},ce=Dt($t),Se=Dt(!1),Jt=$t;function zn(e,t){var n=e.type.contextTypes;if(!n)return $t;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ee(e){return e=e.childContextTypes,e!=null}function Ol(){W(Se),W(ce)}function Ms(e,t,n){if(ce.current!==$t)throw Error(S(168));U(ce,t),U(Se,n)}function Fc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(S(108,Ep(e)||"Unknown",l));return Y({},n,r)}function Rl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$t,Jt=ce.current,U(ce,e),U(Se,Se.current),!0}function zs(e,t,n){var r=e.stateNode;if(!r)throw Error(S(169));n?(e=Fc(e,t,Jt),r.__reactInternalMemoizedMergedChildContext=e,W(Se),W(ce),U(ce,e)):W(Se),U(Se,n)}var lt=null,no=!1,Mo=!1;function Mc(e){lt===null?lt=[e]:lt.push(e)}function Am(e){no=!0,Mc(e)}function At(){if(!Mo&<!==null){Mo=!0;var e=0,t=D;try{var n=lt;for(D=1;e>=i,l-=i,ot=1<<32-We(t)+l|n<j?(B=_,_=null):B=_.sibling;var P=d(p,_,v[j],x);if(P===null){_===null&&(_=B);break}e&&_&&P.alternate===null&&t(p,_),c=o(P,c,j),k===null?N=P:k.sibling=P,k=P,_=B}if(j===v.length)return n(p,_),Q&&Ut(p,j),N;if(_===null){for(;jj?(B=_,_=null):B=_.sibling;var ie=d(p,_,P.value,x);if(ie===null){_===null&&(_=B);break}e&&_&&ie.alternate===null&&t(p,_),c=o(ie,c,j),k===null?N=ie:k.sibling=ie,k=ie,_=B}if(P.done)return n(p,_),Q&&Ut(p,j),N;if(_===null){for(;!P.done;j++,P=v.next())P=h(p,P.value,x),P!==null&&(c=o(P,c,j),k===null?N=P:k.sibling=P,k=P);return Q&&Ut(p,j),N}for(_=r(p,_);!P.done;j++,P=v.next())P=g(_,p,j,P.value,x),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?j:P.key),c=o(P,c,j),k===null?N=P:k.sibling=P,k=P);return e&&_.forEach(function(Ge){return t(p,Ge)}),Q&&Ut(p,j),N}function L(p,c,v,x){if(typeof v=="object"&&v!==null&&v.type===vn&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Qr:e:{for(var N=v.key,k=c;k!==null;){if(k.key===N){if(N=v.type,N===vn){if(k.tag===7){n(p,k.sibling),c=l(k,v.props.children),c.return=p,p=c;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===wt&&Hs(N)===k.type){n(p,k.sibling),c=l(k,v.props),c.ref=tr(p,k,v),c.return=p,p=c;break e}n(p,k);break}else t(p,k);k=k.sibling}v.type===vn?(c=Yt(v.props.children,p.mode,x,v.key),c.return=p,p=c):(x=xl(v.type,v.key,v.props,null,p.mode,x),x.ref=tr(p,c,v),x.return=p,p=x)}return i(p);case hn:e:{for(k=v.key;c!==null;){if(c.key===k)if(c.tag===4&&c.stateNode.containerInfo===v.containerInfo&&c.stateNode.implementation===v.implementation){n(p,c.sibling),c=l(c,v.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=Ho(v,p.mode,x),c.return=p,p=c}return i(p);case wt:return k=v._init,L(p,c,k(v._payload),x)}if(or(v))return w(p,c,v,x);if(Zn(v))return E(p,c,v,x);nl(p,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,v),c.return=p,p=c):(n(p,c),c=Uo(v,p.mode,x),c.return=p,p=c),i(p)):n(p,c)}return L}var In=Hc(!0),Vc=Hc(!1),Br={},et=Dt(Br),Lr=Dt(Br),Or=Dt(Br);function Gt(e){if(e===Br)throw Error(S(174));return e}function ku(e,t){switch(U(Or,t),U(Lr,e),U(et,Br),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:oi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=oi(t,e)}W(et),U(et,t)}function Dn(){W(et),W(Lr),W(Or)}function Wc(e){Gt(Or.current);var t=Gt(et.current),n=oi(t,e.type);t!==n&&(U(Lr,e),U(et,n))}function Cu(e){Lr.current===e&&(W(et),W(Lr))}var G=Dt(0);function Il(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var zo=[];function _u(){for(var e=0;en?n:4,e(!0);var r=$o.transition;$o.transition={};try{e(!1),t()}finally{D=n,$o.transition=r}}function uf(){return Ae().memoizedState}function Vm(e,t,n){var r=Pt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},sf(e))af(t,n);else if(n=Dc(e,t,n,r),n!==null){var l=me();Qe(n,e,r,l),cf(n,t,r)}}function Wm(e,t,n){var r=Pt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(sf(e))af(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,Ke(u,i)){var s=t.interleaved;s===null?(l.next=l,Su(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=Dc(e,t,l,r),n!==null&&(l=me(),Qe(n,e,r,l),cf(n,t,r))}}function sf(e){var t=e.alternate;return e===X||t!==null&&t===X}function af(e,t){mr=Dl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function cf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,uu(e,n)}}var Al={readContext:De,useCallback:ue,useContext:ue,useEffect:ue,useImperativeHandle:ue,useInsertionEffect:ue,useLayoutEffect:ue,useMemo:ue,useReducer:ue,useRef:ue,useState:ue,useDebugValue:ue,useDeferredValue:ue,useTransition:ue,useMutableSource:ue,useSyncExternalStore:ue,useId:ue,unstable_isNewReconciler:!1},Qm={readContext:De,useCallback:function(e,t){return Je().memoizedState=[e,t===void 0?null:t],e},useContext:De,useEffect:Ws,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,vl(4194308,4,tf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return vl(4194308,4,e,t)},useInsertionEffect:function(e,t){return vl(4,2,e,t)},useMemo:function(e,t){var n=Je();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Je();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Vm.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=Je();return e={current:e},t.memoizedState=e},useState:Vs,useDebugValue:Ou,useDeferredValue:function(e){return Je().memoizedState=e},useTransition:function(){var e=Vs(!1),t=e[0];return e=Hm.bind(null,e[1]),Je().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,l=Je();if(Q){if(n===void 0)throw Error(S(407));n=n()}else{if(n=t(),ne===null)throw Error(S(349));bt&30||Gc(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Ws(Yc.bind(null,r,o,e),[e]),r.flags|=2048,Fr(9,Xc.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Je(),t=ne.identifierPrefix;if(Q){var n=it,r=ot;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[qe]=t,e[jr]=r,wf(e,t,!1,!1),t.stateNode=e;e:{switch(i=ui(n,r),n){case"dialog":V("cancel",e),V("close",e),l=r;break;case"iframe":case"object":case"embed":V("load",e),l=r;break;case"video":case"audio":for(l=0;lBn&&(t.flags|=128,r=!0,nr(o,!1),t.lanes=4194304)}else{if(!r)if(e=Il(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),nr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Q)return se(t),null}else 2*J()-o.renderingStartTime>Bn&&n!==1073741824&&(t.flags|=128,r=!0,nr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=J(),t.sibling=null,n=G.current,U(G,r?n&1|2:n&1),t):(se(t),null);case 22:case 23:return $u(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ce&1073741824&&(se(t),t.subtreeFlags&6&&(t.flags|=8192)):se(t),null;case 24:return null;case 25:return null}throw Error(S(156,t.tag))}function bm(e,t){switch(vu(t),t.tag){case 1:return Ee(t.type)&&Ol(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Dn(),W(Se),W(ce),_u(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Cu(t),null;case 13:if(W(G),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(S(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return W(G),null;case 4:return Dn(),null;case 10:return xu(t.type._context),null;case 22:case 23:return $u(),null;case 24:return null;default:return null}}var ll=!1,ae=!1,eh=typeof WeakSet=="function"?WeakSet:Set,T=null;function _n(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function Mi(e,t,n){try{n()}catch(r){Z(e,t,r)}}var bs=!1;function th(e,t){if(yi=Nl,e=Cc(),mu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,m=0,h=e,d=null;t:for(;;){for(var g;h!==n||l!==0&&h.nodeType!==3||(u=i+l),h!==o||r!==0&&h.nodeType!==3||(s=i+r),h.nodeType===3&&(i+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===n&&++a===l&&(u=i),d===o&&++m===r&&(s=i),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(gi={focusedElem:e,selectionRange:n},Nl=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var E=w.memoizedProps,L=w.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?E:Ue(t.type,E),L);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(x){Z(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return w=bs,bs=!1,w}function hr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Mi(t,n,o)}l=l.next}while(l!==r)}}function oo(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ef(e){var t=e.alternate;t!==null&&(e.alternate=null,Ef(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[qe],delete t[jr],delete t[Si],delete t[Im],delete t[Dm])),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 kf(e){return e.tag===5||e.tag===3||e.tag===4}function ea(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kf(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 $i(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ll));else if(r!==4&&(e=e.child,e!==null))for($i(e,t,n),e=e.sibling;e!==null;)$i(e,t,n),e=e.sibling}function Ii(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ii(e,t,n),e=e.sibling;e!==null;)Ii(e,t,n),e=e.sibling}var re=null,He=!1;function yt(e,t,n){for(n=n.child;n!==null;)Cf(e,t,n),n=n.sibling}function Cf(e,t,n){if(be&&typeof be.onCommitFiberUnmount=="function")try{be.onCommitFiberUnmount(Jl,n)}catch{}switch(n.tag){case 5:ae||_n(n,t);case 6:var r=re,l=He;re=null,yt(e,t,n),re=r,He=l,re!==null&&(He?(e=re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):re.removeChild(n.stateNode));break;case 18:re!==null&&(He?(e=re,n=n.stateNode,e.nodeType===8?Fo(e.parentNode,n):e.nodeType===1&&Fo(e,n),kr(e)):Fo(re,n.stateNode));break;case 4:r=re,l=He,re=n.stateNode.containerInfo,He=!0,yt(e,t,n),re=r,He=l;break;case 0:case 11:case 14:case 15:if(!ae&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Mi(n,t,i),l=l.next}while(l!==r)}yt(e,t,n);break;case 1:if(!ae&&(_n(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Z(n,t,u)}yt(e,t,n);break;case 21:yt(e,t,n);break;case 22:n.mode&1?(ae=(r=ae)||n.memoizedState!==null,yt(e,t,n),ae=r):yt(e,t,n);break;default:yt(e,t,n)}}function ta(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eh),t.forEach(function(r){var l=ch.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Be(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=J()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rh(r/1960))-r,10e?16:e,_t===null)var r=!1;else{if(e=_t,_t=null,Hl=0,z&6)throw Error(S(331));var l=z;for(z|=4,T=e.current;T!==null;){var o=T,i=o.child;if(T.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sJ()-Mu?Xt(e,0):Fu|=n),ke(e,t)}function Pf(e,t){t===0&&(e.mode&1?(t=Yr,Yr<<=1,!(Yr&130023424)&&(Yr=4194304)):t=1);var n=me();e=ft(e,t),e!==null&&(Ir(e,t,n),ke(e,n))}function ah(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Pf(e,n)}function ch(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(S(314))}r!==null&&r.delete(t),Pf(e,n)}var Ff;Ff=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Se.current)xe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xe=!1,Jm(e,t,n);xe=!!(e.flags&131072)}else xe=!1,Q&&t.flags&1048576&&zc(t,Fl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yl(e,t),e=t.pendingProps;var l=zn(t,ce.current);Pn(t,n),l=Tu(null,t,r,e,l,n);var o=ju();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ee(r)?(o=!0,Rl(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Eu(t),l.updater=ro,t.stateNode=l,l._reactInternals=t,Ti(t,r,e,n),t=Oi(null,t,r,!0,o,n)):(t.tag=0,Q&&o&&hu(t),de(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yl(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=dh(r),e=Ue(r,e),l){case 0:t=Li(null,t,r,e,n);break e;case 1:t=Zs(null,t,r,e,n);break e;case 11:t=Xs(null,t,r,e,n);break e;case 14:t=Ys(null,t,r,Ue(r.type,e),n);break e}throw Error(S(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Li(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Zs(e,t,r,l,n);case 3:e:{if(vf(t),e===null)throw Error(S(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Ac(e,t),$l(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=An(Error(S(423)),t),t=Js(e,t,r,n,l);break e}else if(r!==l){l=An(Error(S(424)),t),t=Js(e,t,r,n,l);break e}else for(_e=Lt(t.stateNode.containerInfo.firstChild),Ne=t,Q=!0,Ve=null,n=Vc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($n(),r===l){t=dt(e,t,n);break e}de(e,t,r,n)}t=t.child}return t;case 5:return Wc(t),e===null&&Ci(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,wi(r,l)?i=null:o!==null&&wi(r,o)&&(t.flags|=32),hf(e,t),de(e,t,i,n),t.child;case 6:return e===null&&Ci(t),null;case 13:return yf(e,t,n);case 4:return ku(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=In(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),Xs(e,t,r,l,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,U(Ml,r._currentValue),r._currentValue=i,o!==null)if(Ke(o.value,i)){if(o.children===l.children&&!Se.current){t=dt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=ut(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var m=a.pending;m===null?s.next=s:(s.next=m.next,m.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),_i(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(S(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),_i(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}de(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,Pn(t,n),l=De(l),r=r(l),t.flags|=1,de(e,t,r,n),t.child;case 14:return r=t.type,l=Ue(r,t.pendingProps),l=Ue(r.type,l),Ys(e,t,r,l,n);case 15:return pf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ue(r,l),yl(e,t),t.tag=1,Ee(r)?(e=!0,Rl(t)):e=!1,Pn(t,n),Uc(t,r,l),Ti(t,r,l,n),Oi(null,t,r,!0,e,n);case 19:return gf(e,t,n);case 22:return mf(e,t,n)}throw Error(S(156,t.tag))};function Mf(e,t){return oc(e,t)}function fh(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $e(e,t,n,r){return new fh(e,t,n,r)}function Du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dh(e){if(typeof e=="function")return Du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ru)return 11;if(e===lu)return 14}return 2}function Ft(e,t){var n=e.alternate;return n===null?(n=$e(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function xl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Du(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case vn:return Yt(n.children,l,o,t);case nu:i=8,l|=8;break;case Jo:return e=$e(12,n,t,l|2),e.elementType=Jo,e.lanes=o,e;case qo:return e=$e(13,n,t,l),e.elementType=qo,e.lanes=o,e;case bo:return e=$e(19,n,t,l),e.elementType=bo,e.lanes=o,e;case Ha:return uo(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ba:i=10;break e;case Ua:i=9;break e;case ru:i=11;break e;case lu:i=14;break e;case wt:i=16,r=null;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=$e(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Yt(e,t,n,r){return e=$e(7,e,r,t),e.lanes=n,e}function uo(e,t,n,r){return e=$e(22,e,r,t),e.elementType=Ha,e.lanes=n,e.stateNode={isHidden:!1},e}function Uo(e,t,n){return e=$e(6,e,null,t),e.lanes=n,e}function Ho(e,t,n){return t=$e(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ph(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Eo(0),this.expirationTimes=Eo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Eo(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Au(e,t,n,r,l,o,i,u,s){return e=new ph(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=$e(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Eu(o),e}function mh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Df)}catch(e){console.error(e)}}Df(),za.exports=je;var Af=za.exports;const Tn=Yl(Af);var aa=Af;Yo.createRoot=aa.createRoot,Yo.hydrateRoot=aa.hydrateRoot;const on=y.createContext({listTorrents:()=>{throw new Error("Function not implemented.")},getTorrentDetails:()=>{throw new Error("Function not implemented.")},getTorrentStats:()=>{throw new Error("Function not implemented.")},uploadTorrent:()=>{throw new Error("Function not implemented.")},pause:()=>{throw new Error("Function not implemented.")},start:()=>{throw new Error("Function not implemented.")},forget:()=>{throw new Error("Function not implemented.")},delete:()=>{throw new Error("Function not implemented.")}}),Ur=y.createContext({setCloseableError:e=>{},refreshTorrents:()=>{}}),Bf=y.createContext({refresh:()=>{}});var Uf={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],l=0;l=0)&&(n[l]=e[l]);return n}function ca(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function xh(e){var t=Sh(e,"string");return typeof t=="symbol"?t:String(t)}function Sh(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Eh(e,t,n){var r=y.useRef(e!==void 0),l=y.useState(t),o=l[0],i=l[1],u=e!==void 0,s=r.current;return r.current=u,!u&&s&&o!==t&&i(t),[u?e:o,y.useCallback(function(a){for(var m=arguments.length,h=new Array(m>1?m-1:0),d=1;d{o.target===e&&(l(),t(o))},n+r)}function Kh(e){e.offsetHeight}const pa=e=>!e||typeof e=="function"?e:t=>{e.current=t};function Gh(e,t){const n=pa(e),r=pa(t);return l=>{n&&n(l),r&&r(l)}}function ho(e,t){return y.useMemo(()=>Gh(e,t),[e,t])}function Xh(e){return e&&"setState"in e?Tn.findDOMNode(e):e??null}const Yh=we.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:l,onExited:o,addEndListener:i,children:u,childRef:s,...a},m)=>{const h=y.useRef(null),d=ho(h,s),g=k=>{d(Xh(k))},w=k=>_=>{k&&h.current&&k(h.current,_)},E=y.useCallback(w(e),[e]),L=y.useCallback(w(t),[t]),p=y.useCallback(w(n),[n]),c=y.useCallback(w(r),[r]),v=y.useCallback(w(l),[l]),x=y.useCallback(w(o),[o]),N=y.useCallback(w(i),[i]);return f.jsx(Uh,{ref:m,...a,onEnter:E,onEntered:p,onEntering:L,onExit:c,onExited:x,onExiting:v,addEndListener:N,nodeRef:h,children:typeof u=="function"?(k,_)=>u(k,{..._,ref:g}):we.cloneElement(u,{ref:g})})}),Zh=Yh;function Jh(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e},[e]),t}function ze(e){const t=Jh(e);return y.useCallback(function(...n){return t.current&&t.current(...n)},[t])}const Jf=e=>y.forwardRef((t,n)=>f.jsx("div",{...t,ref:n,className:M(t.className,e)})),qf=Jf("h4");qf.displayName="DivStyledAsH4";const bf=y.forwardRef(({className:e,bsPrefix:t,as:n=qf,...r},l)=>(t=H(t,"alert-heading"),f.jsx(n,{ref:l,className:M(e,t),...r})));bf.displayName="AlertHeading";const qh=bf;function bh(){return y.useState(null)}function ev(){const e=y.useRef(!0),t=y.useRef(()=>e.current);return y.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function tv(e){const t=y.useRef(null);return y.useEffect(()=>{t.current=e}),t.current}const nv=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",rv=typeof document<"u",ma=rv||nv?y.useLayoutEffect:y.useEffect,lv=["as","disabled"];function ov(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o=0)&&(n[l]=e[l]);return n}function iv(e){return!e||e.trim()==="#"}function Vu({tagName:e,disabled:t,href:n,target:r,rel:l,role:o,onClick:i,tabIndex:u=0,type:s}){e||(n!=null||r!=null||l!=null?e="a":e="button");const a={tagName:e};if(e==="button")return[{type:s||"button",disabled:t},a];const m=d=>{if((t||e==="a"&&iv(n))&&d.preventDefault(),t){d.stopPropagation();return}i==null||i(d)},h=d=>{d.key===" "&&(d.preventDefault(),m(d))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:o??"button",disabled:void 0,tabIndex:t?void 0:u,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?l:void 0,onClick:m,onKeyDown:h},a]}const uv=y.forwardRef((e,t)=>{let{as:n,disabled:r}=e,l=ov(e,lv);const[o,{tagName:i}]=Vu(Object.assign({tagName:n,disabled:r},l));return f.jsx(i,Object.assign({},l,o,{ref:t}))});uv.displayName="Button";const sv=["onKeyDown"];function av(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o=0)&&(n[l]=e[l]);return n}function cv(e){return!e||e.trim()==="#"}const ed=y.forwardRef((e,t)=>{let{onKeyDown:n}=e,r=av(e,sv);const[l]=Vu(Object.assign({tagName:"a"},r)),o=ze(i=>{l.onKeyDown(i),n==null||n(i)});return cv(r.href)||r.role==="button"?f.jsx("a",Object.assign({ref:t},r,l,{onKeyDown:o})):f.jsx("a",Object.assign({ref:t},r,{onKeyDown:n}))});ed.displayName="Anchor";const fv=ed,td=y.forwardRef(({className:e,bsPrefix:t,as:n=fv,...r},l)=>(t=H(t,"alert-link"),f.jsx(n,{ref:l,className:M(e,t),...r})));td.displayName="AlertLink";const dv=td,pv={[St]:"show",[Wt]:"show"},nd=y.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...l},o)=>{const i={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...l},u=y.useCallback((s,a)=>{Kh(s),r==null||r(s,a)},[r]);return f.jsx(Zh,{ref:o,addEndListener:Qh,...i,onEnter:u,childRef:t.ref,children:(s,a)=>y.cloneElement(t,{...a,className:M("fade",e,t.props.className,pv[s],n[s])})})});nd.displayName="Fade";const Kl=nd,mv={"aria-label":st.string,onClick:st.func,variant:st.oneOf(["white"])},Wu=y.forwardRef(({className:e,variant:t,"aria-label":n="Close",...r},l)=>f.jsx("button",{ref:l,type:"button",className:M("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));Wu.displayName="CloseButton";Wu.propTypes=mv;const rd=Wu,ld=y.forwardRef((e,t)=>{const{bsPrefix:n,show:r=!0,closeLabel:l="Close alert",closeVariant:o,className:i,children:u,variant:s="primary",onClose:a,dismissible:m,transition:h=Kl,...d}=kh(e,{show:"onClose"}),g=H(n,"alert"),w=ze(p=>{a&&a(!1,p)}),E=h===!0?Kl:h,L=f.jsxs("div",{role:"alert",...E?void 0:d,ref:t,className:M(i,g,s&&`${g}-${s}`,m&&`${g}-dismissible`),children:[m&&f.jsx(rd,{onClick:w,"aria-label":l,variant:o}),u]});return E?f.jsx(E,{unmountOnExit:!0,...d,ref:void 0,in:r,children:L}):r?L:null});ld.displayName="Alert";const ha=Object.assign(ld,{Link:dv,Heading:qh}),od=y.forwardRef(({as:e,bsPrefix:t,variant:n="primary",size:r,active:l=!1,disabled:o=!1,className:i,...u},s)=>{const a=H(t,"btn"),[m,{tagName:h}]=Vu({tagName:e,disabled:o,...u}),d=h;return f.jsx(d,{...m,...u,ref:s,disabled:o,className:M(i,a,l&&"active",n&&`${a}-${n}`,r&&`${a}-${r}`,u.href&&o&&"disabled")})});od.displayName="Button";const nn=od;function hv(e){const t=y.useRef(e);return t.current=e,t}function id(e){const t=hv(e);y.useEffect(()=>()=>t.current(),[])}function vv(e,t){let n=0;return y.Children.map(e,r=>y.isValidElement(r)?t(r,n++):r)}function yv(e,t){return y.Children.toArray(e).some(n=>y.isValidElement(n)&&n.type===t)}function gv({as:e,bsPrefix:t,className:n,...r}){t=H(t,"col");const l=Vf(),o=Wf(),i=[],u=[];return l.forEach(s=>{const a=r[s];delete r[s];let m,h,d;typeof a=="object"&&a!=null?{span:m,offset:h,order:d}=a:m=a;const g=s!==o?`-${s}`:"";m&&i.push(m===!0?`${t}${g}`:`${t}${g}-${m}`),d!=null&&u.push(`order${g}-${d}`),h!=null&&u.push(`offset${g}-${h}`)}),[{...r,className:M(n,...i,...u)},{as:e,bsPrefix:t,spans:i}]}const ud=y.forwardRef((e,t)=>{const[{className:n,...r},{as:l="div",bsPrefix:o,spans:i}]=gv(e);return f.jsx(l,{...r,ref:t,className:M(n,!i.length&&o)})});ud.displayName="Col";const Qu=ud,sd=y.forwardRef(({bsPrefix:e,fluid:t=!1,as:n="div",className:r,...l},o)=>{const i=H(e,"container"),u=typeof t=="string"?`-${t}`:"-fluid";return f.jsx(n,{ref:o,...l,className:M(r,t?`${i}${u}`:i)})});sd.displayName="Container";const wv=sd;var xv=Function.prototype.bind.call(Function.prototype.call,[].slice);function pn(e,t){return xv(e.querySelectorAll(t))}function va(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}const Sv="data-rr-ui-";function Ev(e){return`${Sv}${e}`}const ad=y.createContext(Qn?window:void 0);ad.Provider;function Ku(){return y.useContext(ad)}const kv={type:st.string,tooltip:st.bool,as:st.elementType},Gu=y.forwardRef(({as:e="div",className:t,type:n="valid",tooltip:r=!1,...l},o)=>f.jsx(e,{...l,ref:o,className:M(t,`${n}-${r?"tooltip":"feedback"}`)}));Gu.displayName="Feedback";Gu.propTypes=kv;const cd=Gu,Cv=y.createContext({}),pt=Cv,fd=y.forwardRef(({id:e,bsPrefix:t,className:n,type:r="checkbox",isValid:l=!1,isInvalid:o=!1,as:i="input",...u},s)=>{const{controlId:a}=y.useContext(pt);return t=H(t,"form-check-input"),f.jsx(i,{...u,ref:s,type:r,id:e||a,className:M(n,t,l&&"is-valid",o&&"is-invalid")})});fd.displayName="FormCheckInput";const dd=fd,pd=y.forwardRef(({bsPrefix:e,className:t,htmlFor:n,...r},l)=>{const{controlId:o}=y.useContext(pt);return e=H(e,"form-check-label"),f.jsx("label",{...r,ref:l,htmlFor:n||o,className:M(t,e)})});pd.displayName="FormCheckLabel";const Xi=pd,md=y.forwardRef(({id:e,bsPrefix:t,bsSwitchPrefix:n,inline:r=!1,reverse:l=!1,disabled:o=!1,isValid:i=!1,isInvalid:u=!1,feedbackTooltip:s=!1,feedback:a,feedbackType:m,className:h,style:d,title:g="",type:w="checkbox",label:E,children:L,as:p="input",...c},v)=>{t=H(t,"form-check"),n=H(n,"form-switch");const{controlId:x}=y.useContext(pt),N=y.useMemo(()=>({controlId:e||x}),[x,e]),k=!L&&E!=null&&E!==!1||yv(L,Xi),_=f.jsx(dd,{...c,type:w==="switch"?"checkbox":w,ref:v,isValid:i,isInvalid:u,disabled:o,as:p});return f.jsx(pt.Provider,{value:N,children:f.jsx("div",{style:d,className:M(h,k&&t,r&&`${t}-inline`,l&&`${t}-reverse`,w==="switch"&&n),children:L||f.jsxs(f.Fragment,{children:[_,k&&f.jsx(Xi,{title:g,children:E}),a&&f.jsx(cd,{type:m,tooltip:s,children:a})]})})})});md.displayName="FormCheck";const Gl=Object.assign(md,{Input:dd,Label:Xi}),hd=y.forwardRef(({bsPrefix:e,type:t,size:n,htmlSize:r,id:l,className:o,isValid:i=!1,isInvalid:u=!1,plaintext:s,readOnly:a,as:m="input",...h},d)=>{const{controlId:g}=y.useContext(pt);return e=H(e,"form-control"),f.jsx(m,{...h,type:t,size:r,ref:d,readOnly:a,id:l||g,className:M(o,s?`${e}-plaintext`:e,n&&`${e}-${n}`,t==="color"&&`${e}-color`,i&&"is-valid",u&&"is-invalid")})});hd.displayName="FormControl";const _v=Object.assign(hd,{Feedback:cd}),vd=y.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},l)=>(t=H(t,"form-floating"),f.jsx(n,{ref:l,className:M(e,t),...r})));vd.displayName="FormFloating";const Nv=vd,yd=y.forwardRef(({controlId:e,as:t="div",...n},r)=>{const l=y.useMemo(()=>({controlId:e}),[e]);return f.jsx(pt.Provider,{value:l,children:f.jsx(t,{...n,ref:r})})});yd.displayName="FormGroup";const gd=yd,wd=y.forwardRef(({as:e="label",bsPrefix:t,column:n=!1,visuallyHidden:r=!1,className:l,htmlFor:o,...i},u)=>{const{controlId:s}=y.useContext(pt);t=H(t,"form-label");let a="col-form-label";typeof n=="string"&&(a=`${a} ${a}-${n}`);const m=M(l,t,r&&"visually-hidden",n&&a);return o=o||s,n?f.jsx(Qu,{ref:u,as:"label",className:m,htmlFor:o,...i}):f.jsx(e,{ref:u,className:m,htmlFor:o,...i})});wd.displayName="FormLabel";const Tv=wd,xd=y.forwardRef(({bsPrefix:e,className:t,id:n,...r},l)=>{const{controlId:o}=y.useContext(pt);return e=H(e,"form-range"),f.jsx("input",{...r,type:"range",ref:l,className:M(t,e),id:n||o})});xd.displayName="FormRange";const jv=xd,Sd=y.forwardRef(({bsPrefix:e,size:t,htmlSize:n,className:r,isValid:l=!1,isInvalid:o=!1,id:i,...u},s)=>{const{controlId:a}=y.useContext(pt);return e=H(e,"form-select"),f.jsx("select",{...u,size:n,ref:s,className:M(r,e,t&&`${e}-${t}`,l&&"is-valid",o&&"is-invalid"),id:i||a})});Sd.displayName="FormSelect";const Lv=Sd,Ed=y.forwardRef(({bsPrefix:e,className:t,as:n="small",muted:r,...l},o)=>(e=H(e,"form-text"),f.jsx(n,{...l,ref:o,className:M(t,e,r&&"text-muted")})));Ed.displayName="FormText";const Ov=Ed,kd=y.forwardRef((e,t)=>f.jsx(Gl,{...e,ref:t,type:"switch"}));kd.displayName="Switch";const Rv=Object.assign(kd,{Input:Gl.Input,Label:Gl.Label}),Cd=y.forwardRef(({bsPrefix:e,className:t,children:n,controlId:r,label:l,...o},i)=>(e=H(e,"form-floating"),f.jsxs(gd,{ref:i,className:M(t,e),controlId:r,...o,children:[n,f.jsx("label",{htmlFor:r,children:l})]})));Cd.displayName="FloatingLabel";const Pv=Cd,Fv={_ref:st.any,validated:st.bool,as:st.elementType},Xu=y.forwardRef(({className:e,validated:t,as:n="form",...r},l)=>f.jsx(n,{...r,ref:l,className:M(e,t&&"was-validated")}));Xu.displayName="Form";Xu.propTypes=Fv;const pe=Object.assign(Xu,{Group:gd,Control:_v,Floating:Nv,Check:Gl,Switch:Rv,Label:Tv,Text:Ov,Range:jv,Select:Lv,FloatingLabel:Pv});var sl;function ya(e){if((!sl&&sl!==0||e)&&Qn){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),sl=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return sl}function Wo(e){e===void 0&&(e=mo());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function Mv(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const ga=Ev("modal-open");class zv{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return Mv(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",l=this.getElement();t.style={overflow:l.style.overflow,[r]:l.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(Zt(l,r)||"0",10)+t.scrollBarWidth}px`),l.setAttribute(ga,""),Zt(l,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(ga),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const Yu=zv,Qo=(e,t)=>Qn?e==null?(t||mo()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function $v(e,t){const n=Ku(),[r,l]=y.useState(()=>Qo(e,n==null?void 0:n.document));if(!r){const o=Qo(e);o&&l(o)}return y.useEffect(()=>{t&&r&&t(r)},[t,r]),y.useEffect(()=>{const o=Qo(e);o!==r&&l(o)},[e,r]),r}function Iv({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:l}){const o=y.useRef(null),i=y.useRef(t),u=ze(n);y.useEffect(()=>{t?i.current=!0:u(o.current)},[t,u]);const s=ho(o,e.ref),a=y.cloneElement(e,{ref:s});return t?a:l||!i.current&&r?null:a}function Dv({in:e,onTransition:t}){const n=y.useRef(null),r=y.useRef(!0),l=ze(t);return ma(()=>{if(!n.current)return;let o=!1;return l({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,l]),ma(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function Av({children:e,in:t,onExited:n,onEntered:r,transition:l}){const[o,i]=y.useState(!t);t&&o&&i(!1);const u=Dv({in:!!t,onTransition:a=>{const m=()=>{a.isStale()||(a.in?r==null||r(a.element,a.initial):(i(!0),n==null||n(a.element)))};Promise.resolve(l(a)).then(m,h=>{throw a.in||i(!0),h})}}),s=ho(u,e.ref);return o&&!t?null:y.cloneElement(e,{ref:s})}function wa(e,t,n){return e?f.jsx(e,Object.assign({},n)):t?f.jsx(Av,Object.assign({},n,{transition:t})):f.jsx(Iv,Object.assign({},n))}function Bv(e){return e.code==="Escape"||e.keyCode===27}const Uv=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function Hv(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o=0)&&(n[l]=e[l]);return n}let Ko;function Vv(e){return Ko||(Ko=new Yu({ownerDocument:e==null?void 0:e.document})),Ko}function Wv(e){const t=Ku(),n=e||Vv(t),r=y.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:y.useCallback(l=>{r.current.dialog=l},[]),setBackdropRef:y.useCallback(l=>{r.current.backdrop=l},[])})}const _d=y.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:l,style:o,children:i,backdrop:u=!0,keyboard:s=!0,onBackdropClick:a,onEscapeKeyDown:m,transition:h,runTransition:d,backdropTransition:g,runBackdropTransition:w,autoFocus:E=!0,enforceFocus:L=!0,restoreFocus:p=!0,restoreFocusOptions:c,renderDialog:v,renderBackdrop:x=K=>f.jsx("div",Object.assign({},K)),manager:N,container:k,onShow:_,onHide:j=()=>{},onExit:B,onExited:P,onExiting:ie,onEnter:Ge,onEntering:Xe,onEntered:un}=e,Kn=Hv(e,Uv);const Oe=Ku(),Ye=$v(k),C=Wv(N),O=ev(),R=tv(n),[I,A]=y.useState(!n),fe=y.useRef(null);y.useImperativeHandle(t,()=>C,[C]),Qn&&!R&&n&&(fe.current=Wo(Oe==null?void 0:Oe.document)),n&&I&&A(!1);const Re=ze(()=>{if(C.add(),an.current=Ql(document,"keydown",vo),sn.current=Ql(document,"focus",()=>setTimeout(Pe),!0),_&&_(),E){var K,Vr;const Yn=Wo((K=(Vr=C.dialog)==null?void 0:Vr.ownerDocument)!=null?K:Oe==null?void 0:Oe.document);C.dialog&&Yn&&!va(C.dialog,Yn)&&(fe.current=Yn,C.dialog.focus())}}),tt=ze(()=>{if(C.remove(),an.current==null||an.current(),sn.current==null||sn.current(),p){var K;(K=fe.current)==null||K.focus==null||K.focus(c),fe.current=null}});y.useEffect(()=>{!n||!Ye||Re()},[n,Ye,Re]),y.useEffect(()=>{I&&tt()},[I,tt]),id(()=>{tt()});const Pe=ze(()=>{if(!L||!O()||!C.isTopModal())return;const K=Wo(Oe==null?void 0:Oe.document);C.dialog&&K&&!va(C.dialog,K)&&C.dialog.focus()}),vt=ze(K=>{K.target===K.currentTarget&&(a==null||a(K),u===!0&&j())}),vo=ze(K=>{s&&Bv(K)&&C.isTopModal()&&(m==null||m(K),K.defaultPrevented||j())}),sn=y.useRef(),an=y.useRef(),Gn=(...K)=>{A(!0),P==null||P(...K)};if(!Ye)return null;const Hr=Object.assign({role:r,ref:C.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},Kn,{style:o,className:l,tabIndex:-1});let Xn=v?v(Hr):f.jsx("div",Object.assign({},Hr,{children:y.cloneElement(i,{role:"document"})}));Xn=wa(h,d,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:B,onExiting:ie,onExited:Gn,onEnter:Ge,onEntering:Xe,onEntered:un,children:Xn});let Bt=null;return u&&(Bt=x({ref:C.setBackdropRef,onClick:vt}),Bt=wa(g,w,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:Bt})),f.jsx(f.Fragment,{children:Tn.createPortal(f.jsxs(f.Fragment,{children:[Bt,Xn]}),Ye)})});_d.displayName="Modal";const Qv=Object.assign(_d,{Manager:Yu});function Kv(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function Gv(e,t){e.classList?e.classList.add(t):Kv(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function xa(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Xv(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=xa(e.className,t):e.setAttribute("class",xa(e.className&&e.className.baseVal||"",t))}const mn={FIXED_CONTENT:".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",STICKY_CONTENT:".sticky-top",NAVBAR_TOGGLER:".navbar-toggler"};class Yv extends Yu{adjustAndStore(t,n,r){const l=n.style[t];n.dataset[t]=l,Zt(n,{[t]:`${parseFloat(Zt(n,t))+r}px`})}restore(t,n){const r=n.dataset[t];r!==void 0&&(delete n.dataset[t],Zt(n,{[t]:r}))}setContainerStyle(t){super.setContainerStyle(t);const n=this.getElement();if(Gv(n,"modal-open"),!t.scrollBarWidth)return;const r=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";pn(n,mn.FIXED_CONTENT).forEach(o=>this.adjustAndStore(r,o,t.scrollBarWidth)),pn(n,mn.STICKY_CONTENT).forEach(o=>this.adjustAndStore(l,o,-t.scrollBarWidth)),pn(n,mn.NAVBAR_TOGGLER).forEach(o=>this.adjustAndStore(l,o,t.scrollBarWidth))}removeContainerStyle(t){super.removeContainerStyle(t);const n=this.getElement();Xv(n,"modal-open");const r=this.isRTL?"paddingLeft":"paddingRight",l=this.isRTL?"marginLeft":"marginRight";pn(n,mn.FIXED_CONTENT).forEach(o=>this.restore(r,o)),pn(n,mn.STICKY_CONTENT).forEach(o=>this.restore(l,o)),pn(n,mn.NAVBAR_TOGGLER).forEach(o=>this.restore(l,o))}}let Go;function Zv(e){return Go||(Go=new Yv(e)),Go}const Nd=y.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},l)=>(t=H(t,"modal-body"),f.jsx(n,{ref:l,className:M(e,t),...r})));Nd.displayName="ModalBody";const Jv=Nd,qv=y.createContext({onHide(){}}),Td=qv,jd=y.forwardRef(({bsPrefix:e,className:t,contentClassName:n,centered:r,size:l,fullscreen:o,children:i,scrollable:u,...s},a)=>{e=H(e,"modal");const m=`${e}-dialog`,h=typeof o=="string"?`${e}-fullscreen-${o}`:`${e}-fullscreen`;return f.jsx("div",{...s,ref:a,className:M(m,t,l&&`${e}-${l}`,r&&`${m}-centered`,u&&`${m}-scrollable`,o&&h),children:f.jsx("div",{className:M(`${e}-content`,n),children:i})})});jd.displayName="ModalDialog";const Ld=jd,Od=y.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},l)=>(t=H(t,"modal-footer"),f.jsx(n,{ref:l,className:M(e,t),...r})));Od.displayName="ModalFooter";const bv=Od,e0=y.forwardRef(({closeLabel:e="Close",closeVariant:t,closeButton:n=!1,onHide:r,children:l,...o},i)=>{const u=y.useContext(Td),s=ze(()=>{u==null||u.onHide(),r==null||r()});return f.jsxs("div",{ref:i,...o,children:[l,n&&f.jsx(rd,{"aria-label":e,variant:t,onClick:s})]})}),t0=e0,Rd=y.forwardRef(({bsPrefix:e,className:t,closeLabel:n="Close",closeButton:r=!1,...l},o)=>(e=H(e,"modal-header"),f.jsx(t0,{ref:o,...l,className:M(t,e),closeLabel:n,closeButton:r})));Rd.displayName="ModalHeader";const n0=Rd,r0=Jf("h4"),Pd=y.forwardRef(({className:e,bsPrefix:t,as:n=r0,...r},l)=>(t=H(t,"modal-title"),f.jsx(n,{ref:l,className:M(e,t),...r})));Pd.displayName="ModalTitle";const l0=Pd;function o0(e){return f.jsx(Kl,{...e,timeout:null})}function i0(e){return f.jsx(Kl,{...e,timeout:null})}const Fd=y.forwardRef(({bsPrefix:e,className:t,style:n,dialogClassName:r,contentClassName:l,children:o,dialogAs:i=Ld,"aria-labelledby":u,"aria-describedby":s,"aria-label":a,show:m=!1,animation:h=!0,backdrop:d=!0,keyboard:g=!0,onEscapeKeyDown:w,onShow:E,onHide:L,container:p,autoFocus:c=!0,enforceFocus:v=!0,restoreFocus:x=!0,restoreFocusOptions:N,onEntered:k,onExit:_,onExiting:j,onEnter:B,onEntering:P,onExited:ie,backdropClassName:Ge,manager:Xe,...un},Kn)=>{const[Oe,Ye]=y.useState({}),[C,O]=y.useState(!1),R=y.useRef(!1),I=y.useRef(!1),A=y.useRef(null),[fe,Re]=bh(),tt=ho(Kn,Re),Pe=ze(L),vt=Th();e=H(e,"modal");const vo=y.useMemo(()=>({onHide:Pe}),[Pe]);function sn(){return Xe||Zv({isRTL:vt})}function an($){if(!Qn)return;const cn=sn().getScrollbarWidth()>0,es=$.scrollHeight>mo($).documentElement.clientHeight;Ye({paddingRight:cn&&!es?ya():void 0,paddingLeft:!cn&&es?ya():void 0})}const Gn=ze(()=>{fe&&an(fe.dialog)});id(()=>{Gi(window,"resize",Gn),A.current==null||A.current()});const Hr=()=>{R.current=!0},Xn=$=>{R.current&&fe&&$.target===fe.dialog&&(I.current=!0),R.current=!1},Bt=()=>{O(!0),A.current=Zf(fe.dialog,()=>{O(!1)})},K=$=>{$.target===$.currentTarget&&Bt()},Vr=$=>{if(d==="static"){K($);return}if(I.current||$.target!==$.currentTarget){I.current=!1;return}L==null||L()},Yn=$=>{g?w==null||w($):($.preventDefault(),d==="static"&&Bt())},Vd=($,cn)=>{$&&an($),B==null||B($,cn)},Wd=$=>{A.current==null||A.current(),_==null||_($)},Qd=($,cn)=>{P==null||P($,cn),Yf(window,"resize",Gn)},Kd=$=>{$&&($.style.display=""),ie==null||ie($),Gi(window,"resize",Gn)},Gd=y.useCallback($=>f.jsx("div",{...$,className:M(`${e}-backdrop`,Ge,!h&&"show")}),[h,Ge,e]),bu={...n,...Oe};bu.display="block";const Xd=$=>f.jsx("div",{role:"dialog",...$,style:bu,className:M(t,e,C&&`${e}-static`,!h&&"show"),onClick:d?Vr:void 0,onMouseUp:Xn,"aria-label":a,"aria-labelledby":u,"aria-describedby":s,children:f.jsx(i,{...un,onMouseDown:Hr,className:r,contentClassName:l,children:o})});return f.jsx(Td.Provider,{value:vo,children:f.jsx(Qv,{show:m,ref:tt,backdrop:d,container:p,keyboard:!0,autoFocus:c,enforceFocus:v,restoreFocus:x,restoreFocusOptions:N,onEscapeKeyDown:Yn,onShow:E,onHide:L,onEnter:Vd,onEntering:Qd,onEntered:k,onExit:Wd,onExiting:j,onExited:Kd,manager:sn(),transition:h?o0:void 0,backdropTransition:h?i0:void 0,renderBackdrop:Gd,renderDialog:Xd})})});Fd.displayName="Modal";const ge=Object.assign(Fd,{Body:Jv,Header:n0,Title:l0,Footer:bv,Dialog:Ld,TRANSITION_DURATION:300,BACKDROP_TRANSITION_DURATION:150}),Sa=1e3;function u0(e,t,n){const r=(e-t)/(n-t)*100;return Math.round(r*Sa)/Sa}function Ea({min:e,now:t,max:n,label:r,visuallyHidden:l,striped:o,animated:i,className:u,style:s,variant:a,bsPrefix:m,...h},d){return f.jsx("div",{ref:d,...h,role:"progressbar",className:M(u,`${m}-bar`,{[`bg-${a}`]:a,[`${m}-bar-animated`]:i,[`${m}-bar-striped`]:i||o}),style:{width:`${u0(t,e,n)}%`,...s},"aria-valuenow":t,"aria-valuemin":e,"aria-valuemax":n,children:l?f.jsx("span",{className:"visually-hidden",children:r}):r})}const Md=y.forwardRef(({isChild:e=!1,...t},n)=>{const r={min:0,max:100,animated:!1,visuallyHidden:!1,striped:!1,...t};if(r.bsPrefix=H(r.bsPrefix,"progress"),e)return Ea(r,n);const{min:l,now:o,max:i,label:u,visuallyHidden:s,striped:a,animated:m,bsPrefix:h,variant:d,className:g,children:w,...E}=r;return f.jsx("div",{ref:n,...E,className:M(g,h),children:w?vv(w,L=>y.cloneElement(L,{isChild:!0})):Ea({min:l,now:o,max:i,label:u,visuallyHidden:s,striped:a,animated:m,bsPrefix:h,variant:d},n)})});Md.displayName="ProgressBar";const s0=Md,zd=y.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},l)=>{const o=H(e,"row"),i=Vf(),u=Wf(),s=`${o}-cols`,a=[];return i.forEach(m=>{const h=r[m];delete r[m];let d;h!=null&&typeof h=="object"?{cols:d}=h:d=h;const g=m!==u?`-${m}`:"";d!=null&&a.push(`${s}${g}-${d}`)}),f.jsx(n,{ref:l,...r,className:M(t,o,...a)})});zd.displayName="Row";const $d=zd,Id=y.forwardRef(({bsPrefix:e,variant:t,animation:n="border",size:r,as:l="div",className:o,...i},u)=>{e=H(e,"spinner");const s=`${e}-${n}`;return f.jsx(l,{ref:u,...i,className:M(o,s,r&&`${s}-${r}`,t&&`text-${t}`)})});Id.displayName="Spinner";const Un=Id,Xl="initializing",Dd="paused",Ad="live",a0="error";function Zu(e,t){let n,r=t;const l=async()=>{if(r=await e(),r==null)throw"asyncCallback returned null or undefined";o()};let o=()=>{n=setTimeout(l,r)};return o(),()=>{clearTimeout(n)}}function c0(e,t){let n;const r=async()=>{await e().then(()=>!1,()=>!0)&&l()};let l=o=>{n=setTimeout(r,o!==void 0?o:t)};return l(0),()=>clearTimeout(n)}const Xo=({onClick:e,disabled:t,color:n,children:r})=>{const l=i=>{i.stopPropagation(),!t&&e()},o=n?`text-${n}`:"";return f.jsx("a",{className:`p-1 ${o}`,onClick:l,href:"#",children:r})},zr=e=>{var r,l,o;let{error:t,remove:n}=e;return t==null?null:f.jsxs(ha,{variant:"danger",onClose:n,dismissible:n!=null,children:[f.jsx(ha.Heading,{children:t.text}),((r=t.details)==null?void 0:r.statusText)&&f.jsx("p",{children:f.jsx("strong",{children:(l=t.details)==null?void 0:l.statusText})}),f.jsx("pre",{children:(o=t.details)==null?void 0:o.text})]})},f0=({id:e,show:t,onHide:n})=>{if(!t)return null;const[r,l]=y.useState(!1),[o,i]=y.useState(null),[u,s]=y.useState(!1),a=y.useContext(Ur),m=y.useContext(on),h=()=>{l(!1),i(null),s(!1),n()},d=()=>{s(!0),(r?m.delete:m.forget)(e).then(()=>{a.refreshTorrents(),h()}).catch(w=>{i({text:`Error deleting torrent id=${e}`,details:w}),s(!1)})};return f.jsxs(ge,{show:t,onHide:h,children:[f.jsx(ge.Header,{closeButton:!0,children:"Delete torrent"}),f.jsxs(ge.Body,{children:[f.jsx(pe,{children:f.jsx(pe.Group,{controlId:"delete-torrent",children:f.jsx(pe.Check,{type:"checkbox",label:"Also delete files",checked:r,onChange:()=>l(!r)})})}),o&&f.jsx(zr,{error:o})]}),f.jsxs(ge.Footer,{children:[u&&f.jsx(Un,{}),f.jsx(nn,{variant:"primary",onClick:d,disabled:u,children:"OK"}),f.jsx(nn,{variant:"secondary",onClick:h,children:"Cancel"})]})]})};var Bd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ka=we.createContext&&we.createContext(Bd),Mt=globalThis&&globalThis.__assign||function(){return Mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{let n=t.state,[r,l]=y.useState(!1),[o,i]=y.useState(!1),u=y.useContext(Bf);const s=n=="live",a=n=="paused"||n=="error",m=y.useContext(Ur),h=y.useContext(on),d=()=>{l(!0),h.start(e).then(()=>{u.refresh()},L=>{m.setCloseableError({text:`Error starting torrent id=${e}`,details:L})}).finally(()=>l(!1))},g=()=>{l(!0),h.pause(e).then(()=>{u.refresh()},L=>{m.setCloseableError({text:`Error pausing torrent id=${e}`,details:L})}).finally(()=>l(!1))},w=()=>{l(!0),i(!0)},E=()=>{l(!1),i(!1)};return f.jsx($d,{children:f.jsxs(Qu,{children:[a&&f.jsx(Xo,{onClick:d,disabled:r,color:"success",children:f.jsx(h0,{})}),s&&f.jsx(Xo,{onClick:g,disabled:r,children:f.jsx(m0,{})}),f.jsx(Xo,{onClick:w,disabled:r,color:"danger",children:f.jsx(v0,{})}),f.jsx(f0,{id:e,show:o,onHide:E})]})})};function qu(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const g0=({statsResponse:e})=>{var t,n;switch(e.state){case Dd:return"Paused";case Xl:return"Checking files";case a0:return"Error"}return e.state!="live"||e.live===null?e.state:f.jsxs(f.Fragment,{children:[!e.finished&&f.jsxs("div",{className:"download-speed",children:["↓ ",(t=e.live.download_speed)==null?void 0:t.human_readable]}),f.jsxs("div",{className:"upload-speed",children:["↑ ",(n=e.live.upload_speed)==null?void 0:n.human_readable,e.live.snapshot.uploaded_bytes>0&&f.jsxs("span",{children:[" ","(",qu(e.live.snapshot.uploaded_bytes),")"]})]})]})},gt=({size:e,label:t,children:n})=>f.jsxs(Qu,{md:e||1,className:"py-3",children:[f.jsx("div",{className:"fw-bold",children:t}),n]});function w0(e){return e.files.filter(n=>n.included).reduce((n,r)=>n.length>r.length?n:r).name}function x0(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,l=(o,i)=>o>0?`${o}${i}`:"";return t>0?`${l(t,"h")} ${l(n,"m")}`.trim():n>0?`${l(n,"m")} ${l(r,"s")}`.trim():`${l(r,"s")}`.trim()}function S0(e){var n,r,l;let t=(l=(r=(n=e==null?void 0:e.live)==null?void 0:n.time_remaining)==null?void 0:r.duration)==null?void 0:l.secs;return t==null?"N/A":x0(t)}const E0=({id:e,detailsResponse:t,statsResponse:n})=>{const r=(n==null?void 0:n.state)??"",l=n==null?void 0:n.error,o=(n==null?void 0:n.total_bytes)??1,i=(n==null?void 0:n.progress_bytes)??0,u=(n==null?void 0:n.finished)||!1,s=l?100:i/o*100,a=(r==Xl||r==Ad)&&!u,m=l?"Error":`${s.toFixed(2)}%`,h=l?"danger":u?"success":r==Xl?"warning":"primary",d=()=>{var E;let w=(E=n==null?void 0:n.live)==null?void 0:E.snapshot.peer_stats;return w?`${w.live} / ${w.seen}`:""};let g=[];return l?g.push("bg-warning"):e%2==0&&g.push("bg-light"),f.jsxs($d,{className:g.join(" "),children:[f.jsx(gt,{size:3,label:"Name",children:t?f.jsxs(f.Fragment,{children:[f.jsx("div",{className:"text-truncate",children:w0(t)}),l&&f.jsxs("p",{className:"text-danger",children:[f.jsx("strong",{children:"Error:"})," ",l]})]}):f.jsx(Un,{})}),n?f.jsxs(f.Fragment,{children:[f.jsx(gt,{label:"Size",children:`${qu(o)} `}),f.jsx(gt,{size:2,label:(r==Dd,"Progress"),children:f.jsx(s0,{now:s,label:m,animated:a,variant:h})}),f.jsx(gt,{size:2,label:"Speed",children:f.jsx(g0,{statsResponse:n})}),f.jsx(gt,{label:"ETA",children:S0(n)}),f.jsx(gt,{size:2,label:"Live / Seen",children:d()}),f.jsx(gt,{label:"Actions",children:f.jsx(y0,{id:e,statsResponse:n})})]}):f.jsx(gt,{label:"Loading stats",size:8,children:f.jsx(Un,{})})]})},k0=({id:e,torrent:t})=>{const[n,r]=y.useState(null),[l,o]=y.useState(null),[i,u]=y.useState(0),s=y.useContext(on),a=()=>{u(i+1)};return y.useEffect(()=>{if(n===null)return c0(async()=>{await s.getTorrentDetails(t.id).then(r)},1e3)},[n]),y.useEffect(()=>Zu(async()=>s.getTorrentStats(t.id).then(g=>(o(g),g)).then(g=>g.state==Xl||g.state==Ad?1e3:1e4,()=>1e4),0),[i]),f.jsx(Bf.Provider,{value:{refresh:a},children:f.jsx(E0,{id:e,detailsResponse:n,statsResponse:l})})},C0=e=>{if(e.torrents===null&&e.loading)return f.jsx(Un,{});if(e.torrents!==null)return e.torrents.length===0?f.jsx("div",{className:"text-center",children:f.jsx("p",{children:"No existing torrents found. Add them through buttons below."})}):f.jsx("div",{style:{fontSize:"smaller"},children:e.torrents.map(t=>f.jsx(k0,{id:t.id,torrent:t},t.id))})},_0=e=>{let{onHide:t,listTorrentResponse:n,listTorrentError:r,listTorrentLoading:l,data:o}=e;const[i,u]=y.useState([]),[s,a]=y.useState(!1),[m,h]=y.useState(null),[d,g]=y.useState(!1),[w,E]=y.useState(""),L=y.useContext(Ur),p=y.useContext(on);y.useEffect(()=>{console.log(n),u(n?n.details.files.map((k,_)=>_):[]),E((n==null?void 0:n.output_folder)||"")},[n]);const c=()=>{t(),u([]),h(null),a(!1)},v=k=>{i.includes(k)?u(i.filter(_=>_!==k)):u([...i,k])},x=async()=>{if(!n)return;a(!0);let k=n.seen_peers?n.seen_peers.slice(0,32):null,_={overwrite:!0,only_files:i,initial_peers:k,output_folder:w};d&&(_.peer_opts={connect_timeout:20,read_write_timeout:60}),p.uploadTorrent(o,_).then(()=>{t(),L.refreshTorrents()},j=>{h({text:"Error starting torrent",details:j})}).finally(()=>a(!1))},N=()=>{if(l)return f.jsx(Un,{});if(r)return f.jsx(zr,{error:r});if(n)return f.jsxs(pe,{children:[f.jsxs("fieldset",{className:"mb-4",children:[f.jsx("legend",{children:"Pick the files to download"}),n.details.files.map((k,_)=>f.jsx(pe.Group,{controlId:`check-${_}`,children:f.jsx(pe.Check,{type:"checkbox",label:`${k.name} (${qu(k.length)})`,checked:i.includes(_),onChange:()=>v(_)})},_))]}),f.jsxs("fieldset",{children:[f.jsx("legend",{children:"Options"}),f.jsxs(pe.Group,{controlId:"output-folder",className:"mb-3",children:[f.jsx(pe.Label,{children:"Output folder"}),f.jsx(pe.Control,{type:"text",value:w,onChange:k=>E(k.target.value)})]}),f.jsxs(pe.Group,{controlId:"unpopular-torrent",className:"mb-3",children:[f.jsx(pe.Check,{type:"checkbox",label:"Increase timeouts",checked:d,onChange:()=>g(!d)}),f.jsx("small",{id:"emailHelp",className:"form-text text-muted",children:"This might be useful for unpopular torrents with few peers. It will slow down fast torrents though."})]})]})]})};return f.jsxs(ge,{show:!0,onHide:c,size:"lg",children:[f.jsx(ge.Header,{closeButton:!0,children:f.jsx(ge.Title,{children:"Add torrent"})}),f.jsxs(ge.Body,{children:[N(),f.jsx(zr,{error:m})]}),f.jsxs(ge.Footer,{children:[s&&f.jsx(Un,{}),f.jsx(nn,{variant:"primary",onClick:x,disabled:l||s||i.length==0,children:"OK"}),f.jsx(nn,{variant:"secondary",onClick:c,children:"Cancel"})]})]})},Hd=({buttonText:e,onClick:t,data:n,resetData:r,variant:l})=>{const[o,i]=y.useState(!1),[u,s]=y.useState(null),[a,m]=y.useState(null),h=y.useContext(on);y.useEffect(()=>{if(n===null)return;let g=setTimeout(async()=>{i(!0);try{const w=await h.uploadTorrent(n,{list_only:!0});s(w)}catch(w){m({text:"Error listing torrent files",details:w})}finally{i(!1)}},0);return()=>clearTimeout(g)},[n]);const d=()=>{r(),m(null),s(null),i(!1)};return f.jsxs(f.Fragment,{children:[f.jsx(nn,{variant:l,onClick:t,className:"m-1",children:e}),n&&f.jsx(_0,{onHide:d,listTorrentError:a,listTorrentResponse:u,data:n,listTorrentLoading:o})]})},N0=({show:e,setUrl:t,cancel:n})=>{let[r,l]=y.useState("");return f.jsxs(ge,{show:e,onHide:n,size:"lg",children:[f.jsx(ge.Header,{closeButton:!0,children:f.jsx(ge.Title,{children:"Add torrent"})}),f.jsx(ge.Body,{children:f.jsx(pe,{children:f.jsxs(pe.Group,{className:"mb-3",controlId:"url",children:[f.jsx(pe.Label,{children:"Enter magnet or HTTP(S) URL to the .torrent"}),f.jsx(pe.Control,{value:r,placeholder:"magnet:?xt=urn:btih:...",onChange:o=>{l(o.target.value)}})]})})}),f.jsxs(ge.Footer,{children:[f.jsx(nn,{variant:"primary",onClick:()=>{t(r),l("")},disabled:r.length==0,children:"OK"}),f.jsx(nn,{variant:"secondary",onClick:n,children:"Cancel"})]})]})},T0=()=>{let[e,t]=y.useState(null),[n,r]=y.useState(!1);return f.jsxs(f.Fragment,{children:[f.jsx(Hd,{variant:"primary",buttonText:"Add Torrent from Magnet / URL",onClick:()=>{r(!0)},data:e,resetData:()=>t(null)}),f.jsx(N0,{show:n,setUrl:l=>{r(!1),t(l)},cancel:()=>{r(!1),t(null)}})]})},j0=()=>{const e=y.useRef(),[t,n]=y.useState(null),r=async()=>{var u;if(!((u=e==null?void 0:e.current)!=null&&u.files))return;const i=e.current.files[0];n(i)},l=()=>{e!=null&&e.current&&(e.current.value="",n(null))},o=()=>{e!=null&&e.current&&e.current.click()};return f.jsxs(f.Fragment,{children:[f.jsx("input",{type:"file",ref:e,accept:".torrent",onChange:r,className:"d-none"}),f.jsx(Hd,{variant:"secondary",buttonText:"Upload .torrent File",onClick:o,data:t,resetData:l})]})},L0=()=>f.jsxs("div",{id:"buttons-container",className:"mt-3",children:[f.jsx(T0,{}),f.jsx(j0,{})]}),O0=e=>{let t=y.useContext(Ur);return f.jsxs(wv,{children:[f.jsx(zr,{error:e.closeableError,remove:()=>t.setCloseableError(null)}),f.jsx(zr,{error:e.otherError}),f.jsx(C0,{torrents:e.torrents,loading:e.torrentsLoading}),f.jsx(L0,{})]})},R0=e=>{const[t,n]=y.useState(null),[r,l]=y.useState(null),[o,i]=y.useState(null),[u,s]=y.useState(!1),a=y.useContext(on),m=async()=>{s(!0);let d=await a.listTorrents().finally(()=>s(!1));i(d.torrents)};y.useEffect(()=>Zu(async()=>m().then(()=>(l(null),5e3),d=>(l({text:"Error refreshing torrents",details:d}),console.error(d),5e3)),0),[]);const h={setCloseableError:n,refreshTorrents:m};return f.jsx(Ur.Provider,{value:h,children:f.jsxs("div",{className:"text-center",children:[f.jsx("h1",{className:"mt-3 mb-4",children:e.title}),f.jsx(O0,{closeableError:t,otherError:r,torrents:o,torrentsLoading:u})]})})},P0=window.origin==="null"||window.origin==="http://localhost:3031"?"http://localhost:3030":"",nt=async(e,t,n)=>{console.log(e,t);const r=P0+t,l={method:e,headers:{Accept:"application/json"},body:n};let o={method:e,path:t,text:""},i;try{i=await fetch(r,l)}catch{return o.text="network error",Promise.reject(o)}if(o.status=i.status,o.statusText=`${i.status} ${i.statusText}`,!i.ok){const s=await i.text();try{const a=JSON.parse(s);o.text=a.human_readable!==void 0?a.human_readable:JSON.stringify(a,null,2)}catch{o.text=s}return Promise.reject(o)}return await i.json()},Ca={listTorrents:()=>nt("GET","/torrents"),getTorrentDetails:e=>nt("GET",`/torrents/${e}`),getTorrentStats:e=>nt("GET",`/torrents/${e}/stats/v1`),uploadTorrent:(e,t)=>{var r,l;let n="/torrents?&overwrite=true";return t!=null&&t.list_only&&(n+="&list_only=true"),(t==null?void 0:t.only_files)!=null&&(n+=`&only_files=${t.only_files.join(",")}`),(r=t==null?void 0:t.peer_opts)!=null&&r.connect_timeout&&(n+=`&peer_connect_timeout=${t.peer_opts.connect_timeout}`),(l=t==null?void 0:t.peer_opts)!=null&&l.read_write_timeout&&(n+=`&peer_read_write_timeout=${t.peer_opts.read_write_timeout}`),t!=null&&t.initial_peers&&(n+=`&initial_peers=${t.initial_peers.join(",")}`),t!=null&&t.output_folder&&(n+=`&output_folder=${t.output_folder}`),typeof e=="string"&&(n+="&is_url=true"),nt("POST",n,e)},pause:e=>nt("POST",`/torrents/${e}/pause`),start:e=>nt("POST",`/torrents/${e}/start`),forget:e=>nt("POST",`/torrents/${e}/forget`),delete:e=>nt("POST",`/torrents/${e}/delete`),getVersion:async()=>(await nt("GET","/")).version},F0=()=>{let[e,t]=y.useState("rqbit web UI");return y.useEffect(()=>Zu(()=>Ca.getVersion().then(r=>{const l=`rqbit web UI - v${r}`;return t(l),document.title=l,1e4},r=>1e3),0),[]),f.jsx(y.StrictMode,{children:f.jsx(on.Provider,{value:Ca,children:f.jsx(R0,{title:e})})})};Yo.createRoot(document.getElementById("app")).render(f.jsx(F0,{}));