(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerpolicy&&(l.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?l.credentials="include":i.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();function Ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A={exports:{}},M={};/** * @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 yr=Symbol.for("react.element"),od=Symbol.for("react.portal"),ud=Symbol.for("react.fragment"),sd=Symbol.for("react.strict_mode"),ad=Symbol.for("react.profiler"),cd=Symbol.for("react.provider"),fd=Symbol.for("react.context"),dd=Symbol.for("react.forward_ref"),pd=Symbol.for("react.suspense"),hd=Symbol.for("react.memo"),md=Symbol.for("react.lazy"),Gu=Symbol.iterator;function vd(e){return e===null||typeof e!="object"?null:(e=Gu&&e[Gu]||e["@@iterator"],typeof e=="function"?e:null)}var Na={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ia=Object.assign,Fa={};function xn(e,t,n){this.props=e,this.context=t,this.refs=Fa,this.updater=n||Na}xn.prototype.isReactComponent={};xn.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")};xn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ta(){}Ta.prototype=xn.prototype;function Vo(e,t,n){this.props=e,this.context=t,this.refs=Fa,this.updater=n||Na}var Bo=Vo.prototype=new Ta;Bo.constructor=Vo;Ia(Bo,xn.prototype);Bo.isPureReactComponent=!0;var Xu=Array.isArray,Da=Object.prototype.hasOwnProperty,qo={current:null},Ma={key:!0,ref:!0,__self:!0,__source:!0};function Ua(e,t,n){var r,i={},l=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(l=""+t.key),t)Da.call(t,r)&&!Ma.hasOwnProperty(r)&&(i[r]=t[r]);var u=arguments.length-2;if(u===1)i.children=n;else if(1>>1,ee=N[G];if(0>>1;G<_r;){var Ft=2*(G+1)-1,ul=N[Ft],Tt=Ft+1,xr=N[Tt];if(0>i(ul,D))Tti(xr,ul)?(N[G]=xr,N[Tt]=D,G=Tt):(N[G]=ul,N[Ft]=D,G=Ft);else if(Tti(xr,D))N[G]=xr,N[Tt]=D,G=Tt;else break e}}return F}function i(N,F){var D=N.sortIndex-F.sortIndex;return D!==0?D:N.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var s=[],a=[],c=1,f=null,h=3,v=!1,S=!1,g=!1,P=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(N){for(var F=n(a);F!==null;){if(F.callback===null)r(a);else if(F.startTime<=N)r(a),F.sortIndex=F.expirationTime,t(s,F);else break;F=n(a)}}function w(N){if(g=!1,p(N),!S)if(n(s)!==null)S=!0,ll(x);else{var F=n(a);F!==null&&ol(w,F.startTime-N)}}function x(N,F){S=!1,g&&(g=!1,m(O),O=-1),v=!0;var D=h;try{for(p(F),f=n(s);f!==null&&(!(f.expirationTime>F)||N&&!de());){var G=f.callback;if(typeof G=="function"){f.callback=null,h=f.priorityLevel;var ee=G(f.expirationTime<=F);F=e.unstable_now(),typeof ee=="function"?f.callback=ee:f===n(s)&&r(s),p(F)}else r(s);f=n(s)}if(f!==null)var _r=!0;else{var Ft=n(a);Ft!==null&&ol(w,Ft.startTime-F),_r=!1}return _r}finally{f=null,h=D,v=!1}}var C=!1,_=null,O=-1,z=5,y=-1;function de(){return!(e.unstable_now()-yN||125G?(N.sortIndex=D,t(a,N),n(s)===null&&N===n(a)&&(g?(m(O),O=-1):g=!0,ol(w,D-G))):(N.sortIndex=ee,t(s,N),S||v||(S=!0,ll(x))),N},e.unstable_shouldYield=de,e.unstable_wrapCallback=function(N){var F=h;return function(){var D=h;h=F;try{return N.apply(this,arguments)}finally{h=D}}}})(ja);(function(e){e.exports=ja})(Aa);/** * @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 Qa=A.exports,xe=Aa.exports;function E(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"),$l=Object.prototype.hasOwnProperty,kd=/^[: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]*$/,Zu={},Ju={};function Cd(e){return $l.call(Ju,e)?!0:$l.call(Zu,e)?!1:kd.test(e)?Ju[e]=!0:(Zu[e]=!0,!1)}function Ed(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 _d(e,t,n,r){if(t===null||typeof t>"u"||Ed(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,i,l,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=l,this.removeEmptyString=o}var ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ue[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];ue[t]=new ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ue[e]=new ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ue[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){ue[e]=new ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ue[e]=new ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ue[e]=new ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ue[e]=new ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ue[e]=new ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ko=/[\-:]([a-z])/g;function Wo(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(Ko,Wo);ue[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(Ko,Wo);ue[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(Ko,Wo);ue[t]=new ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ue[e]=new ve(e,1,!1,e.toLowerCase(),null,!1,!1)});ue.xlinkHref=new ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ue[e]=new ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function Go(e,t,n,r){var i=ue.hasOwnProperty(t)?ue[t]:null;(i!==null?i.type!==0:r||!(2u||i[o]!==l[u]){var s=` `+i[o].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=o&&0<=u);break}}}finally{cl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ln(e):""}function xd(e){switch(e.tag){case 5:return Ln(e.type);case 16:return Ln("Lazy");case 13:return Ln("Suspense");case 19:return Ln("SuspenseList");case 0:case 2:case 15:return e=fl(e.type,!1),e;case 11:return e=fl(e.type.render,!1),e;case 1:return e=fl(e.type,!0),e;default:return""}}function Hl(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 Zt:return"Fragment";case Yt:return"Portal";case Vl:return"Profiler";case Xo:return"StrictMode";case Bl:return"Suspense";case ql:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ba:return(e.displayName||"Context")+".Consumer";case Va:return(e._context.displayName||"Context")+".Provider";case Yo:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zo:return t=e.displayName||null,t!==null?t:Hl(e.type)||"Memo";case ct:t=e._payload,e=e._init;try{return Hl(e(t))}catch{}}return null}function Od(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 Hl(t);case 8:return t===Xo?"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 xt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ha(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Pd(e){var t=Ha(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 i=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,l.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rr(e){e._valueTracker||(e._valueTracker=Pd(e))}function Ka(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ha(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function oi(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 Kl(e,t){var n=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function es(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xt(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 Wa(e,t){t=t.checked,t!=null&&Go(e,"checked",t,!1)}function Wl(e,t){Wa(e,t);var n=xt(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")?Gl(e,t.type,n):t.hasOwnProperty("defaultValue")&&Gl(e,t.type,xt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ts(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 Gl(e,t,n){(t!=="number"||oi(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var An=Array.isArray;function an(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Nr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Jn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Vn={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},Rd=["Webkit","ms","Moz","O"];Object.keys(Vn).forEach(function(e){Rd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Vn[t]=Vn[e]})});function Za(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Vn.hasOwnProperty(e)&&Vn[e]?(""+t).trim():t+"px"}function Ja(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Za(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Nd=K({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 Zl(e,t){if(t){if(Nd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function Jl(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 bl=null;function Jo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var eo=null,cn=null,fn=null;function is(e){if(e=wr(e)){if(typeof eo!="function")throw Error(E(280));var t=e.stateNode;t&&(t=Vi(t),eo(e.stateNode,e.type,t))}}function ba(e){cn?fn?fn.push(e):fn=[e]:cn=e}function ec(){if(cn){var e=cn,t=fn;if(fn=cn=null,is(e),t)for(e=0;e>>=0,e===0?32:31-(Qd(e)/$d|0)|0}var Ir=64,Fr=4194304;function jn(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 ci(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,l=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~i;u!==0?r=jn(u):(l&=o,l!==0&&(r=jn(l)))}else o=n&~i,o!==0?r=jn(o):l!==0&&(r=jn(l));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,l=t&-t,i>=l||i===16&&(l&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function gr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ve(t),e[t]=n}function Hd(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=qn),ps=String.fromCharCode(32),hs=!1;function wc(e,t){switch(e){case"keyup":return Sp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jt=!1;function kp(e,t){switch(e){case"compositionend":return kc(t);case"keypress":return t.which!==32?null:(hs=!0,ps);case"textInput":return e=t.data,e===ps&&hs?null:e;default:return null}}function Cp(e,t){if(Jt)return e==="compositionend"||!ou&&wc(e,t)?(e=gc(),Gr=ru=mt=null,Jt=!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=gs(n)}}function xc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oc(){for(var e=window,t=oi();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=oi(e.document)}return t}function uu(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 Fp(e){var t=Oc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&xc(n.ownerDocument.documentElement,n)){if(r!==null&&uu(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 i=n.textContent.length,l=Math.min(r.start,i);r=r.end===void 0?l:Math.min(r.end,i),!e.extend&&l>r&&(i=r,r=l,l=i),i=Ss(n,l);var o=Ss(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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,bt=null,oo=null,Kn=null,uo=!1;function ws(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;uo||bt==null||bt!==oi(r)||(r=bt,"selectionStart"in r&&uu(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}),Kn&&ir(Kn,r)||(Kn=r,r=pi(oo,"onSelect"),0nn||(e.current=ho[nn],ho[nn]=null,nn--)}function Q(e,t){nn++,ho[nn]=e.current,e.current=t}var Ot={},fe=Rt(Ot),Se=Rt(!1),$t=Ot;function vn(e,t){var n=e.type.contextTypes;if(!n)return Ot;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},l;for(l in n)i[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function we(e){return e=e.childContextTypes,e!=null}function mi(){V(Se),V(fe)}function Ps(e,t,n){if(fe.current!==Ot)throw Error(E(168));Q(fe,t),Q(Se,n)}function Uc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(E(108,Od(e)||"Unknown",i));return K({},n,r)}function vi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ot,$t=fe.current,Q(fe,e),Q(Se,Se.current),!0}function Rs(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=Uc(e,t,$t),r.__reactInternalMemoizedMergedChildContext=e,V(Se),V(fe),Q(fe,e)):V(Se),Q(Se,n)}var Je=null,Bi=!1,xl=!1;function zc(e){Je===null?Je=[e]:Je.push(e)}function Bp(e){Bi=!0,zc(e)}function Nt(){if(!xl&&Je!==null){xl=!0;var e=0,t=j;try{var n=Je;for(j=1;e>=o,i-=o,et=1<<32-Ve(t)+i|n<O?(z=_,_=null):z=_.sibling;var y=h(m,_,p[O],w);if(y===null){_===null&&(_=z);break}e&&_&&y.alternate===null&&t(m,_),d=l(y,d,O),C===null?x=y:C.sibling=y,C=y,_=z}if(O===p.length)return n(m,_),B&&Dt(m,O),x;if(_===null){for(;OO?(z=_,_=null):z=_.sibling;var de=h(m,_,y.value,w);if(de===null){_===null&&(_=z);break}e&&_&&de.alternate===null&&t(m,_),d=l(de,d,O),C===null?x=de:C.sibling=de,C=de,_=z}if(y.done)return n(m,_),B&&Dt(m,O),x;if(_===null){for(;!y.done;O++,y=p.next())y=f(m,y.value,w),y!==null&&(d=l(y,d,O),C===null?x=y:C.sibling=y,C=y);return B&&Dt(m,O),x}for(_=r(m,_);!y.done;O++,y=p.next())y=v(_,m,O,y.value,w),y!==null&&(e&&y.alternate!==null&&_.delete(y.key===null?O:y.key),d=l(y,d,O),C===null?x=y:C.sibling=y,C=y);return e&&_.forEach(function(Gt){return t(m,Gt)}),B&&Dt(m,O),x}function P(m,d,p,w){if(typeof p=="object"&&p!==null&&p.type===Zt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case Pr:e:{for(var x=p.key,C=d;C!==null;){if(C.key===x){if(x=p.type,x===Zt){if(C.tag===7){n(m,C.sibling),d=i(C,p.props.children),d.return=m,m=d;break e}}else if(C.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===ct&&Us(x)===C.type){n(m,C.sibling),d=i(C,p.props),d.ref=Mn(m,C,p),d.return=m,m=d;break e}n(m,C);break}else t(m,C);C=C.sibling}p.type===Zt?(d=Qt(p.props.children,m.mode,w,p.key),d.return=m,m=d):(w=ni(p.type,p.key,p.props,null,m.mode,w),w.ref=Mn(m,d,p),w.return=m,m=w)}return o(m);case Yt:e:{for(C=p.key;d!==null;){if(d.key===C)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(m,d.sibling),d=i(d,p.children||[]),d.return=m,m=d;break e}else{n(m,d);break}else t(m,d);d=d.sibling}d=Dl(p,m.mode,w),d.return=m,m=d}return o(m);case ct:return C=p._init,P(m,d,C(p._payload),w)}if(An(p))return S(m,d,p,w);if(Nn(p))return g(m,d,p,w);Ar(m,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(m,d.sibling),d=i(d,p),d.return=m,m=d):(n(m,d),d=Tl(p,m.mode,w),d.return=m,m=d),o(m)):n(m,d)}return P}var gn=qc(!0),Hc=qc(!1),kr={},Xe=Rt(kr),sr=Rt(kr),ar=Rt(kr);function Lt(e){if(e===kr)throw Error(E(174));return e}function vu(e,t){switch(Q(ar,t),Q(sr,e),Q(Xe,kr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Yl(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Yl(t,e)}V(Xe),Q(Xe,t)}function Sn(){V(Xe),V(sr),V(ar)}function Kc(e){Lt(ar.current);var t=Lt(Xe.current),n=Yl(t,e.type);t!==n&&(Q(sr,e),Q(Xe,n))}function yu(e){sr.current===e&&(V(Xe),V(sr))}var q=Rt(0);function Ci(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)!==0)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 Ol=[];function gu(){for(var e=0;en?n:4,e(!0);var r=Pl.transition;Pl.transition={};try{e(!1),t()}finally{j=n,Pl.transition=r}}function af(){return Le().memoizedState}function Wp(e,t,n){var r=Et(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cf(e))ff(t,n);else if(n=Qc(e,t,n,r),n!==null){var i=he();Be(n,e,r,i),df(n,t,r)}}function Gp(e,t,n){var r=Et(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cf(e))ff(t,i);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var o=t.lastRenderedState,u=l(o,n);if(i.hasEagerState=!0,i.eagerState=u,qe(u,o)){var s=t.interleaved;s===null?(i.next=i,hu(t)):(i.next=s.next,s.next=i),t.interleaved=i;return}}catch{}finally{}n=Qc(e,t,i,r),n!==null&&(i=he(),Be(n,e,r,i),df(n,t,r))}}function cf(e){var t=e.alternate;return e===H||t!==null&&t===H}function ff(e,t){Wn=Ei=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function df(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,eu(e,n)}}var _i={readContext:ze,useCallback:se,useContext:se,useEffect:se,useImperativeHandle:se,useInsertionEffect:se,useLayoutEffect:se,useMemo:se,useReducer:se,useRef:se,useState:se,useDebugValue:se,useDeferredValue:se,useTransition:se,useMutableSource:se,useSyncExternalStore:se,useId:se,unstable_isNewReconciler:!1},Xp={readContext:ze,useCallback:function(e,t){return Ke().memoizedState=[e,t===void 0?null:t],e},useContext:ze,useEffect:Ls,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Jr(4194308,4,rf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Jr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Jr(4,2,e,t)},useMemo:function(e,t){var n=Ke();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ke();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=Wp.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Ke();return e={current:e},t.memoizedState=e},useState:zs,useDebugValue:Eu,useDeferredValue:function(e){return Ke().memoizedState=e},useTransition:function(){var e=zs(!1),t=e[0];return e=Kp.bind(null,e[1]),Ke().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=H,i=Ke();if(B){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),re===null)throw Error(E(349));(Bt&30)!==0||Xc(r,t,n)}i.memoizedState=n;var l={value:n,getSnapshot:t};return i.queue=l,Ls(Zc.bind(null,r,l,e),[e]),r.flags|=2048,dr(9,Yc.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=Ke(),t=re.identifierPrefix;if(B){var n=tt,r=et;n=(r&~(1<<32-Ve(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=cr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[We]=t,e[ur]=r,kf(e,t,!1,!1),t.stateNode=e;e:{switch(o=Jl(n,r),n){case"dialog":$("cancel",e),$("close",e),i=r;break;case"iframe":case"object":case"embed":$("load",e),i=r;break;case"video":case"audio":for(i=0;ikn&&(t.flags|=128,r=!0,Un(l,!1),t.lanes=4194304)}else{if(!r)if(e=Ci(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Un(l,!0),l.tail===null&&l.tailMode==="hidden"&&!o.alternate&&!B)return ae(t),null}else 2*X()-l.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,Un(l,!1),t.lanes=4194304);l.isBackwards?(o.sibling=t.child,t.child=o):(n=l.last,n!==null?n.sibling=o:t.child=o,l.last=o)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=X(),t.sibling=null,n=q.current,Q(q,r?n&1|2:n&1),t):(ae(t),null);case 22:case 23:return Nu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Ce&1073741824)!==0&&(ae(t),t.subtreeFlags&6&&(t.flags|=8192)):ae(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function rh(e,t){switch(au(t),t.tag){case 1:return we(t.type)&&mi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sn(),V(Se),V(fe),gu(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return yu(t),null;case 13:if(V(q),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));yn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(q),null;case 4:return Sn(),null;case 10:return pu(t.type._context),null;case 22:case 23:return Nu(),null;case 24:return null;default:return null}}var Qr=!1,ce=!1,ih=typeof WeakSet=="function"?WeakSet:Set,R=null;function un(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){W(e,t,r)}else n.current=null}function Oo(e,t,n){try{n()}catch(r){W(e,t,r)}}var Ks=!1;function lh(e,t){if(so=fi,e=Oc(),uu(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 i=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var o=0,u=-1,s=-1,a=0,c=0,f=e,h=null;t:for(;;){for(var v;f!==n||i!==0&&f.nodeType!==3||(u=o+i),f!==l||r!==0&&f.nodeType!==3||(s=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(v=f.firstChild)!==null;)h=f,f=v;for(;;){if(f===e)break t;if(h===n&&++a===i&&(u=o),h===l&&++c===r&&(s=o),(v=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=v}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(ao={focusedElem:e,selectionRange:n},fi=!1,R=t;R!==null;)if(t=R,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,R=e;else for(;R!==null;){t=R;try{var S=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var g=S.memoizedProps,P=S.memoizedState,m=t.stateNode,d=m.getSnapshotBeforeUpdate(t.elementType===t.type?g:je(t.type,g),P);m.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(w){W(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,R=e;break}R=t.return}return S=Ks,Ks=!1,S}function Gn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var l=i.destroy;i.destroy=void 0,l!==void 0&&Oo(t,n,l)}i=i.next}while(i!==r)}}function Ki(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 Po(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 _f(e){var t=e.alternate;t!==null&&(e.alternate=null,_f(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[We],delete t[ur],delete t[po],delete t[$p],delete t[Vp])),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 xf(e){return e.tag===5||e.tag===3||e.tag===4}function Ws(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xf(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 Ro(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=hi));else if(r!==4&&(e=e.child,e!==null))for(Ro(e,t,n),e=e.sibling;e!==null;)Ro(e,t,n),e=e.sibling}function No(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(No(e,t,n),e=e.sibling;e!==null;)No(e,t,n),e=e.sibling}var le=null,Qe=!1;function at(e,t,n){for(n=n.child;n!==null;)Of(e,t,n),n=n.sibling}function Of(e,t,n){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(Ai,n)}catch{}switch(n.tag){case 5:ce||un(n,t);case 6:var r=le,i=Qe;le=null,at(e,t,n),le=r,Qe=i,le!==null&&(Qe?(e=le,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):le.removeChild(n.stateNode));break;case 18:le!==null&&(Qe?(e=le,n=n.stateNode,e.nodeType===8?_l(e.parentNode,n):e.nodeType===1&&_l(e,n),nr(e)):_l(le,n.stateNode));break;case 4:r=le,i=Qe,le=n.stateNode.containerInfo,Qe=!0,at(e,t,n),le=r,Qe=i;break;case 0:case 11:case 14:case 15:if(!ce&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var l=i,o=l.destroy;l=l.tag,o!==void 0&&((l&2)!==0||(l&4)!==0)&&Oo(n,t,o),i=i.next}while(i!==r)}at(e,t,n);break;case 1:if(!ce&&(un(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){W(n,t,u)}at(e,t,n);break;case 21:at(e,t,n);break;case 22:n.mode&1?(ce=(r=ce)||n.memoizedState!==null,at(e,t,n),ce=r):at(e,t,n);break;default:at(e,t,n)}}function Gs(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new ih),t.forEach(function(r){var i=hh.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ae(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~l}if(r=i,r=X()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*uh(r/1960))-r,10e?16:e,vt===null)var r=!1;else{if(e=vt,vt=null,Pi=0,(U&6)!==0)throw Error(E(331));var i=U;for(U|=4,R=e.current;R!==null;){var l=R,o=l.child;if((R.flags&16)!==0){var u=l.deletions;if(u!==null){for(var s=0;sX()-Pu?jt(e,0):Ou|=n),ke(e,t)}function Mf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Fr,Fr<<=1,(Fr&130023424)===0&&(Fr=4194304)));var n=he();e=lt(e,t),e!==null&&(gr(e,t,n),ke(e,n))}function ph(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Mf(e,n)}function hh(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),Mf(e,n)}var Uf;Uf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Se.current)ge=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ge=!1,th(e,t,n);ge=(e.flags&131072)!==0}else ge=!1,B&&(t.flags&1048576)!==0&&Lc(t,gi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;br(e,t),e=t.pendingProps;var i=vn(t,fe.current);pn(t,n),i=wu(null,t,r,e,i,n);var l=ku();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,we(r)?(l=!0,vi(t)):l=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mu(t),i.updater=qi,t.stateNode=i,i._reactInternals=t,So(t,r,e,n),t=Co(null,t,r,!0,l,n)):(t.tag=0,B&&l&&su(t),pe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(br(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=vh(r),e=je(r,e),i){case 0:t=ko(null,t,r,e,n);break e;case 1:t=Bs(null,t,r,e,n);break e;case 11:t=$s(null,t,r,e,n);break e;case 14:t=Vs(null,t,r,je(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:je(r,i),ko(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:je(r,i),Bs(e,t,r,i,n);case 3:e:{if(gf(t),e===null)throw Error(E(387));r=t.pendingProps,l=t.memoizedState,i=l.element,$c(e,t),ki(t,r,null,n);var o=t.memoizedState;if(r=o.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){i=wn(Error(E(423)),t),t=qs(e,t,r,n,i);break e}else if(r!==i){i=wn(Error(E(424)),t),t=qs(e,t,r,n,i);break e}else for(Ee=wt(t.stateNode.containerInfo.firstChild),_e=t,B=!0,$e=null,n=Hc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yn(),r===i){t=ot(e,t,n);break e}pe(e,t,r,n)}t=t.child}return t;case 5:return Kc(t),e===null&&vo(t),r=t.type,i=t.pendingProps,l=e!==null?e.memoizedProps:null,o=i.children,co(r,i)?o=null:l!==null&&co(r,l)&&(t.flags|=32),yf(e,t),pe(e,t,o,n),t.child;case 6:return e===null&&vo(t),null;case 13:return Sf(e,t,n);case 4:return vu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gn(t,null,r,n):pe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:je(r,i),$s(e,t,r,i,n);case 7:return pe(e,t,t.pendingProps,n),t.child;case 8:return pe(e,t,t.pendingProps.children,n),t.child;case 12:return pe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,l=t.memoizedProps,o=i.value,Q(Si,r._currentValue),r._currentValue=o,l!==null)if(qe(l.value,o)){if(l.children===i.children&&!Se.current){t=ot(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var u=l.dependencies;if(u!==null){o=l.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(l.tag===1){s=nt(-1,n&-n),s.tag=2;var a=l.updateQueue;if(a!==null){a=a.shared;var c=a.pending;c===null?s.next=s:(s.next=c.next,c.next=s),a.pending=s}}l.lanes|=n,s=l.alternate,s!==null&&(s.lanes|=n),yo(l.return,n,t),u.lanes|=n;break}s=s.next}}else if(l.tag===10)o=l.type===t.type?null:l.child;else if(l.tag===18){if(o=l.return,o===null)throw Error(E(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),yo(o,n,t),o=l.sibling}else o=l.child;if(o!==null)o.return=l;else for(o=l;o!==null;){if(o===t){o=null;break}if(l=o.sibling,l!==null){l.return=o.return,o=l;break}o=o.return}l=o}pe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,pn(t,n),i=ze(i),r=r(i),t.flags|=1,pe(e,t,r,n),t.child;case 14:return r=t.type,i=je(r,t.pendingProps),i=je(r.type,i),Vs(e,t,r,i,n);case 15:return mf(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:je(r,i),br(e,t),t.tag=1,we(r)?(e=!0,vi(t)):e=!1,pn(t,n),Bc(t,r,i),So(t,r,i,n),Co(null,t,r,!0,e,n);case 19:return wf(e,t,n);case 22:return vf(e,t,n)}throw Error(E(156,t.tag))};function zf(e,t){return uc(e,t)}function mh(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 Me(e,t,n,r){return new mh(e,t,n,r)}function Fu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function vh(e){if(typeof e=="function")return Fu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yo)return 11;if(e===Zo)return 14}return 2}function _t(e,t){var n=e.alternate;return n===null?(n=Me(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 ni(e,t,n,r,i,l){var o=2;if(r=e,typeof e=="function")Fu(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Zt:return Qt(n.children,i,l,t);case Xo:o=8,i|=8;break;case Vl:return e=Me(12,n,t,i|2),e.elementType=Vl,e.lanes=l,e;case Bl:return e=Me(13,n,t,i),e.elementType=Bl,e.lanes=l,e;case ql:return e=Me(19,n,t,i),e.elementType=ql,e.lanes=l,e;case qa:return Gi(n,i,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Va:o=10;break e;case Ba:o=9;break e;case Yo:o=11;break e;case Zo:o=14;break e;case ct:o=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=Me(o,n,t,i),t.elementType=e,t.type=r,t.lanes=l,t}function Qt(e,t,n,r){return e=Me(7,e,r,t),e.lanes=n,e}function Gi(e,t,n,r){return e=Me(22,e,r,t),e.elementType=qa,e.lanes=n,e.stateNode={isHidden:!1},e}function Tl(e,t,n){return e=Me(6,e,null,t),e.lanes=n,e}function Dl(e,t,n){return t=Me(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function yh(e,t,n,r,i){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=pl(0),this.expirationTimes=pl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pl(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Tu(e,t,n,r,i,l,o,u,s){return e=new yh(e,t,n,u,s),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Me(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},mu(l),e}function gh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Pe})(La);var na=La.exports;Ql.createRoot=na.createRoot,Ql.hydrateRoot=na.hydrateRoot;var zu={exports:{}},Qf={};/** * @license React * use-sync-external-store-shim.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 Cn=A.exports;function Eh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var _h=typeof Object.is=="function"?Object.is:Eh,xh=Cn.useState,Oh=Cn.useEffect,Ph=Cn.useLayoutEffect,Rh=Cn.useDebugValue;function Nh(e,t){var n=t(),r=xh({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return Ph(function(){i.value=n,i.getSnapshot=t,Ml(i)&&l({inst:i})},[e,n,t]),Oh(function(){return Ml(i)&&l({inst:i}),e(function(){Ml(i)&&l({inst:i})})},[e]),Rh(n),n}function Ml(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_h(e,n)}catch{return!0}}function Ih(e,t){return t()}var Fh=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ih:Nh;Qf.useSyncExternalStore=Cn.useSyncExternalStore!==void 0?Cn.useSyncExternalStore:Fh;(function(e){e.exports=Qf})(zu);var bi={exports:{}},el={};/** * @license React * react-jsx-runtime.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 Th=A.exports,Dh=Symbol.for("react.element"),Mh=Symbol.for("react.fragment"),Uh=Object.prototype.hasOwnProperty,zh=Th.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Lh={key:!0,ref:!0,__self:!0,__source:!0};function $f(e,t,n){var r,i={},l=null,o=null;n!==void 0&&(l=""+n),t.key!==void 0&&(l=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Uh.call(t,r)&&!Lh.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Dh,type:e,key:l,ref:o,props:i,_owner:zh.current}}el.Fragment=Mh;el.jsx=$f;el.jsxs=$f;(function(e){e.exports=el})(bi);const Ah=bi.exports.Fragment,k=bi.exports.jsx,I=bi.exports.jsxs;/** * react-query * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */class Cr{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const hr=typeof window>"u";function Ie(){}function jh(e,t){return typeof e=="function"?e(t):e}function Mo(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vf(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ri(e,t,n){return tl(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function dt(e,t,n){return tl(e)?[{...t,queryKey:e},n]:[e||{},t]}function ra(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:l,queryKey:o,stale:u}=e;if(tl(o)){if(r){if(t.queryHash!==Lu(o,t.options))return!1}else if(!Ii(t.queryKey,o))return!1}if(n!=="all"){const s=t.isActive();if(n==="active"&&!s||n==="inactive"&&s)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||typeof i<"u"&&i!==t.state.fetchStatus||l&&!l(t))}function ia(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:l}=e;if(tl(l)){if(!t.options.mutationKey)return!1;if(n){if(At(t.options.mutationKey)!==At(l))return!1}else if(!Ii(t.options.mutationKey,l))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Lu(e,t){return((t==null?void 0:t.queryKeyHashFn)||At)(e)}function At(e){return JSON.stringify(e,(t,n)=>Uo(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ii(e,t){return Bf(e,t)}function Bf(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Bf(e[n],t[n])):!1}function qf(e,t){if(e===t)return e;const n=oa(e)&&oa(t);if(n||Uo(e)&&Uo(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),l=i.length,o=n?[]:{};let u=0;for(let s=0;s"u")return!0;const n=t.prototype;return!(!ua(n)||!n.hasOwnProperty("isPrototypeOf"))}function ua(e){return Object.prototype.toString.call(e)==="[object Object]"}function tl(e){return Array.isArray(e)}function Hf(e){return new Promise(t=>{setTimeout(t,e)})}function sa(e){Hf(0).then(e)}function Qh(){if(typeof AbortController=="function")return new AbortController}function zo(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?qf(e,t):t}class $h extends Cr{constructor(){super(),this.setup=t=>{if(!hr&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Fi=new $h;class Vh extends Cr{constructor(){super(),this.setup=t=>{if(!hr&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const Ti=new Vh;function Bh(e){return Math.min(1e3*2**e,3e4)}function nl(e){return(e!=null?e:"online")==="online"?Ti.isOnline():!0}class Kf{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function ii(e){return e instanceof Kf}function Wf(e){let t=!1,n=0,r=!1,i,l,o;const u=new Promise((P,m)=>{l=P,o=m}),s=P=>{r||(v(new Kf(P)),e.abort==null||e.abort())},a=()=>{t=!0},c=()=>{t=!1},f=()=>!Fi.isFocused()||e.networkMode!=="always"&&!Ti.isOnline(),h=P=>{r||(r=!0,e.onSuccess==null||e.onSuccess(P),i==null||i(),l(P))},v=P=>{r||(r=!0,e.onError==null||e.onError(P),i==null||i(),o(P))},S=()=>new Promise(P=>{i=m=>{if(r||!f())return P(m)},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),g=()=>{if(r)return;let P;try{P=e.fn()}catch(m){P=Promise.reject(m)}Promise.resolve(P).then(h).catch(m=>{var d,p;if(r)return;const w=(d=e.retry)!=null?d:3,x=(p=e.retryDelay)!=null?p:Bh,C=typeof x=="function"?x(n,m):x,_=w===!0||typeof w=="number"&&n{if(f())return S()}).then(()=>{t?v(m):g()})})};return nl(e.networkMode)?g():S().then(g),{promise:u,cancel:s,continue:()=>{i==null||i()},cancelRetry:a,continueRetry:c}}const Au=console;function qh(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const i=c=>{let f;t++;try{f=c()}finally{t--,t||u()}return f},l=c=>{t?e.push(c):sa(()=>{n(c)})},o=c=>(...f)=>{l(()=>{c(...f)})},u=()=>{const c=e;e=[],c.length&&sa(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:i,batchCalls:o,schedule:l,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const Y=qh();class Gf{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mo(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:hr?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class Hh extends Gf{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Au,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||Kh(this.options),this.state=this.initialState,this.meta=t.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.meta=t==null?void 0:t.meta,this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=zo(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(Ie).catch(Ie):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!Vf(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var l;return(l=this.retryer)==null||l.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const v=this.observers.find(S=>S.options.queryFn);v&&this.setOptions(v.options)}Array.isArray(this.options.queryKey);const o=Qh(),u={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},s=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};s(u);const a=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(u)):Promise.reject("Missing queryFn"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a,meta:this.meta};if(s(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=c.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta})}const h=v=>{if(ii(v)&&v.silent||this.dispatch({type:"error",error:v}),!ii(v)){var S,g;(S=(g=this.cache.config).onError)==null||S.call(g,v,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Wf({fn:c.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:v=>{var S,g;if(typeof v>"u"){h(new Error("Query data cannot be undefined"));return}this.setData(v),(S=(g=this.cache.config).onSuccess)==null||S.call(g,v,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:h,onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,l;switch(t.type){case"failed":return{...r,fetchFailureCount:r.fetchFailureCount+1};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:nl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(l=t.dataUpdatedAt)!=null?l:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0}};case"error":const o=t.error;return ii(o)&&o.revert&&this.revertState?{...this.revertState}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Y.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function Kh(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof e.initialData<"u"?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0,i=typeof t<"u";return{data:t,dataUpdateCount:0,dataUpdatedAt:i?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isInvalidated:!1,status:i?"success":"loading",fetchStatus:"idle"}}class Wh extends Cr{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const l=n.queryKey,o=(i=n.queryHash)!=null?i:Lu(l,n);let u=this.get(o);return u||(u=new Hh({cache:this,logger:t.getLogger(),queryKey:l,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(l),meta:n.meta}),this.add(u)),u}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){Y.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=dt(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>ra(r,i))}findAll(t,n){const[r]=dt(t,n);return Object.keys(r).length>0?this.queries.filter(i=>ra(r,i)):this.queries}notify(t){Y.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Y.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){Y.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class Gh extends Gf{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Au,this.observers=[],this.state=t.state||Xh(),this.meta=t.meta,this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){const t=()=>{var p;return this.retryer=Wf({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(p=this.options.retry)!=null?p:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,l,o,u,s;if(!n){var a,c,f,h;this.dispatch({type:"loading",variables:this.options.variables}),(a=(c=this.mutationCache.config).onMutate)==null||a.call(c,this.state.variables,this);const w=await((f=(h=this.options).onMutate)==null?void 0:f.call(h,this.state.variables));w!==this.state.context&&this.dispatch({type:"loading",context:w,variables:this.state.variables})}const p=await t();return(r=(i=this.mutationCache.config).onSuccess)==null||r.call(i,p,this.state.variables,this.state.context,this),await((l=(o=this.options).onSuccess)==null?void 0:l.call(o,p,this.state.variables,this.state.context)),await((u=(s=this.options).onSettled)==null?void 0:u.call(s,p,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:p}),p}catch(p){try{var v,S,g,P,m,d;throw(v=(S=this.mutationCache.config).onError)==null||v.call(S,p,this.state.variables,this.state.context,this),await((g=(P=this.options).onError)==null?void 0:g.call(P,p,this.state.variables,this.state.context)),await((m=(d=this.options).onSettled)==null?void 0:m.call(d,void 0,p,this.state.variables,this.state.context)),p}finally{this.dispatch({type:"error",error:p})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:r.failureCount+1};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,error:null,isPaused:!nl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),Y.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function Xh(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}class Yh extends Cr{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new Gh({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0,meta:n.meta});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){Y.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>ia(t,n))}findAll(t){return this.mutations.filter(n=>ia(t,n))}notify(t){Y.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.mutations.filter(n=>n.state.isPaused);return Y.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ie)),Promise.resolve()))}}function Zh(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,l,o;const u=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,s=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,a=s==null?void 0:s.pageParam,c=(s==null?void 0:s.direction)==="forward",f=(s==null?void 0:s.direction)==="backward",h=((l=e.state.data)==null?void 0:l.pages)||[],v=((o=e.state.data)==null?void 0:o.pageParams)||[];let S=v,g=!1;const P=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>{var _;if((_=e.signal)!=null&&_.aborted)g=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{g=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),d=(C,_,O,z)=>(S=z?[_,...S]:[...S,_],z?[O,...C]:[...C,O]),p=(C,_,O,z)=>{if(g)return Promise.reject("Cancelled");if(typeof O>"u"&&!_&&C.length)return Promise.resolve(C);const y={queryKey:e.queryKey,pageParam:O,meta:e.meta};P(y);const de=m(y);return Promise.resolve(de).then(It=>d(C,O,It,z))};let w;if(!h.length)w=p([]);else if(c){const C=typeof a<"u",_=C?a:aa(e.options,h);w=p(h,C,_)}else if(f){const C=typeof a<"u",_=C?a:Jh(e.options,h);w=p(h,C,_,!0)}else{S=[];const C=typeof e.options.getNextPageParam>"u";w=(u&&h[0]?u(h[0],0,h):!0)?p([],C,v[0]):Promise.resolve(d([],v[0],h[0]));for(let O=1;O{if(u&&h[O]?u(h[O],O,h):!0){const de=C?v[O]:aa(e.options,z);return p(z,C,de)}return Promise.resolve(d(z,v[O],h[O]))})}return w.then(C=>({pages:C,pageParams:S}))}}}}function aa(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function Jh(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class bh{constructor(t={}){this.queryCache=t.queryCache||new Wh,this.mutationCache=t.mutationCache||new Yh,this.logger=t.logger||Au,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=Fi.subscribe(()=>{Fi.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=Ti.subscribe(()=>{Ti.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var t,n;(t=this.unsubscribeFocus)==null||t.call(this),(n=this.unsubscribeOnline)==null||n.call(this)}isFetching(t,n){const[r]=dt(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),l=i==null?void 0:i.state.data,o=jh(n,l);if(typeof o>"u")return;const u=ri(t),s=this.defaultQueryOptions(u);return this.queryCache.build(this,s).setData(o,{...r,manual:!0})}setQueriesData(t,n,r){return Y.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=dt(t,n),i=this.queryCache;Y.batch(()=>{i.findAll(r).forEach(l=>{i.remove(l)})})}resetQueries(t,n,r){const[i,l]=dt(t,n,r),o=this.queryCache,u={type:"active",...i};return Y.batch(()=>(o.findAll(i).forEach(s=>{s.reset()}),this.refetchQueries(u,l)))}cancelQueries(t,n,r){const[i,l={}]=dt(t,n,r);typeof l.revert>"u"&&(l.revert=!0);const o=Y.batch(()=>this.queryCache.findAll(i).map(u=>u.cancel(l)));return Promise.all(o).then(Ie).catch(Ie)}invalidateQueries(t,n,r){const[i,l]=dt(t,n,r);return Y.batch(()=>{var o,u;if(this.queryCache.findAll(i).forEach(a=>{a.invalidate()}),i.refetchType==="none")return Promise.resolve();const s={...i,type:(o=(u=i.refetchType)!=null?u:i.type)!=null?o:"active"};return this.refetchQueries(s,l)})}refetchQueries(t,n,r){const[i,l]=dt(t,n,r),o=Y.batch(()=>this.queryCache.findAll(i).filter(s=>!s.isDisabled()).map(s=>{var a;return s.fetch(void 0,{...l,cancelRefetch:(a=l==null?void 0:l.cancelRefetch)!=null?a:!0,meta:{refetchPage:i.refetchPage}})}));let u=Promise.all(o).then(Ie);return l!=null&&l.throwOnError||(u=u.catch(Ie)),u}fetchQuery(t,n,r){const i=ri(t,n,r),l=this.defaultQueryOptions(i);typeof l.retry>"u"&&(l.retry=!1);const o=this.queryCache.build(this,l);return o.isStaleByTime(l.staleTime)?o.fetch(l):Promise.resolve(o.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(Ie).catch(Ie)}fetchInfiniteQuery(t,n,r){const i=ri(t,n,r);return i.behavior=Zh(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(Ie).catch(Ie)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>At(t)===At(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Ii(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>At(t)===At(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Ii(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=Lu(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class em extends Cr{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),ca(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return Lo(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Lo(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),la(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const l=this.hasListeners();l&&fa(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),l&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();l&&(this.currentQuery!==i||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ie)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),hr||this.currentResult.isStale||!Mo(this.options.staleTime))return;const n=Vf(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(hr||this.options.enabled===!1||!Mo(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Fi.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,l=this.currentResult,o=this.currentResultState,u=this.currentResultOptions,s=t!==r,a=s?t.state:this.currentQueryInitialState,c=s?this.currentResult:this.previousQueryResult,{state:f}=t;let{dataUpdatedAt:h,error:v,errorUpdatedAt:S,fetchStatus:g,status:P}=f,m=!1,d=!1,p;if(n._optimisticResults){const C=this.hasListeners(),_=!C&&ca(t,n),O=C&&fa(t,r,n,i);(_||O)&&(g=nl(t.options.networkMode)?"fetching":"paused",h||(P="loading")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.keepPreviousData&&!f.dataUpdateCount&&c!=null&&c.isSuccess&&P!=="error")p=c.data,h=c.dataUpdatedAt,P=c.status,m=!0;else if(n.select&&typeof f.data<"u")if(l&&f.data===(o==null?void 0:o.data)&&n.select===this.selectFn)p=this.selectResult;else try{this.selectFn=n.select,p=n.select(f.data),p=zo(l==null?void 0:l.data,p,n),this.selectResult=p,this.selectError=null}catch(C){this.selectError=C}else p=f.data;if(typeof n.placeholderData<"u"&&typeof p>"u"&&P==="loading"){let C;if(l!=null&&l.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))C=l.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof C<"u")try{C=n.select(C),C=zo(l==null?void 0:l.data,C,n),this.selectError=null}catch(_){this.selectError=_}typeof C<"u"&&(P="success",p=C,d=!0)}this.selectError&&(v=this.selectError,p=this.selectResult,S=Date.now(),P="error");const w=g==="fetching";return{status:P,fetchStatus:g,isLoading:P==="loading",isSuccess:P==="success",isError:P==="error",data:p,dataUpdatedAt:h,error:v,errorUpdatedAt:S,failureCount:f.fetchFailureCount,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>a.dataUpdateCount||f.errorUpdateCount>a.errorUpdateCount,isFetching:w,isRefetching:w&&P!=="loading",isLoadingError:P==="error"&&f.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:d,isPreviousData:m,isRefetchError:P==="error"&&f.dataUpdatedAt!==0,isStale:ju(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,la(r,n))return;this.currentResult=r;const i={cache:!0},l=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options;if(o==="all"||!o&&!this.trackedProps.size)return!0;const u=new Set(o!=null?o:this.trackedProps);return this.options.useErrorBoundary&&u.add("error"),Object.keys(this.currentResult).some(s=>{const a=s;return this.currentResult[a]!==n[a]&&u.has(a)})};(t==null?void 0:t.listeners)!==!1&&l()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!ii(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){Y.batch(()=>{if(t.onSuccess){var n,r,i,l;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(l=this.options).onSettled)==null||i.call(l,this.currentResult.data,null)}else if(t.onError){var o,u,s,a;(o=(u=this.options).onError)==null||o.call(u,this.currentResult.error),(s=(a=this.options).onSettled)==null||s.call(a,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(c=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function tm(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ca(e,t){return tm(e,t)||e.state.dataUpdatedAt>0&&Lo(e,t,t.refetchOnMount)}function Lo(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ju(e,t)}return!1}function fa(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&ju(e,n)}function ju(e,t){return e.isStaleByTime(t.staleTime)}const da=A.exports.createContext(void 0),Xf=A.exports.createContext(!1);function Yf(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=da),window.ReactQueryClientContext):da)}const Zf=({context:e}={})=>{const t=A.exports.useContext(Yf(e,A.exports.useContext(Xf)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},nm=({client:e,children:t,context:n,contextSharing:r=!1})=>{A.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=Yf(n,r);return k(Xf.Provider,{value:!n&&r,children:k(i.Provider,{value:e,children:t})})},Jf=A.exports.createContext(!1),rm=()=>A.exports.useContext(Jf);Jf.Provider;function im(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const lm=A.exports.createContext(im()),om=()=>A.exports.useContext(lm);function um(e,t){return typeof e=="function"?e(...t):!!e}function sm(e,t){const n=Zf({context:e.context}),r=rm(),i=om(),l=n.defaultQueryOptions(e);l._optimisticResults=r?"isRestoring":"optimistic",l.onError&&(l.onError=Y.batchCalls(l.onError)),l.onSuccess&&(l.onSuccess=Y.batchCalls(l.onSuccess)),l.onSettled&&(l.onSettled=Y.batchCalls(l.onSettled)),l.suspense&&typeof l.staleTime!="number"&&(l.staleTime=1e3),(l.suspense||l.useErrorBoundary)&&(i.isReset()||(l.retryOnMount=!1));const[o]=A.exports.useState(()=>new t(n,l)),u=o.getOptimisticResult(l);if(zu.exports.useSyncExternalStore(A.exports.useCallback(s=>r?()=>{}:o.subscribe(Y.batchCalls(s)),[o,r]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),A.exports.useEffect(()=>{i.clearReset()},[i]),A.exports.useEffect(()=>{o.setOptions(l,{listeners:!1})},[l,o]),l.suspense&&u.isLoading&&u.isFetching&&!r)throw o.fetchOptimistic(l).then(({data:s})=>{l.onSuccess==null||l.onSuccess(s),l.onSettled==null||l.onSettled(s,null)}).catch(s=>{i.clearReset(),l.onError==null||l.onError(s),l.onSettled==null||l.onSettled(void 0,s)});if(u.isError&&!i.isReset()&&!u.isFetching&&um(l.useErrorBoundary,[u.error,o.getCurrentQuery()]))throw u.error;return l.notifyOnChangeProps?u:o.trackResult(u)}function rl(e,t,n){const r=ri(e,t,n);return sm(r,em)}/** * react-query-devtools-noop * * Copyright (c) TanStack * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function am(){return null}function De(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:Qu(e)?2:$u(e)?3:0}function Ao(e,t){return Rn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function cm(e,t){return Rn(e)===2?e.get(t):e[t]}function bf(e,t,n){var r=Rn(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function fm(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Qu(e){return ym&&e instanceof Map}function $u(e){return gm&&e instanceof Set}function te(e){return e.o||e.t}function Vu(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=wm(e);delete t[L];for(var n=Ku(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=dm),Object.freeze(e),t&&_n(e,function(n,r){return Bu(r,!0)},!0)),e}function dm(){De(2)}function qu(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Ye(e){var t=Qo[e];return t||De(18,e),t}function pm(e,t){Qo[e]||(Qo[e]=t)}function Di(){return vr}function Ul(e,t){t&&(Ye("Patches"),e.u=[],e.s=[],e.v=t)}function Mi(e){jo(e),e.p.forEach(hm),e.p=null}function jo(e){e===vr&&(vr=e.l)}function pa(e){return vr={p:[],l:vr,h:e,m:!0,_:0}}function hm(e){var t=e[L];t.i===0||t.i===1?t.j():t.O=!0}function zl(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||Ye("ES5").S(t,e,r),r?(n[L].P&&(Mi(t),De(4)),ut(e)&&(e=Ui(t,e),t.l||zi(t,e)),t.u&&Ye("Patches").M(n[L].t,e,t.u,t.s)):e=Ui(t,n,[]),Mi(t),t.u&&t.v(t.u,t.s),e!==ed?e:void 0}function Ui(e,t,n){if(qu(t))return t;var r=t[L];if(!r)return _n(t,function(l,o){return ha(e,r,t,l,o,n)},!0),t;if(r.A!==e)return t;if(!r.P)return zi(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=Vu(r.k):r.o;_n(r.i===3?new Set(i):i,function(l,o){return ha(e,r,i,l,o,n)}),zi(e,i,!1),n&&e.u&&Ye("Patches").R(r,n,e.u,e.s)}return r.o}function ha(e,t,n,r,i,l){if(En(i)){var o=Ui(e,i,l&&t&&t.i!==3&&!Ao(t.D,r)?l.concat(r):void 0);if(bf(n,r,o),!En(o))return;e.m=!1}if(ut(i)&&!qu(i)){if(!e.h.F&&e._<1)return;Ui(e,i),t&&t.A.l||zi(e,i)}}function zi(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Bu(t,n)}function Ll(e,t){var n=e[L];return(n?te(n):e)[t]}function ma(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function be(e){e.P||(e.P=!0,e.l&&be(e.l))}function Al(e){e.o||(e.o=Vu(e.t))}function mr(e,t,n){var r=Qu(t)?Ye("MapSet").N(t,n):$u(t)?Ye("MapSet").T(t,n):e.g?function(i,l){var o=Array.isArray(i),u={i:o?1:0,A:l?l.A:Di(),P:!1,I:!1,D:{},l,t:i,k:null,o:null,j:null,C:!1},s=u,a=$o;o&&(s=[u],a=$n);var c=Proxy.revocable(s,a),f=c.revoke,h=c.proxy;return u.k=h,u.j=f,h}(t,n):Ye("ES5").J(t,n);return(n?n.A:Di()).p.push(r),r}function mm(e){return En(e)||De(22,e),function t(n){if(!ut(n))return n;var r,i=n[L],l=Rn(n);if(i){if(!i.P&&(i.i<4||!Ye("ES5").K(i)))return i.t;i.I=!0,r=va(n,l),i.I=!1}else r=va(n,l);return _n(r,function(o,u){i&&cm(i.t,o)===u||bf(r,o,t(u))}),l===3?new Set(r):r}(e)}function va(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Vu(e)}function vm(){function e(u,s){function a(){this.constructor=u}i(u,s),u.prototype=(a.prototype=s.prototype,new a)}function t(u){u.o||(u.D=new Map,u.o=new Map(u.t))}function n(u){u.o||(u.o=new Set,u.t.forEach(function(s){if(ut(s)){var a=mr(u.A.h,s,u);u.p.set(s,a),u.o.add(a)}else u.o.add(s)}))}function r(u){u.O&&De(3,JSON.stringify(te(u)))}var i=function(u,s){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,c){a.__proto__=c}||function(a,c){for(var f in c)c.hasOwnProperty(f)&&(a[f]=c[f])})(u,s)},l=function(){function u(a,c){return this[L]={i:2,l:c,A:c?c.A:Di(),P:!1,I:!1,o:void 0,D:void 0,t:a,k:this,C:!1,O:!1},this}e(u,Map);var s=u.prototype;return Object.defineProperty(s,"size",{get:function(){return te(this[L]).size}}),s.has=function(a){return te(this[L]).has(a)},s.set=function(a,c){var f=this[L];return r(f),te(f).has(a)&&te(f).get(a)===c||(t(f),be(f),f.D.set(a,!0),f.o.set(a,c),f.D.set(a,!0)),this},s.delete=function(a){if(!this.has(a))return!1;var c=this[L];return r(c),t(c),be(c),c.t.has(a)?c.D.set(a,!1):c.D.delete(a),c.o.delete(a),!0},s.clear=function(){var a=this[L];r(a),te(a).size&&(t(a),be(a),a.D=new Map,_n(a.t,function(c){a.D.set(c,!1)}),a.o.clear())},s.forEach=function(a,c){var f=this;te(this[L]).forEach(function(h,v){a.call(c,f.get(v),v,f)})},s.get=function(a){var c=this[L];r(c);var f=te(c).get(a);if(c.I||!ut(f)||f!==c.t.get(a))return f;var h=mr(c.A.h,f,c);return t(c),c.o.set(a,h),h},s.keys=function(){return te(this[L]).keys()},s.values=function(){var a,c=this,f=this.keys();return(a={})[Br]=function(){return c.values()},a.next=function(){var h=f.next();return h.done?h:{done:!1,value:c.get(h.value)}},a},s.entries=function(){var a,c=this,f=this.keys();return(a={})[Br]=function(){return c.entries()},a.next=function(){var h=f.next();if(h.done)return h;var v=c.get(h.value);return{done:!1,value:[h.value,v]}},a},s[Br]=function(){return this.entries()},u}(),o=function(){function u(a,c){return this[L]={i:3,l:c,A:c?c.A:Di(),P:!1,I:!1,o:void 0,t:a,k:this,p:new Map,O:!1,C:!1},this}e(u,Set);var s=u.prototype;return Object.defineProperty(s,"size",{get:function(){return te(this[L]).size}}),s.has=function(a){var c=this[L];return r(c),c.o?!!c.o.has(a)||!(!c.p.has(a)||!c.o.has(c.p.get(a))):c.t.has(a)},s.add=function(a){var c=this[L];return r(c),this.has(a)||(n(c),be(c),c.o.add(a)),this},s.delete=function(a){if(!this.has(a))return!1;var c=this[L];return r(c),n(c),be(c),c.o.delete(a)||!!c.p.has(a)&&c.o.delete(c.p.get(a))},s.clear=function(){var a=this[L];r(a),te(a).size&&(n(a),be(a),a.o.clear())},s.values=function(){var a=this[L];return r(a),n(a),a.o.values()},s.entries=function(){var a=this[L];return r(a),n(a),a.o.entries()},s.keys=function(){return this.values()},s[Br]=function(){return this.values()},s.forEach=function(a,c){for(var f=this.values(),h=f.next();!h.done;)a.call(c,h.value,h.value,this),h=f.next()},u}();pm("MapSet",{N:function(u,s){return new l(u,s)},T:function(u,s){return new o(u,s)}})}var ya,vr,Hu=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ym=typeof Map<"u",gm=typeof Set<"u",ga=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ed=Hu?Symbol.for("immer-nothing"):((ya={})["immer-nothing"]=!0,ya),Sa=Hu?Symbol.for("immer-draftable"):"__$immer_draftable",L=Hu?Symbol.for("immer-state"):"__$immer_state",Br=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",Sm=""+Object.prototype.constructor,Ku=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,wm=Object.getOwnPropertyDescriptors||function(e){var t={};return Ku(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},Qo={},$o={get:function(e,t){if(t===L)return e;var n=te(e);if(!Ao(n,t))return function(i,l,o){var u,s=ma(l,o);return s?"value"in s?s.value:(u=s.get)===null||u===void 0?void 0:u.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!ut(r)?r:r===Ll(e.t,t)?(Al(e),e.o[t]=mr(e.A.h,r,e)):r},has:function(e,t){return t in te(e)},ownKeys:function(e){return Reflect.ownKeys(te(e))},set:function(e,t,n){var r=ma(te(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=Ll(te(e),t),l=i==null?void 0:i[L];if(l&&l.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(fm(n,i)&&(n!==void 0||Ao(e.t,t)))return!0;Al(e),be(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return Ll(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,Al(e),be(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=te(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){De(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){De(12)}},$n={};_n($o,function(e,t){$n[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),$n.deleteProperty=function(e,t){return $n.set.call(this,e,t,void 0)},$n.set=function(e,t,n){return $o.set.call(this,e[0],t,n,e[0])};var km=function(){function e(n){var r=this;this.g=ga,this.F=!0,this.produce=function(i,l,o){if(typeof i=="function"&&typeof l!="function"){var u=l;l=i;var s=r;return function(g){var P=this;g===void 0&&(g=u);for(var m=arguments.length,d=Array(m>1?m-1:0),p=1;p1?c-1:0),h=1;h=0;i--){var l=r[i];if(l.path.length===0&&l.op==="replace"){n=l.value;break}}i>-1&&(r=r.slice(i+1));var o=Ye("Patches").$;return En(n)?o(n,r):this.produce(n,function(u){return o(u,r)})},e}(),Oe=new km,Ne=Oe.produce;Oe.produceWithPatches.bind(Oe);Oe.setAutoFreeze.bind(Oe);Oe.setUseProxies.bind(Oe);Oe.applyPatches.bind(Oe);Oe.createDraft.bind(Oe);Oe.finishDraft.bind(Oe);const Er="",Cm=5e3,Em=async()=>{const e=`${Er}/ping`;return await(await fetch(e)).json()},_m=async()=>await(await fetch(`${Er}/modifiers.json`)).json(),xm=async()=>(await(await fetch(`${Er}/output_dir`)).json())[0],wa="MakeImage",Om=async e=>await(await fetch(`${Er}/image`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).json(),ka=e=>{let t;const n=new Set,r=(s,a)=>{const c=typeof s=="function"?s(t):s;if(c!==t){const f=t;t=(a!=null?a:typeof c!="object")?c:Object.assign({},t,c),n.forEach(h=>h(t,f))}},i=()=>t,u={setState:r,getState:i,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>n.clear()};return t=e(r,i,u),u},Pm=e=>e?ka(e):ka;var td={exports:{}},nd={};/** * @license React * use-sync-external-store-shim/with-selector.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 il=A.exports,Rm=zu.exports;function Nm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Im=typeof Object.is=="function"?Object.is:Nm,Fm=Rm.useSyncExternalStore,Tm=il.useRef,Dm=il.useEffect,Mm=il.useMemo,Um=il.useDebugValue;nd.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var l=Tm(null);if(l.current===null){var o={hasValue:!1,value:null};l.current=o}else o=l.current;l=Mm(function(){function s(v){if(!a){if(a=!0,c=v,v=r(v),i!==void 0&&o.hasValue){var S=o.value;if(i(S,v))return f=S}return f=v}if(S=f,Im(c,v))return S;var g=r(v);return i!==void 0&&i(S,g)?S:(c=v,f=g)}var a=!1,c,f,h=n===void 0?null:n;return[function(){return s(t())},h===null?void 0:function(){return s(h())}]},[t,n,r,i]);var u=Fm(e,l[0],l[1]);return Dm(function(){o.hasValue=!0,o.value=u},[u]),Um(u),u};(function(e){e.exports=nd})(td);const zm=Ra(td.exports),{useSyncExternalStoreWithSelector:Lm}=zm;function Am(e,t=e.getState,n){const r=Lm(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return A.exports.useDebugValue(r),r}const Ca=e=>{const t=typeof e=="function"?Pm(e):e,n=(r,i)=>Am(t,r,i);return Object.assign(n,t),n},jm=e=>e?Ca(e):Ca;var rd=jm;const Qm=(e,t={})=>(n,r,i)=>{const{enabled:l,anonymousActionType:o,...u}=t;let s;try{s=(l!=null?l:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!s)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&l&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const a=s.connect(u);let c=!0;i.setState=(v,S,g)=>{const P=n(v,S);return c&&a.send(g===void 0?{type:o||"anonymous"}:typeof g=="string"?{type:g}:g,r()),P};const f=(...v)=>{const S=c;c=!1,n(...v),c=S},h=e(i.setState,r,i);if(a.init(h),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let v=!1;const S=i.dispatch;i.dispatch=(...g)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&g[0].type==="__setState"&&!v&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),v=!0),S(...g)}}return a.subscribe(v=>{var S;switch(v.type){case"ACTION":if(typeof v.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return jl(v.payload,g=>{if(g.type==="__setState"){f(g.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(g)});case"DISPATCH":switch(v.payload.type){case"RESET":return f(h),a.init(i.getState());case"COMMIT":return a.init(i.getState());case"ROLLBACK":return jl(v.state,g=>{f(g),a.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return jl(v.state,g=>{f(g)});case"IMPORT_STATE":{const{nextLiftedState:g}=v.payload,P=(S=g.computedStates.slice(-1)[0])==null?void 0:S.state;if(!P)return;f(P),a.send(null,g);return}case"PAUSE_RECORDING":return c=!c}return}}),h},$m=Qm,jl=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function Li(){return Math.floor(Math.random()*1e4)}const T=rd($m((e,t)=>({parallelCount:1,requestOptions:{prompt:"a photograph of an astronaut riding a horse",seed:Li(),num_outputs:1,num_inference_steps:50,guidance_scale:7.5,width:512,height:512,prompt_strength:.8,turbo:!0,use_cpu:!1,use_full_precision:!0,save_to_disk_path:"null",use_face_correction:"GFPGANv1.3",use_upscale:"RealESRGAN_x4plus",show_only_filtered_image:!0},tags:[],setParallelCount:n=>e(Ne(r=>{r.parallelCount=n})),setRequestOptions:(n,r)=>{e(Ne(i=>{i.requestOptions[n]=r}))},getValueForRequestKey:n=>t().requestOptions[n],toggleTag:n=>{e(Ne(r=>{const i=r.tags.indexOf(n);i>-1?r.tags.splice(i,1):r.tags.push(n)}))},hasTag:n=>t().tags.indexOf(n)>-1,selectedTags:()=>t().tags,builtRequest:()=>{const n=t(),r=n.requestOptions,i=n.tags,l=`${r.prompt} ${i.join(",")}`,o={...r,prompt:l};return n.uiOptions.isUseAutoSave||(o.save_to_disk_path=null),n.uiOptions.isCheckUseFaceCorrection||(o.use_face_correction=null),n.uiOptions.isCheckedUseUpscaling||(o.use_upscale=null),o},uiOptions:{advancedSettingsIsOpen:!1,imageModifierIsOpen:!1,isCheckedUseUpscaling:!1,isCheckUseFaceCorrection:!0,isUseRandomSeed:!0,isUseAutoSave:!1,isSoundEnabled:!1},toggleAdvancedSettingsIsOpen:()=>{e(Ne(n=>{n.uiOptions.advancedSettingsIsOpen=!n.uiOptions.advancedSettingsIsOpen,localStorage.setItem("ui:advancedSettingsIsOpen",n.uiOptions.advancedSettingsIsOpen)}))},toggleImageModifiersIsOpen:()=>{e(Ne(n=>{n.uiOptions.imageModifierIsOpen=!n.uiOptions.imageModifierIsOpen,localStorage.setItem("ui:imageModifierIsOpen",n.uiOptions.imageModifierIsOpen)}))},toggleUseUpscaling:()=>{e(Ne(n=>{n.uiOptions.isCheckedUseUpscaling=!n.uiOptions.isCheckedUseUpscaling,n.requestOptions.use_upscale=n.uiOptions.isCheckedUseUpscaling?"RealESRGAN_x4plus":void 0,localStorage.setItem("ui:isCheckedUseUpscaling",n.uiOptions.isCheckedUseUpscaling)}))},isUsingUpscaling:()=>t().uiOptions.isCheckedUseUpscaling,toggleUseFaceCorrection:()=>{e(Ne(n=>{n.uiOptions.isCheckUseFaceCorrection=!n.uiOptions.isCheckUseFaceCorrection,n.use_face_correction=n.uiOptions.isCheckUseFaceCorrection?"GFPGANv1.3":null}))},isUsingFaceCorrection:()=>t().uiOptions.isCheckUseFaceCorrection,toggleUseRandomSeed:()=>{e(Ne(n=>{n.uiOptions.isUseRandomSeed=!n.uiOptions.isUseRandomSeed,n.requestOptions.seed=n.uiOptions.isUseRandomSeed?Li():n.requestOptions.seed,localStorage.setItem("ui:isUseRandomSeed",n.uiOptions.isUseRandomSeed)}))},isRandomSeed:()=>t().uiOptions.isUseRandomSeed,toggleUseAutoSave:()=>{e(Ne(n=>{n.uiOptions.isUseAutoSave=!n.uiOptions.isUseAutoSave,localStorage.setItem("ui:isUseAutoSave",n.uiOptions.isUseAutoSave)}))},isUseAutoSave:()=>t().uiOptions.isUseAutoSave,toggleSoundEnabled:()=>{e(Ne(n=>{n.uiOptions.isSoundEnabled=!n.uiOptions.isSoundEnabled}))},isSoundEnabled:()=>t().uiOptions.isSoundEnabled})));const Ea="Stable Diffusion is starting...",Vm="Stable Diffusion is ready to use!",_a="Stable Diffusion is not running!";function Bm({className:e}){const[t,n]=A.exports.useState(Ea),[r,i]=A.exports.useState("starting"),{status:l,data:o}=rl(["health"],Em,{refetchInterval:Cm});return A.exports.useEffect(()=>{l==="loading"?(n(Ea),i("starting")):l==="error"?(n(_a),i("error")):l==="success"&&(o[0]==="OK"?(n(Vm),i("success")):(n(_a),i("error")))},[l,o]),k(Ah,{children:k("p",{className:[r,e].join(" "),children:t})})}function qm(){return I("div",{className:"header-display",children:[k("h1",{children:"Stable Diffusion UI v2.1.0"}),k(Bm,{className:"status-display"})]})}const li=rd((e,t)=>({images:new Array,completedImageIds:new Array,addNewImage:(n,r,i=!1)=>{e(Ne(l=>{let{seed:o}=r;i&&(o=Li()),l.images.push({id:n,options:{...r,seed:o}})}))},hasQueuedImages:()=>t().images.length>0,firstInQueue:()=>t().images[0]||[],removeFirstInQueue:()=>{e(Ne(n=>{const r=n.images.shift();n.completedImageIds.push(r.id)}))}}));let qr;const Hm=new Uint8Array(16);function Km(){if(!qr&&(qr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qr(Hm)}const ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function Wm(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}const Gm=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),xa={randomUUID:Gm};function Xm(e,t,n){if(xa.randomUUID&&!t&&!e)return xa.randomUUID();e=e||{};const r=e.random||(e.rng||Km)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return Wm(r)}function Ym(){const e=T(i=>i.parallelCount),t=T(i=>i.builtRequest),n=li(i=>i.addNewImage);return k("button",{onClick:()=>{const i=t();let l=[],{num_outputs:o}=i;if(e>o)l.push(o);else for(;o>=1;)o-=e,o<=0?l.push(e):l.push(Math.abs(o));l.forEach((u,s)=>{let a=i.seed;s!==0&&(a=Li()),n(Xm(),{...i,num_outputs:u,seed:a})})},children:"Make"})}const Oa=[{value:128,label:"128 (*)"},{value:192,label:"192"},{value:256,label:"256 (*)"},{value:320,label:"320"},{value:384,label:"384"},{value:448,label:"448"},{value:512,label:"512 (*)"},{value:576,label:"576"},{value:640,label:"640"},{value:704,label:"704"},{value:768,label:"768 (*)"},{value:832,label:"832"},{value:896,label:"896"},{value:960,label:"960"},{value:1024,label:"1024 (*)"}];function Zm(){const e=T(y=>y.parallelCount),t=T(y=>y.setParallelCount),n=T(y=>y.setRequestOptions),r=T(y=>y.toggleUseFaceCorrection),i=T(y=>y.isUsingFaceCorrection()),l=T(y=>y.toggleUseUpscaling),o=T(y=>y.isUsingUpscaling()),u=T(y=>y.toggleUseRandomSeed),s=T(y=>y.isRandomSeed()),a=T(y=>y.toggleUseAutoSave),c=T(y=>y.isUseAutoSave()),f=T(y=>y.toggleSoundEnabled),h=T(y=>y.isSoundEnabled()),v=T(y=>y.getValueForRequestKey("use_upscale")),S=T(y=>y.getValueForRequestKey("show_only_filtered_image")),g=T(y=>y.getValueForRequestKey("seed")),P=T(y=>y.getValueForRequestKey("width")),m=T(y=>y.getValueForRequestKey("num_outputs")),d=T(y=>y.getValueForRequestKey("height")),p=T(y=>y.getValueForRequestKey("num_inference_steps")),w=T(y=>y.getValueForRequestKey("guidance_scale")),x=T(y=>y.getValueForRequestKey("prompt_strength")),C=T(y=>y.getValueForRequestKey("save_to_disk_path")),_=T(y=>y.getValueForRequestKey("turbo")),O=T(y=>y.getValueForRequestKey("use_cpu")),z=T(y=>y.getValueForRequestKey("use_full_precision"));return I("ul",{id:"editor-settings-entries",children:[k("li",{children:I("label",{children:[k("input",{type:"checkbox",checked:i,onChange:y=>r()}),"Fix incorrect faces and eyes (uses GFPGAN)"]})}),k("li",{children:I("label",{children:[k("input",{type:"checkbox",checked:o,onChange:y=>l()}),"Upscale the image to 4x resolution using",I("select",{id:"upscale_model",name:"upscale_model",disabled:!o,value:v,onChange:y=>{n("use_upscale",y.target.value)},children:[k("option",{value:"RealESRGAN_x4plus",children:"RealESRGAN_x4plus"}),k("option",{value:"RealESRGAN_x4plus_anime_6B",children:"RealESRGAN_x4plus_anime_6B"})]})]})}),k("li",{children:I("label",{children:[k("input",{type:"checkbox",checked:S,onChange:y=>n("show_only_filtered_image",y.target.checked)}),"Show only filtered image"]})}),I("li",{children:[I("label",{children:["Seed:",k("input",{size:10,value:g,onChange:y=>n("seed",y.target.value),disabled:s,placeholder:"random"})]}),I("label",{children:[k("input",{type:"checkbox",checked:s,onChange:y=>u()})," ","Random Image"]})]}),I("li",{children:[I("label",{children:["Number of images to make:"," ",k("input",{type:"number",value:m,onChange:y=>n("num_outputs",parseInt(y.target.value,10)),size:4})]}),I("label",{children:["Generate in parallel:",k("input",{type:"number",value:e,onChange:y=>t(parseInt(y.target.value,10)),size:4})]})]}),k("li",{children:I("label",{children:["Width:",k("select",{value:P,onChange:y=>n("width",y.target.value),children:Oa.map(y=>k("option",{value:y.value,children:y.label},"width-option_"+y.value))})]})}),k("li",{children:I("label",{children:["Height:",k("select",{value:d,onChange:y=>n("height",y.target.value),children:Oa.map(y=>k("option",{value:y.value,children:y.label},"height-option_"+y.value))})]})}),k("li",{children:I("label",{children:["Number of inference steps:"," ",k("input",{value:p,onChange:y=>{n("num_inference_steps",y.target.value)},size:4})]})}),I("li",{children:[I("label",{children:["Guidance Scale:",k("input",{value:w,onChange:y=>n("guidance_scale",y.target.value),type:"range",min:"0",max:"20",step:".1"})]}),k("span",{children:w})]}),I("li",{className:"mb-4",children:[I("label",{children:["Prompt Strength:"," ",k("input",{value:x,onChange:y=>n("prompt_strength",y.target.value),type:"range",min:"0",max:"1",step:".05"})]}),k("span",{children:x})]}),I("li",{children:[I("label",{children:[k("input",{checked:c,onChange:y=>a(),type:"checkbox"}),"Automatically save to"," "]}),I("label",{children:[k("input",{value:C,onChange:y=>n("save_to_disk_path",y.target.value),size:40,disabled:!c}),k("span",{className:"visually-hidden",children:"Path on disk where images will be saved"})]})]}),k("li",{children:I("label",{children:[k("input",{checked:h,onChange:y=>f(),type:"checkbox"}),"Play sound on task completion"]})}),k("li",{children:I("label",{children:[k("input",{checked:_,onChange:y=>n("turbo",y.target.checked),type:"checkbox"}),"Turbo mode (generates images faster, but uses an additional 1 GB of GPU memory)"]})}),k("li",{children:I("label",{children:[k("input",{type:"checkbox",checked:O,onChange:y=>n("use_cpu",y.target.checked)}),"Use CPU instead of GPU (warning: this will be *very* slow)"]})}),k("li",{children:I("label",{children:[k("input",{checked:z,onChange:y=>n("use_full_precision",y.target.checked),type:"checkbox"}),"Use full precision (for GPU-only. warning: this will consume more VRAM)"]})})]})}function Jm(){const e=T(n=>n.uiOptions.advancedSettingsIsOpen),t=T(n=>n.toggleAdvancedSettingsIsOpen);return I("div",{className:"panel-box",children:[k("button",{type:"button",onClick:t,className:"panel-box-toggle-btn",children:k("h4",{children:"Advanced Settings"})}),e&&k(Zm,{})]})}function id({name:e}){const t=T(i=>i.hasTag(e))?"selected":"",n=T(i=>i.toggleTag),r=()=>{n(e)};return k("div",{className:"modifierTag "+t,onClick:r,children:k("p",{children:e})})}function bm({tags:e}){return k("ul",{className:"modifier-list",children:e.map(t=>k("li",{children:k(id,{name:t})},t))})}function ev({title:e,tags:t}){const[n,r]=A.exports.useState(!1);return I("div",{className:"modifier-grouping",children:[k("div",{className:"modifier-grouping-header",onClick:()=>{r(!n)},children:k("h5",{children:e})}),n&&k(bm,{tags:t})]})}function tv(){const{status:e,data:t}=rl(["modifications"],_m),n=T(l=>l.uiOptions.imageModifierIsOpen),r=T(l=>l.toggleImageModifiersIsOpen);return I("div",{className:"panel-box",children:[k("button",{type:"button",onClick:()=>{r()},className:"panel-box-toggle-btn",children:k("h4",{children:"Image Modifiers (art styles, tags, ect)"})}),n&&t.map((l,o)=>k(ev,{title:l[0],tags:l[1]},l[0]))]})}function nv(){const e=T(u=>u.getValueForRequestKey("prompt")),t=T(u=>u.getValueForRequestKey("init_image")),n=T(u=>u.setRequestOptions),r=T(u=>u.selectedTags());return I("div",{className:"create-panel",children:[I("div",{className:"basic-create",children:[I("div",{className:"prompt",children:[k("p",{children:"Prompt "}),k("textarea",{value:e,onChange:u=>{n("prompt",u.target.value)}})]}),I("div",{id:"editor-inputs-init-image",className:"row",children:[I("label",{children:[k("b",{children:"Initial Image:"})," (optional)"," "]}),k("input",{id:"init_image",name:"init_image",type:"file",onChange:u=>{const s=u.target.files[0];if(s){const a=new FileReader;a.onload=c=>{if(c.target){debugger;n("init_image",c.target.result)}},a.readAsDataURL(s)}}}),k("br",{}),t&&I("div",{id:"init_image_preview",className:"image_preview",children:[k("img",{id:"init_image_preview",src:t,width:"100",height:"100"}),k("button",{id:"init_image_clear",className:"image_clear_btn",onClick:()=>{n("init_image",void 0)},children:"X"})]})]}),k(Ym,{}),I("div",{className:"selected-tags",children:[k("p",{children:"Active Tags"}),k("ul",{children:r.map(u=>k("li",{children:k(id,{name:u})},u))})]})]}),I("div",{className:"advanced-create",children:[k(Jm,{}),k(tv,{})]})]})}const rv=`${Er}/ding.mp3`,iv=za.forwardRef((e,t)=>k("audio",{ref:t,style:{display:"none"},children:k("source",{src:rv,type:"audio/mp3"})}));function Pa({imageData:e,metadata:t,className:n}){const r=T(u=>u.setRequestOptions),i=()=>{const{prompt:u,seed:s,num_inference_steps:a,guidance_scale:c,use_face_correction:f,use_upscale:h,width:v,height:S}=t;let g=u.replace(/[^a-zA-Z0-9]/g,"_");g=g.substring(0,100);let P=`${g}_Seed-${s}_Steps-${a}_Guidance-${c}`;return f&&(P+=`_FaceCorrection-${f}`),h&&(P+=`_Upscale-${h}`),P+=`_${v}x${S}`,P+=".png",P},l=()=>{const u=document.createElement("a");u.download=i(),u.href=e,u.click()},o=()=>{r("init_image",e)};return I("div",{className:["generated-image",n].join(" "),children:[k("p",{children:t.prompt}),I("div",{className:"image-contain",children:[k("img",{src:e,alt:"generated"}),k("button",{id:"save-button",onClick:l,children:"Save"}),k("button",{id:"use-button",onClick:o,children:"Use as Input"})]})]})}function lv(){const e=A.exports.useRef(null),t=T(f=>f.isSoundEnabled()),{id:n,options:r}=li(f=>f.firstInQueue()),i=li(f=>f.removeFirstInQueue),{status:l,data:o}=rl([wa,n],()=>Om(r),{enabled:n!==void 0});A.exports.useEffect(()=>{var f;l==="success"&&o.status==="succeeded"&&(t&&((f=e.current)==null||f.play()),i())},[l,o,i,e,t]);const u=Zf(),[s,a]=A.exports.useState([]),c=li(f=>f.completedImageIds);return A.exports.useEffect(()=>{const f=c.map(h=>u.getQueryData([wa,h]));if(f.length>0){const h=f.map((v,S)=>{if(v!==void 0)return v.output.map(g=>({id:`${c[S]}-${g.seed}`,data:g.data,info:{...v.request,seed:g.seed}}))}).flat().reverse();a(h);debugger}else a([])},[a,u,c]),I("div",{className:"display-panel",children:[k("h1",{children:"Display Panel"}),k(iv,{ref:e}),s.length>0&&I("div",{id:"display-container",children:[k(Pa,{imageData:s[0].data,metadata:s[0].info},s[0].id),k("div",{id:"previous-images",children:s.map((f,h)=>f!==void 0?h==0?null:k(Pa,{className:"previous-image",imageData:f.data,metadata:f.info},f.id):(console.warn("image is undefined",f,h),null))})]})]})}function ov(){return I("div",{id:"footer",className:"panel-box",children:[I("p",{children:["If you found this project useful and want to help keep it alive, please"," ",k("a",{href:"https://ko-fi.com/cmdr2_stablediffusion_ui",target:"_blank",children:k("img",{src:"./kofi.png",id:"coffeeButton"})})," ","to help cover the cost of development and maintenance! Thank you for your support!"]}),I("p",{children:["Please feel free to join the"," ",k("a",{href:"https://discord.com/invite/u9yhsFmEkB",target:"_blank",children:"discord community"})," ","or"," ",k("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/issues",target:"_blank",children:"file an issue"})," ","if you have any problems or suggestions in using this interface."]}),I("div",{id:"footer-legal",children:[I("p",{children:[k("b",{children:"Disclaimer:"})," The authors of this project are not responsible for any content generated using this interface."]}),I("p",{children:["This license of this software forbids you from sharing any content that violates any laws, produce any harm to a person, disseminate any personal information that would be meant for harm, ",k("br",{}),"spread misinformation and target vulnerable groups. For the full list of restrictions please read"," ",k("a",{href:"https://github.com/cmdr2/stable-diffusion-ui/blob/main/LICENSE",target:"_blank",children:"the license"}),"."]}),k("p",{children:"By using this software, you consent to the terms and conditions of the license."})]})]})}function uv(){const e=T(r=>r.setRequestOptions),{status:t,data:n}=rl(["SaveDir"],xm);return A.exports.useEffect(()=>{t==="success"&&e("save_to_disk_path",n)},[e,t,n]),I("div",{className:"App",children:[k("header",{className:"header-layout",children:k(qm,{})}),k("nav",{className:"create-layout",children:k(nv,{})}),k("main",{className:"display-layout",children:k(lv,{})}),k("footer",{className:"footer-layout",children:k(ov,{})})]})}const sv=new bh({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,refetchOnMount:!1,staleTime:1/0}}});vm();Ql.createRoot(document.getElementById("root")).render(k(za.StrictMode,{children:I(nm,{client:sv,children:[k(uv,{}),k(am,{initialIsOpen:!0})]})}));