diff --git a/assets/index-1d519441.js b/assets/index-1d519441.js new file mode 100644 index 0000000..0ecd9a3 --- /dev/null +++ b/assets/index-1d519441.js @@ -0,0 +1,95 @@ +function pv(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function al(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rh={exports:{}},ul={},ih={exports:{}},ne={};/** + * @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 Mo=Symbol.for("react.element"),mv=Symbol.for("react.portal"),vv=Symbol.for("react.fragment"),gv=Symbol.for("react.strict_mode"),yv=Symbol.for("react.profiler"),_v=Symbol.for("react.provider"),Sv=Symbol.for("react.context"),wv=Symbol.for("react.forward_ref"),Ev=Symbol.for("react.suspense"),xv=Symbol.for("react.memo"),kv=Symbol.for("react.lazy"),Jc=Symbol.iterator;function Cv(e){return e===null||typeof e!="object"?null:(e=Jc&&e[Jc]||e["@@iterator"],typeof e=="function"?e:null)}var oh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sh=Object.assign,lh={};function Si(e,t,n){this.props=e,this.context=t,this.refs=lh,this.updater=n||oh}Si.prototype.isReactComponent={};Si.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")};Si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ah(){}ah.prototype=Si.prototype;function Au(e,t,n){this.props=e,this.context=t,this.refs=lh,this.updater=n||oh}var Iu=Au.prototype=new ah;Iu.constructor=Au;sh(Iu,Si.prototype);Iu.isPureReactComponent=!0;var Zc=Array.isArray,uh=Object.prototype.hasOwnProperty,Mu={current:null},ch={key:!0,ref:!0,__self:!0,__source:!0};function fh(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)uh.call(t,r)&&!ch.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,_e=U[X];if(0>>1;Xi(ct,K))ft<_e&&0>i(Kt,ct)?(U[X]=Kt,U[ft]=K,X=ft):(U[X]=ct,U[oe]=K,X=oe);else if(ft<_e&&0>i(Kt,K))U[X]=Kt,U[ft]=K,X=ft;else break e}}return b}function i(U,b){var K=U.sortIndex-b.sortIndex;return K!==0?K:U.id-b.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,h=null,d=3,g=!1,y=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(U){for(var b=n(u);b!==null;){if(b.callback===null)r(u);else if(b.startTime<=U)r(u),b.sortIndex=b.expirationTime,t(a,b);else break;b=n(u)}}function v(U){if(S=!1,_(U),!y)if(n(a)!==null)y=!0,at(R);else{var b=n(u);b!==null&&ut(v,b.startTime-U)}}function R(U,b){y=!1,S&&(S=!1,m(O),O=-1),g=!0;var K=d;try{for(_(b),h=n(a);h!==null&&(!(h.expirationTime>b)||U&&!Z());){var X=h.callback;if(typeof X=="function"){h.callback=null,d=h.priorityLevel;var _e=X(h.expirationTime<=b);b=e.unstable_now(),typeof _e=="function"?h.callback=_e:h===n(a)&&r(a),_(b)}else r(a);h=n(a)}if(h!==null)var ae=!0;else{var oe=n(u);oe!==null&&ut(v,oe.startTime-b),ae=!1}return ae}finally{h=null,d=K,g=!1}}var D=!1,T=null,O=-1,A=5,F=-1;function Z(){return!(e.unstable_now()-FU||125X?(U.sortIndex=K,t(u,U),n(a)===null&&U===n(u)&&(S?(m(O),O=-1):S=!0,ut(v,K-X))):(U.sortIndex=_e,t(a,U),y||g||(y=!0,at(R))),U},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(U){var b=d;return function(){var K=d;d=b;try{return U.apply(this,arguments)}finally{d=K}}}})(vh);mh.exports=vh;var Uv=mh.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gh=L,gt=Uv;function M(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"),Ca=Object.prototype.hasOwnProperty,jv=/^[: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]*$/,tf={},nf={};function bv(e){return Ca.call(nf,e)?!0:Ca.call(tf,e)?!1:jv.test(e)?nf[e]=!0:(tf[e]=!0,!1)}function zv(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 Bv(e,t,n,r){if(t===null||typeof t>"u"||zv(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 tt(e,t,n,r,i,o,s){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=o,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new tt(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){$e[e]=new tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Fu=/[\-:]([a-z])/g;function Uu(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(Fu,Uu);$e[t]=new tt(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(Fu,Uu);$e[t]=new tt(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(Fu,Uu);$e[t]=new tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function ju(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` +`+i[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{$l=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wi(e):""}function $v(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=ql(e.type,!1),e;case 11:return e=ql(e.type.render,!1),e;case 1:return e=ql(e.type,!0),e;default:return""}}function Oa(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 zr:return"Fragment";case br:return"Portal";case Ta:return"Profiler";case bu:return"StrictMode";case Ra:return"Suspense";case Pa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Sh:return(e.displayName||"Context")+".Consumer";case _h:return(e._context.displayName||"Context")+".Provider";case zu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Bu:return t=e.displayName||null,t!==null?t:Oa(e.type)||"Memo";case Nn:t=e._payload,e=e._init;try{return Oa(e(t))}catch{}}return null}function qv(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 Oa(t);case 8:return t===bu?"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 Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Eh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hv(e){var t=Eh(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Vo(e){e._valueTracker||(e._valueTracker=Hv(e))}function xh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Eh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Rs(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 Da(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function of(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xn(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 kh(e,t){t=t.checked,t!=null&&ju(e,"checked",t,!1)}function Na(e,t){kh(e,t);var n=Xn(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")?Aa(e,t.type,n):t.hasOwnProperty("defaultValue")&&Aa(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function sf(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 Aa(e,t,n){(t!=="number"||Rs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function ti(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ho(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={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},Qv=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){Qv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Ph(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function Oh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Ph(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Wv=ke({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 La(e,t){if(t){if(Wv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function Fa(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 Ua=null;function $u(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ja=null,ni=null,ri=null;function uf(e){if(e=Uo(e)){if(typeof ja!="function")throw Error(M(280));var t=e.stateNode;t&&(t=pl(t),ja(e.stateNode,e.type,t))}}function Dh(e){ni?ri?ri.push(e):ri=[e]:ni=e}function Nh(){if(ni){var e=ni,t=ri;if(ri=ni=null,uf(e),t)for(e=0;e>>=0,e===0?32:31-(rg(e)/ig|0)|0}var Go=64,Yo=4194304;function Ki(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 Ns(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ki(l):(o&=s,o!==0&&(r=Ki(o)))}else s=n&~i,s!==0?r=Ki(s):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function ag(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=Zi),yf=String.fromCharCode(32),_f=!1;function Xh(e,t){switch(e){case"keyup":return Fg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Jh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function jg(e,t){switch(e){case"compositionend":return Jh(t);case"keypress":return t.which!==32?null:(_f=!0,yf);case"textInput":return e=t.data,e===yf&&_f?null:e;default:return null}}function bg(e,t){if(Br)return e==="compositionend"||!Yu&&Xh(e,t)?(e=Gh(),ms=Vu=Fn=null,Br=!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=xf(n)}}function np(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?np(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function rp(){for(var e=window,t=Rs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rs(e.document)}return t}function Xu(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 Kg(e){var t=rp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&np(n.ownerDocument.documentElement,n)){if(r!==null&&Xu(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,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=kf(n,o);var s=kf(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,$r=null,Ha=null,to=null,Qa=!1;function Cf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qa||$r==null||$r!==Rs(r)||(r=$r,"selectionStart"in r&&Xu(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}),to&&_o(to,r)||(to=r,r=Ms(Ha,"onSelect"),0Qr||(e.current=Xa[Qr],Xa[Qr]=null,Qr--)}function he(e,t){Qr++,Xa[Qr]=e.current,e.current=t}var Jn={},Ge=nr(Jn),ot=nr(!1),xr=Jn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Jn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function st(e){return e=e.childContextTypes,e!=null}function Fs(){me(ot),me(Ge)}function Af(e,t,n){if(Ge.current!==Jn)throw Error(M(168));he(Ge,t),he(ot,n)}function dp(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(M(108,qv(e)||"Unknown",i));return ke({},n,r)}function Us(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jn,xr=Ge.current,he(Ge,e),he(ot,ot.current),!0}function If(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=dp(e,t,xr),r.__reactInternalMemoizedMergedChildContext=e,me(ot),me(Ge),he(Ge,e)):me(ot),he(ot,n)}var dn=null,ml=!1,ra=!1;function hp(e){dn===null?dn=[e]:dn.push(e)}function sy(e){ml=!0,hp(e)}function rr(){if(!ra&&dn!==null){ra=!0;var e=0,t=le;try{var n=dn;for(le=1;e>=s,i-=s,hn=1<<32-qt(t)+i|n<O?(A=T,T=null):A=T.sibling;var F=d(m,T,_[O],v);if(F===null){T===null&&(T=A);break}e&&T&&F.alternate===null&&t(m,T),p=o(F,p,O),D===null?R=F:D.sibling=F,D=F,T=A}if(O===_.length)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;O<_.length;O++)T=h(m,_[O],v),T!==null&&(p=o(T,p,O),D===null?R=T:D.sibling=T,D=T);return ye&&pr(m,O),R}for(T=r(m,T);O<_.length;O++)A=g(T,m,O,_[O],v),A!==null&&(e&&A.alternate!==null&&T.delete(A.key===null?O:A.key),p=o(A,p,O),D===null?R=A:D.sibling=A,D=A);return e&&T.forEach(function(Z){return t(m,Z)}),ye&&pr(m,O),R}function S(m,p,_,v){var R=Ai(_);if(typeof R!="function")throw Error(M(150));if(_=R.call(_),_==null)throw Error(M(151));for(var D=R=null,T=p,O=p=0,A=null,F=_.next();T!==null&&!F.done;O++,F=_.next()){T.index>O?(A=T,T=null):A=T.sibling;var Z=d(m,T,F.value,v);if(Z===null){T===null&&(T=A);break}e&&T&&Z.alternate===null&&t(m,T),p=o(Z,p,O),D===null?R=Z:D.sibling=Z,D=Z,T=A}if(F.done)return n(m,T),ye&&pr(m,O),R;if(T===null){for(;!F.done;O++,F=_.next())F=h(m,F.value,v),F!==null&&(p=o(F,p,O),D===null?R=F:D.sibling=F,D=F);return ye&&pr(m,O),R}for(T=r(m,T);!F.done;O++,F=_.next())F=g(T,m,O,F.value,v),F!==null&&(e&&F.alternate!==null&&T.delete(F.key===null?O:F.key),p=o(F,p,O),D===null?R=F:D.sibling=F,D=F);return e&&T.forEach(function(V){return t(m,V)}),ye&&pr(m,O),R}function E(m,p,_,v){if(typeof _=="object"&&_!==null&&_.type===zr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Wo:e:{for(var R=_.key,D=p;D!==null;){if(D.key===R){if(R=_.type,R===zr){if(D.tag===7){n(m,D.sibling),p=i(D,_.props.children),p.return=m,m=p;break e}}else if(D.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===Nn&&zf(R)===D.type){n(m,D.sibling),p=i(D,_.props),p.ref=Ui(m,D,_),p.return=m,m=p;break e}n(m,D);break}else t(m,D);D=D.sibling}_.type===zr?(p=Er(_.props.children,m.mode,v,_.key),p.return=m,m=p):(v=xs(_.type,_.key,_.props,null,m.mode,v),v.ref=Ui(m,p,_),v.return=m,m=v)}return s(m);case br:e:{for(D=_.key;p!==null;){if(p.key===D)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){n(m,p.sibling),p=i(p,_.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=fa(_,m.mode,v),p.return=m,m=p}return s(m);case Nn:return D=_._init,E(m,p,D(_._payload),v)}if(Vi(_))return y(m,p,_,v);if(Ai(_))return S(m,p,_,v);rs(m,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,_),p.return=m,m=p):(n(m,p),p=ca(_,m.mode,v),p.return=m,m=p),s(m)):n(m,p)}return E}var hi=wp(!0),Ep=wp(!1),jo={},rn=nr(jo),xo=nr(jo),ko=nr(jo);function yr(e){if(e===jo)throw Error(M(174));return e}function sc(e,t){switch(he(ko,t),he(xo,e),he(rn,jo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ma(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ma(t,e)}me(rn),he(rn,t)}function pi(){me(rn),me(xo),me(ko)}function xp(e){yr(ko.current);var t=yr(rn.current),n=Ma(t,e.type);t!==n&&(he(xo,e),he(rn,n))}function lc(e){xo.current===e&&(me(rn),me(xo))}var we=nr(0);function qs(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ia=[];function ac(){for(var e=0;en?n:4,e(!0);var r=oa.transition;oa.transition={};try{e(!1),t()}finally{le=n,oa.transition=r}}function bp(){return Nt().memoizedState}function cy(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},zp(e))Bp(t,n);else if(n=gp(e,t,n,r),n!==null){var i=Je();Ht(n,e,r,i),$p(n,t,r)}}function fy(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(zp(e))Bp(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Qt(l,s)){var a=t.interleaved;a===null?(i.next=i,ic(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=gp(e,t,i,r),n!==null&&(i=Je(),Ht(n,e,r,i),$p(n,t,r))}}function zp(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function Bp(e,t){no=Hs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function $p(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Hu(e,n)}}var Qs={readContext:Dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},dy={readContext:Dt,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:$f,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_s(4194308,4,Mp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){return _s(4,2,e,t)},useMemo:function(e,t){var n=Zt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zt();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=cy.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:Bf,useDebugValue:hc,useDeferredValue:function(e){return Zt().memoizedState=e},useTransition:function(){var e=Bf(!1),t=e[0];return e=uy.bind(null,e[1]),Zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,i=Zt();if(ye){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),be===null)throw Error(M(349));Cr&30||Tp(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,$f(Pp.bind(null,r,o,e),[e]),r.flags|=2048,Ro(9,Rp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Zt(),t=be.identifierPrefix;if(ye){var n=pn,r=hn;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Co++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[tn]=t,e[Eo]=r,Xp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Fa(n,r),n){case"dialog":pe("cancel",e),pe("close",e),i=r;break;case"iframe":case"object":case"embed":pe("load",e),i=r;break;case"video":case"audio":for(i=0;ivi&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=qs(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ye)return We(t),null}else 2*Te()-o.renderingStartTime>vi&&n!==1073741824&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Te(),t.sibling=null,n=we.current,he(we,r?n&1|2:n&1),t):(We(t),null);case 22:case 23:return _c(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function Sy(e,t){switch(Zu(t),t.tag){case 1:return st(t.type)&&Fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),me(ot),me(Ge),ac(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lc(t),null;case 13:if(me(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(we),null;case 4:return pi(),null;case 10:return rc(t.type._context),null;case 22:case 23:return _c(),null;case 24:return null;default:return null}}var os=!1,Ke=!1,wy=typeof WeakSet=="function"?WeakSet:Set,z=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function uu(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Xf=!1;function Ey(e,t){if(Wa=As,e=rp(),Xu(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,h=e,d=null;t:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=s+i),h!==o||r!==0&&h.nodeType!==3||(a=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===n&&++u===i&&(l=s),d===o&&++c===r&&(a=s),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Va={focusedElem:e,selectionRange:n},As=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var S=y.memoizedProps,E=y.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?S:jt(t.type,S),E);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(M(163))}}catch(v){Ce(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return y=Xf,Xf=!1,y}function ro(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 o=i.destroy;i.destroy=void 0,o!==void 0&&uu(t,n,o)}i=i.next}while(i!==r)}}function yl(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 cu(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 em(e){var t=e.alternate;t!==null&&(e.alternate=null,em(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tn],delete t[Eo],delete t[Ya],delete t[iy],delete t[oy])),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 tm(e){return e.tag===5||e.tag===3||e.tag===4}function Jf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||tm(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 fu(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=Ls));else if(r!==4&&(e=e.child,e!==null))for(fu(e,t,n),e=e.sibling;e!==null;)fu(e,t,n),e=e.sibling}function du(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(du(e,t,n),e=e.sibling;e!==null;)du(e,t,n),e=e.sibling}var ze=null,bt=!1;function Dn(e,t,n){for(n=n.child;n!==null;)nm(e,t,n),n=n.sibling}function nm(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(cl,n)}catch{}switch(n.tag){case 5:Ke||Gr(n,t);case 6:var r=ze,i=bt;ze=null,Dn(e,t,n),ze=r,bt=i,ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?na(e.parentNode,n):e.nodeType===1&&na(e,n),go(e)):na(ze,n.stateNode));break;case 4:r=ze,i=bt,ze=n.stateNode.containerInfo,bt=!0,Dn(e,t,n),ze=r,bt=i;break;case 0:case 11:case 14:case 15:if(!Ke&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&uu(n,t,s),i=i.next}while(i!==r)}Dn(e,t,n);break;case 1:if(!Ke&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ce(n,t,l)}Dn(e,t,n);break;case 21:Dn(e,t,n);break;case 22:n.mode&1?(Ke=(r=Ke)||n.memoizedState!==null,Dn(e,t,n),Ke=r):Dn(e,t,n);break;default:Dn(e,t,n)}}function Zf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new wy),t.forEach(function(r){var i=Ny.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ft(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*ky(r/1960))-r,10e?16:e,Un===null)var r=!1;else{if(e=Un,Un=null,Ks=0,ie&6)throw Error(M(331));var i=ie;for(ie|=4,z=e.current;z!==null;){var o=z,s=o.child;if(z.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aTe()-gc?wr(e,0):vc|=n),lt(e,t)}function cm(e,t){t===0&&(e.mode&1?(t=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):t=1);var n=Je();e=_n(e,t),e!==null&&(Lo(e,t,n),lt(e,n))}function Dy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),cm(e,n)}function Ny(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(M(314))}r!==null&&r.delete(t),cm(e,n)}var fm;fm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,yy(e,t,n);it=!!(e.flags&131072)}else it=!1,ye&&t.flags&1048576&&pp(t,bs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var i=fi(t,Ge.current);oi(t,n),i=cc(null,t,r,e,i,n);var o=fc();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,st(r)?(o=!0,Us(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,oc(t),i.updater=vl,t.stateNode=i,i._reactInternals=t,nu(t,r,e,n),t=ou(null,t,r,!0,o,n)):(t.tag=0,ye&&o&&Ju(t),Xe(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Iy(r),e=jt(r,e),i){case 0:t=iu(null,t,r,e,n);break e;case 1:t=Kf(null,t,r,e,n);break e;case 11:t=Wf(null,t,r,e,n);break e;case 14:t=Vf(null,t,r,jt(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),iu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Kf(e,t,r,i,n);case 3:e:{if(Kp(t),e===null)throw Error(M(387));r=t.pendingProps,o=t.memoizedState,i=o.element,yp(e,t),$s(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(M(423)),t),t=Gf(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(M(424)),t),t=Gf(e,t,r,n,i);break e}else for(mt=Hn(t.stateNode.containerInfo.firstChild),vt=t,ye=!0,Bt=null,n=Ep(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=Sn(e,t,n);break e}Xe(e,t,r,n)}t=t.child}return t;case 5:return xp(t),e===null&&Za(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Ka(r,i)?s=null:o!==null&&Ka(r,o)&&(t.flags|=32),Vp(e,t),Xe(e,t,s,n),t.child;case 6:return e===null&&Za(t),null;case 13:return Gp(e,t,n);case 4:return sc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hi(t,null,r,n):Xe(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Wf(e,t,r,i,n);case 7:return Xe(e,t,t.pendingProps,n),t.child;case 8:return Xe(e,t,t.pendingProps.children,n),t.child;case 12:return Xe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,he(zs,r._currentValue),r._currentValue=s,o!==null)if(Qt(o.value,s)){if(o.children===i.children&&!ot.current){t=Sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=mn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),eu(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(M(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),eu(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Xe(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Dt(i),r=r(i),t.flags|=1,Xe(e,t,r,n),t.child;case 14:return r=t.type,i=jt(r,t.pendingProps),i=jt(r.type,i),Vf(e,t,r,i,n);case 15:return Qp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Ss(e,t),t.tag=1,st(r)?(e=!0,Us(t)):e=!1,oi(t,n),Sp(t,r,i),nu(t,r,i,n),ou(null,t,r,!0,e,n);case 19:return Yp(e,t,n);case 22:return Wp(e,t,n)}throw Error(M(156,t.tag))};function dm(e,t){return jh(e,t)}function Ay(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 Pt(e,t,n,r){return new Ay(e,t,n,r)}function wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Iy(e){if(typeof e=="function")return wc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zu)return 11;if(e===Bu)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Pt(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 xs(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")wc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case zr:return Er(n.children,i,o,t);case bu:s=8,i|=8;break;case Ta:return e=Pt(12,n,t,i|2),e.elementType=Ta,e.lanes=o,e;case Ra:return e=Pt(13,n,t,i),e.elementType=Ra,e.lanes=o,e;case Pa:return e=Pt(19,n,t,i),e.elementType=Pa,e.lanes=o,e;case wh:return Sl(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _h:s=10;break e;case Sh:s=9;break e;case zu:s=11;break e;case Bu:s=14;break e;case Nn:s=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=Pt(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Er(e,t,n,r){return e=Pt(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=Pt(22,e,r,t),e.elementType=wh,e.lanes=n,e.stateNode={isHidden:!1},e}function ca(e,t,n){return e=Pt(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=Pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function My(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=Ql(0),this.expirationTimes=Ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ql(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Ec(e,t,n,r,i,o,s,l,a){return e=new My(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Pt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oc(o),e}function Ly(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vm)}catch(e){console.error(e)}}vm(),ph.exports=yt;var zy=ph.exports,ld=zy;ka.createRoot=ld.createRoot,ka.hydrateRoot=ld.hydrateRoot;var gm={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i"u")throw new Error(t)}function Pr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qy(){return Math.random().toString(36).substr(2,8)}function ud(e,t){return{usr:e.state,key:e.key,idx:t}}function Oo(e,t,n,r){return n===void 0&&(n=null),ge({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?on(t):t,{state:n,key:t&&t.key||r||qy()})}function bo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function on(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Hy(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=Oe.Pop,a=null,u=c();u==null&&(u=0,s.replaceState(ge({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function h(){l=Oe.Pop;let E=c(),m=E==null?null:E-u;u=E,a&&a({action:l,location:S.location,delta:m})}function d(E,m){l=Oe.Push;let p=Oo(S.location,E,m);n&&n(p,E),u=c()+1;let _=ud(p,u),v=S.createHref(p);try{s.pushState(_,"",v)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;i.location.assign(v)}o&&a&&a({action:l,location:S.location,delta:1})}function g(E,m){l=Oe.Replace;let p=Oo(S.location,E,m);n&&n(p,E),u=c();let _=ud(p,u),v=S.createHref(p);s.replaceState(_,"",v),o&&a&&a({action:l,location:S.location,delta:0})}function y(E){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof E=="string"?E:bo(E);return te(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let S={get action(){return l},get location(){return e(i,s)},listen(E){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(ad,h),a=E,()=>{i.removeEventListener(ad,h),a=null}},createHref(E){return t(i,E)},createURL:y,encodeLocation(E){let m=y(E);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:g,go(E){return s.go(E)}};return S}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const Qy=new Set(["lazy","caseSensitive","path","id","index","children"]);function Wy(e){return e.index===!0}function gu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let s=[...n,o],l=typeof i.id=="string"?i.id:s.join("-");if(te(i.index!==!0||!i.children,"Cannot specify children on an index route"),te(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Wy(i)){let a=ge({},i,t(i),{id:l});return r[l]=a,a}else{let a=ge({},i,t(i),{id:l,children:void 0});return r[l]=a,i.children&&(a.children=gu(i.children,t,s,r)),a}})}function Xr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?on(t):t,i=zo(r.pathname||"/",n);if(i==null)return null;let o=ym(e);Vy(o);let s=null;for(let l=0;s==null&&l{let a={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};a.relativePath.startsWith("/")&&(te(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Yn([r,a.relativePath]),c=n.concat(a);o.children&&o.children.length>0&&(te(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),ym(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:e_(u,o.index),routesMeta:c})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let a of _m(o.path))i(o,s,a)}),t}function _m(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=_m(r.join("/")),l=[];return l.push(...s.map(a=>a===""?o:[o,a].join("/"))),i&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Vy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:t_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Ky=/^:\w+$/,Gy=3,Yy=2,Xy=1,Jy=10,Zy=-2,cd=e=>e==="*";function e_(e,t){let n=e.split("/"),r=n.length;return n.some(cd)&&(r+=Zy),t&&(r+=Yy),n.filter(i=>!cd(i)).reduce((i,o)=>i+(Ky.test(o)?Gy:o===""?Xy:Jy),r)}function t_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function n_(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(c==="*"){let d=l[h]||"";s=o.slice(0,o.length-d.length).replace(/(.)\/+$/,"$1")}return u[c]=s_(l[h]||"",c),u},{}),pathname:o,pathnameBase:s,pattern:e}}function i_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Pr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,l)=>(r.push(l),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function o_(e){try{return decodeURI(e)}catch(t){return Pr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function s_(e,t){try{return decodeURIComponent(e)}catch(n){return Pr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function zo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function l_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?on(e):e;return{pathname:n?n.startsWith("/")?n:a_(n,t):t,search:c_(r),hash:f_(i)}}function a_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function da(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Tc(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Sm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=on(e):(i=ge({},e),te(!i.pathname||!i.pathname.includes("?"),da("?","pathname","search",i)),te(!i.pathname||!i.pathname.includes("#"),da("#","pathname","hash",i)),te(!i.search||!i.search.includes("#"),da("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(r||s==null)l=n;else{let h=t.length-1;if(s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),h-=1;i.pathname=d.join("/")}l=h>=0?t[h]:"/"}let a=l_(i,l),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||c)&&(a.pathname+="/"),a}const Yn=e=>e.join("/").replace(/\/\/+/g,"/"),u_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),c_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,f_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Rc{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function wm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Em=["post","put","patch","delete"],d_=new Set(Em),h_=["get",...Em],p_=new Set(h_),m_=new Set([301,302,303,307,308]),v_=new Set([307,308]),ha={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},g_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},xm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,y_=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function __(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;te(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;i=C=>({hasErrorBoundary:k(C)})}else i=y_;let o={},s=gu(e.routes,i,void 0,o),l,a=e.basename||"/",u=ge({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),c=null,h=new Set,d=null,g=null,y=null,S=e.hydrationData!=null,E=Xr(s,e.history.location,a),m=null;if(E==null){let k=xt(404,{pathname:e.history.location.pathname}),{matches:C,route:N}=yd(s);E=C,m={[N.id]:k}}let p=!E.some(k=>k.route.lazy)&&(!E.some(k=>k.route.loader)||e.hydrationData!=null),_,v={historyAction:e.history.action,location:e.history.location,matches:E,initialized:p,navigation:ha,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},R=Oe.Pop,D=!1,T,O=!1,A=!1,F=[],Z=[],V=new Map,qe=0,kn=-1,Vt=new Map,at=new Set,ut=new Map,U=new Map,b=new Map,K=!1;function X(){return c=e.history.listen(k=>{let{action:C,location:N,delta:B}=k;if(K){K=!1;return}Pr(b.size===0||B!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let G=Mr({currentLocation:v.location,nextLocation:N,historyAction:C});if(G&&B!=null){K=!0,e.history.go(B*-1),ur(G,{state:"blocked",location:N,proceed(){ur(G,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),e.history.go(B)},reset(){let $=new Map(v.blockers);$.set(G,zi),oe({blockers:$})}});return}return It(C,N)}),v.initialized||It(Oe.Pop,v.location),_}function _e(){c&&c(),h.clear(),T&&T.abort(),v.fetchers.forEach((k,C)=>Pi(C)),v.blockers.forEach((k,C)=>Oi(C))}function ae(k){return h.add(k),()=>h.delete(k)}function oe(k){v=ge({},v,k),h.forEach(C=>C(v))}function ct(k,C){var N,B;let G=v.actionData!=null&&v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((N=k.state)==null?void 0:N._isRedirect)!==!0,$;C.actionData?Object.keys(C.actionData).length>0?$=C.actionData:$=null:G?$=v.actionData:$=null;let W=C.loaderData?gd(v.loaderData,C.loaderData,C.matches||[],C.errors):v.loaderData,Q=v.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((se,re)=>Q.set(re,zi)));let H=D===!0||v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&((B=k.state)==null?void 0:B._isRedirect)!==!0;l&&(s=l,l=void 0),O||R===Oe.Pop||(R===Oe.Push?e.history.push(k,k.state):R===Oe.Replace&&e.history.replace(k,k.state)),oe(ge({},C,{actionData:$,loaderData:W,historyAction:R,location:k,initialized:!0,navigation:ha,revalidation:"idle",restoreScrollPosition:un(k,C.matches||v.matches),preventScrollReset:H,blockers:Q})),R=Oe.Pop,D=!1,O=!1,A=!1,F=[],Z=[]}async function ft(k,C){if(typeof k=="number"){e.history.go(k);return}let N=yu(v.location,v.matches,a,u.v7_prependBasename,k,C==null?void 0:C.fromRouteId,C==null?void 0:C.relative),{path:B,submission:G,error:$}=fd(u.v7_normalizeFormMethod,!1,N,C),W=v.location,Q=Oo(v.location,B,C&&C.state);Q=ge({},Q,e.history.encodeLocation(Q));let H=C&&C.replace!=null?C.replace:void 0,se=Oe.Push;H===!0?se=Oe.Replace:H===!1||G!=null&&zt(G.formMethod)&&G.formAction===v.location.pathname+v.location.search&&(se=Oe.Replace);let re=C&&"preventScrollReset"in C?C.preventScrollReset===!0:void 0,He=Mr({currentLocation:W,nextLocation:Q,historyAction:se});if(He){ur(He,{state:"blocked",location:Q,proceed(){ur(He,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),ft(k,C)},reset(){let Re=new Map(v.blockers);Re.set(He,zi),oe({blockers:Re})}});return}return await It(se,Q,{submission:G,pendingError:$,preventScrollReset:re,replace:C&&C.replace})}function Kt(){if(Ir(),oe({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){It(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}It(R||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function It(k,C,N){T&&T.abort(),T=null,R=k,O=(N&&N.startUninterruptedRevalidation)===!0,Mt(v.location,v.matches),D=(N&&N.preventScrollReset)===!0;let B=l||s,G=N&&N.overrideNavigation,$=Xr(B,C,a);if(!$){let Re=xt(404,{pathname:C.pathname}),{matches:Ae,route:nt}=yd(B);Lr(),ct(C,{matches:Ae,loaderData:{},errors:{[nt.id]:Re}});return}if(v.initialized&&!A&&k_(v.location,C)&&!(N&&N.submission&&zt(N.submission.formMethod))){ct(C,{matches:$});return}T=new AbortController;let W=$i(e.history,C,T.signal,N&&N.submission),Q,H;if(N&&N.pendingError)H={[Jr($).route.id]:N.pendingError};else if(N&&N.submission&&zt(N.submission.formMethod)){let Re=await qo(W,C,N.submission,$,{replace:N.replace});if(Re.shortCircuited)return;Q=Re.pendingActionData,H=Re.pendingActionError,G=as(C,N.submission),W=new Request(W.url,{signal:W.signal})}let{shortCircuited:se,loaderData:re,errors:He}=await Cn(W,C,$,G,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,Q,H);se||(T=null,ct(C,ge({matches:$},Q?{actionData:Q}:{},{loaderData:re,errors:He})))}async function qo(k,C,N,B,G){G===void 0&&(G={}),Ir();let $=O_(C,N);oe({navigation:$});let W,Q=Su(B,C);if(!Q.route.action&&!Q.route.lazy)W={type:Me.error,error:xt(405,{method:k.method,pathname:C.pathname,routeId:Q.route.id})};else if(W=await Bi("action",k,Q,B,o,i,a),k.signal.aborted)return{shortCircuited:!0};if(li(W)){let H;return G&&G.replace!=null?H=G.replace:H=W.location===v.location.pathname+v.location.search,await Yt(v,W,{submission:N,replace:H}),{shortCircuited:!0}}if(so(W)){let H=Jr(B,Q.route.id);return(G&&G.replace)!==!0&&(R=Oe.Push),{pendingActionData:{},pendingActionError:{[H.route.id]:W.error}}}if(_r(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[Q.route.id]:W.data}}}async function Cn(k,C,N,B,G,$,W,Q,H){let se=B||as(C,G),re=G||$||wd(se),He=l||s,[Re,Ae]=dd(e.history,v,N,re,C,A,F,Z,ut,at,He,a,Q,H);if(Lr(fe=>!(N&&N.some(Ye=>Ye.route.id===fe))||Re&&Re.some(Ye=>Ye.route.id===fe)),Re.length===0&&Ae.length===0){let fe=ln();return ct(C,ge({matches:N,loaderData:{},errors:H||null},Q?{actionData:Q}:{},fe?{fetchers:new Map(v.fetchers)}:{})),{shortCircuited:!0}}if(!O){Ae.forEach(Ye=>{let cn=v.fetchers.get(Ye.key),Ie=qi(void 0,cn?cn.data:void 0);v.fetchers.set(Ye.key,Ie)});let fe=Q||v.actionData;oe(ge({navigation:se},fe?Object.keys(fe).length===0?{actionData:null}:{actionData:fe}:{},Ae.length>0?{fetchers:new Map(v.fetchers)}:{}))}kn=++qe,Ae.forEach(fe=>{V.has(fe.key)&&St(fe.key),fe.controller&&V.set(fe.key,fe.controller)});let nt=()=>Ae.forEach(fe=>St(fe.key));T&&T.signal.addEventListener("abort",nt);let{results:fr,loaderResults:Lt,fetcherResults:Pn}=await lr(v.matches,N,Re,Ae,k);if(k.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",nt),Ae.forEach(fe=>V.delete(fe.key));let wt=_d(fr);if(wt)return await Yt(v,wt,{replace:W}),{shortCircuited:!0};let{loaderData:dr,errors:Ni}=vd(v,N,Re,Lt,H,Ae,Pn,U);U.forEach((fe,Ye)=>{fe.subscribe(cn=>{(cn||fe.done)&&U.delete(Ye)})});let On=ln(),dt=an(kn),hr=On||dt||Ae.length>0;return ge({loaderData:dr,errors:Ni},hr?{fetchers:new Map(v.fetchers)}:{})}function Gt(k){return v.fetchers.get(k)||g_}function Ti(k,C,N,B){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");V.has(k)&&St(k);let G=l||s,$=yu(v.location,v.matches,a,u.v7_prependBasename,N,C,B==null?void 0:B.relative),W=Xr(G,$,a);if(!W){ar(k,C,xt(404,{pathname:$}));return}let{path:Q,submission:H,error:se}=fd(u.v7_normalizeFormMethod,!0,$,B);if(se){ar(k,C,se);return}let re=Su(W,Q);if(D=(B&&B.preventScrollReset)===!0,H&&zt(H.formMethod)){Ri(k,C,Q,re,W,H);return}ut.set(k,{routeId:C,path:Q}),Tn(k,C,Q,re,W,H)}async function Ri(k,C,N,B,G,$){if(Ir(),ut.delete(k),!B.route.action&&!B.route.lazy){let Ie=xt(405,{method:$.formMethod,pathname:N,routeId:C});ar(k,C,Ie);return}let W=v.fetchers.get(k),Q=D_($,W);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal,$);V.set(k,H);let re=await Bi("action",se,B,G,o,i,a);if(se.signal.aborted){V.get(k)===H&&V.delete(k);return}if(li(re)){V.delete(k),at.add(k);let Ie=qi($);return v.fetchers.set(k,Ie),oe({fetchers:new Map(v.fetchers)}),Yt(v,re,{submission:$,isFetchActionRedirect:!0})}if(so(re)){ar(k,C,re.error);return}if(_r(re))throw xt(400,{type:"defer-action"});let He=v.navigation.location||v.location,Re=$i(e.history,He,H.signal),Ae=l||s,nt=v.navigation.state!=="idle"?Xr(Ae,v.navigation.location,a):v.matches;te(nt,"Didn't find any matches after fetcher action");let fr=++qe;Vt.set(k,fr);let Lt=qi($,re.data);v.fetchers.set(k,Lt);let[Pn,wt]=dd(e.history,v,nt,$,He,A,F,Z,ut,at,Ae,a,{[B.route.id]:re.data},void 0);wt.filter(Ie=>Ie.key!==k).forEach(Ie=>{let q=Ie.key,w=v.fetchers.get(q),I=qi(void 0,w?w.data:void 0);v.fetchers.set(q,I),V.has(q)&&St(q),Ie.controller&&V.set(q,Ie.controller)}),oe({fetchers:new Map(v.fetchers)});let dr=()=>wt.forEach(Ie=>St(Ie.key));H.signal.addEventListener("abort",dr);let{results:Ni,loaderResults:On,fetcherResults:dt}=await lr(v.matches,nt,Pn,wt,Re);if(H.signal.aborted)return;H.signal.removeEventListener("abort",dr),Vt.delete(k),V.delete(k),wt.forEach(Ie=>V.delete(Ie.key));let hr=_d(Ni);if(hr)return Yt(v,hr);let{loaderData:fe,errors:Ye}=vd(v,v.matches,Pn,On,void 0,wt,dt,U);if(v.fetchers.has(k)){let Ie=ks(re.data);v.fetchers.set(k,Ie)}let cn=an(fr);v.navigation.state==="loading"&&fr>kn?(te(R,"Expected pending action"),T&&T.abort(),ct(v.navigation.location,{matches:nt,loaderData:fe,errors:Ye,fetchers:new Map(v.fetchers)})):(oe(ge({errors:Ye,loaderData:gd(v.loaderData,fe,nt,Ye)},cn||wt.length>0?{fetchers:new Map(v.fetchers)}:{})),A=!1)}async function Tn(k,C,N,B,G,$){let W=v.fetchers.get(k),Q=qi($,W?W.data:void 0);v.fetchers.set(k,Q),oe({fetchers:new Map(v.fetchers)});let H=new AbortController,se=$i(e.history,N,H.signal);V.set(k,H);let re=await Bi("loader",se,B,G,o,i,a);if(_r(re)&&(re=await Tm(re,se.signal,!0)||re),V.get(k)===H&&V.delete(k),se.signal.aborted)return;if(li(re)){at.add(k),await Yt(v,re);return}if(so(re)){let Re=Jr(v.matches,C);v.fetchers.delete(k),oe({fetchers:new Map(v.fetchers),errors:{[Re.route.id]:re.error}});return}te(!_r(re),"Unhandled fetcher deferred data");let He=ks(re.data);v.fetchers.set(k,He),oe({fetchers:new Map(v.fetchers)})}async function Yt(k,C,N){let{submission:B,replace:G,isFetchActionRedirect:$}=N===void 0?{}:N;C.revalidate&&(A=!0);let W=Oo(k.location,C.location,ge({_isRedirect:!0},$?{_isFetchActionRedirect:!0}:{}));if(te(W,"Expected a location on the redirect navigation"),xm.test(C.location)&&n){let se=e.history.createURL(C.location),re=zo(se.pathname,a)==null;if(t.location.origin!==se.origin||re){G?t.location.replace(C.location):t.location.assign(C.location);return}}T=null;let Q=G===!0?Oe.Replace:Oe.Push,H=B||wd(k.navigation);if(v_.has(C.status)&&H&&zt(H.formMethod))await It(Q,W,{submission:ge({},H,{formAction:C.location}),preventScrollReset:D});else if($)await It(Q,W,{overrideNavigation:as(W),fetcherSubmission:H,preventScrollReset:D});else{let se=as(W,H);await It(Q,W,{overrideNavigation:se,preventScrollReset:D})}}async function lr(k,C,N,B,G){let $=await Promise.all([...N.map(H=>Bi("loader",G,H,C,o,i,a)),...B.map(H=>H.matches&&H.match&&H.controller?Bi("loader",$i(e.history,H.path,H.controller.signal),H.match,H.matches,o,i,a):{type:Me.error,error:xt(404,{pathname:H.path})})]),W=$.slice(0,N.length),Q=$.slice(N.length);return await Promise.all([Sd(k,N,W,W.map(()=>G.signal),!1,v.loaderData),Sd(k,B.map(H=>H.match),Q,B.map(H=>H.controller?H.controller.signal:null),!0)]),{results:$,loaderResults:W,fetcherResults:Q}}function Ir(){A=!0,F.push(...Lr()),ut.forEach((k,C)=>{V.has(C)&&(Z.push(C),St(C))})}function ar(k,C,N){let B=Jr(v.matches,C);Pi(k),oe({errors:{[B.route.id]:N},fetchers:new Map(v.fetchers)})}function Pi(k){let C=v.fetchers.get(k);V.has(k)&&!(C&&C.state==="loading"&&Vt.has(k))&&St(k),ut.delete(k),Vt.delete(k),at.delete(k),v.fetchers.delete(k)}function St(k){let C=V.get(k);te(C,"Expected fetch controller: "+k),C.abort(),V.delete(k)}function Rn(k){for(let C of k){let N=Gt(C),B=ks(N.data);v.fetchers.set(C,B)}}function ln(){let k=[],C=!1;for(let N of at){let B=v.fetchers.get(N);te(B,"Expected fetcher: "+N),B.state==="loading"&&(at.delete(N),k.push(N),C=!0)}return Rn(k),C}function an(k){let C=[];for(let[N,B]of Vt)if(B0}function Ho(k,C){let N=v.blockers.get(k)||zi;return b.get(k)!==C&&b.set(k,C),N}function Oi(k){v.blockers.delete(k),b.delete(k)}function ur(k,C){let N=v.blockers.get(k)||zi;te(N.state==="unblocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="blocked"||N.state==="blocked"&&C.state==="proceeding"||N.state==="blocked"&&C.state==="unblocked"||N.state==="proceeding"&&C.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+C.state);let B=new Map(v.blockers);B.set(k,C),oe({blockers:B})}function Mr(k){let{currentLocation:C,nextLocation:N,historyAction:B}=k;if(b.size===0)return;b.size>1&&Pr(!1,"A router only supports one blocker at a time");let G=Array.from(b.entries()),[$,W]=G[G.length-1],Q=v.blockers.get($);if(!(Q&&Q.state==="proceeding")&&W({currentLocation:C,nextLocation:N,historyAction:B}))return $}function Lr(k){let C=[];return U.forEach((N,B)=>{(!k||k(B))&&(N.cancel(),C.push(B),U.delete(B))}),C}function Fr(k,C,N){if(d=k,y=C,g=N||null,!S&&v.navigation===ha){S=!0;let B=un(v.location,v.matches);B!=null&&oe({restoreScrollPosition:B})}return()=>{d=null,y=null,g=null}}function cr(k,C){return g&&g(k,C.map(B=>P_(B,v.loaderData)))||k.key}function Mt(k,C){if(d&&y){let N=cr(k,C);d[N]=y()}}function un(k,C){if(d){let N=cr(k,C),B=d[N];if(typeof B=="number")return B}return null}function Di(k){o={},l=gu(k,i,void 0,o)}return _={get basename(){return a},get state(){return v},get routes(){return s},initialize:X,subscribe:ae,enableScrollRestoration:Fr,navigate:ft,fetch:Ti,revalidate:Kt,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:Gt,deleteFetcher:Pi,dispose:_e,getBlocker:Ho,deleteBlocker:Oi,_internalFetchControllers:V,_internalActiveDeferreds:U,_internalSetRoutes:Di},_}function S_(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function yu(e,t,n,r,i,o,s){let l,a;if(o!=null&&s!=="path"){l=[];for(let c of t)if(l.push(c),c.route.id===o){a=c;break}}else l=t,a=t[t.length-1];let u=Sm(i||".",Tc(l).map(c=>c.pathnameBase),zo(e.pathname,n)||e.pathname,s==="path");return i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Pc(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Yn([n,u.pathname])),bo(u)}function fd(e,t,n,r){if(!r||!S_(r))return{path:n};if(r.formMethod&&!R_(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let i=()=>({path:n,error:xt(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),l=Cm(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!zt(s))return i();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[S,E]=y;return""+g+S+"="+E+` +`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!zt(s))return i();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}te(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=_u(r.formData),u=r.formData;else if(r.body instanceof FormData)a=_u(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=md(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=md(a)}catch{return i()}let c={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(zt(c.formMethod))return{path:n,submission:c};let h=on(n);return t&&h.search&&Pc(h.search)&&a.append("index",""),h.search="?"+a,{path:bo(h),submission:c}}function w_(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function dd(e,t,n,r,i,o,s,l,a,u,c,h,d,g){let y=g?Object.values(g)[0]:d?Object.values(d)[0]:void 0,S=e.createURL(t.location),E=e.createURL(i),m=g?Object.keys(g)[0]:void 0,_=w_(n,m).filter((R,D)=>{if(R.route.lazy)return!0;if(R.route.loader==null)return!1;if(E_(t.loaderData,t.matches[D],R)||s.some(A=>A===R.route.id))return!0;let T=t.matches[D],O=R;return hd(R,ge({currentUrl:S,currentParams:T.params,nextUrl:E,nextParams:O.params},r,{actionResult:y,defaultShouldRevalidate:o||S.pathname+S.search===E.pathname+E.search||S.search!==E.search||km(T,O)}))}),v=[];return a.forEach((R,D)=>{if(!n.some(V=>V.route.id===R.routeId))return;let T=Xr(c,R.path,h);if(!T){v.push({key:D,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(D),A=O&&O.state!=="idle"&&O.data===void 0&&!u.has(D),F=Su(T,R.path);(l.includes(D)||A||hd(F,ge({currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:o})))&&v.push({key:D,routeId:R.routeId,path:R.path,matches:T,match:F,controller:new AbortController})}),[_,v]}function E_(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function km(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function hd(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function pd(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];te(i,"No route found in manifest");let o={};for(let s in r){let a=i[s]!==void 0&&s!=="hasErrorBoundary";Pr(!a,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!a&&!Qy.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,ge({},t(i),{lazy:void 0}))}async function Bi(e,t,n,r,i,o,s,l){l===void 0&&(l={});let a,u,c,h=y=>{let S,E=new Promise((m,p)=>S=p);return c=()=>S(),t.signal.addEventListener("abort",c),Promise.race([y({request:t,params:n.params,context:l.requestContext}),E])};try{let y=n.route[e];if(n.route.lazy)if(y)u=(await Promise.all([h(y),pd(n.route,o,i)]))[0];else if(await pd(n.route,o,i),y=n.route[e],y)u=await h(y);else if(e==="action"){let S=new URL(t.url),E=S.pathname+S.search;throw xt(405,{method:t.method,pathname:E,routeId:n.route.id})}else return{type:Me.data,data:void 0};else if(y)u=await h(y);else{let S=new URL(t.url),E=S.pathname+S.search;throw xt(404,{pathname:E})}te(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){a=Me.error,u=y}finally{c&&t.signal.removeEventListener("abort",c)}if(T_(u)){let y=u.status;if(m_.has(y)){let m=u.headers.get("Location");if(te(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!xm.test(m))m=yu(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!l.isStaticRequest){let p=new URL(t.url),_=m.startsWith("//")?new URL(p.protocol+m):new URL(m),v=zo(_.pathname,s)!=null;_.origin===p.origin&&v&&(m=_.pathname+_.search+_.hash)}if(l.isStaticRequest)throw u.headers.set("Location",m),u;return{type:Me.redirect,status:y,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l.isRouteRequest)throw{type:a||Me.data,response:u};let S,E=u.headers.get("Content-Type");return E&&/\bapplication\/json\b/.test(E)?S=await u.json():S=await u.text(),a===Me.error?{type:a,error:new Rc(y,u.statusText,S),headers:u.headers}:{type:Me.data,data:S,statusCode:u.status,headers:u.headers}}if(a===Me.error)return{type:a,error:u};if(C_(u)){var d,g;return{type:Me.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:Me.data,data:u}}function $i(e,t,n,r){let i=e.createURL(Cm(t)).toString(),o={signal:n};if(r&&zt(r.formMethod)){let{formMethod:s,formEncType:l}=r;o.method=s.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=_u(r.formData):o.body=r.formData}return new Request(i,o)}function _u(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function md(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function x_(e,t,n,r,i){let o={},s=null,l,a=!1,u={};return n.forEach((c,h)=>{let d=t[h].route.id;if(te(!li(c),"Cannot handle redirect results in processLoaderData"),so(c)){let g=Jr(e,d),y=c.error;r&&(y=Object.values(r)[0],r=void 0),s=s||{},s[g.route.id]==null&&(s[g.route.id]=y),o[d]=void 0,a||(a=!0,l=wm(c.error)?c.error.status:500),c.headers&&(u[d]=c.headers)}else _r(c)?(i.set(d,c.deferredData),o[d]=c.deferredData.data):o[d]=c.data,c.statusCode!=null&&c.statusCode!==200&&!a&&(l=c.statusCode),c.headers&&(u[d]=c.headers)}),r&&(s=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:s,statusCode:l||200,loaderHeaders:u}}function vd(e,t,n,r,i,o,s,l){let{loaderData:a,errors:u}=x_(t,n,r,i,l);for(let c=0;cr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function yd(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Rc(e||500,s,new Error(l),!0)}function _d(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(li(n))return n}}function Cm(e){let t=typeof e=="string"?on(e):e;return bo(ge({},t,{hash:""}))}function k_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _r(e){return e.type===Me.deferred}function so(e){return e.type===Me.error}function li(e){return(e&&e.type)===Me.redirect}function C_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function T_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function R_(e){return p_.has(e.toLowerCase())}function zt(e){return d_.has(e.toLowerCase())}async function Sd(e,t,n,r,i,o){for(let s=0;sh.route.id===a.route.id),c=u!=null&&!km(u,a)&&(o&&o[a.route.id])!==void 0;if(_r(l)&&(i||c)){let h=r[s];te(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await Tm(l,h,i).then(d=>{d&&(n[s]=d||n[s])})}}}async function Tm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function Pc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function P_(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function Su(e,t){let n=typeof t=="string"?on(t).search:t.search;if(e[e.length-1].route.index&&Pc(n||""))return e[e.length-1];let r=Tc(e);return r[r.length-1]}function wd(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function as(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function O_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qi(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function D_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function ks(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** + * React Router v6.14.1 + * + * Copyright (c) Remix Software Inc. + * + * 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 Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=L.useRef(!1);return Om(()=>{s.current=!0}),L.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){n.go(a);return}let c=Sm(a,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:Yn([t,c.pathname])),(u.replace?n.replace:n.push)(c,u.state,u)},[t,n,o,i,e])}function A_(e,t,n){Pl()||te(!1);let{navigator:r}=L.useContext(Tl),{matches:i}=L.useContext(xi),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let a=Oc(),u;if(t){var c;let S=typeof t=="string"?on(t):t;l==="/"||(c=S.pathname)!=null&&c.startsWith(l)||te(!1),u=S}else u=a;let h=u.pathname||"/",d=l==="/"?h:h.slice(l.length)||"/",g=Xr(e,{pathname:d}),y=U_(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Yn([l,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Yn([l,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n);return t&&y?L.createElement(Rl.Provider,{value:{location:Xs({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Oe.Pop}},y):y}function I_(){let e=B_(),t=wm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},t),n?L.createElement("pre",{style:i},n):null,o)}const M_=L.createElement(I_,null);class L_ extends L.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?L.createElement(xi.Provider,{value:this.props.routeContext},L.createElement(Pm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function F_(e){let{routeContext:t,match:n,children:r}=e,i=L.useContext(Cl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),L.createElement(xi.Provider,{value:t},r)}function U_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let l=o.findIndex(a=>a.route.id&&(s==null?void 0:s[a.route.id]));l>=0||te(!1),o=o.slice(0,Math.min(o.length,l+1))}return o.reduceRight((l,a,u)=>{let c=a.route.id?s==null?void 0:s[a.route.id]:null,h=null;n&&(h=a.route.errorElement||M_);let d=t.concat(o.slice(0,u+1)),g=()=>{let y;return c?y=h:a.route.Component?y=L.createElement(a.route.Component,null):a.route.element?y=a.route.element:y=l,L.createElement(F_,{match:a,routeContext:{outlet:l,matches:d,isDataRoute:n!=null},children:y})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?L.createElement(L_,{location:n.location,revalidation:n.revalidation,component:h,error:c,children:g(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):g()},null)}var wu;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(wu||(wu={}));var Do;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Do||(Do={}));function j_(e){let t=L.useContext(Cl);return t||te(!1),t}function b_(e){let t=L.useContext(Rm);return t||te(!1),t}function z_(e){let t=L.useContext(xi);return t||te(!1),t}function Dm(e){let t=z_(),n=t.matches[t.matches.length-1];return n.route.id||te(!1),n.route.id}function B_(){var e;let t=L.useContext(Pm),n=b_(Do.UseRouteError),r=Dm(Do.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function $_(){let{router:e}=j_(wu.UseNavigateStable),t=Dm(Do.UseNavigateStable),n=L.useRef(!1);return Om(()=>{n.current=!0}),L.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Xs({fromRouteId:t},o)))},[e,t])}const q_="startTransition",Ed=Dv[q_];function H_(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=L.useState(n.state),{v7_startTransition:s}=r||{},l=L.useCallback(h=>{s&&Ed?Ed(()=>o(h)):o(h)},[o,s]);L.useLayoutEffect(()=>n.subscribe(l),[n,l]);let a=L.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:h=>n.navigate(h),push:(h,d,g)=>n.navigate(h,{state:d,preventScrollReset:g==null?void 0:g.preventScrollReset}),replace:(h,d,g)=>n.navigate(h,{replace:!0,state:d,preventScrollReset:g==null?void 0:g.preventScrollReset})}),[n]),u=n.basename||"/",c=L.useMemo(()=>({router:n,navigator:a,static:!1,basename:u}),[n,a,u]);return L.createElement(L.Fragment,null,L.createElement(Cl.Provider,{value:c},L.createElement(Rm.Provider,{value:i},L.createElement(W_,{basename:u,location:i.location,navigationType:i.historyAction,navigator:a},i.initialized?L.createElement(Q_,{routes:n.routes,state:i}):t))),null)}function Q_(e){let{routes:t,state:n}=e;return A_(t,void 0,n)}function W_(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Oe.Pop,navigator:o,static:s=!1}=e;Pl()&&te(!1);let l=t.replace(/^\/*/,"/"),a=L.useMemo(()=>({basename:l,navigator:o,static:s}),[l,o,s]);typeof r=="string"&&(r=on(r));let{pathname:u="/",search:c="",hash:h="",state:d=null,key:g="default"}=r,y=L.useMemo(()=>{let S=zo(u,l);return S==null?null:{location:{pathname:S,search:c,hash:h,state:d,key:g},navigationType:i}},[l,u,c,h,d,g,i]);return y==null?null:L.createElement(Tl.Provider,{value:a},L.createElement(Rl.Provider,{children:n,value:y}))}var xd;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(xd||(xd={}));new Promise(()=>{});function V_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:L.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:L.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.14.1 + * + * Copyright (c) Remix Software Inc. + * + * 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 Js(){return Js=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const No=typeof window>"u"||"Deno"in window;function kt(){}function X_(e,t){return typeof e=="function"?e(t):e}function Eu(e){return typeof e=="number"&&e>=0&&e!==1/0}function Nm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yi(e,t,n){return Ol(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function In(e,t,n){return Ol(e)?[{...t,queryKey:e},n]:[e||{},t]}function Td(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(Ol(s)){if(r){if(t.queryHash!==Nc(s,t.options))return!1}else if(!Zs(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function Rd(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Ol(o)){if(!t.options.mutationKey)return!1;if(n){if(Sr(t.options.mutationKey)!==Sr(o))return!1}else if(!Zs(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Nc(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sr)(e)}function Sr(e){return JSON.stringify(e,(t,n)=>ku(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Zs(e,t){return Am(e,t)}function Am(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Am(e[n],t[n])):!1}function Im(e,t){if(e===t)return e;const n=Pd(e)&&Pd(t);if(n||ku(e)&&ku(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!Od(n)||!n.hasOwnProperty("isPrototypeOf"))}function Od(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ol(e){return Array.isArray(e)}function Mm(e){return new Promise(t=>{setTimeout(t,e)})}function Dd(e){Mm(0).then(e)}function J_(){if(typeof AbortController=="function")return new AbortController}function Cu(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Im(e,t):t}class Z_ extends Bo{constructor(){super(),this.setup=t=>{if(!No&&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&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const el=new Z_,Nd=["online","offline"];class e0 extends Bo{constructor(){super(),this.setup=t=>{if(!No&&window.addEventListener){const n=()=>t();return Nd.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Nd.forEach(r=>{window.removeEventListener(r,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&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const tl=new e0;function t0(e){return Math.min(1e3*2**e,3e4)}function Dl(e){return(e??"online")==="online"?tl.isOnline():!0}class Lm{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Cs(e){return e instanceof Lm}function Fm(e){let t=!1,n=0,r=!1,i,o,s;const l=new Promise((E,m)=>{o=E,s=m}),a=E=>{r||(g(new Lm(E)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},h=()=>!el.isFocused()||e.networkMode!=="always"&&!tl.isOnline(),d=E=>{r||(r=!0,e.onSuccess==null||e.onSuccess(E),i==null||i(),o(E))},g=E=>{r||(r=!0,e.onError==null||e.onError(E),i==null||i(),s(E))},y=()=>new Promise(E=>{i=m=>{const p=r||!h();return p&&E(m),p},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(m){E=Promise.reject(m)}Promise.resolve(E).then(d).catch(m=>{var p,_;if(r)return;const v=(p=e.retry)!=null?p:3,R=(_=e.retryDelay)!=null?_:t0,D=typeof R=="function"?R(n,m):R,T=v===!0||typeof v=="number"&&n{if(h())return y()}).then(()=>{t?g(m):S()})})};return Dl(e.networkMode)?S():y().then(S),{promise:l,cancel:a,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:u,continueRetry:c}}const Ac=console;function n0(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const i=c=>{let h;t++;try{h=c()}finally{t--,t||l()}return h},o=c=>{t?e.push(c):Dd(()=>{n(c)})},s=c=>(...h)=>{o(()=>{c(...h)})},l=()=>{const c=e;e=[],c.length&&Dd(()=>{r(()=>{c.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const De=n0();class Um{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eu(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(No?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class r0 extends Um{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Ac,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||i0(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Cu(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(kt).catch(kt):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||!Nm(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.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(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 o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}Array.isArray(this.options.queryKey);const s=J_(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(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 h;this.dispatch({type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta})}const d=g=>{if(Cs(g)&&g.silent||this.dispatch({type:"error",error:g}),!Cs(g)){var y,S,E,m;(y=(S=this.cache.config).onError)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,this.state.data,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Fm({fn:c.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:g=>{var y,S,E,m;if(typeof g>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(g),(y=(S=this.cache.config).onSuccess)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(g,y)=>{this.dispatch({type:"failed",failureCount:g,error:y})},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,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Dl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Cs(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function i0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class o0 extends Bo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:Nc(o,n);let l=this.get(s);return l||(l=new r0({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}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(){De.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=In(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>Td(r,i))}findAll(t,n){const[r]=In(t,n);return Object.keys(r).length>0?this.queries.filter(i=>Td(r,i)):this.queries}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){De.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class s0 extends Um{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Ac,this.observers=[],this.state=t.state||l0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(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(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var T;return this.retryer=Fm({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,A)=>{this.dispatch({type:"failed",failureCount:O,error:A})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,a,u,c;if(!n){var h,d,g,y;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(d=this.mutationCache.config).onMutate)==null?void 0:h.call(d,this.state.variables,this));const O=await((g=(y=this.options).onMutate)==null?void 0:g.call(y,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const T=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,T,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,T,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,T,null,this.state.variables,this.state.context,this)),await((u=(c=this.options).onSettled)==null?void 0:u.call(c,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var S,E,m,p,_,v,R,D;throw await((S=(E=this.mutationCache.config).onError)==null?void 0:S.call(E,T,this.state.variables,this.state.context,this)),await((m=(p=this.options).onError)==null?void 0:m.call(p,T,this.state.variables,this.state.context)),await((_=(v=this.mutationCache.config).onSettled)==null?void 0:_.call(v,void 0,T,this.state.variables,this.state.context,this)),await((R=(D=this.options).onSettled)==null?void 0:R.call(D,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Dl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function l0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class a0 extends Bo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new s0({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});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(){De.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=>Rd(t,n))}findAll(t){return this.mutations.filter(n=>Rd(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return De.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(kt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function u0(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,u=a==null?void 0:a.pageParam,c=(a==null?void 0:a.direction)==="forward",h=(a==null?void 0:a.direction)==="backward",d=((o=e.state.data)==null?void 0:o.pages)||[],g=((s=e.state.data)==null?void 0:s.pageParams)||[];let y=g,S=!1;const E=D=>{Object.defineProperty(D,"signal",{enumerable:!0,get:()=>{var T;if((T=e.signal)!=null&&T.aborted)S=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{S=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),p=(D,T,O,A)=>(y=A?[T,...y]:[...y,T],A?[O,...D]:[...D,O]),_=(D,T,O,A)=>{if(S)return Promise.reject("Cancelled");if(typeof O>"u"&&!T&&D.length)return Promise.resolve(D);const F={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};E(F);const Z=m(F);return Promise.resolve(Z).then(qe=>p(D,O,qe,A))};let v;if(!d.length)v=_([]);else if(c){const D=typeof u<"u",T=D?u:Ad(e.options,d);v=_(d,D,T)}else if(h){const D=typeof u<"u",T=D?u:c0(e.options,d);v=_(d,D,T,!0)}else{y=[];const D=typeof e.options.getNextPageParam>"u";v=(l&&d[0]?l(d[0],0,d):!0)?_([],D,g[0]):Promise.resolve(p([],g[0],d[0]));for(let O=1;O{if(l&&d[O]?l(d[O],O,d):!0){const Z=D?g[O]:Ad(e.options,A);return _(A,D,Z)}return Promise.resolve(p(A,g[O],d[O]))})}return v.then(D=>({pages:D,pageParams:y}))}}}}function Ad(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function c0(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class f0{constructor(t={}){this.queryCache=t.queryCache||new o0,this.mutationCache=t.mutationCache||new a0,this.logger=t.logger||Ac,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=el.subscribe(()=>{el.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=tl.subscribe(()=>{tl.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=In(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}ensureQueryData(t,n,r){const i=Yi(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}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),o=i==null?void 0:i.state.data,s=X_(n,o);if(typeof s>"u")return;const l=Yi(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return De.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]=In(t,n),i=this.queryCache;De.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=In(t,n,r),s=this.queryCache,l={type:"active",...i};return De.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries(l,o)))}cancelQueries(t,n,r){const[i,o={}]=In(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=De.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(kt).catch(kt)}invalidateQueries(t,n,r){const[i,o]=In(t,n,r);return De.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(u=>{u.invalidate()}),i.refetchType==="none")return Promise.resolve();const a={...i,type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"};return this.refetchQueries(a,o)})}refetchQueries(t,n,r){const[i,o]=In(t,n,r),s=De.batch(()=>this.queryCache.findAll(i).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...o,cancelRefetch:(u=o==null?void 0:o.cancelRefetch)!=null?u:!0,meta:{refetchPage:i.refetchPage}})}));let l=Promise.all(s).then(kt);return o!=null&&o.throwOnError||(l=l.catch(kt)),l}fetchQuery(t,n,r){const i=Yi(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(kt).catch(kt)}fetchInfiniteQuery(t,n,r){const i=Yi(t,n,r);return i.behavior=u0(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(kt).catch(kt)}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=>Sr(t)===Sr(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Zs(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Sr(t)===Sr(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Zs(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=Nc(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 d0 extends Bo{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.size===1&&(this.currentQuery.addObserver(this),Id(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Tu(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Tu(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,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),xu(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 o=this.hasListeners();o&&Md(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return p0(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}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(kt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),No||this.currentResult.isStale||!Eu(this.options.staleTime))return;const n=Nm(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,!(No||this.options.enabled===!1||!Eu(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||el.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,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,c=a?this.currentResult:this.previousQueryResult,{state:h}=t;let{dataUpdatedAt:d,error:g,errorUpdatedAt:y,fetchStatus:S,status:E}=h,m=!1,p=!1,_;if(n._optimisticResults){const O=this.hasListeners(),A=!O&&Id(t,n),F=O&&Md(t,r,n,i);(A||F)&&(S=Dl(t.options.networkMode)?"fetching":"paused",d||(E="loading")),n._optimisticResults==="isRestoring"&&(S="idle")}if(n.keepPreviousData&&!h.dataUpdatedAt&&c!=null&&c.isSuccess&&E!=="error")_=c.data,d=c.dataUpdatedAt,E=c.status,m=!0;else if(n.select&&typeof h.data<"u")if(o&&h.data===(s==null?void 0:s.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(h.data),_=Cu(o==null?void 0:o.data,_,n),this.selectResult=_,this.selectError=null}catch(O){this.selectError=O}else _=h.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&E==="loading"){let O;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=o.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(A){this.selectError=A}typeof O<"u"&&(E="success",_=Cu(o==null?void 0:o.data,O,n),p=!0)}this.selectError&&(g=this.selectError,_=this.selectResult,y=Date.now(),E="error");const v=S==="fetching",R=E==="loading",D=E==="error";return{status:E,fetchStatus:S,isLoading:R,isSuccess:E==="success",isError:D,isInitialLoading:R&&v,data:_,dataUpdatedAt:d,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!R,isLoadingError:D&&h.dataUpdatedAt===0,isPaused:S==="paused",isPlaceholderData:p,isPreviousData:m,isRefetchError:D&&h.dataUpdatedAt!==0,isStale:Ic(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,xu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const c=u;return this.currentResult[c]!==n[c]&&a.has(c)})};(t==null?void 0:t.listeners)!==!1&&o()&&(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"&&!Cs(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){De.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,l,a,u;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:c})=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function h0(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Id(e,t){return h0(e,t)||e.state.dataUpdatedAt>0&&Tu(e,t,t.refetchOnMount)}function Tu(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ic(e,t)}return!1}function Md(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Ic(e,n)}function Ic(e,t){return e.isStaleByTime(t.staleTime)}function p0(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!xu(e.getCurrentResult(),t)}var jm={exports:{}},bm={};/** + * @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 gi=L;function m0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var v0=typeof Object.is=="function"?Object.is:m0,g0=gi.useState,y0=gi.useEffect,_0=gi.useLayoutEffect,S0=gi.useDebugValue;function w0(e,t){var n=t(),r=g0({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return _0(function(){i.value=n,i.getSnapshot=t,pa(i)&&o({inst:i})},[e,n,t]),y0(function(){return pa(i)&&o({inst:i}),e(function(){pa(i)&&o({inst:i})})},[e]),S0(n),n}function pa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!v0(e,n)}catch{return!0}}function E0(e,t){return t()}var x0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?E0:w0;bm.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:x0;jm.exports=bm;var zm=jm.exports;const k0=zm.useSyncExternalStore,Ld=L.createContext(void 0),Bm=L.createContext(!1);function $m(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Ld),window.ReactQueryClientContext):Ld)}const C0=({context:e}={})=>{const t=L.useContext($m(e,L.useContext(Bm)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},T0=({client:e,children:t,context:n,contextSharing:r=!1})=>{L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=$m(n,r);return L.createElement(Bm.Provider,{value:!n&&r},L.createElement(i.Provider,{value:e},t))},qm=L.createContext(!1),R0=()=>L.useContext(qm);qm.Provider;function P0(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const O0=L.createContext(P0()),D0=()=>L.useContext(O0);function N0(e,t){return typeof e=="function"?e(...t):!!e}const A0=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},I0=e=>{L.useEffect(()=>{e.clearReset()},[e])},M0=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&N0(n,[e.error,r]),L0=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},F0=(e,t)=>e.isLoading&&e.isFetching&&!t,U0=(e,t,n)=>(e==null?void 0:e.suspense)&&F0(t,n),j0=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function b0(e,t){const n=C0({context:e.context}),r=R0(),i=D0(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=De.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=De.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=De.batchCalls(o.onSettled)),L0(o),A0(o,i),I0(i);const[s]=L.useState(()=>new t(n,o)),l=s.getOptimisticResult(o);if(k0(L.useCallback(a=>{const u=r?()=>{}:s.subscribe(De.batchCalls(a));return s.updateResult(),u},[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),L.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),U0(o,l,r))throw j0(o,s,i);if(M0({result:l,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:s.trackResult(l)}function z0(e,t,n){const r=Yi(e,t,n);return b0(r,d0)}const Fd=e=>{let t;const n=new Set,r=(a,u)=>{const c=typeof a=="function"?a(t):a;if(!Object.is(c,t)){const h=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(d=>d(t,h))}},i=()=>t,l={setState:r,getState:i,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,i,l),l},B0=e=>e?Fd(e):Fd;var Hm={exports:{}},Qm={};/** + * @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 Nl=L,$0=zm;function q0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var H0=typeof Object.is=="function"?Object.is:q0,Q0=$0.useSyncExternalStore,W0=Nl.useRef,V0=Nl.useEffect,K0=Nl.useMemo,G0=Nl.useDebugValue;Qm.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=W0(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=K0(function(){function a(g){if(!u){if(u=!0,c=g,g=r(g),i!==void 0&&s.hasValue){var y=s.value;if(i(y,g))return h=y}return h=g}if(y=h,H0(c,g))return y;var S=r(g);return i!==void 0&&i(y,S)?y:(c=g,h=S)}var u=!1,c,h,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,i]);var l=Q0(e,o[0],o[1]);return V0(function(){s.hasValue=!0,s.value=l},[l]),G0(l),l};Hm.exports=Qm;var Y0=Hm.exports;const X0=al(Y0),{useSyncExternalStoreWithSelector:J0}=X0;function Z0(e,t=e.getState,n){const r=J0(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return L.useDebugValue(r),r}const Ud=e=>{const t=typeof e=="function"?B0(e):e,n=(r,i)=>Z0(t,r,i);return Object.assign(n,t),n},e1=e=>e?Ud(e):Ud,jn=4,Zr=2,Ru=[{id:"RUB",title:"Рубль",symbol:"₽",in:"В рублях",decimals:jn,visible_decimals:Zr},{id:"GEL",title:"Лари",symbol:"₾",in:"В лари",decimals:jn,visible_decimals:Zr},{id:"TRY",title:"Лира",symbol:"₺",in:"В лирах",decimals:jn,visible_decimals:Zr},{id:"EUR",title:"Евро",symbol:"€",in:"В евро",decimals:jn,visible_decimals:Zr}],t1=e=>{const t={Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"};return e.split("").map(n=>t[n]||"").join("")},n1=e=>({id:Math.round(Math.random()*1e10),first_name:e,last_name:e,username:Math.random()>.2?t1(e):void 0,profile_photo:`https://i.pravatar.cc/48/${Math.round(Math.random()*1e10)}`,_name:e}),r1=()=>{const e=["Александр","Дмитрий","Максим","Сергей","Андрей","Алексей","Артём","Илья","Кирилл","Михаил","Никита","Матвей","Роман","Егор","Арсений","Иван","Денис","Евгений","Тимофей","Владислав","Игорь","Владимир","Павел","Руслан","Марк","Константин","Тимур","Олег","Ярослав","Антон","Николай","Данил","Анастасия","Мария","Анна","Виктория","Екатерина","Наталья","Марина","Полина","София","Дарья","Алиса","Ксения","Александра","Елена"];return e[Math.floor(Math.random()*e.length)]},i1=e=>{const t=[];do{const n=r1();t.includes(n)||t.push(n)}while(t.length!==e);return t},o1=i1(6),Wm=o1.map(e=>n1(e)),lo=Wm.slice(0,4).map((e,t)=>({person_id:`Person${t}`,normalized_name:e._name,related_user_id:Math.random()>.3?e.id:void 0,is_payer:t==0,amount:Math.round(Math.random()*100)*10**jn}));lo.splice(1,0,{...lo[0],amount:lo[0].amount/3,is_payer:!1});const s1={id:"1",is_voice:!0,raw_text:lo.map(e=>`${e.normalized_name} ${e.is_payer?"заплатил":"должен"} ${(e.amount/10**jn).toFixed(0)}`).join(", "),shares:lo,is_confirmed:!1,currency_id:Ru[0].id},ir=e1((e,t)=>({txId:void 0,setTxId:n=>e({txId:n}),users:Wm,setUsers:n=>e({users:n}),selectPersonId:null,setSelectPersonId:n=>e({selectPersonId:n}),currencies:Ru,currency:Ru[0],setCurrency:n=>{e({transaction:{...t().transaction,currency_id:n}})},transaction:s1,setTransaction:n=>e({transaction:n}),isSuccess:null,setSuccess:n=>e({isSuccess:n})})),Al=()=>{const{txId:e,setTxId:t}=ir(),n=Oc();if(!e){const i=new URLSearchParams(n.search).get("txid");t(i||null)}},Vm=()=>{const e=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[t,n]=L.useState(e()),r=()=>{n(e())};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),{isDarkTheme:t}},Il=()=>{const{users:e,transaction:t,setTransaction:n,selectPersonId:r}=ir(),i=t.shares.map(c=>c.related_user_id),o=e.filter(c=>!i.includes(c.id)),s=t.shares.every(c=>c.related_user_id);return{users:e,unrelatedUsers:o,isRelationsComplete:s,getUserById:c=>e.find(h=>h.id===c),selectUser:c=>()=>{if(r!==null){const h=[...t.shares],d=h.findIndex(g=>g.related_user_id===c.id);for(let g=0;g()=>{const h=[...t.shares].filter(d=>d.person_id!==c);n({...t,shares:h}),history.back()}}},Km=({size:e})=>x.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 w-[50px] h-[50px]",style:{width:e,height:e},children:x.jsx("div",{className:"w-full h-full rounded-full border-[3px] border-button border-l-button/10 border-t-button/10 animate-[spin_0.6s_linear_infinite]"})});function ao({children:e,theme:t="default",disabled:n,isBusy:r,onClick:i}){const o={default:"mx-auto w-full max-w-[500px] md:max-w-[300px] block h-10 bg-button text-buttonText rounded-md text-[14px] leading-[20px] font-semibold enabled:hover:brightness-110 enabled:active:brightness-[1.2] disabled:opacity-40 transition-all",text:"h-6 text-[14px] leading-[24px] text-button hover:brightness-[1.2] active:brightness-[1.4] transition-all"}[t];return x.jsxs("div",{className:"relative",children:[x.jsx("button",{className:o,disabled:n||r,onClick:i,children:e}),r&&x.jsx(Km,{size:30})]})}const l1=({onClick:e})=>{var t,n,r;const i=typeof window<"u"?(t=window)==null||(n=t.Telegram)==null||(r=n.WebApp)==null?void 0:r.BackButton:null;return i&&(L.useEffect(()=>(i.show(),()=>{i.hide()}),[]),L.useEffect(()=>{if(e)return i.onClick(e),()=>{i.offClick(e)}},[e])),null},a1=e=>L.createElement("svg",{width:12,height:20,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.53714 19.5928L0.292152 10.6788C-0.097384 10.3036 -0.097384 9.69738 0.292152 9.32117L9.53714 0.407154C10.0995 -0.135718 11.0144 -0.135718 11.5777 0.407154C12.14 0.950026 12.14 1.8311 11.5777 2.37397L3.66913 10.0005L11.5777 17.6251C12.14 18.1689 12.14 19.05 11.5777 19.5928C11.0144 20.1357 10.0995 20.1357 9.53714 19.5928Z",fill:"currentColor"}));function Ml({onBack:e,onCancel:t}){var n,r;return((r=(n=window==null?void 0:window.Telegram)==null?void 0:n.WebApp)==null?void 0:r.platform)!=="unknown"?x.jsx("div",{className:"h-3",children:x.jsx(l1,{onClick:e})}):x.jsxs("header",{className:"relative flex items-center justify-center h-[64px]",children:[t&&x.jsx("button",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:t,children:"Отмена"}),e&&x.jsxs("button",{className:"flex items-center gap-[5px] absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:e,children:[x.jsx(a1,{}),x.jsx("span",{children:"Назад"})]}),x.jsxs("div",{className:"flex flex-col items-center justify-center gap-0.5",children:[x.jsx("div",{className:"text-[17px] leading-[22px] font-semibold",children:"Split"}),x.jsx("div",{className:"text-hint text-[13px] leading-[18px] font-semibold opacity-70",children:"бот"})]})]})}const u1=e=>{const t=e?e.split(" "):[];return`${t[0]?t[0][0]:""}${t[1]?t[1][0]:""}`},c1=e=>{};function f1({url:e,fullName:t,size:n=40}){const r=c1(t),{isDarkTheme:i}=Vm(),s=!e&&t?r+"22":i?"#9AA6AC":"#EEF0F2",l=!e&&t?u1(t):null;return x.jsx("div",{className:"flex items-center justify-center rounded-full bg-cover bg-center",style:{width:n,height:n,backgroundColor:s,backgroundImage:`url(${e})`},children:l&&x.jsx("div",{className:"uppercase font-semibold text-main",style:{fontSize:.35*n+"px",lineHeight:.6*n+"px",color:r},children:l})})}function Mc({user:e,size:t=40}){const n=[...e!=null&&e.first_name?[e.first_name]:[],...e!=null&&e.last_name?[e.last_name]:[]].join(" ");return x.jsxs("div",{className:"w-full flex gap-2 items-center truncate",children:[x.jsx(f1,{url:e==null?void 0:e.profile_photo,size:t,fullName:n}),x.jsx("div",{className:"flex flex-col -gap-0.5 flex-1 text-left truncate text-[16px] leading-[20px]",children:e?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"truncate",children:[e.first_name," ",e.last_name]}),e.username&&x.jsxs("div",{className:"text-[14px] leading-[18px] text-hint truncate",children:["@",e.username]})]}):x.jsx("div",{className:"text-hint truncate",children:"(выберите)"})})]})}const uo=e=>(e/10**jn).toFixed(Zr),jd=e=>parseFloat(e)*10**jn||0,d1=(e,t)=>{const n=Zr,r=10,i=/[^0-9.]/,o=t.replace(/,/g,".").replace(i,"");if(!/^\d*.?\d*$/.test(o)||o.length>r)return e;const[l,a]=e.split("."),[u,c]=o.split(".");return l==="0"&&u==="00"||a==="0".repeat(n-1)&&c==="0".repeat(n)||c&&c.length>n?e:e===""&&o==="."?"0.":e==="0."&&o==="0"?"":e!=="0."&&o==="0"?"0.":o};function h1({amount:e,onChange:t}){const[n,r]=L.useState(uo(e));L.useEffect(()=>{const s=jd(n);e!==s&&r(uo(e))},[e,n]);const i=s=>{const l=s.target.value,a=d1(n,l);r(a);const u=jd(a);t(u)},o=()=>{r(uo(e))};return x.jsx("input",{type:"text",className:"w-[117px] h-10 p-2 rounded-md border border-[#DDE2E4] dark:border-[#6E7C87] dark:bg-[#D5DADD] text-right text-[16px] text-text dark:text-[#48535B] leading-[24px] focus:ring-2 focus:ring-button focus:outline-none appearance-none transition-all selection:bg-button selection:text-buttonText",inputMode:"decimal",placeholder:"0",value:n,onFocus:s=>{s.target.select()},onBlur:o,onChange:i})}function bd({related_user_id:e,amount:t,onChange:n}){const{getUserById:r}=Il(),i=e?r(e):void 0;return i?x.jsxs("div",{className:"flex gap-3",children:[x.jsx(Mc,{user:i,size:48}),x.jsx(h1,{amount:t,onChange:n})]}):null}function ai({children:e,className:t}){return x.jsx("div",{className:Gn("panel p-4 pb-6 rounded-3xl bg-bg",t),children:e})}function p1(){var r;const{transaction:e,users:t,txId:n}=ir();return x.jsxs(ai,{className:"mt-10 text-[12px] break-words opacity-40 overflow-x-auto",children:[x.jsx("h2",{children:"Debug"}),x.jsx("strong",{children:"href = "}),location.href,x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"txid = "}),String(n),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"transaction = "}),x.jsx("pre",{children:JSON.stringify(e,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"users = "}),x.jsx("pre",{children:JSON.stringify(t,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"window.Telegram.Webapp = "}),x.jsx("pre",{children:JSON.stringify((r=window.Telegram)==null?void 0:r.WebApp,null,2)})]})}function Ll({children:e,className:t}){return x.jsx("div",{className:Gn("fixed top-0 left-0 w-full h-full overflow-y-auto text-text bg-bg2",t),children:x.jsxs("div",{className:"limiter",children:[e,x.jsx(p1,{})]})})}var vn={DEBUG:!1,LIB_VERSION:"2.47.0"},Ee;if(typeof window>"u"){var zd={hostname:""};Ee={navigator:{userAgent:""},document:{location:zd,referrer:""},screen:{width:0,height:0},location:zd}}else Ee=window;var Fl=Array.prototype,m1=Function.prototype,Gm=Object.prototype,bn=Fl.slice,$o=Gm.toString,Ul=Gm.hasOwnProperty,Pe=Ee.console,zn=Ee.navigator,de=Ee.document,us=Ee.opera,nl=Ee.screen,en=zn.userAgent,ma=m1.bind,Bd=Fl.forEach,$d=Fl.indexOf,qd=Fl.map,v1=Array.isArray,Pu={},f={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ce={log:function(){if(vn.DEBUG&&!f.isUndefined(Pe)&&Pe)try{Pe.log.apply(Pe,arguments)}catch{f.each(arguments,function(t){Pe.log(t)})}},warn:function(){if(vn.DEBUG&&!f.isUndefined(Pe)&&Pe){var e=["Mixpanel warning:"].concat(f.toArray(arguments));try{Pe.warn.apply(Pe,e)}catch{f.each(e,function(n){Pe.warn(n)})}}},error:function(){if(vn.DEBUG&&!f.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(f.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{f.each(e,function(n){Pe.error(n)})}}},critical:function(){if(!f.isUndefined(Pe)&&Pe){var e=["Mixpanel error:"].concat(f.toArray(arguments));try{Pe.error.apply(Pe,e)}catch{f.each(e,function(n){Pe.error(n)})}}}},va=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ce,arguments)}},Lc=function(e){return{log:va(ce.log,e),error:va(ce.error,e),critical:va(ce.critical,e)}};f.bind=function(e,t){var n,r;if(ma&&e.bind===ma)return ma.apply(e,bn.call(arguments,1));if(!f.isFunction(e))throw new TypeError;return n=bn.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(bn.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(bn.call(arguments)));return Object(s)===s?s:o},r};f.each=function(e,t,n){if(e!=null){if(Bd&&e.forEach===Bd)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r0&&(t[r]=n)}),t};f.truncate=function(e,t){var n;return typeof e=="string"?n=e.slice(0,t):f.isArray(e)?(n=[],f.each(e,function(r){n.push(f.truncate(r,t))})):f.isObject(e)?(n={},f.each(e,function(r,i){n[i]=f.truncate(r,t)})):n=e,n};f.JSONEncode=function(){return function(e){var t=e,n=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var a=s[l];return typeof a=="string"?a:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,o){var s="",l=" ",a=0,u="",c="",h=0,d=s,g=[],y=o[i];switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(i)),typeof y){case"string":return n(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":return String(y);case"object":if(!y)return"null";if(s+=l,g=[],$o.apply(y)==="[object Array]"){for(h=y.length,a=0;a="0"&&t<="9";)y+=t,o();if(t===".")for(y+=".";o()&&t>="0"&&t<="9";)y+=t;if(t==="e"||t==="E")for(y+=t,o(),(t==="-"||t==="+")&&(y+=t,o());t>="0"&&t<="9";)y+=t,o();if(g=+y,!isFinite(g))i("Bad number");else return g},l=function(){var g,y,S="",E;if(t==='"')for(;o();){if(t==='"')return o(),S;if(t==="\\")if(o(),t==="u"){for(E=0,y=0;y<4&&(g=parseInt(o(),16),!!isFinite(g));y+=1)E=E*16+g;S+=String.fromCharCode(E)}else if(typeof n[t]=="string")S+=n[t];else break;else S+=t}i("Bad string")},a=function(){for(;t&&t<=" ";)o()},u=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},c,h=function(){var g=[];if(t==="["){if(o("["),a(),t==="]")return o("]"),g;for(;t;){if(g.push(c()),a(),t==="]")return o("]"),g;o(","),a()}}i("Bad array")},d=function(){var g,y={};if(t==="{"){if(o("{"),a(),t==="}")return o("}"),y;for(;t;){if(g=l(),a(),o(":"),Object.hasOwnProperty.call(y,g)&&i('Duplicate key "'+g+'"'),y[g]=c(),a(),t==="}")return o("}"),y;o(","),a()}}i("Bad object")};return c=function(){switch(a(),t){case"{":return d();case"[":return h();case'"':return l();case"-":return s();default:return t>="0"&&t<="9"?s():u()}},function(g){var y;return r=g,e=0,t=" ",y=c(),a(),t&&i("Syntax error"),y}}();f.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,r,i,o,s,l,a,u,c=0,h=0,d="",g=[];if(!e)return e;e=f.utf8Encode(e);do n=e.charCodeAt(c++),r=e.charCodeAt(c++),i=e.charCodeAt(c++),u=n<<16|r<<8|i,o=u>>18&63,s=u>>12&63,l=u>>6&63,a=u&63,g[h++]=t.charAt(o)+t.charAt(s)+t.charAt(l)+t.charAt(a);while(c127&&s<2048?l=String.fromCharCode(s>>6|192,s&63|128):l=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),l!==null&&(r>n&&(t+=e.substring(n,r)),t+=l,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t};f.UUID=function(){var e=function(){var r=1*new Date,i;if(Ee.performance&&Ee.performance.now)i=Ee.performance.now();else for(i=0;r==1*new Date;)i++;return r.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){var r=en,i,o,s=[],l=0;function a(u,c){var h,d=0;for(h=0;h=4&&(l=a(l,s),s=[]);return s.length>0&&(l=a(l,s)),l.toString(16)};return function(){var r=(nl.height*nl.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+r+"-"+e()}}();var Hd=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];f.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t=0}function r(i){if(!de.getElementsByTagName)return[];var o=i.split(" "),s,l,a,u,c,h,d,g,y,S,E=[de];for(h=0;h-1){l=s.split("#"),a=l[0];var m=l[1],p=de.getElementById(m);if(!p||a&&p.nodeName.toLowerCase()!=a)return[];E=[p];continue}if(s.indexOf(".")>-1){l=s.split("."),a=l[0];var _=l[1];for(a||(a="*"),u=[],c=0,d=0;d-1};break;default:O=function(A){return A.getAttribute(R)}}for(E=[],S=0,d=0;d=3?t[2]:""},properties:function(){return f.extend(f.strip_empty_properties({$os:f.info.os(),$browser:f.info.browser(en,zn.vendor,us),$referrer:de.referrer,$referring_domain:f.info.referringDomain(de.referrer),$device:f.info.device(en)}),{$current_url:Ee.location.href,$browser_version:f.info.browserVersion(en,zn.vendor,us),$screen_height:nl.height,$screen_width:nl.width,mp_lib:"web",$lib_version:vn.LIB_VERSION,$insert_id:Fc(),time:f.timestamp()/1e3})},people_properties:function(){return f.extend(f.strip_empty_properties({$os:f.info.os(),$browser:f.info.browser(en,zn.vendor,us)}),{$browser_version:f.info.browserVersion(en,zn.vendor,us)})},mpPageViewProperties:function(){return f.strip_empty_properties({current_page_title:de.title,current_domain:Ee.location.hostname,current_url_path:Ee.location.pathname,current_url_protocol:Ee.location.protocol,current_url_search:Ee.location.search})}};var Fc=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},S1=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,w1=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Qd=function(e){var t=w1,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=S1);var i=e.match(t);return i?i[0]:""},il=null,ol=null;typeof JSON<"u"&&(il=JSON.stringify,ol=JSON.parse);il=il||f.JSONEncode;ol=ol||f.JSONDecode;f.toArray=f.toArray;f.isObject=f.isObject;f.JSONEncode=f.JSONEncode;f.JSONDecode=f.JSONDecode;f.isBlockedUA=f.isBlockedUA;f.isEmptyObject=f.isEmptyObject;f.info=f.info;f.info.device=f.info.device;f.info.browser=f.info.browser;f.info.browserVersion=f.info.browserVersion;f.info.properties=f.info.properties;var xn=function(){};xn.prototype.create_properties=function(){};xn.prototype.event_handler=function(){};xn.prototype.after_track_handler=function(){};xn.prototype.init=function(e){return this.mp=e,this};xn.prototype.track=function(e,t,n,r){var i=this,o=f.dom_query(e);if(o.length===0){ce.error("The DOM query ("+e+") returned 0 elements");return}return f.each(o,function(s){f.register_event(s,this.override_event,function(l){var a={},u=i.create_properties(n,this),c=i.mp.get_config("track_links_timeout");i.event_handler(l,this,a),window.setTimeout(i.track_callback(r,u,a,!0),c),i.mp.track(t,u,i.track_callback(r,u,a))})},this),!0};xn.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}};xn.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=f.extend({},e),n};var yi=function(){this.override_event="click"};f.inherit(yi,xn);yi.prototype.create_properties=function(e,t){var n=yi.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n};yi.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()};yi.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var jl=function(){this.override_event="submit"};f.inherit(jl,xn);jl.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()};jl.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var E1=Lc("lock"),Ym=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Ym.prototype.withLock=function(e,t,n){!n&&typeof t!="function"&&(n=t,t=null);var r=n||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,s=this.pollIntervalMS,l=this.timeoutMS,a=this.storage,u=o+":X",c=o+":Y",h=o+":Z",d=function(p){t&&t(p)},g=function(p){if(new Date().getTime()-i>l){E1.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),a.removeItem(h),a.removeItem(c),E();return}setTimeout(function(){try{p()}catch(_){d(_)}},s*(Math.random()+.1))},y=function(p,_){p()?_():g(function(){y(p,_)})},S=function(){var p=a.getItem(c);if(p&&p!==r)return!1;if(a.setItem(c,r),a.getItem(c)===r)return!0;if(!rl(a,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},E=function(){a.setItem(u,r),y(S,function(){if(a.getItem(u)===r){m();return}g(function(){if(a.getItem(c)!==r){E();return}y(function(){return!a.getItem(h)},m)})})},m=function(){a.setItem(h,"1");try{e()}finally{a.removeItem(h),a.getItem(c)===r&&a.removeItem(c),a.getItem(u)===r&&a.removeItem(u)}};try{if(rl(a,!0))E();else throw new Error("localStorage support check failed")}catch(p){d(p)}};var Wd=Lc("batch"),or=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||f.bind(Wd.error,Wd),this.lock=new Ym(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};or.prototype.enqueue=function(e,t,n){var r={id:Fc(),flushAfter:new Date().getTime()+t*2,payload:e};this.lock.withLock(f.bind(function(){var o;try{var s=this.readFromStorage();s.push(r),o=this.saveToStorage(s),o&&this.memQueue.push(r)}catch{this.reportError("Error enqueueing item",e),o=!1}n&&n(o)},this),f.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid)};or.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var Vd=function(e,t){var n=[];return f.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};or.prototype.removeItemsByID=function(e,t){var n={};f.each(e,function(i){n[i]=!0}),this.memQueue=Vd(this.memQueue,n);var r=f.bind(function(){var i;try{var o=this.readFromStorage();if(o=Vd(o,n),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var s=0;s5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[d]}),h=!1):this.reportError("[dupe] found item with no ID",{item:u}),h&&o.push(c)}s[u.id]=c},this),o.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=f.bind(function(u){this.requestInProgress=!1;try{var c=!1;if(e.unloading)this.queue.updatePayloads(s);else if(f.isObject(u)&&u.error==="timeout"&&new Date().getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(f.isObject(u)&&u.xhr_req&&(u.xhr_req.status>=500||u.xhr_req.status===429||u.error==="timeout")){var h=this.flushInterval*2,d=u.xhr_req.responseHeaders;if(d){var g=d["Retry-After"];g&&(h=parseInt(g,10)*1e3||h)}h=Math.min(x1,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h)}else if(f.isObject(u)&&u.xhr_req&&u.xhr_req.status===413)if(i.length>1){var y=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,y,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),c=!0;else c=!0;c&&(this.queue.removeItemsByID(f.map(i,function(S){return S.id}),f.bind(function(S){S?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),f.each(i,f.bind(function(S){var E=S.id;E?(this.itemIdsSentSuccessfully[E]=this.itemIdsSentSuccessfully[E]||0,this.itemIdsSentSuccessfully[E]++,this.itemIdsSentSuccessfully[E]>5&&this.reportError("[dupe] item ID sent too many times",{item:S,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[E]})):this.reportError("[dupe] found item with no ID while removing",{item:S})},this)))}catch(S){this.reportError("Error handling API response",S),this.resetFlush()}},this),a={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(a.transport="sendBeacon"),co.log("MIXPANEL REQUEST:",o),this.sendRequest(o,a,l)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}};sn.prototype.reportError=function(e,t){if(co.error.apply(co.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){co.error(n)}};var k1="__mp_opt_in_out_";function C1(e,t){Zm(!0,e,t)}function T1(e,t){Zm(!1,e,t)}function R1(e,t){return Jm(e,t)==="1"}function Xm(e,t){if(O1(t))return ce.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=Jm(e,t)==="0";return n&&ce.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function ki(e){return bc(e,function(t){return this.get_config(t)})}function sr(e){return bc(e,function(t){return this._get_config(t)})}function Ci(e){return bc(e,function(t){return this._get_config(t)})}function P1(e,t){t=t||{},Uc(t).remove(jc(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Uc(e){return e=e||{},e.persistenceType==="localStorage"?f.localStorage:f.cookie}function jc(e,t){return t=t||{},(t.persistencePrefix||k1)+e}function Jm(e,t){return Uc(t).get(jc(e,t))}function O1(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Ee,n=t.navigator||{},r=!1;return f.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){f.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function Zm(e,t,n){if(!f.isString(t)||!t.length){ce.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Uc(n).set(jc(t,n),e?1:0,f.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function bc(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");r&&(n=Xm(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:l}))}catch(u){ce.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var Zn="$set",_i="$set_once",$t="$unset",Or="$add",wn="$append",Dr="$union",er="$remove",D1="$delete",ev={set_action:function(e,t){var n={},r={};return f.isObject(e)?f.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Zn]=r,n},unset_action:function(e){var t={},n=[];return f.isArray(e)||(e=[e]),f.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[$t]=n,t},set_once_action:function(e,t){var n={},r={};return f.isObject(e)?f.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[_i]=r,n},union_action:function(e,t){var n={},r={};return f.isObject(e)?f.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=f.isArray(i)?i:[i])},this):r[e]=f.isArray(t)?t:[t],n[Dr]=r,n},append_action:function(e,t){var n={},r={};return f.isObject(e)?f.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[wn]=r,n},remove_action:function(e,t){var n={},r={};return f.isObject(e)?f.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[er]=r,n},delete_action:function(){var e={};return e[D1]="",e}},ve=function(){};f.extend(ve.prototype,ev);ve.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n};ve.prototype.set=Ci(function(e,t,n){var r=this.set_action(e,t);return f.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.set_once=Ci(function(e,t,n){var r=this.set_once_action(e,t);return f.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.unset=Ci(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});ve.prototype.union=Ci(function(e,t,n){f.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});ve.prototype.delete=Ci(function(e){var t=this.delete_action();return this._send_request(t,e)});ve.prototype.remove=Ci(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)});ve.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=f.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)};ve.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};ve.prototype._get_config=function(e){return this._mixpanel.get_config(e)};ve.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};ve.prototype.remove=ve.prototype.remove;ve.prototype.set=ve.prototype.set;ve.prototype.set_once=ve.prototype.set_once;ve.prototype.union=ve.prototype.union;ve.prototype.unset=ve.prototype.unset;ve.prototype.toString=ve.prototype.toString;var Y=function(){};f.extend(Y.prototype,ev);Y.prototype._init=function(e){this._mixpanel=e};Y.prototype.set=sr(function(e,t,n){var r=this.set_action(e,t);return f.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[Zn]=f.extend({},f.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r[Zn]),this._send_request(r,n)});Y.prototype.set_once=sr(function(e,t,n){var r=this.set_once_action(e,t);return f.isObject(e)&&(n=t),this._send_request(r,n)});Y.prototype.unset=sr(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});Y.prototype.increment=sr(function(e,t,n){var r={},i={};return f.isObject(e)?(f.each(e,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){ce.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),n=t):(f.isUndefined(t)&&(t=1),i[e]=t),r[Or]=i,this._send_request(r,n)});Y.prototype.append=sr(function(e,t,n){f.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)});Y.prototype.remove=sr(function(e,t,n){f.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)});Y.prototype.union=sr(function(e,t,n){f.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});Y.prototype.track_charge=sr(function(e,t,n){if(!f.isNumber(e)&&(e=parseFloat(e),isNaN(e))){ce.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",f.extend({$amount:e},t),n)});Y.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};Y.prototype.delete_user=function(){if(!this._identify_called()){ce.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};Y.prototype.toString=function(){return this._mixpanel.toString()+".people"};Y.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=f.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),f.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),f.truncate(o,255))};Y.prototype._get_config=function(e){return this._mixpanel.get_config(e)};Y.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};Y.prototype._enqueue=function(e){Zn in e?this._mixpanel.persistence._add_to_people_queue(Zn,e):_i in e?this._mixpanel.persistence._add_to_people_queue(_i,e):$t in e?this._mixpanel.persistence._add_to_people_queue($t,e):Or in e?this._mixpanel.persistence._add_to_people_queue(Or,e):wn in e?this._mixpanel.persistence._add_to_people_queue(wn,e):er in e?this._mixpanel.persistence._add_to_people_queue(er,e):Dr in e?this._mixpanel.persistence._add_to_people_queue(Dr,e):ce.error("Invalid call to _enqueue():",e)};Y.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=f.extend({},this._mixpanel.persistence._get_queue(e)),s=o;!f.isUndefined(o)&&f.isObject(o)&&!f.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,function(l,a){l===0&&i._mixpanel.persistence._add_to_people_queue(e,o),f.isUndefined(n)||n(l,a)}))};Y.prototype._flush=function(e,t,n,r,i,o,s){var l=this,a=this._mixpanel.persistence._get_queue(wn),u=this._mixpanel.persistence._get_queue(er);if(this._flush_one_queue(Zn,this.set,e),this._flush_one_queue(_i,this.set_once,r),this._flush_one_queue($t,this.unset,o,function(E){return f.keys(E)}),this._flush_one_queue(Or,this.increment,t),this._flush_one_queue(Dr,this.union,i),!f.isUndefined(a)&&f.isArray(a)&&a.length){for(var c,h=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(wn,c),f.isUndefined(n)||n(E,m)},d=a.length-1;d>=0;d--)c=a.pop(),f.isEmptyObject(c)||l.append(c,h);l._mixpanel.persistence.save()}if(!f.isUndefined(u)&&f.isArray(u)&&u.length){for(var g,y=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(er,g),f.isUndefined(s)||s(E,m)},S=u.length-1;S>=0;S--)g=u.pop(),f.isEmptyObject(g)||l.remove(g,y);l._mixpanel.persistence.save()}};Y.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};Y.prototype.set=Y.prototype.set;Y.prototype.set_once=Y.prototype.set_once;Y.prototype.unset=Y.prototype.unset;Y.prototype.increment=Y.prototype.increment;Y.prototype.append=Y.prototype.append;Y.prototype.remove=Y.prototype.remove;Y.prototype.union=Y.prototype.union;Y.prototype.track_charge=Y.prototype.track_charge;Y.prototype.clear_charges=Y.prototype.clear_charges;Y.prototype.delete_user=Y.prototype.delete_user;Y.prototype.toString=Y.prototype.toString;var zc="__mps",Bc="__mpso",$c="__mpus",qc="__mpa",Hc="__mpap",Qc="__mpr",Wc="__mpu",tv="$people_distinct_id",sl="__alias",Ao="__timers",N1=[zc,Bc,$c,qc,Hc,Qc,Wc,tv,sl,Ao],ee=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(ce.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&f.localStorage.is_supported()?this.storage=f.localStorage:this.storage=f.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};ee.prototype.properties=function(){var e={};return f.each(this.props,function(t,n){f.include(N1,n)||(e[n]=t)}),e};ee.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=f.extend({},e))}};ee.prototype.upgrade=function(e){var t=e.upgrade,n,r;t&&(n="mp_super_properties",typeof t=="string"&&(n=t),r=this.storage.parse(n),this.storage.remove(n),this.storage.remove(n,!0),r&&(this.props=f.extend(this.props,r.all,r.events))),!e.cookie_name&&e.name!=="mixpanel"&&(n="mp_"+e.token+"_"+e.name,r=this.storage.parse(n),r&&(this.storage.remove(n),this.storage.remove(n,!0),this.register_once(r))),this.storage===f.localStorage&&(r=f.cookie.parse(this.name),f.cookie.remove(this.name),f.cookie.remove(this.name,!0),r&&this.register_once(r))};ee.prototype.save=function(){this.disabled||this.storage.set(this.name,f.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};ee.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};ee.prototype.clear=function(){this.remove(),this.props={}};ee.prototype.register_once=function(e,t,n){return f.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,f.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1};ee.prototype.register=function(e,t){return f.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,f.extend(this.props,e),this.save(),!0):!1};ee.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())};ee.prototype.update_search_keyword=function(e){this.register(f.info.searchInfo(e))};ee.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:f.info.referringDomain(e)||"$direct"},"")};ee.prototype.get_referrer_info=function(){return f.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};ee.prototype.safe_merge=function(e){return f.each(this.props,function(t,n){n in e||(e[n]=t)}),e};ee.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};ee.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};ee.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};ee.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};ee.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};ee.prototype.get_cross_subdomain=function(){return this.cross_subdomain};ee.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};ee.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(Zn),o=this._get_or_create_queue(_i),s=this._get_or_create_queue($t),l=this._get_or_create_queue(Or),a=this._get_or_create_queue(Dr),u=this._get_or_create_queue(er,[]),c=this._get_or_create_queue(wn,[]);n===zc?(f.extend(i,r),this._pop_from_people_queue(Or,r),this._pop_from_people_queue(Dr,r),this._pop_from_people_queue($t,r)):n===Bc?(f.each(r,function(h,d){d in o||(o[d]=h)}),this._pop_from_people_queue($t,r)):n===$c?f.each(r,function(h){f.each([i,o,l,a],function(d){h in d&&delete d[h]}),f.each(c,function(d){h in d&&delete d[h]}),s[h]=!0}):n===qc?(f.each(r,function(h,d){d in i?i[d]+=h:(d in l||(l[d]=0),l[d]+=h)},this),this._pop_from_people_queue($t,r)):n===Wc?(f.each(r,function(h,d){f.isArray(h)&&(d in a||(a[d]=[]),a[d]=a[d].concat(h))}),this._pop_from_people_queue($t,r)):n===Qc?(u.push(r),this._pop_from_people_queue(wn,r)):n===Hc&&(c.push(r),this._pop_from_people_queue($t,r)),ce.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ce.log(t),this.save()};ee.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);f.isUndefined(n)||(f.each(t,function(r,i){e===wn||e===er?f.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this),this.save())};ee.prototype._get_queue_key=function(e){if(e===Zn)return zc;if(e===_i)return Bc;if(e===$t)return $c;if(e===Or)return qc;if(e===wn)return Hc;if(e===er)return Qc;if(e===Dr)return Wc;ce.error("Invalid queue:",e)};ee.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]};ee.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=f.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)};ee.prototype.set_event_timer=function(e,t){var n=this.props[Ao]||{};n[e]=t,this.props[Ao]=n,this.save()};ee.prototype.remove_event_timer=function(e){var t=this.props[Ao]||{},n=t[e];return f.isUndefined(n)||(delete this.props[Ao][e],this.save()),n};var Vc,Ve,nv=0,A1=1,I1=function(e){return e},Io=function(){},Rt="mixpanel",rv="base64",M1="json",Kc="$device:",ui=Ee.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,iv=!ui&&en.indexOf("MSIE")===-1&&en.indexOf("Mozilla")===-1,ll=null;zn.sendBeacon&&(ll=function(){return zn.sendBeacon.apply(zn,arguments)});var Gd={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:rv,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Io,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Io,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},ov=!1,P=function(){},Ou=function(e,t,n){var r,i=n===Rt?Ve:Ve[n];if(i&&Vc===nv)r=i;else{if(i&&!f.isArray(i)){ce.error("You have already initialized "+n);return}r=new P}if(r._cached_groups={},r._init(e,t,n),r.people=new Y,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=f.info.campaignParams(null),s={},l=!1;f.each(o,function(a,u){s["initial_"+u]=a,a&&(l=!0)}),l&&r.people.set_once(s)}return vn.DEBUG=vn.DEBUG||r.get_config("debug"),!f.isUndefined(i)&&f.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};P.prototype.init=function(e,t,n){if(f.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Rt){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ou(e,t,n);return Ve[n]=r,r._loaded(),r};P.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||Gd.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=M1)}if(this.set_config(f.extend({},Gd,r,t,{name:n,token:e,callback_fn:(n===Rt?n:Rt+"."+n)+"._jsc"})),this._jsc=Io,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!f.localStorage.is_supported(!0)||!ui)this._batch_requests=!1,ce.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.init_batchers(),ll&&Ee.addEventListener){var o=f.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Ee.addEventListener("pagehide",function(l){l.persisted&&o()}),Ee.addEventListener("visibilitychange",function(){de.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new ee(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=f.UUID();this.get_distinct_id()||this.register_once({distinct_id:Kc+s,$device_id:s},""),this.get_config("track_pageview")&&this.track_pageview()};P.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};P.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(de.referrer),this.get_config("store_google")&&this.register(f.info.campaignParams(),{persistent:!1}),this.get_config("save_referrer")&&this.persistence.update_referrer_info(de.referrer)};P.prototype._dom_loaded=function(){f.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||f.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};P.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!ov)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)};P.prototype._prepare_callback=function(e,t){if(f.isUndefined(e))return null;if(ui){var n=function(s){e(s,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],e(s,t)},o}};P.prototype._send_request=function(e,t,n,r){var i=!0;if(iv)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(f.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=f.extend(o,n||{}),ui||(n.method="GET");var l=n.method==="POST",a=ll&&l&&n.transport.toLowerCase()==="sendbeacon",u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),ui||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),l&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+f.HTTPBuildQuery(t);var c=this;if("img"in t){var h=de.createElement("img");h.src=e,de.body.appendChild(h)}else if(a){try{i=ll(e,s)}catch(m){c.report_error(m),i=!1}try{r&&r(i?1:0)}catch(m){c.report_error(m)}}else if(ui)try{var d=new XMLHttpRequest;d.open(n.method,e,!0);var g=this.get_config("xhr_headers");if(l&&(g["Content-Type"]="application/x-www-form-urlencoded"),f.each(g,function(m,p){d.setRequestHeader(p,m)}),n.timeout_ms&&typeof d.timeout<"u"){d.timeout=n.timeout_ms;var y=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(u){var m;try{m=f.JSONDecode(d.responseText)}catch(_){if(c.report_error(_),n.ignore_json_errors)m=d.responseText;else return}r(m)}else r(Number(d.responseText))}else{var p;d.timeout&&!d.status&&new Date().getTime()-y>=d.timeout?p="timeout":p="Bad HTTP status: "+d.status+" "+d.statusText,c.report_error(p),r&&r(u?{status:0,error:p,xhr_req:d}:0)}},d.send(s)}catch(m){c.report_error(m),i=!1}else{var S=de.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var E=de.getElementsByTagName("script")[0];E.parentNode.insertBefore(S,E)}return i};P.prototype._execute_array=function(e){var t,n=[],r=[],i=[];f.each(e,function(s){s&&(t=s[0],f.isArray(t)?i.push(s):typeof s=="function"?s.call(this):f.isArray(s)&&t==="alias"?n.push(s):f.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):r.push(s))},this);var o=function(s,l){f.each(s,function(a){if(f.isArray(a[0])){var u=l;f.each(a,function(c){u=u[c[0]].apply(u,c.slice(1))})}else this[a[0]].apply(this,a.slice(1))},l)};o(n,this),o(r,this),o(i,this)};P.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};P.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=f.bind(function(n){return new sn("__mpq_"+e+n.queue_suffix,{libConfig:this.config,sendRequestFunc:f.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:f.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:f.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()};P.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,f.each(this.request_batchers,function(e){e.start()}))};P.prototype.stop_batch_senders=function(){this._batch_requests=!1,f.each(this.request_batchers,function(e){e.stop(),e.clear()})};P.prototype.push=function(e){this._execute_array([e])};P.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};P.prototype._encode_data_for_request=function(e){var t=f.JSONEncode(e);return this.get_config("api_payload_format")===rv&&(t=f.base64Encode(t)),{data:t}};P.prototype._track_or_batch=function(e,t){var n=f.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Io;var l=!0,a=f.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(ce.log("MIXPANEL REQUEST:"),ce.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n,function(u){u?t(1,n):a()}):l=a(),l&&n};P.prototype.track=ki(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=Io),f.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=t||{},t.token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!f.isUndefined(s)){var l=new Date().getTime()-s;t.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?f.info.marketingParams():{};t=f.extend({},f.info.properties(),a,this.persistence.properties(),this.unpersisted_superprops,t);var u=this.get_config("property_blacklist");f.isArray(u)?f.each(u,function(d){delete t[d]}):this.report_error("Invalid value for property_blacklist config: "+u);var c={event:e,properties:t},h=this._track_or_batch({type:"events",data:c,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h});P.prototype.set_group=ki(function(e,t,n){f.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)});P.prototype.add_group=ki(function(e,t,n){var r=this.get_property(e);if(r===void 0){var i={};i[e]=[t],this.register(i)}else r.indexOf(t)===-1&&(r.push(t),this.register(i));return this.people.union(e,t,n)});P.prototype.remove_group=ki(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)});P.prototype.track_with_groups=ki(function(e,t,n,r){var i=f.extend({},t||{});return f.each(n,function(o,s){o!=null&&(i[s]=o)}),this.track(e,i,r)});P.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};P.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};P.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new ve,r._init(this,e,t),this._cached_groups[n]=r),r};P.prototype.track_pageview=ki(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=f.extend(f.info.mpPageViewProperties(),f.info.campaignParams(),f.info.clickParams()),i=f.extend({},r,e);return this.track(n,i)});P.prototype.track_links=function(){return this._track_dom.call(this,yi,arguments)};P.prototype.track_forms=function(){return this._track_dom.call(this,jl,arguments)};P.prototype.time_event=function(e){if(f.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var L1={persistent:!0},Gc=function(e){var t;return f.isObject(e)?t=e:f.isUndefined(e)?t={}:t={days:e},f.extend({},L1,t)};P.prototype.register=function(e,t){var n=Gc(t);n.persistent?this.persistence.register(e,n.days):f.extend(this.unpersisted_superprops,e)};P.prototype.register_once=function(e,t,n){var r=Gc(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),f.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))};P.prototype.unregister=function(e,t){t=Gc(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};P.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)};P.prototype.identify=function(e,t,n,r,i,o,s,l){var a=this.get_distinct_id();if(e&&a!==e){if(typeof e=="string"&&e.indexOf(Kc)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==a&&e!==this.get_property(sl)&&(this.unregister(sl),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,l),e!==a&&this.track("$identify",{distinct_id:e,$anon_distinct_id:a},{skip_hooks:!0})};P.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=f.UUID();this.register_once({distinct_id:Kc+e,$device_id:e},"")};P.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};P.prototype.alias=function(e,t){if(e===this.get_property(tv))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return f.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(sl,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};P.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};P.prototype.set_config=function(e){if(f.isObject(e)){f.extend(this.config,e);var t=e.batch_size;t&&f.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),vn.DEBUG=vn.DEBUG||this.get_config("debug")}};P.prototype.get_config=function(e){return this.config[e]};P.prototype._run_hook=function(e){var t=(this.config.hooks[e]||I1).apply(this,bn.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};P.prototype.get_property=function(e){return this.persistence.props[e]};P.prototype.toString=function(){var e=this.get_config("name");return e!==Rt&&(e=Rt+"."+e),e};P.prototype._event_is_disabled=function(e){return f.isBlockedUA(en)||this._flags.disable_all_events||f.include(this.__disabled_events,e)};P.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&f.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||f.cookie.get("mp_optout"))&&(f.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};P.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t&&f.each(this.request_batchers,function(n){n.clear()})};P.prototype._gdpr_call_func=function(e,t){return t=f.extend({track:f.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),f.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};P.prototype.opt_in_tracking=function(e){e=f.extend({enable_persistence:!0},e),this._gdpr_call_func(C1,e),this._gdpr_update_persistence(e)};P.prototype.opt_out_tracking=function(e){e=f.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(T1,e),this._gdpr_update_persistence(e)};P.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(R1,e)};P.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Xm,e)};P.prototype.clear_opt_in_out_tracking=function(e){e=f.extend({enable_persistence:!0},e),this._gdpr_call_func(P1,e),this._gdpr_update_persistence(e)};P.prototype.report_error=function(e,t){ce.error.apply(ce.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){ce.error(n)}};P.prototype.init=P.prototype.init;P.prototype.reset=P.prototype.reset;P.prototype.disable=P.prototype.disable;P.prototype.time_event=P.prototype.time_event;P.prototype.track=P.prototype.track;P.prototype.track_links=P.prototype.track_links;P.prototype.track_forms=P.prototype.track_forms;P.prototype.track_pageview=P.prototype.track_pageview;P.prototype.register=P.prototype.register;P.prototype.register_once=P.prototype.register_once;P.prototype.unregister=P.prototype.unregister;P.prototype.identify=P.prototype.identify;P.prototype.alias=P.prototype.alias;P.prototype.name_tag=P.prototype.name_tag;P.prototype.set_config=P.prototype.set_config;P.prototype.get_config=P.prototype.get_config;P.prototype.get_property=P.prototype.get_property;P.prototype.get_distinct_id=P.prototype.get_distinct_id;P.prototype.toString=P.prototype.toString;P.prototype.opt_out_tracking=P.prototype.opt_out_tracking;P.prototype.opt_in_tracking=P.prototype.opt_in_tracking;P.prototype.has_opted_out_tracking=P.prototype.has_opted_out_tracking;P.prototype.has_opted_in_tracking=P.prototype.has_opted_in_tracking;P.prototype.clear_opt_in_out_tracking=P.prototype.clear_opt_in_out_tracking;P.prototype.get_group=P.prototype.get_group;P.prototype.set_group=P.prototype.set_group;P.prototype.add_group=P.prototype.add_group;P.prototype.remove_group=P.prototype.remove_group;P.prototype.track_with_groups=P.prototype.track_with_groups;P.prototype.start_batch_senders=P.prototype.start_batch_senders;P.prototype.stop_batch_senders=P.prototype.stop_batch_senders;ee.prototype.properties=ee.prototype.properties;ee.prototype.update_search_keyword=ee.prototype.update_search_keyword;ee.prototype.update_referrer_info=ee.prototype.update_referrer_info;ee.prototype.get_cross_subdomain=ee.prototype.get_cross_subdomain;ee.prototype.clear=ee.prototype.clear;var ei={},F1=function(){f.each(ei,function(e,t){t!==Rt&&(Ve[t]=e)}),Ve._=f},U1=function(){Ve.init=function(e,t,n){if(n)return Ve[n]||(Ve[n]=ei[n]=Ou(e,t,n),Ve[n]._loaded()),Ve[n];var r=Ve;ei[Rt]?r=ei[Rt]:e&&(r=Ou(e,t,Rt),r._loaded(),ei[Rt]=r),Ve=r,Vc===A1&&(Ee[Rt]=Ve),F1()}},j1=function(){function e(){e.done||(e.done=!0,ov=!0,iv=!1,f.each(ei,function(r){r._dom_loaded()}))}function t(){try{de.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(de.addEventListener)de.readyState==="complete"?e():de.addEventListener("DOMContentLoaded",e,!1);else if(de.attachEvent){de.attachEvent("onreadystatechange",e);var n=!1;try{n=Ee.frameElement===null}catch{}de.documentElement.doScroll&&n&&t()}f.register_event(Ee,"load",e,!0)};function b1(){return Vc=nv,Ve=new P,U1(),Ve.init(),j1(),Ve}var z1=b1(),B1=z1;const sv=al(B1),$1="9b5c61bf2bf4c48916655fe862e8fcbd",q1=$1,lv={OPEN_WEBAPP:"open_webapp",SEND_TRANSACTION:"send_transaction"},av=async e=>{console.info("[mixpanel]",e),await sv.track(e)};sv.init(q1,{loaded:()=>{av(lv.OPEN_WEBAPP)}});const uv="https://jsonplaceholder.typicode.com",H1=()=>z0({queryKey:["currencies"],queryFn:()=>fetch(`${uv}/users`).then(e=>e.json()),onSuccess:e=>{console.log("data",e)},staleTime:60*1e3}),Q1=e=>fetch(`${uv}/posts/1`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-type":"application/json"}});function W1(){Al();const e=Dc(),[t,n]=L.useState(!1),{currencies:r,transaction:i,setTransaction:o,setSuccess:s}=ir(),l=r.find(A=>A.id===i.currency_id),a=(A,F)=>{const Z=i.shares.findIndex(V=>V.person_id===A.person_id&&V.related_user_id===A.related_user_id&&V.is_payer===A.is_payer);if(~Z){const V=[...i.shares];V[Z].amount=F,o({...i,shares:V})}},u=i.shares.filter(A=>A.is_payer).reduce((A,F)=>A+F.amount,0),c=uo(u),h=i.shares.filter(A=>!A.is_payer).reduce((A,F)=>A+F.amount,0),d=uo(h),g=1,y=uh+g,m=i.shares.filter(A=>A.related_user_id&&A.is_payer),p=i.shares.filter(A=>A.related_user_id&&!A.is_payer),_=m.map(A=>A.related_user_id),v=p.map(A=>A.related_user_id),R=_.some(A=>v.includes(A)),D=p.every(A=>A.amount===p[0].amount),T=()=>{const A=Math.round(u/p.length),F=[...i.shares];o({...i,shares:F.map(Z=>Z.is_payer?Z:{...Z,amount:A})})},O=async()=>{var F,Z;const A={...i,is_confirmed:!0};n(!0);try{await av(lv.SEND_TRANSACTION),console.log(JSON.stringify(A,null,2));const V=await Q1(A);console.log("res",V);const qe=await V.json();console.log("res json",qe),V.ok?(s(!0),(Z=(F=window==null?void 0:window.Telegram)==null?void 0:F.WebApp)==null||Z.close()):s(!1)}catch{s(!1)}finally{n(!1)}};return x.jsxs(Ll,{children:[x.jsx(Ml,{onBack:()=>{e("/")}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:"Проверить траты"}),x.jsx(ao,{theme:"text",onClick:()=>{e("/select-currency")},children:l?l.in:"Выберите валюту"})]}),x.jsxs(ai,{className:"!pb-4",children:[x.jsxs("h3",{className:Gn(!S&&"text-error"),children:[y&&"Не хватает",S&&"Всё верно",E&&"Перебор"]}),x.jsxs("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:["Заплатили ",c," ",l==null?void 0:l.symbol,", должны ",d," ",l==null?void 0:l.symbol]})]}),x.jsxs(ai,{children:[x.jsx("h3",{children:"Заплатили"}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!m.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),m.map((A,F)=>x.jsx(bd,{...A,onChange:Z=>{a(A,Z)}},`payer-share-${F}`))]})]}),x.jsxs(ai,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("h3",{children:["За ",R&&x.jsx("span",{children:"себя и за"})," других"]}),!!p.length&&(!D||!S)&&x.jsx(ao,{theme:"text",onClick:T,children:"Поровну"})]}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!p.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),p.map((A,F)=>x.jsx(bd,{...A,onChange:Z=>{a(A,Z)}},`owe-share-${F}`))]}),x.jsx("div",{className:"mt-8 py-2",children:x.jsx(ao,{onClick:O,disabled:!S,isBusy:t,children:"Сохранить"})})]})]})}function Yc(){return x.jsx("div",{className:"h-[1px] -my-[0.5px] mx-4 bg-[#E5E9EB] dark:bg-[#84919A]"})}function V1(){var u;Al();const{users:e,unrelatedUsers:t,selectUser:n,deleteUser:r}=Il(),{selectPersonId:i,transaction:o}=ir(),s=i!==null?e:t,l=i!==null?(u=o.shares.find(c=>c.person_id===i))==null?void 0:u.normalized_name:null,a=l?`Выберите, кто "${l}"`:"Выберите человека";return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between gap-3",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:a}),i!==null&&x.jsx(ao,{theme:"text",onClick:r(i),children:"Удалить"})]}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:s.map((c,h,d)=>x.jsxs(x.Fragment,{children:[x.jsx("button",{className:"w-full px-4 py-2 hover:bg-text/5 active:bg-text/10 transition-all",onClick:n(c),children:x.jsx(Mc,{user:c})}),hi(n),children:[x.jsx("input",{className:"hidden",id:`${e}-${n}`,name:e,checked:r}),x.jsx("div",{className:"p-1.5",children:x.jsx("div",{className:Gn("flex items-center justify-center w-5 h-5 border-2 rounded-full text-hint",r&&"!text-link"),children:x.jsx("div",{className:Gn("w-[10px] h-[10px] rounded-full bg-link opacity-0 transition-all",r&&"!opacity-100")})})}),x.jsx("div",{className:"flex-1",children:t})]})}function G1(){Al();const e=Dc(),{currencies:t,transaction:n,setCurrency:r}=ir(),i=o=>{r(o),e("/check")};return x.jsxs(Ll,{className:"!bg-bg",children:[x.jsx(Ml,{onBack:()=>{history.back()}}),x.jsx("div",{className:"px-4",children:x.jsx("h2",{children:"Выберите валюту"})}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:t.map((o,s)=>x.jsxs("div",{children:[x.jsx(K1,{group:"currencies",label:`${o.symbol} ${o.title}`,value:o.id,checked:(n==null?void 0:n.currency_id)===o.id,onChange:i},`currencies-${o.id}`),sL.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{d:"M8 1C8 0.447715 7.55228 0 7 0C6.44772 0 6 0.447715 6 1V6H1C0.447715 6 0 6.44771 0 7C0 7.55228 0.447715 8 1 8H6V13C6 13.5523 6.44772 14 7 14C7.55228 14 8 13.5523 8 13V8H13C13.5523 8 14 7.55228 14 7C14 6.44772 13.5523 6 13 6H8V1Z",fill:"currentColor"}));/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:cv,setPrototypeOf:Yd,isFrozen:X1,getPrototypeOf:J1,getOwnPropertyDescriptor:Z1}=Object;let{freeze:Ze,seal:Wt,create:eS}=Object,{apply:Du,construct:Nu}=typeof Reflect<"u"&&Reflect;Du||(Du=function(t,n,r){return t.apply(n,r)});Ze||(Ze=function(t){return t});Wt||(Wt=function(t){return t});Nu||(Nu=function(t,n){return new t(...n)});const tS=At(Array.prototype.forEach),Xd=At(Array.prototype.pop),Hi=At(Array.prototype.push),Ts=At(String.prototype.toLowerCase),ya=At(String.prototype.toString),nS=At(String.prototype.match),Ut=At(String.prototype.replace),rS=At(String.prototype.indexOf),iS=At(String.prototype.trim),ht=At(RegExp.prototype.test),Qi=oS(TypeError);function At(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i/gm),cS=Wt(/\${[\w\W]*}/gm),fS=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),dS=Wt(/^aria-[\-\w]+$/),fv=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),hS=Wt(/^(?:\w+script|data):/i),pS=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dv=Wt(/^html$/i);var nh=Object.freeze({__proto__:null,MUSTACHE_EXPR:aS,ERB_EXPR:uS,TMPLIT_EXPR:cS,DATA_ATTR:fS,ARIA_ATTR:dS,IS_ALLOWED_URI:fv,IS_SCRIPT_OR_DATA:hS,ATTR_WHITESPACE:pS,DOCTYPE_NAME:dv});const mS=()=>typeof window>"u"?null:window,vS=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function hv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mS();const t=q=>hv(q);if(t.version="3.0.5",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;const n=e.document,r=n.currentScript;let{document:i}=e;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:g}=e,y=a.prototype,S=cs(y,"cloneNode"),E=cs(y,"nextSibling"),m=cs(y,"childNodes"),p=cs(y,"parentNode");if(typeof s=="function"){const q=i.createElement("template");q.content&&q.content.ownerDocument&&(i=q.content.ownerDocument)}let _,v="";const{implementation:R,createNodeIterator:D,createDocumentFragment:T,getElementsByTagName:O}=i,{importNode:A}=n;let F={};t.isSupported=typeof cv=="function"&&typeof p=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Z,ERB_EXPR:V,TMPLIT_EXPR:qe,DATA_ATTR:kn,ARIA_ATTR:Vt,IS_SCRIPT_OR_DATA:at,ATTR_WHITESPACE:ut}=nh;let{IS_ALLOWED_URI:U}=nh,b=null;const K=J({},[...Jd,..._a,...Sa,...wa,...Zd]);let X=null;const _e=J({},[...eh,...Ea,...th,...fs]);let ae=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),oe=null,ct=null,ft=!0,Kt=!0,It=!1,qo=!0,Cn=!1,Gt=!1,Ti=!1,Ri=!1,Tn=!1,Yt=!1,lr=!1,Ir=!0,ar=!1;const Pi="user-content-";let St=!0,Rn=!1,ln={},an=null;const Ho=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Oi=null;const ur=J({},["audio","video","img","source","image","track"]);let Mr=null;const Lr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fr="http://www.w3.org/1998/Math/MathML",cr="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let un=Mt,Di=!1,k=null;const C=J({},[Fr,cr,Mt],ya);let N;const B=["application/xhtml+xml","text/html"],G="text/html";let $,W=null;const Q=i.createElement("form"),H=function(w){return w instanceof RegExp||w instanceof Function},se=function(w){if(!(W&&W===w)){if((!w||typeof w!="object")&&(w={}),w=jr(w),N=B.indexOf(w.PARSER_MEDIA_TYPE)===-1?N=G:N=w.PARSER_MEDIA_TYPE,$=N==="application/xhtml+xml"?ya:Ts,b="ALLOWED_TAGS"in w?J({},w.ALLOWED_TAGS,$):K,X="ALLOWED_ATTR"in w?J({},w.ALLOWED_ATTR,$):_e,k="ALLOWED_NAMESPACES"in w?J({},w.ALLOWED_NAMESPACES,ya):C,Mr="ADD_URI_SAFE_ATTR"in w?J(jr(Lr),w.ADD_URI_SAFE_ATTR,$):Lr,Oi="ADD_DATA_URI_TAGS"in w?J(jr(ur),w.ADD_DATA_URI_TAGS,$):ur,an="FORBID_CONTENTS"in w?J({},w.FORBID_CONTENTS,$):Ho,oe="FORBID_TAGS"in w?J({},w.FORBID_TAGS,$):{},ct="FORBID_ATTR"in w?J({},w.FORBID_ATTR,$):{},ln="USE_PROFILES"in w?w.USE_PROFILES:!1,ft=w.ALLOW_ARIA_ATTR!==!1,Kt=w.ALLOW_DATA_ATTR!==!1,It=w.ALLOW_UNKNOWN_PROTOCOLS||!1,qo=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Cn=w.SAFE_FOR_TEMPLATES||!1,Gt=w.WHOLE_DOCUMENT||!1,Tn=w.RETURN_DOM||!1,Yt=w.RETURN_DOM_FRAGMENT||!1,lr=w.RETURN_TRUSTED_TYPE||!1,Ri=w.FORCE_BODY||!1,Ir=w.SANITIZE_DOM!==!1,ar=w.SANITIZE_NAMED_PROPS||!1,St=w.KEEP_CONTENT!==!1,Rn=w.IN_PLACE||!1,U=w.ALLOWED_URI_REGEXP||fv,un=w.NAMESPACE||Mt,ae=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ae.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ae.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ae.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Cn&&(Kt=!1),Yt&&(Tn=!0),ln&&(b=J({},[...Zd]),X=[],ln.html===!0&&(J(b,Jd),J(X,eh)),ln.svg===!0&&(J(b,_a),J(X,Ea),J(X,fs)),ln.svgFilters===!0&&(J(b,Sa),J(X,Ea),J(X,fs)),ln.mathMl===!0&&(J(b,wa),J(X,th),J(X,fs))),w.ADD_TAGS&&(b===K&&(b=jr(b)),J(b,w.ADD_TAGS,$)),w.ADD_ATTR&&(X===_e&&(X=jr(X)),J(X,w.ADD_ATTR,$)),w.ADD_URI_SAFE_ATTR&&J(Mr,w.ADD_URI_SAFE_ATTR,$),w.FORBID_CONTENTS&&(an===Ho&&(an=jr(an)),J(an,w.FORBID_CONTENTS,$)),St&&(b["#text"]=!0),Gt&&J(b,["html","head","body"]),b.table&&(J(b,["tbody"]),delete oe.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,v=_.createHTML("")}else _===void 0&&(_=vS(g,r)),_!==null&&typeof v=="string"&&(v=_.createHTML(""));Ze&&Ze(w),W=w}},re=J({},["mi","mo","mn","ms","mtext"]),He=J({},["foreignobject","desc","title","annotation-xml"]),Re=J({},["title","style","font","a","script"]),Ae=J({},_a);J(Ae,Sa),J(Ae,sS);const nt=J({},wa);J(nt,lS);const fr=function(w){let I=p(w);(!I||!I.tagName)&&(I={namespaceURI:un,tagName:"template"});const j=Ts(w.tagName),ue=Ts(I.tagName);return k[w.namespaceURI]?w.namespaceURI===cr?I.namespaceURI===Mt?j==="svg":I.namespaceURI===Fr?j==="svg"&&(ue==="annotation-xml"||re[ue]):!!Ae[j]:w.namespaceURI===Fr?I.namespaceURI===Mt?j==="math":I.namespaceURI===cr?j==="math"&&He[ue]:!!nt[j]:w.namespaceURI===Mt?I.namespaceURI===cr&&!He[ue]||I.namespaceURI===Fr&&!re[ue]?!1:!nt[j]&&(Re[j]||!Ae[j]):!!(N==="application/xhtml+xml"&&k[w.namespaceURI]):!1},Lt=function(w){Hi(t.removed,{element:w});try{w.parentNode.removeChild(w)}catch{w.remove()}},Pn=function(w,I){try{Hi(t.removed,{attribute:I.getAttributeNode(w),from:I})}catch{Hi(t.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is"&&!X[w])if(Tn||Yt)try{Lt(I)}catch{}else try{I.setAttribute(w,"")}catch{}},wt=function(w){let I,j;if(Ri)w=""+w;else{const Et=nS(w,/^[\r\n\t ]+/);j=Et&&Et[0]}N==="application/xhtml+xml"&&un===Mt&&(w=''+w+"");const ue=_?_.createHTML(w):w;if(un===Mt)try{I=new d().parseFromString(ue,N)}catch{}if(!I||!I.documentElement){I=R.createDocument(un,"template",null);try{I.documentElement.innerHTML=Di?v:ue}catch{}}const Ue=I.body||I.documentElement;return w&&j&&Ue.insertBefore(i.createTextNode(j),Ue.childNodes[0]||null),un===Mt?O.call(I,Gt?"html":"body")[0]:Gt?I.documentElement:Ue},dr=function(w){return D.call(w.ownerDocument||w,w,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Ni=function(w){return w instanceof h&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof c)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},On=function(w){return typeof l=="object"?w instanceof l:w&&typeof w=="object"&&typeof w.nodeType=="number"&&typeof w.nodeName=="string"},dt=function(w,I,j){F[w]&&tS(F[w],ue=>{ue.call(t,I,j,W)})},hr=function(w){let I;if(dt("beforeSanitizeElements",w,null),Ni(w))return Lt(w),!0;const j=$(w.nodeName);if(dt("uponSanitizeElement",w,{tagName:j,allowedTags:b}),w.hasChildNodes()&&!On(w.firstElementChild)&&(!On(w.content)||!On(w.content.firstElementChild))&&ht(/<[/\w]/g,w.innerHTML)&&ht(/<[/\w]/g,w.textContent))return Lt(w),!0;if(!b[j]||oe[j]){if(!oe[j]&&Ye(j)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j)))return!1;if(St&&!an[j]){const ue=p(w)||w.parentNode,Ue=m(w)||w.childNodes;if(Ue&&ue){const Et=Ue.length;for(let Se=Et-1;Se>=0;--Se)ue.insertBefore(S(Ue[Se],!0),E(w))}}return Lt(w),!0}return w instanceof a&&!fr(w)||(j==="noscript"||j==="noembed"||j==="noframes")&&ht(/<\/no(script|embed|frames)/i,w.innerHTML)?(Lt(w),!0):(Cn&&w.nodeType===3&&(I=w.textContent,I=Ut(I,Z," "),I=Ut(I,V," "),I=Ut(I,qe," "),w.textContent!==I&&(Hi(t.removed,{element:w.cloneNode()}),w.textContent=I)),dt("afterSanitizeElements",w,null),!1)},fe=function(w,I,j){if(Ir&&(I==="id"||I==="name")&&(j in i||j in Q))return!1;if(!(Kt&&!ct[I]&&ht(kn,I))){if(!(ft&&ht(Vt,I))){if(!X[I]||ct[I]){if(!(Ye(w)&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,w)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(w))&&(ae.attributeNameCheck instanceof RegExp&&ht(ae.attributeNameCheck,I)||ae.attributeNameCheck instanceof Function&&ae.attributeNameCheck(I))||I==="is"&&ae.allowCustomizedBuiltInElements&&(ae.tagNameCheck instanceof RegExp&&ht(ae.tagNameCheck,j)||ae.tagNameCheck instanceof Function&&ae.tagNameCheck(j))))return!1}else if(!Mr[I]){if(!ht(U,Ut(j,ut,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&rS(j,"data:")===0&&Oi[w])){if(!(It&&!ht(at,Ut(j,ut,"")))){if(j)return!1}}}}}}return!0},Ye=function(w){return w.indexOf("-")>0},cn=function(w){let I,j,ue,Ue;dt("beforeSanitizeAttributes",w,null);const{attributes:Et}=w;if(!Et)return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X};for(Ue=Et.length;Ue--;){I=Et[Ue];const{name:Xt,namespaceURI:bl}=I;if(j=Xt==="value"?I.value:iS(I.value),ue=$(Xt),Se.attrName=ue,Se.attrValue=j,Se.keepAttr=!0,Se.forceKeepAttr=void 0,dt("uponSanitizeAttribute",w,Se),j=Se.attrValue,Se.forceKeepAttr||(Pn(Xt,w),!Se.keepAttr))continue;if(!qo&&ht(/\/>/i,j)){Pn(Xt,w);continue}Cn&&(j=Ut(j,Z," "),j=Ut(j,V," "),j=Ut(j,qe," "));const Xc=$(w.nodeName);if(fe(Xc,ue,j)){if(ar&&(ue==="id"||ue==="name")&&(Pn(Xt,w),j=Pi+j),_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!bl)switch(g.getAttributeType(Xc,ue)){case"TrustedHTML":{j=_.createHTML(j);break}case"TrustedScriptURL":{j=_.createScriptURL(j);break}}try{bl?w.setAttributeNS(bl,Xt,j):w.setAttribute(Xt,j),Xd(t.removed)}catch{}}}dt("afterSanitizeAttributes",w,null)},Ie=function q(w){let I;const j=dr(w);for(dt("beforeSanitizeShadowDOM",w,null);I=j.nextNode();)dt("uponSanitizeShadowNode",I,null),!hr(I)&&(I.content instanceof o&&q(I.content),cn(I));dt("afterSanitizeShadowDOM",w,null)};return t.sanitize=function(q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I,j,ue,Ue;if(Di=!q,Di&&(q=""),typeof q!="string"&&!On(q))if(typeof q.toString=="function"){if(q=q.toString(),typeof q!="string")throw Qi("dirty is not a string, aborting")}else throw Qi("toString is not a function");if(!t.isSupported)return q;if(Ti||se(w),t.removed=[],typeof q=="string"&&(Rn=!1),Rn){if(q.nodeName){const Xt=$(q.nodeName);if(!b[Xt]||oe[Xt])throw Qi("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof l)I=wt(""),j=I.ownerDocument.importNode(q,!0),j.nodeType===1&&j.nodeName==="BODY"||j.nodeName==="HTML"?I=j:I.appendChild(j);else{if(!Tn&&!Cn&&!Gt&&q.indexOf("<")===-1)return _&&lr?_.createHTML(q):q;if(I=wt(q),!I)return Tn?null:lr?v:""}I&&Ri&&Lt(I.firstChild);const Et=dr(Rn?q:I);for(;ue=Et.nextNode();)hr(ue)||(ue.content instanceof o&&Ie(ue.content),cn(ue));if(Rn)return q;if(Tn){if(Yt)for(Ue=T.call(I.ownerDocument);I.firstChild;)Ue.appendChild(I.firstChild);else Ue=I;return(X.shadowroot||X.shadowrootmode)&&(Ue=A.call(n,Ue,!0)),Ue}let Se=Gt?I.outerHTML:I.innerHTML;return Gt&&b["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&ht(dv,I.ownerDocument.doctype.name)&&(Se=" +`+Se),Cn&&(Se=Ut(Se,Z," "),Se=Ut(Se,V," "),Se=Ut(Se,qe," ")),_&&lr?_.createHTML(Se):Se},t.setConfig=function(q){se(q),Ti=!0},t.clearConfig=function(){W=null,Ti=!1},t.isValidAttribute=function(q,w,I){W||se({});const j=$(q),ue=$(w);return fe(j,ue,I)},t.addHook=function(q,w){typeof w=="function"&&(F[q]=F[q]||[],Hi(F[q],w))},t.removeHook=function(q){if(F[q])return Xd(F[q])},t.removeHooks=function(q){F[q]&&(F[q]=[])},t.removeAllHooks=function(){F={}},t}var gS=hv();const yS=({string:e,allowedTags:t})=>{const n=gS.sanitize(e,{ALLOWED_TAGS:t});return x.jsx("span",{dangerouslySetInnerHTML:{__html:n}})},_S=e=>L.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},L.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 6.29289C9.68342 5.90237 10.3166 5.90237 10.7071 6.29289L15.7071 11.2929C16.0976 11.6834 16.0976 12.3166 15.7071 12.7071L10.7071 17.7071C10.3166 18.0976 9.68342 18.0976 9.29289 17.7071C8.90237 17.3166 8.90237 16.6834 9.29289 16.2929L13.5858 12L9.29289 7.70711C8.90237 7.31658 8.90237 6.68342 9.29289 6.29289Z",fill:"currentColor"}));function SS({normalized_name:e,related_user_id:t,onClick:n}){const{getUserById:r}=Il(),i=t?r(t):void 0;return x.jsxs("button",{className:"w-full flex gap-3 text-left items-center px-4 py-2.5 truncate hover:bg-text/5 active:bg-text/10 transition-all",onClick:n,children:[x.jsx("div",{className:"flex w-[35%] truncate",children:e?x.jsx("div",{className:"truncate",children:e==="MESSAGE_AUTHOR"?x.jsx("span",{className:"font-semibold",children:"Вы"}):x.jsx("span",{children:e})}):x.jsx("div",{className:"truncate opacity-30",children:"(доп.)"})}),x.jsx("div",{className:"flex w-[55%] truncate",children:x.jsx(Mc,{user:i})}),x.jsx("div",{className:"h-6 w-6 text-hint opacity-50",children:x.jsx(_S,{})})]})}function xa(){Al();const e=Dc(),{transaction:t,setSelectPersonId:n}=ir(),{unrelatedUsers:r,isRelationsComplete:i}=Il(),o=t.shares.reduce((u,c)=>u.map(d=>d.person_id).includes(c.person_id)?u:[...u,c],[]),s=u=>{n(u),e("/select-user")},l=()=>{n(null),e("/select-user")},a=()=>{alert("close webapp...")};return x.jsxs(Ll,{children:[x.jsx(Ml,{onCancel:a}),x.jsxs(ai,{children:[x.jsx("div",{className:"text-[12px] leading-[1.33em] font-medium text-hint",children:"Сообщение"}),x.jsxs("div",{className:"mt-1",children:[!!t.is_voice&&x.jsx("span",{children:"🎙 "}),t.formatted_text?x.jsx(yS,{allowedTags:["b","strong"],string:t.formatted_text}):x.jsx("strong",{children:t.raw_text})]})]}),x.jsxs(ai,{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Соотнесите людей"}),x.jsx("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:"Со временем мы запомним соотношения"}),x.jsx("div",{className:"mt-2 -mx-4 overflow-y-auto",children:o.map((u,c)=>x.jsxs("div",{children:[x.jsx(SS,{...u,onClick:()=>s(u.person_id)},`UserRelation-${c}`),c{e("/check")},children:"Далее"})})]})]})}function wS(){const{isLoading:e,error:t}=H1(),n=e,r=t,{isSuccess:i}=ir(),o=n||r||i;return x.jsx("div",{className:Gn("fixed top-0 left-0 w-full h-full overflow-y-auto bg-bg2 transition-all",o?"opacity-100":"pointer-events-none opacity-0"),children:x.jsxs("div",{className:"flex items-center justify-center w-full min-h-full",children:[n&&x.jsx(Km,{size:50}),!!r&&x.jsxs("div",{className:"p-4 text-center text-[#c00]",children:["Ошибка: ",r.message]}),!!i&&x.jsx("div",{className:"p-4 text-center text-button text-[24px]",children:"Успешно!"}),i===!1&&x.jsx("div",{className:"p-4 text-center text-[#c00] text-[24px]",children:"Ошибка сохранения"})]})})}const ES=new f0;function xS(){const{isDarkTheme:e}=Vm(),t=K_([{path:"/",element:x.jsx(xa,{}),errorElement:x.jsx(xa,{})},{path:"*",element:x.jsx(xa,{})},{path:"/select-user",element:x.jsx(V1,{})},{path:"/check",element:x.jsx(W1,{})},{path:"/select-currency",element:x.jsx(G1,{})}]);return x.jsx(T0,{client:ES,children:x.jsxs("div",{className:Gn(e?"theme-dark":"theme-light"),children:[x.jsx(H_,{router:t}),x.jsx(wS,{})]})})}ka.createRoot(document.getElementById("root")).render(x.jsx(dh.StrictMode,{children:x.jsx(xS,{})})); diff --git a/assets/index-777086c7.js b/assets/index-777086c7.js deleted file mode 100644 index 690162a..0000000 --- a/assets/index-777086c7.js +++ /dev/null @@ -1,95 +0,0 @@ -function hv(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(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 o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function ll(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var th={exports:{}},al={},nh={exports:{}},ee={};/** - * @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 Io=Symbol.for("react.element"),pv=Symbol.for("react.portal"),mv=Symbol.for("react.fragment"),vv=Symbol.for("react.strict_mode"),gv=Symbol.for("react.profiler"),yv=Symbol.for("react.provider"),_v=Symbol.for("react.context"),Sv=Symbol.for("react.forward_ref"),wv=Symbol.for("react.suspense"),Ev=Symbol.for("react.memo"),xv=Symbol.for("react.lazy"),Gc=Symbol.iterator;function kv(e){return e===null||typeof e!="object"?null:(e=Gc&&e[Gc]||e["@@iterator"],typeof e=="function"?e:null)}var rh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ih=Object.assign,oh={};function Si(e,t,n){this.props=e,this.context=t,this.refs=oh,this.updater=n||rh}Si.prototype.isReactComponent={};Si.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")};Si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function sh(){}sh.prototype=Si.prototype;function Du(e,t,n){this.props=e,this.context=t,this.refs=oh,this.updater=n||rh}var Nu=Du.prototype=new sh;Nu.constructor=Du;ih(Nu,Si.prototype);Nu.isPureReactComponent=!0;var Yc=Array.isArray,lh=Object.prototype.hasOwnProperty,Au={current:null},ah={key:!0,ref:!0,__self:!0,__source:!0};function uh(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)lh.call(t,r)&&!ah.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,_e=L[Y];if(0>>1;Yi(ct,V))ft<_e&&0>i(Kt,ct)?(L[Y]=Kt,L[ft]=V,Y=ft):(L[Y]=ct,L[ie]=V,Y=ie);else if(ft<_e&&0>i(Kt,V))L[Y]=Kt,L[ft]=V,Y=ft;else break e}}return j}function i(L,j){var V=L.sortIndex-j.sortIndex;return V!==0?V:L.id-j.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],f=1,h=null,d=3,g=!1,y=!1,S=!1,E=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(L){for(var j=n(u);j!==null;){if(j.callback===null)r(u);else if(j.startTime<=L)r(u),j.sortIndex=j.expirationTime,t(a,j);else break;j=n(u)}}function v(L){if(S=!1,_(L),!y)if(n(a)!==null)y=!0,at(P);else{var j=n(u);j!==null&&ut(v,j.startTime-L)}}function P(L,j){y=!1,S&&(S=!1,m(O),O=-1),g=!0;var V=d;try{for(_(j),h=n(a);h!==null&&(!(h.expirationTime>j)||L&&!he());){var Y=h.callback;if(typeof Y=="function"){h.callback=null,d=h.priorityLevel;var _e=Y(h.expirationTime<=j);j=e.unstable_now(),typeof _e=="function"?h.callback=_e:h===n(a)&&r(a),_(j)}else r(a);h=n(a)}if(h!==null)var le=!0;else{var ie=n(u);ie!==null&&ut(v,ie.startTime-j),le=!1}return le}finally{h=null,d=V,g=!1}}var k=!1,T=null,O=-1,U=5,B=-1;function he(){return!(e.unstable_now()-BL||125Y?(L.sortIndex=V,t(u,L),n(a)===null&&L===n(u)&&(S?(m(O),O=-1):S=!0,ut(v,V-Y))):(L.sortIndex=_e,t(a,L),y||g||(y=!0,at(P))),L},e.unstable_shouldYield=he,e.unstable_wrapCallback=function(L){var j=d;return function(){var V=d;d=j;try{return L.apply(this,arguments)}finally{d=V}}}})(ph);hh.exports=ph;var Uv=hh.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var mh=M,gt=Uv;function I(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"),xa=Object.prototype.hasOwnProperty,Fv=/^[: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]*$/,Jc={},Zc={};function jv(e){return xa.call(Zc,e)?!0:xa.call(Jc,e)?!1:Fv.test(e)?Zc[e]=!0:(Jc[e]=!0,!1)}function bv(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 zv(e,t,n,r){if(t===null||typeof t>"u"||bv(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 et(e,t,n,r,i,o,s){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=o,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new et(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){$e[e]=new et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new et(e,5,!1,e.toLowerCase(),null,!1,!1)});var Mu=/[\-:]([a-z])/g;function Lu(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(Mu,Lu);$e[t]=new et(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(Mu,Lu);$e[t]=new et(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(Mu,Lu);$e[t]=new et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new et(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Uu(e,t,n,r){var i=$e.hasOwnProperty(t)?$e[t]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var a=` -`+i[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{zl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Wi(e):""}function Bv(e){switch(e.tag){case 5:return Wi(e.type);case 16:return Wi("Lazy");case 13:return Wi("Suspense");case 19:return Wi("SuspenseList");case 0:case 2:case 15:return e=Bl(e.type,!1),e;case 11:return e=Bl(e.type.render,!1),e;case 1:return e=Bl(e.type,!0),e;default:return""}}function Ra(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 zr:return"Fragment";case br:return"Portal";case ka:return"Profiler";case Fu:return"StrictMode";case Ca:return"Suspense";case Ta:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case yh:return(e.displayName||"Context")+".Consumer";case gh:return(e._context.displayName||"Context")+".Provider";case ju:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case bu:return t=e.displayName||null,t!==null?t:Ra(e.type)||"Memo";case Nn:t=e._payload,e=e._init;try{return Ra(e(t))}catch{}}return null}function $v(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 Ra(t);case 8:return t===Fu?"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 Xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sh(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qv(e){var t=Sh(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,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wo(e){e._valueTracker||(e._valueTracker=qv(e))}function wh(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Sh(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ts(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 Oa(e,t){var n=t.checked;return ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function tf(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xn(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 Eh(e,t){t=t.checked,t!=null&&Uu(e,"checked",t,!1)}function Pa(e,t){Eh(e,t);var n=Xn(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")?Da(e,t.type,n):t.hasOwnProperty("defaultValue")&&Da(e,t.type,Xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nf(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 Da(e,t,n){(t!=="number"||Ts(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Vi=Array.isArray;function ti(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Vo.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xi={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},Hv=["Webkit","ms","Moz","O"];Object.keys(Xi).forEach(function(e){Hv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Xi[t]=Xi[e]})});function Th(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Xi.hasOwnProperty(e)&&Xi[e]?(""+t).trim():t+"px"}function Rh(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Th(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Qv=ke({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 Ia(e,t){if(t){if(Qv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(I(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(I(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(I(61))}if(t.style!=null&&typeof t.style!="object")throw Error(I(62))}}function Ma(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 La=null;function zu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ua=null,ni=null,ri=null;function sf(e){if(e=Uo(e)){if(typeof Ua!="function")throw Error(I(280));var t=e.stateNode;t&&(t=hl(t),Ua(e.stateNode,e.type,t))}}function Oh(e){ni?ri?ri.push(e):ri=[e]:ni=e}function Ph(){if(ni){var e=ni,t=ri;if(ri=ni=null,sf(e),t)for(e=0;e>>=0,e===0?32:31-(ng(e)/rg|0)|0}var Ko=64,Go=4194304;function Ki(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 Ds(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=Ki(l):(o&=s,o!==0&&(r=Ki(o)))}else s=n&~i,s!==0?r=Ki(s):o!==0&&(r=Ki(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Mo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qt(t),e[t]=n}function lg(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=Zi),mf=String.fromCharCode(32),vf=!1;function Gh(e,t){switch(e){case"keyup":return Lg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Br=!1;function Fg(e,t){switch(e){case"compositionend":return Yh(t);case"keypress":return t.which!==32?null:(vf=!0,mf);case"textInput":return e=t.data,e===mf&&vf?null:e;default:return null}}function jg(e,t){if(Br)return e==="compositionend"||!Ku&&Gh(e,t)?(e=Vh(),ps=Qu=Un=null,Br=!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=Sf(n)}}function ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function tp(){for(var e=window,t=Ts();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ts(e.document)}return t}function Gu(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 Vg(e){var t=tp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ep(n.ownerDocument.documentElement,n)){if(r!==null&&Gu(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,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=wf(n,o);var s=wf(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,$r=null,$a=null,to=null,qa=!1;function Ef(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qa||$r==null||$r!==Ts(r)||(r=$r,"selectionStart"in r&&Gu(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}),to&&yo(to,r)||(to=r,r=Is($a,"onSelect"),0Qr||(e.current=Ga[Qr],Ga[Qr]=null,Qr--)}function de(e,t){Qr++,Ga[Qr]=e.current,e.current=t}var Jn={},Ke=nr(Jn),ot=nr(!1),Er=Jn;function fi(e,t){var n=e.type.contextTypes;if(!n)return Jn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function st(e){return e=e.childContextTypes,e!=null}function Ls(){me(ot),me(Ke)}function Pf(e,t,n){if(Ke.current!==Jn)throw Error(I(168));de(Ke,t),de(ot,n)}function cp(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(I(108,$v(e)||"Unknown",i));return ke({},n,r)}function Us(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jn,Er=Ke.current,de(Ke,e),de(ot,ot.current),!0}function Df(e,t,n){var r=e.stateNode;if(!r)throw Error(I(169));n?(e=cp(e,t,Er),r.__reactInternalMemoizedMergedChildContext=e,me(ot),me(Ke),de(Ke,e)):me(ot),de(ot,n)}var dn=null,pl=!1,ta=!1;function fp(e){dn===null?dn=[e]:dn.push(e)}function oy(e){pl=!0,fp(e)}function rr(){if(!ta&&dn!==null){ta=!0;var e=0,t=se;try{var n=dn;for(se=1;e>=s,i-=s,hn=1<<32-qt(t)+i|n<O?(U=T,T=null):U=T.sibling;var B=d(m,T,_[O],v);if(B===null){T===null&&(T=U);break}e&&T&&B.alternate===null&&t(m,T),p=o(B,p,O),k===null?P=B:k.sibling=B,k=B,T=U}if(O===_.length)return n(m,T),ye&&hr(m,O),P;if(T===null){for(;O<_.length;O++)T=h(m,_[O],v),T!==null&&(p=o(T,p,O),k===null?P=T:k.sibling=T,k=T);return ye&&hr(m,O),P}for(T=r(m,T);O<_.length;O++)U=g(T,m,O,_[O],v),U!==null&&(e&&U.alternate!==null&&T.delete(U.key===null?O:U.key),p=o(U,p,O),k===null?P=U:k.sibling=U,k=U);return e&&T.forEach(function(he){return t(m,he)}),ye&&hr(m,O),P}function S(m,p,_,v){var P=Ai(_);if(typeof P!="function")throw Error(I(150));if(_=P.call(_),_==null)throw Error(I(151));for(var k=P=null,T=p,O=p=0,U=null,B=_.next();T!==null&&!B.done;O++,B=_.next()){T.index>O?(U=T,T=null):U=T.sibling;var he=d(m,T,B.value,v);if(he===null){T===null&&(T=U);break}e&&T&&he.alternate===null&&t(m,T),p=o(he,p,O),k===null?P=he:k.sibling=he,k=he,T=U}if(B.done)return n(m,T),ye&&hr(m,O),P;if(T===null){for(;!B.done;O++,B=_.next())B=h(m,B.value,v),B!==null&&(p=o(B,p,O),k===null?P=B:k.sibling=B,k=B);return ye&&hr(m,O),P}for(T=r(m,T);!B.done;O++,B=_.next())B=g(T,m,O,B.value,v),B!==null&&(e&&B.alternate!==null&&T.delete(B.key===null?O:B.key),p=o(B,p,O),k===null?P=B:k.sibling=B,k=B);return e&&T.forEach(function(ne){return t(m,ne)}),ye&&hr(m,O),P}function E(m,p,_,v){if(typeof _=="object"&&_!==null&&_.type===zr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case Qo:e:{for(var P=_.key,k=p;k!==null;){if(k.key===P){if(P=_.type,P===zr){if(k.tag===7){n(m,k.sibling),p=i(k,_.props.children),p.return=m,m=p;break e}}else if(k.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Nn&&Ff(P)===k.type){n(m,k.sibling),p=i(k,_.props),p.ref=Fi(m,k,_),p.return=m,m=p;break e}n(m,k);break}else t(m,k);k=k.sibling}_.type===zr?(p=wr(_.props.children,m.mode,v,_.key),p.return=m,m=p):(v=Es(_.type,_.key,_.props,null,m.mode,v),v.ref=Fi(m,p,_),v.return=m,m=v)}return s(m);case br:e:{for(k=_.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===_.containerInfo&&p.stateNode.implementation===_.implementation){n(m,p.sibling),p=i(p,_.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=ua(_,m.mode,v),p.return=m,m=p}return s(m);case Nn:return k=_._init,E(m,p,k(_._payload),v)}if(Vi(_))return y(m,p,_,v);if(Ai(_))return S(m,p,_,v);ns(m,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,_),p.return=m,m=p):(n(m,p),p=aa(_,m.mode,v),p.return=m,m=p),s(m)):n(m,p)}return E}var hi=_p(!0),Sp=_p(!1),Fo={},rn=nr(Fo),Eo=nr(Fo),xo=nr(Fo);function gr(e){if(e===Fo)throw Error(I(174));return e}function ic(e,t){switch(de(xo,t),de(Eo,e),de(rn,Fo),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Aa(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Aa(t,e)}me(rn),de(rn,t)}function pi(){me(rn),me(Eo),me(xo)}function wp(e){gr(xo.current);var t=gr(rn.current),n=Aa(t,e.type);t!==n&&(de(Eo,e),de(rn,n))}function oc(e){Eo.current===e&&(me(rn),me(Eo))}var we=nr(0);function $s(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var na=[];function sc(){for(var e=0;en?n:4,e(!0);var r=ra.transition;ra.transition={};try{e(!1),t()}finally{se=n,ra.transition=r}}function Fp(){return Nt().memoizedState}function uy(e,t,n){var r=Vn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},jp(e))bp(t,n);else if(n=mp(e,t,n,r),n!==null){var i=Xe();Ht(n,e,r,i),zp(n,t,r)}}function cy(e,t,n){var r=Vn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(jp(e))bp(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Qt(l,s)){var a=t.interleaved;a===null?(i.next=i,nc(t)):(i.next=a.next,a.next=i),t.interleaved=i;return}}catch{}finally{}n=mp(e,t,i,r),n!==null&&(i=Xe(),Ht(n,e,r,i),zp(n,t,r))}}function jp(e){var t=e.alternate;return e===xe||t!==null&&t===xe}function bp(e,t){no=qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zp(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$u(e,n)}}var Hs={readContext:Dt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},fy={readContext:Dt,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:bf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ys(4194308,4,Ap.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ys(4194308,4,e,t)},useInsertionEffect:function(e,t){return ys(4,2,e,t)},useMemo:function(e,t){var n=Zt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Zt();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=uy.bind(null,xe,e),[r.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:jf,useDebugValue:fc,useDeferredValue:function(e){return Zt().memoizedState=e},useTransition:function(){var e=jf(!1),t=e[0];return e=ay.bind(null,e[1]),Zt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=xe,i=Zt();if(ye){if(n===void 0)throw Error(I(407));n=n()}else{if(n=t(),be===null)throw Error(I(349));kr&30||kp(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,bf(Tp.bind(null,r,o,e),[e]),r.flags|=2048,To(9,Cp.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Zt(),t=be.identifierPrefix;if(ye){var n=pn,r=hn;n=(r&~(1<<32-qt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ko++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[tn]=t,e[wo]=r,Gp(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ma(n,r),n){case"dialog":pe("cancel",e),pe("close",e),i=r;break;case"iframe":case"object":case"embed":pe("load",e),i=r;break;case"video":case"audio":for(i=0;ivi&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304)}else{if(!r)if(e=$s(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ji(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ye)return Qe(t),null}else 2*Te()-o.renderingStartTime>vi&&n!==1073741824&&(t.flags|=128,r=!0,ji(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Te(),t.sibling=null,n=we.current,de(we,r?n&1|2:n&1),t):(Qe(t),null);case 22:case 23:return gc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?pt&1073741824&&(Qe(t),t.subtreeFlags&6&&(t.flags|=8192)):Qe(t),null;case 24:return null;case 25:return null}throw Error(I(156,t.tag))}function _y(e,t){switch(Xu(t),t.tag){case 1:return st(t.type)&&Ls(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(),me(ot),me(Ke),sc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return oc(t),null;case 13:if(me(we),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(I(340));di()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(we),null;case 4:return pi(),null;case 10:return tc(t.type._context),null;case 22:case 23:return gc(),null;case 24:return null;default:return null}}var is=!1,Ve=!1,Sy=typeof WeakSet=="function"?WeakSet:Set,b=null;function Gr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ce(e,t,r)}else n.current=null}function lu(e,t,n){try{n()}catch(r){Ce(e,t,r)}}var Kf=!1;function wy(e,t){if(Ha=Ns,e=tp(),Gu(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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,f=0,h=e,d=null;t:for(;;){for(var g;h!==n||i!==0&&h.nodeType!==3||(l=s+i),h!==o||r!==0&&h.nodeType!==3||(a=s+r),h.nodeType===3&&(s+=h.nodeValue.length),(g=h.firstChild)!==null;)d=h,h=g;for(;;){if(h===e)break t;if(d===n&&++u===i&&(l=s),d===o&&++f===r&&(a=s),(g=h.nextSibling)!==null)break;h=d,d=h.parentNode}h=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Qa={focusedElem:e,selectionRange:n},Ns=!1,b=t;b!==null;)if(t=b,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,b=e;else for(;b!==null;){t=b;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var S=y.memoizedProps,E=y.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?S:jt(t.type,S),E);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(I(163))}}catch(v){Ce(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,b=e;break}b=t.return}return y=Kf,Kf=!1,y}function ro(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 o=i.destroy;i.destroy=void 0,o!==void 0&&lu(t,n,o)}i=i.next}while(i!==r)}}function gl(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 au(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 Jp(e){var t=e.alternate;t!==null&&(e.alternate=null,Jp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tn],delete t[wo],delete t[Ka],delete t[ry],delete t[iy])),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 Zp(e){return e.tag===5||e.tag===3||e.tag===4}function Gf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Zp(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 uu(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=Ms));else if(r!==4&&(e=e.child,e!==null))for(uu(e,t,n),e=e.sibling;e!==null;)uu(e,t,n),e=e.sibling}function cu(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(cu(e,t,n),e=e.sibling;e!==null;)cu(e,t,n),e=e.sibling}var ze=null,bt=!1;function Dn(e,t,n){for(n=n.child;n!==null;)em(e,t,n),n=n.sibling}function em(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(ul,n)}catch{}switch(n.tag){case 5:Ve||Gr(n,t);case 6:var r=ze,i=bt;ze=null,Dn(e,t,n),ze=r,bt=i,ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ze.removeChild(n.stateNode));break;case 18:ze!==null&&(bt?(e=ze,n=n.stateNode,e.nodeType===8?ea(e.parentNode,n):e.nodeType===1&&ea(e,n),vo(e)):ea(ze,n.stateNode));break;case 4:r=ze,i=bt,ze=n.stateNode.containerInfo,bt=!0,Dn(e,t,n),ze=r,bt=i;break;case 0:case 11:case 14:case 15:if(!Ve&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&lu(n,t,s),i=i.next}while(i!==r)}Dn(e,t,n);break;case 1:if(!Ve&&(Gr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ce(n,t,l)}Dn(e,t,n);break;case 21:Dn(e,t,n);break;case 22:n.mode&1?(Ve=(r=Ve)||n.memoizedState!==null,Dn(e,t,n),Ve=r):Dn(e,t,n);break;default:Dn(e,t,n)}}function Yf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Sy),t.forEach(function(r){var i=Dy.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Te()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xy(r/1960))-r,10e?16:e,Fn===null)var r=!1;else{if(e=Fn,Fn=null,Vs=0,re&6)throw Error(I(331));var i=re;for(re|=4,b=e.current;b!==null;){var o=b,s=o.child;if(b.flags&16){var l=o.deletions;if(l!==null){for(var a=0;aTe()-mc?Sr(e,0):pc|=n),lt(e,t)}function am(e,t){t===0&&(e.mode&1?(t=Go,Go<<=1,!(Go&130023424)&&(Go=4194304)):t=1);var n=Xe();e=_n(e,t),e!==null&&(Mo(e,t,n),lt(e,n))}function Py(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),am(e,n)}function Dy(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(I(314))}r!==null&&r.delete(t),am(e,n)}var um;um=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)it=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return it=!1,gy(e,t,n);it=!!(e.flags&131072)}else it=!1,ye&&t.flags&1048576&&dp(t,js,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_s(e,t),e=t.pendingProps;var i=fi(t,Ke.current);oi(t,n),i=ac(null,t,r,e,i,n);var o=uc();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,st(r)?(o=!0,Us(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,rc(t),i.updater=ml,t.stateNode=i,i._reactInternals=t,eu(t,r,e,n),t=ru(null,t,r,!0,o,n)):(t.tag=0,ye&&o&&Yu(t),Ye(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_s(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=Ay(r),e=jt(r,e),i){case 0:t=nu(null,t,r,e,n);break e;case 1:t=Qf(null,t,r,e,n);break e;case 11:t=qf(null,t,r,e,n);break e;case 14:t=Hf(null,t,r,jt(r.type,e),n);break e}throw Error(I(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),nu(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),Qf(e,t,r,i,n);case 3:e:{if(Wp(t),e===null)throw Error(I(387));r=t.pendingProps,o=t.memoizedState,i=o.element,vp(e,t),Bs(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=mi(Error(I(423)),t),t=Wf(e,t,r,n,i);break e}else if(r!==i){i=mi(Error(I(424)),t),t=Wf(e,t,r,n,i);break e}else for(mt=Hn(t.stateNode.containerInfo.firstChild),vt=t,ye=!0,Bt=null,n=Sp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(di(),r===i){t=Sn(e,t,n);break e}Ye(e,t,r,n)}t=t.child}return t;case 5:return wp(t),e===null&&Xa(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,Wa(r,i)?s=null:o!==null&&Wa(r,o)&&(t.flags|=32),Qp(e,t),Ye(e,t,s,n),t.child;case 6:return e===null&&Xa(t),null;case 13:return Vp(e,t,n);case 4:return ic(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=hi(t,null,r,n):Ye(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),qf(e,t,r,i,n);case 7:return Ye(e,t,t.pendingProps,n),t.child;case 8:return Ye(e,t,t.pendingProps.children,n),t.child;case 12:return Ye(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,de(bs,r._currentValue),r._currentValue=s,o!==null)if(Qt(o.value,s)){if(o.children===i.children&&!ot.current){t=Sn(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(o.tag===1){a=mn(-1,n&-n),a.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?a.next=a:(a.next=f.next,f.next=a),u.pending=a}}o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ja(o.return,n,t),l.lanes|=n;break}a=a.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(I(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Ja(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ye(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,oi(t,n),i=Dt(i),r=r(i),t.flags|=1,Ye(e,t,r,n),t.child;case 14:return r=t.type,i=jt(r,t.pendingProps),i=jt(r.type,i),Hf(e,t,r,i,n);case 15:return qp(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:jt(r,i),_s(e,t),t.tag=1,st(r)?(e=!0,Us(t)):e=!1,oi(t,n),yp(t,r,i),eu(t,r,i,n),ru(null,t,r,!0,e,n);case 19:return Kp(e,t,n);case 22:return Hp(e,t,n)}throw Error(I(156,t.tag))};function cm(e,t){return Uh(e,t)}function Ny(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 Ot(e,t,n,r){return new Ny(e,t,n,r)}function _c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ay(e){if(typeof e=="function")return _c(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ju)return 11;if(e===bu)return 14}return 2}function Kn(e,t){var n=e.alternate;return n===null?(n=Ot(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 Es(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")_c(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case zr:return wr(n.children,i,o,t);case Fu:s=8,i|=8;break;case ka:return e=Ot(12,n,t,i|2),e.elementType=ka,e.lanes=o,e;case Ca:return e=Ot(13,n,t,i),e.elementType=Ca,e.lanes=o,e;case Ta:return e=Ot(19,n,t,i),e.elementType=Ta,e.lanes=o,e;case _h:return _l(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gh:s=10;break e;case yh:s=9;break e;case ju:s=11;break e;case bu:s=14;break e;case Nn:s=16,r=null;break e}throw Error(I(130,e==null?e:typeof e,""))}return t=Ot(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function wr(e,t,n,r){return e=Ot(7,e,r,t),e.lanes=n,e}function _l(e,t,n,r){return e=Ot(22,e,r,t),e.elementType=_h,e.lanes=n,e.stateNode={isHidden:!1},e}function aa(e,t,n){return e=Ot(6,e,null,t),e.lanes=n,e}function ua(e,t,n){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Iy(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=ql(0),this.expirationTimes=ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ql(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Sc(e,t,n,r,i,o,s,l,a){return e=new Iy(e,t,n,l,a),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Ot(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},rc(o),e}function My(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pm)}catch(e){console.error(e)}}pm(),dh.exports=yt;var by=dh.exports,id=by;Ea.createRoot=id.createRoot,Ea.hydrateRoot=id.hydrateRoot;var mm={exports:{}};/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i"u")throw new Error(t)}function Rr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $y(){return Math.random().toString(36).substr(2,8)}function sd(e,t){return{usr:e.state,key:e.key,idx:t}}function Oo(e,t,n,r){return n===void 0&&(n=null),ge({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?on(t):t,{state:n,key:t&&t.key||r||$y()})}function jo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function on(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function qy(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=Pe.Pop,a=null,u=f();u==null&&(u=0,s.replaceState(ge({},s.state,{idx:u}),""));function f(){return(s.state||{idx:null}).idx}function h(){l=Pe.Pop;let E=f(),m=E==null?null:E-u;u=E,a&&a({action:l,location:S.location,delta:m})}function d(E,m){l=Pe.Push;let p=Oo(S.location,E,m);n&&n(p,E),u=f()+1;let _=sd(p,u),v=S.createHref(p);try{s.pushState(_,"",v)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(v)}o&&a&&a({action:l,location:S.location,delta:1})}function g(E,m){l=Pe.Replace;let p=Oo(S.location,E,m);n&&n(p,E),u=f();let _=sd(p,u),v=S.createHref(p);s.replaceState(_,"",v),o&&a&&a({action:l,location:S.location,delta:0})}function y(E){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof E=="string"?E:jo(E);return Z(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let S={get action(){return l},get location(){return e(i,s)},listen(E){if(a)throw new Error("A history only accepts one active listener");return i.addEventListener(od,h),a=E,()=>{i.removeEventListener(od,h),a=null}},createHref(E){return t(i,E)},createURL:y,encodeLocation(E){let m=y(E);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:d,replace:g,go(E){return s.go(E)}};return S}var Me;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Me||(Me={}));const Hy=new Set(["lazy","caseSensitive","path","id","index","children"]);function Qy(e){return e.index===!0}function mu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let s=[...n,o],l=typeof i.id=="string"?i.id:s.join("-");if(Z(i.index!==!0||!i.children,"Cannot specify children on an index route"),Z(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Qy(i)){let a=ge({},i,t(i),{id:l});return r[l]=a,a}else{let a=ge({},i,t(i),{id:l,children:void 0});return r[l]=a,i.children&&(a.children=mu(i.children,t,s,r)),a}})}function Xr(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?on(t):t,i=bo(r.pathname||"/",n);if(i==null)return null;let o=vm(e);Wy(o);let s=null;for(let l=0;s==null&&l{let a={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};a.relativePath.startsWith("/")&&(Z(a.relativePath.startsWith(r),'Absolute route path "'+a.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),a.relativePath=a.relativePath.slice(r.length));let u=Yn([r,a.relativePath]),f=n.concat(a);o.children&&o.children.length>0&&(Z(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),vm(o.children,t,f,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:Zy(u,o.index),routesMeta:f})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let a of gm(o.path))i(o,s,a)}),t}function gm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=gm(r.join("/")),l=[];return l.push(...s.map(a=>a===""?o:[o,a].join("/"))),i&&l.push(...s),l.map(a=>e.startsWith("/")&&a===""?"/":a)}function Wy(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:e_(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Vy=/^:\w+$/,Ky=3,Gy=2,Yy=1,Xy=10,Jy=-2,ld=e=>e==="*";function Zy(e,t){let n=e.split("/"),r=n.length;return n.some(ld)&&(r+=Jy),t&&(r+=Gy),n.filter(i=>!ld(i)).reduce((i,o)=>i+(Vy.test(o)?Ky:o===""?Yy:Xy),r)}function e_(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function t_(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(f==="*"){let d=l[h]||"";s=o.slice(0,o.length-d.length).replace(/(.)\/+$/,"$1")}return u[f]=o_(l[h]||"",f),u},{}),pathname:o,pathnameBase:s,pattern:e}}function r_(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Rr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,l)=>(r.push(l),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function i_(e){try{return decodeURI(e)}catch(t){return Rr(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function o_(e,t){try{return decodeURIComponent(e)}catch(n){return Rr(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function bo(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function s_(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?on(e):e;return{pathname:n?n.startsWith("/")?n:l_(n,t):t,search:u_(r),hash:c_(i)}}function l_(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function ca(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kc(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ym(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=on(e):(i=ge({},e),Z(!i.pathname||!i.pathname.includes("?"),ca("?","pathname","search",i)),Z(!i.pathname||!i.pathname.includes("#"),ca("#","pathname","hash",i)),Z(!i.search||!i.search.includes("#"),ca("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,l;if(r||s==null)l=n;else{let h=t.length-1;if(s.startsWith("..")){let d=s.split("/");for(;d[0]==="..";)d.shift(),h-=1;i.pathname=d.join("/")}l=h>=0?t[h]:"/"}let a=s_(i,l),u=s&&s!=="/"&&s.endsWith("/"),f=(o||s===".")&&n.endsWith("/");return!a.pathname.endsWith("/")&&(u||f)&&(a.pathname+="/"),a}const Yn=e=>e.join("/").replace(/\/\/+/g,"/"),a_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),u_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,c_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Cc{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function _m(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Sm=["post","put","patch","delete"],f_=new Set(Sm),d_=["get",...Sm],h_=new Set(d_),p_=new Set([301,302,303,307,308]),m_=new Set([307,308]),fa={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},v_={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zi={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},wm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,g_=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function y_(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Z(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let C=e.detectErrorBoundary;i=R=>({hasErrorBoundary:C(R)})}else i=g_;let o={},s=mu(e.routes,i,void 0,o),l,a=e.basename||"/",u=ge({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),f=null,h=new Set,d=null,g=null,y=null,S=e.hydrationData!=null,E=Xr(s,e.history.location,a),m=null;if(E==null){let C=xt(404,{pathname:e.history.location.pathname}),{matches:R,route:N}=md(s);E=R,m={[N.id]:C}}let p=!E.some(C=>C.route.lazy)&&(!E.some(C=>C.route.loader)||e.hydrationData!=null),_,v={historyAction:e.history.action,location:e.history.location,matches:E,initialized:p,navigation:fa,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||m,fetchers:new Map,blockers:new Map},P=Pe.Pop,k=!1,T,O=!1,U=!1,B=[],he=[],ne=new Map,tt=0,kn=-1,Vt=new Map,at=new Set,ut=new Map,L=new Map,j=new Map,V=!1;function Y(){return f=e.history.listen(C=>{let{action:R,location:N,delta:z}=C;if(V){V=!1;return}Rr(j.size===0||z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let K=Mr({currentLocation:v.location,nextLocation:N,historyAction:R});if(K&&z!=null){V=!0,e.history.go(z*-1),ar(K,{state:"blocked",location:N,proceed(){ar(K,{state:"proceeding",proceed:void 0,reset:void 0,location:N}),e.history.go(z)},reset(){let $=new Map(v.blockers);$.set(K,zi),ie({blockers:$})}});return}return It(R,N)}),v.initialized||It(Pe.Pop,v.location),_}function _e(){f&&f(),h.clear(),T&&T.abort(),v.fetchers.forEach((C,R)=>Oi(R)),v.blockers.forEach((C,R)=>Pi(R))}function le(C){return h.add(C),()=>h.delete(C)}function ie(C){v=ge({},v,C),h.forEach(R=>R(v))}function ct(C,R){var N,z;let K=v.actionData!=null&&v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&v.navigation.state==="loading"&&((N=C.state)==null?void 0:N._isRedirect)!==!0,$;R.actionData?Object.keys(R.actionData).length>0?$=R.actionData:$=null:K?$=v.actionData:$=null;let W=R.loaderData?pd(v.loaderData,R.loaderData,R.matches||[],R.errors):v.loaderData,Q=v.blockers;Q.size>0&&(Q=new Map(Q),Q.forEach((oe,te)=>Q.set(te,zi)));let H=k===!0||v.navigation.formMethod!=null&&zt(v.navigation.formMethod)&&((z=C.state)==null?void 0:z._isRedirect)!==!0;l&&(s=l,l=void 0),O||P===Pe.Pop||(P===Pe.Push?e.history.push(C,C.state):P===Pe.Replace&&e.history.replace(C,C.state)),ie(ge({},R,{actionData:$,loaderData:W,historyAction:P,location:C,initialized:!0,navigation:fa,revalidation:"idle",restoreScrollPosition:un(C,R.matches||v.matches),preventScrollReset:H,blockers:Q})),P=Pe.Pop,k=!1,O=!1,U=!1,B=[],he=[]}async function ft(C,R){if(typeof C=="number"){e.history.go(C);return}let N=vu(v.location,v.matches,a,u.v7_prependBasename,C,R==null?void 0:R.fromRouteId,R==null?void 0:R.relative),{path:z,submission:K,error:$}=ad(u.v7_normalizeFormMethod,!1,N,R),W=v.location,Q=Oo(v.location,z,R&&R.state);Q=ge({},Q,e.history.encodeLocation(Q));let H=R&&R.replace!=null?R.replace:void 0,oe=Pe.Push;H===!0?oe=Pe.Replace:H===!1||K!=null&&zt(K.formMethod)&&K.formAction===v.location.pathname+v.location.search&&(oe=Pe.Replace);let te=R&&"preventScrollReset"in R?R.preventScrollReset===!0:void 0,qe=Mr({currentLocation:W,nextLocation:Q,historyAction:oe});if(qe){ar(qe,{state:"blocked",location:Q,proceed(){ar(qe,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),ft(C,R)},reset(){let Re=new Map(v.blockers);Re.set(qe,zi),ie({blockers:Re})}});return}return await It(oe,Q,{submission:K,pendingError:$,preventScrollReset:te,replace:R&&R.replace})}function Kt(){if(Ir(),ie({revalidation:"loading"}),v.navigation.state!=="submitting"){if(v.navigation.state==="idle"){It(v.historyAction,v.location,{startUninterruptedRevalidation:!0});return}It(P||v.historyAction,v.navigation.location,{overrideNavigation:v.navigation})}}async function It(C,R,N){T&&T.abort(),T=null,P=C,O=(N&&N.startUninterruptedRevalidation)===!0,Mt(v.location,v.matches),k=(N&&N.preventScrollReset)===!0;let z=l||s,K=N&&N.overrideNavigation,$=Xr(z,R,a);if(!$){let Re=xt(404,{pathname:R.pathname}),{matches:Ae,route:nt}=md(z);Lr(),ct(R,{matches:Ae,loaderData:{},errors:{[nt.id]:Re}});return}if(v.initialized&&!U&&x_(v.location,R)&&!(N&&N.submission&&zt(N.submission.formMethod))){ct(R,{matches:$});return}T=new AbortController;let W=$i(e.history,R,T.signal,N&&N.submission),Q,H;if(N&&N.pendingError)H={[Jr($).route.id]:N.pendingError};else if(N&&N.submission&&zt(N.submission.formMethod)){let Re=await $o(W,R,N.submission,$,{replace:N.replace});if(Re.shortCircuited)return;Q=Re.pendingActionData,H=Re.pendingActionError,K=ls(R,N.submission),W=new Request(W.url,{signal:W.signal})}let{shortCircuited:oe,loaderData:te,errors:qe}=await Cn(W,R,$,K,N&&N.submission,N&&N.fetcherSubmission,N&&N.replace,Q,H);oe||(T=null,ct(R,ge({matches:$},Q?{actionData:Q}:{},{loaderData:te,errors:qe})))}async function $o(C,R,N,z,K){K===void 0&&(K={}),Ir();let $=O_(R,N);ie({navigation:$});let W,Q=yu(z,R);if(!Q.route.action&&!Q.route.lazy)W={type:Me.error,error:xt(405,{method:C.method,pathname:R.pathname,routeId:Q.route.id})};else if(W=await Bi("action",C,Q,z,o,i,a),C.signal.aborted)return{shortCircuited:!0};if(li(W)){let H;return K&&K.replace!=null?H=K.replace:H=W.location===v.location.pathname+v.location.search,await Yt(v,W,{submission:N,replace:H}),{shortCircuited:!0}}if(so(W)){let H=Jr(z,Q.route.id);return(K&&K.replace)!==!0&&(P=Pe.Push),{pendingActionData:{},pendingActionError:{[H.route.id]:W.error}}}if(yr(W))throw xt(400,{type:"defer-action"});return{pendingActionData:{[Q.route.id]:W.data}}}async function Cn(C,R,N,z,K,$,W,Q,H){let oe=z||ls(R,K),te=K||$||yd(oe),qe=l||s,[Re,Ae]=ud(e.history,v,N,te,R,U,B,he,ut,at,qe,a,Q,H);if(Lr(ce=>!(N&&N.some(Ge=>Ge.route.id===ce))||Re&&Re.some(Ge=>Ge.route.id===ce)),Re.length===0&&Ae.length===0){let ce=ln();return ct(R,ge({matches:N,loaderData:{},errors:H||null},Q?{actionData:Q}:{},ce?{fetchers:new Map(v.fetchers)}:{})),{shortCircuited:!0}}if(!O){Ae.forEach(Ge=>{let cn=v.fetchers.get(Ge.key),Ie=qi(void 0,cn?cn.data:void 0);v.fetchers.set(Ge.key,Ie)});let ce=Q||v.actionData;ie(ge({navigation:oe},ce?Object.keys(ce).length===0?{actionData:null}:{actionData:ce}:{},Ae.length>0?{fetchers:new Map(v.fetchers)}:{}))}kn=++tt,Ae.forEach(ce=>{ne.has(ce.key)&&St(ce.key),ce.controller&&ne.set(ce.key,ce.controller)});let nt=()=>Ae.forEach(ce=>St(ce.key));T&&T.signal.addEventListener("abort",nt);let{results:cr,loaderResults:Lt,fetcherResults:On}=await sr(v.matches,N,Re,Ae,C);if(C.signal.aborted)return{shortCircuited:!0};T&&T.signal.removeEventListener("abort",nt),Ae.forEach(ce=>ne.delete(ce.key));let wt=vd(cr);if(wt)return await Yt(v,wt,{replace:W}),{shortCircuited:!0};let{loaderData:fr,errors:Ni}=hd(v,N,Re,Lt,H,Ae,On,L);L.forEach((ce,Ge)=>{ce.subscribe(cn=>{(cn||ce.done)&&L.delete(Ge)})});let Pn=ln(),dt=an(kn),dr=Pn||dt||Ae.length>0;return ge({loaderData:fr,errors:Ni},dr?{fetchers:new Map(v.fetchers)}:{})}function Gt(C){return v.fetchers.get(C)||v_}function Ti(C,R,N,z){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");ne.has(C)&&St(C);let K=l||s,$=vu(v.location,v.matches,a,u.v7_prependBasename,N,R,z==null?void 0:z.relative),W=Xr(K,$,a);if(!W){lr(C,R,xt(404,{pathname:$}));return}let{path:Q,submission:H,error:oe}=ad(u.v7_normalizeFormMethod,!0,$,z);if(oe){lr(C,R,oe);return}let te=yu(W,Q);if(k=(z&&z.preventScrollReset)===!0,H&&zt(H.formMethod)){Ri(C,R,Q,te,W,H);return}ut.set(C,{routeId:R,path:Q}),Tn(C,R,Q,te,W,H)}async function Ri(C,R,N,z,K,$){if(Ir(),ut.delete(C),!z.route.action&&!z.route.lazy){let Ie=xt(405,{method:$.formMethod,pathname:N,routeId:R});lr(C,R,Ie);return}let W=v.fetchers.get(C),Q=P_($,W);v.fetchers.set(C,Q),ie({fetchers:new Map(v.fetchers)});let H=new AbortController,oe=$i(e.history,N,H.signal,$);ne.set(C,H);let te=await Bi("action",oe,z,K,o,i,a);if(oe.signal.aborted){ne.get(C)===H&&ne.delete(C);return}if(li(te)){ne.delete(C),at.add(C);let Ie=qi($);return v.fetchers.set(C,Ie),ie({fetchers:new Map(v.fetchers)}),Yt(v,te,{submission:$,isFetchActionRedirect:!0})}if(so(te)){lr(C,R,te.error);return}if(yr(te))throw xt(400,{type:"defer-action"});let qe=v.navigation.location||v.location,Re=$i(e.history,qe,H.signal),Ae=l||s,nt=v.navigation.state!=="idle"?Xr(Ae,v.navigation.location,a):v.matches;Z(nt,"Didn't find any matches after fetcher action");let cr=++tt;Vt.set(C,cr);let Lt=qi($,te.data);v.fetchers.set(C,Lt);let[On,wt]=ud(e.history,v,nt,$,qe,U,B,he,ut,at,Ae,a,{[z.route.id]:te.data},void 0);wt.filter(Ie=>Ie.key!==C).forEach(Ie=>{let q=Ie.key,w=v.fetchers.get(q),A=qi(void 0,w?w.data:void 0);v.fetchers.set(q,A),ne.has(q)&&St(q),Ie.controller&&ne.set(q,Ie.controller)}),ie({fetchers:new Map(v.fetchers)});let fr=()=>wt.forEach(Ie=>St(Ie.key));H.signal.addEventListener("abort",fr);let{results:Ni,loaderResults:Pn,fetcherResults:dt}=await sr(v.matches,nt,On,wt,Re);if(H.signal.aborted)return;H.signal.removeEventListener("abort",fr),Vt.delete(C),ne.delete(C),wt.forEach(Ie=>ne.delete(Ie.key));let dr=vd(Ni);if(dr)return Yt(v,dr);let{loaderData:ce,errors:Ge}=hd(v,v.matches,On,Pn,void 0,wt,dt,L);if(v.fetchers.has(C)){let Ie=xs(te.data);v.fetchers.set(C,Ie)}let cn=an(cr);v.navigation.state==="loading"&&cr>kn?(Z(P,"Expected pending action"),T&&T.abort(),ct(v.navigation.location,{matches:nt,loaderData:ce,errors:Ge,fetchers:new Map(v.fetchers)})):(ie(ge({errors:Ge,loaderData:pd(v.loaderData,ce,nt,Ge)},cn||wt.length>0?{fetchers:new Map(v.fetchers)}:{})),U=!1)}async function Tn(C,R,N,z,K,$){let W=v.fetchers.get(C),Q=qi($,W?W.data:void 0);v.fetchers.set(C,Q),ie({fetchers:new Map(v.fetchers)});let H=new AbortController,oe=$i(e.history,N,H.signal);ne.set(C,H);let te=await Bi("loader",oe,z,K,o,i,a);if(yr(te)&&(te=await km(te,oe.signal,!0)||te),ne.get(C)===H&&ne.delete(C),oe.signal.aborted)return;if(li(te)){at.add(C),await Yt(v,te);return}if(so(te)){let Re=Jr(v.matches,R);v.fetchers.delete(C),ie({fetchers:new Map(v.fetchers),errors:{[Re.route.id]:te.error}});return}Z(!yr(te),"Unhandled fetcher deferred data");let qe=xs(te.data);v.fetchers.set(C,qe),ie({fetchers:new Map(v.fetchers)})}async function Yt(C,R,N){let{submission:z,replace:K,isFetchActionRedirect:$}=N===void 0?{}:N;R.revalidate&&(U=!0);let W=Oo(C.location,R.location,ge({_isRedirect:!0},$?{_isFetchActionRedirect:!0}:{}));if(Z(W,"Expected a location on the redirect navigation"),wm.test(R.location)&&n){let oe=e.history.createURL(R.location),te=bo(oe.pathname,a)==null;if(t.location.origin!==oe.origin||te){K?t.location.replace(R.location):t.location.assign(R.location);return}}T=null;let Q=K===!0?Pe.Replace:Pe.Push,H=z||yd(C.navigation);if(m_.has(R.status)&&H&&zt(H.formMethod))await It(Q,W,{submission:ge({},H,{formAction:R.location}),preventScrollReset:k});else if($)await It(Q,W,{overrideNavigation:ls(W),fetcherSubmission:H,preventScrollReset:k});else{let oe=ls(W,H);await It(Q,W,{overrideNavigation:oe,preventScrollReset:k})}}async function sr(C,R,N,z,K){let $=await Promise.all([...N.map(H=>Bi("loader",K,H,R,o,i,a)),...z.map(H=>H.matches&&H.match&&H.controller?Bi("loader",$i(e.history,H.path,H.controller.signal),H.match,H.matches,o,i,a):{type:Me.error,error:xt(404,{pathname:H.path})})]),W=$.slice(0,N.length),Q=$.slice(N.length);return await Promise.all([gd(C,N,W,W.map(()=>K.signal),!1,v.loaderData),gd(C,z.map(H=>H.match),Q,z.map(H=>H.controller?H.controller.signal:null),!0)]),{results:$,loaderResults:W,fetcherResults:Q}}function Ir(){U=!0,B.push(...Lr()),ut.forEach((C,R)=>{ne.has(R)&&(he.push(R),St(R))})}function lr(C,R,N){let z=Jr(v.matches,R);Oi(C),ie({errors:{[z.route.id]:N},fetchers:new Map(v.fetchers)})}function Oi(C){let R=v.fetchers.get(C);ne.has(C)&&!(R&&R.state==="loading"&&Vt.has(C))&&St(C),ut.delete(C),Vt.delete(C),at.delete(C),v.fetchers.delete(C)}function St(C){let R=ne.get(C);Z(R,"Expected fetch controller: "+C),R.abort(),ne.delete(C)}function Rn(C){for(let R of C){let N=Gt(R),z=xs(N.data);v.fetchers.set(R,z)}}function ln(){let C=[],R=!1;for(let N of at){let z=v.fetchers.get(N);Z(z,"Expected fetcher: "+N),z.state==="loading"&&(at.delete(N),C.push(N),R=!0)}return Rn(C),R}function an(C){let R=[];for(let[N,z]of Vt)if(z0}function qo(C,R){let N=v.blockers.get(C)||zi;return j.get(C)!==R&&j.set(C,R),N}function Pi(C){v.blockers.delete(C),j.delete(C)}function ar(C,R){let N=v.blockers.get(C)||zi;Z(N.state==="unblocked"&&R.state==="blocked"||N.state==="blocked"&&R.state==="blocked"||N.state==="blocked"&&R.state==="proceeding"||N.state==="blocked"&&R.state==="unblocked"||N.state==="proceeding"&&R.state==="unblocked","Invalid blocker state transition: "+N.state+" -> "+R.state);let z=new Map(v.blockers);z.set(C,R),ie({blockers:z})}function Mr(C){let{currentLocation:R,nextLocation:N,historyAction:z}=C;if(j.size===0)return;j.size>1&&Rr(!1,"A router only supports one blocker at a time");let K=Array.from(j.entries()),[$,W]=K[K.length-1],Q=v.blockers.get($);if(!(Q&&Q.state==="proceeding")&&W({currentLocation:R,nextLocation:N,historyAction:z}))return $}function Lr(C){let R=[];return L.forEach((N,z)=>{(!C||C(z))&&(N.cancel(),R.push(z),L.delete(z))}),R}function Ur(C,R,N){if(d=C,y=R,g=N||null,!S&&v.navigation===fa){S=!0;let z=un(v.location,v.matches);z!=null&&ie({restoreScrollPosition:z})}return()=>{d=null,y=null,g=null}}function ur(C,R){return g&&g(C,R.map(z=>R_(z,v.loaderData)))||C.key}function Mt(C,R){if(d&&y){let N=ur(C,R);d[N]=y()}}function un(C,R){if(d){let N=ur(C,R),z=d[N];if(typeof z=="number")return z}return null}function Di(C){o={},l=mu(C,i,void 0,o)}return _={get basename(){return a},get state(){return v},get routes(){return s},initialize:Y,subscribe:le,enableScrollRestoration:Ur,navigate:ft,fetch:Ti,revalidate:Kt,createHref:C=>e.history.createHref(C),encodeLocation:C=>e.history.encodeLocation(C),getFetcher:Gt,deleteFetcher:Oi,dispose:_e,getBlocker:qo,deleteBlocker:Pi,_internalFetchControllers:ne,_internalActiveDeferreds:L,_internalSetRoutes:Di},_}function __(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function vu(e,t,n,r,i,o,s){let l,a;if(o!=null&&s!=="path"){l=[];for(let f of t)if(l.push(f),f.route.id===o){a=f;break}}else l=t,a=t[t.length-1];let u=ym(i||".",kc(l).map(f=>f.pathnameBase),bo(e.pathname,n)||e.pathname,s==="path");return i==null&&(u.search=e.search,u.hash=e.hash),(i==null||i===""||i===".")&&a&&a.route.index&&!Tc(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(u.pathname=u.pathname==="/"?n:Yn([n,u.pathname])),jo(u)}function ad(e,t,n,r){if(!r||!__(r))return{path:n};if(r.formMethod&&!T_(r.formMethod))return{path:n,error:xt(405,{method:r.formMethod})};let i=()=>({path:n,error:xt(400,{type:"invalid-body"})}),o=r.formMethod||"get",s=e?o.toUpperCase():o.toLowerCase(),l=xm(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!zt(s))return i();let d=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((g,y)=>{let[S,E]=y;return""+g+S+"="+E+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:d}}}else if(r.formEncType==="application/json"){if(!zt(s))return i();try{let d=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:l,formEncType:r.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}Z(typeof FormData=="function","FormData is not available in this environment");let a,u;if(r.formData)a=gu(r.formData),u=r.formData;else if(r.body instanceof FormData)a=gu(r.body),u=r.body;else if(r.body instanceof URLSearchParams)a=r.body,u=dd(a);else if(r.body==null)a=new URLSearchParams,u=new FormData;else try{a=new URLSearchParams(r.body),u=dd(a)}catch{return i()}let f={formMethod:s,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(zt(f.formMethod))return{path:n,submission:f};let h=on(n);return t&&h.search&&Tc(h.search)&&a.append("index",""),h.search="?"+a,{path:jo(h),submission:f}}function S_(e,t){let n=e;if(t){let r=e.findIndex(i=>i.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function ud(e,t,n,r,i,o,s,l,a,u,f,h,d,g){let y=g?Object.values(g)[0]:d?Object.values(d)[0]:void 0,S=e.createURL(t.location),E=e.createURL(i),m=g?Object.keys(g)[0]:void 0,_=S_(n,m).filter((P,k)=>{if(P.route.lazy)return!0;if(P.route.loader==null)return!1;if(w_(t.loaderData,t.matches[k],P)||s.some(U=>U===P.route.id))return!0;let T=t.matches[k],O=P;return cd(P,ge({currentUrl:S,currentParams:T.params,nextUrl:E,nextParams:O.params},r,{actionResult:y,defaultShouldRevalidate:o||S.pathname+S.search===E.pathname+E.search||S.search!==E.search||Em(T,O)}))}),v=[];return a.forEach((P,k)=>{if(!n.some(ne=>ne.route.id===P.routeId))return;let T=Xr(f,P.path,h);if(!T){v.push({key:k,routeId:P.routeId,path:P.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(k),U=O&&O.state!=="idle"&&O.data===void 0&&!u.has(k),B=yu(T,P.path);(l.includes(k)||U||cd(B,ge({currentUrl:S,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:n[n.length-1].params},r,{actionResult:y,defaultShouldRevalidate:o})))&&v.push({key:k,routeId:P.routeId,path:P.path,matches:T,match:B,controller:new AbortController})}),[_,v]}function w_(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function Em(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function cd(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function fd(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];Z(i,"No route found in manifest");let o={};for(let s in r){let a=i[s]!==void 0&&s!=="hasErrorBoundary";Rr(!a,'Route "'+i.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!a&&!Hy.has(s)&&(o[s]=r[s])}Object.assign(i,o),Object.assign(i,ge({},t(i),{lazy:void 0}))}async function Bi(e,t,n,r,i,o,s,l){l===void 0&&(l={});let a,u,f,h=y=>{let S,E=new Promise((m,p)=>S=p);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([y({request:t,params:n.params,context:l.requestContext}),E])};try{let y=n.route[e];if(n.route.lazy)if(y)u=(await Promise.all([h(y),fd(n.route,o,i)]))[0];else if(await fd(n.route,o,i),y=n.route[e],y)u=await h(y);else if(e==="action"){let S=new URL(t.url),E=S.pathname+S.search;throw xt(405,{method:t.method,pathname:E,routeId:n.route.id})}else return{type:Me.data,data:void 0};else if(y)u=await h(y);else{let S=new URL(t.url),E=S.pathname+S.search;throw xt(404,{pathname:E})}Z(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(y){a=Me.error,u=y}finally{f&&t.signal.removeEventListener("abort",f)}if(C_(u)){let y=u.status;if(p_.has(y)){let m=u.headers.get("Location");if(Z(m,"Redirects returned/thrown from loaders/actions must have a Location header"),!wm.test(m))m=vu(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,m);else if(!l.isStaticRequest){let p=new URL(t.url),_=m.startsWith("//")?new URL(p.protocol+m):new URL(m),v=bo(_.pathname,s)!=null;_.origin===p.origin&&v&&(m=_.pathname+_.search+_.hash)}if(l.isStaticRequest)throw u.headers.set("Location",m),u;return{type:Me.redirect,status:y,location:m,revalidate:u.headers.get("X-Remix-Revalidate")!==null}}if(l.isRouteRequest)throw{type:a||Me.data,response:u};let S,E=u.headers.get("Content-Type");return E&&/\bapplication\/json\b/.test(E)?S=await u.json():S=await u.text(),a===Me.error?{type:a,error:new Cc(y,u.statusText,S),headers:u.headers}:{type:Me.data,data:S,statusCode:u.status,headers:u.headers}}if(a===Me.error)return{type:a,error:u};if(k_(u)){var d,g;return{type:Me.deferred,deferredData:u,statusCode:(d=u.init)==null?void 0:d.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:Me.data,data:u}}function $i(e,t,n,r){let i=e.createURL(xm(t)).toString(),o={signal:n};if(r&&zt(r.formMethod)){let{formMethod:s,formEncType:l}=r;o.method=s.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=gu(r.formData):o.body=r.formData}return new Request(i,o)}function gu(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function dd(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function E_(e,t,n,r,i){let o={},s=null,l,a=!1,u={};return n.forEach((f,h)=>{let d=t[h].route.id;if(Z(!li(f),"Cannot handle redirect results in processLoaderData"),so(f)){let g=Jr(e,d),y=f.error;r&&(y=Object.values(r)[0],r=void 0),s=s||{},s[g.route.id]==null&&(s[g.route.id]=y),o[d]=void 0,a||(a=!0,l=_m(f.error)?f.error.status:500),f.headers&&(u[d]=f.headers)}else yr(f)?(i.set(d,f.deferredData),o[d]=f.deferredData.data):o[d]=f.data,f.statusCode!=null&&f.statusCode!==200&&!a&&(l=f.statusCode),f.headers&&(u[d]=f.headers)}),r&&(s=r,o[Object.keys(r)[0]]=void 0),{loaderData:o,errors:s,statusCode:l||200,loaderHeaders:u}}function hd(e,t,n,r,i,o,s,l){let{loaderData:a,errors:u}=E_(t,n,r,i,l);for(let f=0;fr.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function md(e){let t=e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function xt(e,t){let{pathname:n,routeId:r,method:i,type:o}=t===void 0?{}:t,s="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(s="Bad Request",i&&n&&r?l="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?l="defer() is not supported in actions":o==="invalid-body"&&(l="Unable to encode submission body")):e===403?(s="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(s="Not Found",l='No route matches URL "'+n+'"'):e===405&&(s="Method Not Allowed",i&&n&&r?l="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(l='Invalid request method "'+i.toUpperCase()+'"')),new Cc(e||500,s,new Error(l),!0)}function vd(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(li(n))return n}}function xm(e){let t=typeof e=="string"?on(e):e;return jo(ge({},t,{hash:""}))}function x_(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function yr(e){return e.type===Me.deferred}function so(e){return e.type===Me.error}function li(e){return(e&&e.type)===Me.redirect}function k_(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function C_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function T_(e){return h_.has(e.toLowerCase())}function zt(e){return f_.has(e.toLowerCase())}async function gd(e,t,n,r,i,o){for(let s=0;sh.route.id===a.route.id),f=u!=null&&!Em(u,a)&&(o&&o[a.route.id])!==void 0;if(yr(l)&&(i||f)){let h=r[s];Z(h,"Expected an AbortSignal for revalidating fetcher deferred result"),await km(l,h,i).then(d=>{d&&(n[s]=d||n[s])})}}}async function km(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Me.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Me.error,error:i}}return{type:Me.data,data:e.deferredData.data}}}function Tc(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function R_(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function yu(e,t){let n=typeof t=="string"?on(t).search:t.search;if(e[e.length-1].route.index&&Tc(n||""))return e[e.length-1];let r=kc(e);return r[r.length-1]}function yd(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:s}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function ls(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function O_(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function qi(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function P_(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0," _hasFetcherDoneAnything ":!0}}function xs(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/** - * React Router v6.14.1 - * - * Copyright (c) Remix Software Inc. - * - * 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 Ys(){return Ys=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.pathnameBase)),s=M.useRef(!1);return Om(()=>{s.current=!0}),M.useCallback(function(a,u){if(u===void 0&&(u={}),!s.current)return;if(typeof a=="number"){n.go(a);return}let f=ym(a,JSON.parse(o),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Yn([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,o,i,e])}function N_(e,t,n){Rl()||Z(!1);let{navigator:r}=M.useContext(Cl),{matches:i}=M.useContext(xi),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let a=Rm(),u;if(t){var f;let S=typeof t=="string"?on(t):t;l==="/"||(f=S.pathname)!=null&&f.startsWith(l)||Z(!1),u=S}else u=a;let h=u.pathname||"/",d=l==="/"?h:h.slice(l.length)||"/",g=Xr(e,{pathname:d}),y=U_(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},s,S.params),pathname:Yn([l,r.encodeLocation?r.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?l:Yn([l,r.encodeLocation?r.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n);return t&&y?M.createElement(Tl.Provider,{value:{location:Ys({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Pe.Pop}},y):y}function A_(){let e=z_(),t=_m(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},o=null;return M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},t),n?M.createElement("pre",{style:i},n):null,o)}const I_=M.createElement(A_,null);class M_ extends M.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?M.createElement(xi.Provider,{value:this.props.routeContext},M.createElement(Tm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function L_(e){let{routeContext:t,match:n,children:r}=e,i=M.useContext(kl);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),M.createElement(xi.Provider,{value:t},r)}function U_(e,t,n){var r;if(t===void 0&&(t=[]),n===void 0&&(n=null),e==null){var i;if((i=n)!=null&&i.errors)e=n.matches;else return null}let o=e,s=(r=n)==null?void 0:r.errors;if(s!=null){let l=o.findIndex(a=>a.route.id&&(s==null?void 0:s[a.route.id]));l>=0||Z(!1),o=o.slice(0,Math.min(o.length,l+1))}return o.reduceRight((l,a,u)=>{let f=a.route.id?s==null?void 0:s[a.route.id]:null,h=null;n&&(h=a.route.errorElement||I_);let d=t.concat(o.slice(0,u+1)),g=()=>{let y;return f?y=h:a.route.Component?y=M.createElement(a.route.Component,null):a.route.element?y=a.route.element:y=l,M.createElement(L_,{match:a,routeContext:{outlet:l,matches:d,isDataRoute:n!=null},children:y})};return n&&(a.route.ErrorBoundary||a.route.errorElement||u===0)?M.createElement(M_,{location:n.location,revalidation:n.revalidation,component:h,error:f,children:g(),routeContext:{outlet:null,matches:d,isDataRoute:!0}}):g()},null)}var _u;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(_u||(_u={}));var Po;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(Po||(Po={}));function F_(e){let t=M.useContext(kl);return t||Z(!1),t}function j_(e){let t=M.useContext(Cm);return t||Z(!1),t}function b_(e){let t=M.useContext(xi);return t||Z(!1),t}function Pm(e){let t=b_(),n=t.matches[t.matches.length-1];return n.route.id||Z(!1),n.route.id}function z_(){var e;let t=M.useContext(Tm),n=j_(Po.UseRouteError),r=Pm(Po.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function B_(){let{router:e}=F_(_u.UseNavigateStable),t=Pm(Po.UseNavigateStable),n=M.useRef(!1);return Om(()=>{n.current=!0}),M.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ys({fromRouteId:t},o)))},[e,t])}const $_="startTransition",_d=Pv[$_];function q_(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=M.useState(n.state),{v7_startTransition:s}=r||{},l=M.useCallback(h=>{s&&_d?_d(()=>o(h)):o(h)},[o,s]);M.useLayoutEffect(()=>n.subscribe(l),[n,l]);let a=M.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:h=>n.navigate(h),push:(h,d,g)=>n.navigate(h,{state:d,preventScrollReset:g==null?void 0:g.preventScrollReset}),replace:(h,d,g)=>n.navigate(h,{replace:!0,state:d,preventScrollReset:g==null?void 0:g.preventScrollReset})}),[n]),u=n.basename||"/",f=M.useMemo(()=>({router:n,navigator:a,static:!1,basename:u}),[n,a,u]);return M.createElement(M.Fragment,null,M.createElement(kl.Provider,{value:f},M.createElement(Cm.Provider,{value:i},M.createElement(Q_,{basename:u,location:i.location,navigationType:i.historyAction,navigator:a},i.initialized?M.createElement(H_,{routes:n.routes,state:i}):t))),null)}function H_(e){let{routes:t,state:n}=e;return N_(t,void 0,n)}function Q_(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Pe.Pop,navigator:o,static:s=!1}=e;Rl()&&Z(!1);let l=t.replace(/^\/*/,"/"),a=M.useMemo(()=>({basename:l,navigator:o,static:s}),[l,o,s]);typeof r=="string"&&(r=on(r));let{pathname:u="/",search:f="",hash:h="",state:d=null,key:g="default"}=r,y=M.useMemo(()=>{let S=bo(u,l);return S==null?null:{location:{pathname:S,search:f,hash:h,state:d,key:g},navigationType:i}},[l,u,f,h,d,g,i]);return y==null?null:M.createElement(Cl.Provider,{value:a},M.createElement(Tl.Provider,{children:n,value:y}))}var Sd;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(Sd||(Sd={}));new Promise(()=>{});function W_(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:M.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:M.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.14.1 - * - * Copyright (c) Remix Software Inc. - * - * 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 Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Do=typeof window>"u"||"Deno"in window;function kt(){}function Y_(e,t){return typeof e=="function"?e(t):e}function Su(e){return typeof e=="number"&&e>=0&&e!==1/0}function Dm(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Yi(e,t,n){return Ol(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function In(e,t,n){return Ol(e)?[{...t,queryKey:e},n]:[e||{},t]}function xd(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:l}=e;if(Ol(s)){if(r){if(t.queryHash!==Oc(s,t.options))return!1}else if(!Js(t.queryKey,s))return!1}if(n!=="all"){const a=t.isActive();if(n==="active"&&!a||n==="inactive"&&a)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function kd(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Ol(o)){if(!t.options.mutationKey)return!1;if(n){if(_r(t.options.mutationKey)!==_r(o))return!1}else if(!Js(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function Oc(e,t){return((t==null?void 0:t.queryKeyHashFn)||_r)(e)}function _r(e){return JSON.stringify(e,(t,n)=>Eu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Js(e,t){return Nm(e,t)}function Nm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Nm(e[n],t[n])):!1}function Am(e,t){if(e===t)return e;const n=Cd(e)&&Cd(t);if(n||Eu(e)&&Eu(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let l=0;for(let a=0;a"u")return!0;const n=t.prototype;return!(!Td(n)||!n.hasOwnProperty("isPrototypeOf"))}function Td(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ol(e){return Array.isArray(e)}function Im(e){return new Promise(t=>{setTimeout(t,e)})}function Rd(e){Im(0).then(e)}function X_(){if(typeof AbortController=="function")return new AbortController}function xu(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Am(e,t):t}class J_ extends zo{constructor(){super(),this.setup=t=>{if(!Do&&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&&(this.focused=t,this.onFocus())}onFocus(){this.listeners.forEach(({listener:t})=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const Zs=new J_,Od=["online","offline"];class Z_ extends zo{constructor(){super(),this.setup=t=>{if(!Do&&window.addEventListener){const n=()=>t();return Od.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Od.forEach(r=>{window.removeEventListener(r,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&&(this.online=t,this.onOnline())}onOnline(){this.listeners.forEach(({listener:t})=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const el=new Z_;function e0(e){return Math.min(1e3*2**e,3e4)}function Pl(e){return(e??"online")==="online"?el.isOnline():!0}class Mm{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function ks(e){return e instanceof Mm}function Lm(e){let t=!1,n=0,r=!1,i,o,s;const l=new Promise((E,m)=>{o=E,s=m}),a=E=>{r||(g(new Mm(E)),e.abort==null||e.abort())},u=()=>{t=!0},f=()=>{t=!1},h=()=>!Zs.isFocused()||e.networkMode!=="always"&&!el.isOnline(),d=E=>{r||(r=!0,e.onSuccess==null||e.onSuccess(E),i==null||i(),o(E))},g=E=>{r||(r=!0,e.onError==null||e.onError(E),i==null||i(),s(E))},y=()=>new Promise(E=>{i=m=>{const p=r||!h();return p&&E(m),p},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),S=()=>{if(r)return;let E;try{E=e.fn()}catch(m){E=Promise.reject(m)}Promise.resolve(E).then(d).catch(m=>{var p,_;if(r)return;const v=(p=e.retry)!=null?p:3,P=(_=e.retryDelay)!=null?_:e0,k=typeof P=="function"?P(n,m):P,T=v===!0||typeof v=="number"&&n{if(h())return y()}).then(()=>{t?g(m):S()})})};return Pl(e.networkMode)?S():y().then(S),{promise:l,cancel:a,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:u,continueRetry:f}}const Pc=console;function t0(){let e=[],t=0,n=f=>{f()},r=f=>{f()};const i=f=>{let h;t++;try{h=f()}finally{t--,t||l()}return h},o=f=>{t?e.push(f):Rd(()=>{n(f)})},s=f=>(...h)=>{o(()=>{f(...h)})},l=()=>{const f=e;e=[],f.length&&Rd(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f}}}const De=t0();class Um{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Su(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t??(Do?1/0:5*60*1e3))}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class n0 extends Um{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||Pc,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||r0(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=xu(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(kt).catch(kt):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||!Dm(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.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(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 o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const g=this.observers.find(y=>y.options.queryFn);g&&this.setOptions(g.options)}Array.isArray(this.options.queryKey);const s=X_(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},a=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};a(l);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),f={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u};if(a(f),(r=this.options.behavior)==null||r.onFetch(f),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=f.fetchOptions)==null?void 0:i.meta)){var h;this.dispatch({type:"fetch",meta:(h=f.fetchOptions)==null?void 0:h.meta})}const d=g=>{if(ks(g)&&g.silent||this.dispatch({type:"error",error:g}),!ks(g)){var y,S,E,m;(y=(S=this.cache.config).onError)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,this.state.data,g,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Lm({fn:f.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:g=>{var y,S,E,m;if(typeof g>"u"){d(new Error(this.queryHash+" data is undefined"));return}this.setData(g),(y=(S=this.cache.config).onSuccess)==null||y.call(S,g,this),(E=(m=this.cache.config).onSettled)==null||E.call(m,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:d,onFail:(g,y)=>{this.dispatch({type:"failed",failureCount:g,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:Pl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return ks(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function r0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class i0 extends zo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:Oc(o,n);let l=this.get(s);return l||(l=new n0({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(l)),l}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(){De.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=In(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>xd(r,i))}findAll(t,n){const[r]=In(t,n);return Object.keys(r).length>0?this.queries.filter(i=>xd(r,i)):this.queries}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}onFocus(){De.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class o0 extends Um{constructor(t){super(),this.defaultOptions=t.defaultOptions,this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||Pc,this.observers=[],this.state=t.state||s0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.includes(t)||(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(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var T;return this.retryer=Lm({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(O,U)=>{this.dispatch({type:"failed",failureCount:O,error:U})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(T=this.options.retry)!=null?T:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,l,a,u,f;if(!n){var h,d,g,y;this.dispatch({type:"loading",variables:this.options.variables}),await((h=(d=this.mutationCache.config).onMutate)==null?void 0:h.call(d,this.state.variables,this));const O=await((g=(y=this.options).onMutate)==null?void 0:g.call(y,this.state.variables));O!==this.state.context&&this.dispatch({type:"loading",context:O,variables:this.state.variables})}const T=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,T,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,T,this.state.variables,this.state.context)),await((l=(a=this.mutationCache.config).onSettled)==null?void 0:l.call(a,T,null,this.state.variables,this.state.context,this)),await((u=(f=this.options).onSettled)==null?void 0:u.call(f,T,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:T}),T}catch(T){try{var S,E,m,p,_,v,P,k;throw await((S=(E=this.mutationCache.config).onError)==null?void 0:S.call(E,T,this.state.variables,this.state.context,this)),await((m=(p=this.options).onError)==null?void 0:m.call(p,T,this.state.variables,this.state.context)),await((_=(v=this.mutationCache.config).onSettled)==null?void 0:_.call(v,void 0,T,this.state.variables,this.state.context,this)),await((P=(k=this.options).onSettled)==null?void 0:P.call(k,void 0,T,this.state.variables,this.state.context)),T}finally{this.dispatch({type:"error",error:T})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!Pl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function s0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class l0 extends zo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new o0({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});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(){De.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=>kd(t,n))}findAll(t){return this.mutations.filter(n=>kd(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(({listener:n})=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return De.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(kt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function a0(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const l=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,a=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,u=a==null?void 0:a.pageParam,f=(a==null?void 0:a.direction)==="forward",h=(a==null?void 0:a.direction)==="backward",d=((o=e.state.data)==null?void 0:o.pages)||[],g=((s=e.state.data)==null?void 0:s.pageParams)||[];let y=g,S=!1;const E=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>{var T;if((T=e.signal)!=null&&T.aborted)S=!0;else{var O;(O=e.signal)==null||O.addEventListener("abort",()=>{S=!0})}return e.signal}})},m=e.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+e.options.queryHash+"'")),p=(k,T,O,U)=>(y=U?[T,...y]:[...y,T],U?[O,...k]:[...k,O]),_=(k,T,O,U)=>{if(S)return Promise.reject("Cancelled");if(typeof O>"u"&&!T&&k.length)return Promise.resolve(k);const B={queryKey:e.queryKey,pageParam:O,meta:e.options.meta};E(B);const he=m(B);return Promise.resolve(he).then(tt=>p(k,O,tt,U))};let v;if(!d.length)v=_([]);else if(f){const k=typeof u<"u",T=k?u:Pd(e.options,d);v=_(d,k,T)}else if(h){const k=typeof u<"u",T=k?u:u0(e.options,d);v=_(d,k,T,!0)}else{y=[];const k=typeof e.options.getNextPageParam>"u";v=(l&&d[0]?l(d[0],0,d):!0)?_([],k,g[0]):Promise.resolve(p([],g[0],d[0]));for(let O=1;O{if(l&&d[O]?l(d[O],O,d):!0){const he=k?g[O]:Pd(e.options,U);return _(U,k,he)}return Promise.resolve(p(U,g[O],d[O]))})}return v.then(k=>({pages:k,pageParams:y}))}}}}function Pd(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function u0(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class c0{constructor(t={}){this.queryCache=t.queryCache||new i0,this.mutationCache=t.mutationCache||new l0,this.logger=t.logger||Pc,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=Zs.subscribe(()=>{Zs.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=el.subscribe(()=>{el.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=In(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}ensureQueryData(t,n,r){const i=Yi(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}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),o=i==null?void 0:i.state.data,s=Y_(n,o);if(typeof s>"u")return;const l=Yi(t),a=this.defaultQueryOptions(l);return this.queryCache.build(this,a).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return De.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]=In(t,n),i=this.queryCache;De.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=In(t,n,r),s=this.queryCache,l={type:"active",...i};return De.batch(()=>(s.findAll(i).forEach(a=>{a.reset()}),this.refetchQueries(l,o)))}cancelQueries(t,n,r){const[i,o={}]=In(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=De.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(o)));return Promise.all(s).then(kt).catch(kt)}invalidateQueries(t,n,r){const[i,o]=In(t,n,r);return De.batch(()=>{var s,l;if(this.queryCache.findAll(i).forEach(u=>{u.invalidate()}),i.refetchType==="none")return Promise.resolve();const a={...i,type:(s=(l=i.refetchType)!=null?l:i.type)!=null?s:"active"};return this.refetchQueries(a,o)})}refetchQueries(t,n,r){const[i,o]=In(t,n,r),s=De.batch(()=>this.queryCache.findAll(i).filter(a=>!a.isDisabled()).map(a=>{var u;return a.fetch(void 0,{...o,cancelRefetch:(u=o==null?void 0:o.cancelRefetch)!=null?u:!0,meta:{refetchPage:i.refetchPage}})}));let l=Promise.all(s).then(kt);return o!=null&&o.throwOnError||(l=l.catch(kt)),l}fetchQuery(t,n,r){const i=Yi(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(kt).catch(kt)}fetchInfiniteQuery(t,n,r){const i=Yi(t,n,r);return i.behavior=a0(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(kt).catch(kt)}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=>_r(t)===_r(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>Js(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>_r(t)===_r(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>Js(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=Oc(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 f0 extends zo{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.size===1&&(this.currentQuery.addObserver(this),Dd(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ku(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ku(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,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),wu(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 o=this.hasListeners();o&&Nd(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t),r=this.createResult(n,t);return h0(this,r,t)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}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(kt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Do||this.currentResult.isStale||!Su(this.options.staleTime))return;const n=Dm(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,!(Do||this.options.enabled===!1||!Su(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||Zs.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,o=this.currentResult,s=this.currentResultState,l=this.currentResultOptions,a=t!==r,u=a?t.state:this.currentQueryInitialState,f=a?this.currentResult:this.previousQueryResult,{state:h}=t;let{dataUpdatedAt:d,error:g,errorUpdatedAt:y,fetchStatus:S,status:E}=h,m=!1,p=!1,_;if(n._optimisticResults){const O=this.hasListeners(),U=!O&&Dd(t,n),B=O&&Nd(t,r,n,i);(U||B)&&(S=Pl(t.options.networkMode)?"fetching":"paused",d||(E="loading")),n._optimisticResults==="isRestoring"&&(S="idle")}if(n.keepPreviousData&&!h.dataUpdatedAt&&f!=null&&f.isSuccess&&E!=="error")_=f.data,d=f.dataUpdatedAt,E=f.status,m=!0;else if(n.select&&typeof h.data<"u")if(o&&h.data===(s==null?void 0:s.data)&&n.select===this.selectFn)_=this.selectResult;else try{this.selectFn=n.select,_=n.select(h.data),_=xu(o==null?void 0:o.data,_,n),this.selectResult=_,this.selectError=null}catch(O){this.selectError=O}else _=h.data;if(typeof n.placeholderData<"u"&&typeof _>"u"&&E==="loading"){let O;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))O=o.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),this.selectError=null}catch(U){this.selectError=U}typeof O<"u"&&(E="success",_=xu(o==null?void 0:o.data,O,n),p=!0)}this.selectError&&(g=this.selectError,_=this.selectResult,y=Date.now(),E="error");const v=S==="fetching",P=E==="loading",k=E==="error";return{status:E,fetchStatus:S,isLoading:P,isSuccess:E==="success",isError:k,isInitialLoading:P&&v,data:_,dataUpdatedAt:d,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:v,isRefetching:v&&!P,isLoadingError:k&&h.dataUpdatedAt===0,isPaused:S==="paused",isPlaceholderData:p,isPreviousData:m,isRefetchError:k&&h.dataUpdatedAt!==0,isStale:Dc(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,wu(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.trackedProps.size)return!0;const a=new Set(l??this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const f=u;return this.currentResult[f]!==n[f]&&a.has(f)})};(t==null?void 0:t.listeners)!==!1&&o()&&(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"&&!ks(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){De.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,l,a,u;(s=(l=this.options).onError)==null||s.call(l,this.currentResult.error),(a=(u=this.options).onSettled)==null||a.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(({listener:f})=>{f(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function d0(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Dd(e,t){return d0(e,t)||e.state.dataUpdatedAt>0&&ku(e,t,t.refetchOnMount)}function ku(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Dc(e,t)}return!1}function Nd(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Dc(e,n)}function Dc(e,t){return e.isStaleByTime(t.staleTime)}function h0(e,t,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?t.isPlaceholderData:!wu(e.getCurrentResult(),t)}var Fm={exports:{}},jm={};/** - * @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 gi=M;function p0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var m0=typeof Object.is=="function"?Object.is:p0,v0=gi.useState,g0=gi.useEffect,y0=gi.useLayoutEffect,_0=gi.useDebugValue;function S0(e,t){var n=t(),r=v0({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return y0(function(){i.value=n,i.getSnapshot=t,da(i)&&o({inst:i})},[e,n,t]),g0(function(){return da(i)&&o({inst:i}),e(function(){da(i)&&o({inst:i})})},[e]),_0(n),n}function da(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!m0(e,n)}catch{return!0}}function w0(e,t){return t()}var E0=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?w0:S0;jm.useSyncExternalStore=gi.useSyncExternalStore!==void 0?gi.useSyncExternalStore:E0;Fm.exports=jm;var bm=Fm.exports;const x0=bm.useSyncExternalStore,Ad=M.createContext(void 0),zm=M.createContext(!1);function Bm(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=Ad),window.ReactQueryClientContext):Ad)}const k0=({context:e}={})=>{const t=M.useContext(Bm(e,M.useContext(zm)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},C0=({client:e,children:t,context:n,contextSharing:r=!1})=>{M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=Bm(n,r);return M.createElement(zm.Provider,{value:!n&&r},M.createElement(i.Provider,{value:e},t))},$m=M.createContext(!1),T0=()=>M.useContext($m);$m.Provider;function R0(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const O0=M.createContext(R0()),P0=()=>M.useContext(O0);function D0(e,t){return typeof e=="function"?e(...t):!!e}const N0=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},A0=e=>{M.useEffect(()=>{e.clearReset()},[e])},I0=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&D0(n,[e.error,r]),M0=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},L0=(e,t)=>e.isLoading&&e.isFetching&&!t,U0=(e,t,n)=>(e==null?void 0:e.suspense)&&L0(t,n),F0=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function j0(e,t){const n=k0({context:e.context}),r=T0(),i=P0(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=De.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=De.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=De.batchCalls(o.onSettled)),M0(o),N0(o,i),A0(i);const[s]=M.useState(()=>new t(n,o)),l=s.getOptimisticResult(o);if(x0(M.useCallback(a=>{const u=r?()=>{}:s.subscribe(De.batchCalls(a));return s.updateResult(),u},[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),M.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),U0(o,l,r))throw F0(o,s,i);if(I0({result:l,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw l.error;return o.notifyOnChangeProps?l:s.trackResult(l)}function b0(e,t,n){const r=Yi(e,t,n);return j0(r,f0)}const qm=()=>{const e=()=>window.matchMedia("(prefers-color-scheme: dark)").matches,[t,n]=M.useState(e()),r=()=>{n(e())};return window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",r),{isDarkTheme:t}},Hm=({size:e})=>x.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-y-1/2 -translate-x-1/2 w-[50px] h-[50px]",style:{width:e,height:e},children:x.jsx("div",{className:"w-full h-full rounded-full border-[3px] border-button border-l-button/10 border-t-button/10 animate-[spin_0.6s_linear_infinite]"})});function lo({children:e,theme:t="default",disabled:n,isBusy:r,onClick:i}){const o={default:"mx-auto w-full max-w-[500px] md:max-w-[300px] block h-10 bg-button text-buttonText rounded-md text-[14px] leading-[20px] font-semibold enabled:hover:brightness-110 enabled:active:brightness-[1.2] disabled:opacity-40 transition-all",text:"h-6 text-[14px] leading-[24px] text-button hover:brightness-[1.2] active:brightness-[1.4] transition-all"}[t];return x.jsxs("div",{className:"relative",children:[x.jsx("button",{className:o,disabled:n||r,onClick:i,children:e}),r&&x.jsx(Hm,{size:30})]})}const z0=({onClick:e})=>{var t,n,r;const i=typeof window<"u"?(t=window)==null||(n=t.Telegram)==null||(r=n.WebApp)==null?void 0:r.BackButton:null;return i&&(M.useEffect(()=>(i.show(),()=>{i.hide()}),[]),M.useEffect(()=>{if(e)return i.onClick(e),()=>{i.offClick(e)}},[e])),null},B0=e=>M.createElement("svg",{width:12,height:20,viewBox:"0 0 12 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.53714 19.5928L0.292152 10.6788C-0.097384 10.3036 -0.097384 9.69738 0.292152 9.32117L9.53714 0.407154C10.0995 -0.135718 11.0144 -0.135718 11.5777 0.407154C12.14 0.950026 12.14 1.8311 11.5777 2.37397L3.66913 10.0005L11.5777 17.6251C12.14 18.1689 12.14 19.05 11.5777 19.5928C11.0144 20.1357 10.0995 20.1357 9.53714 19.5928Z",fill:"currentColor"}));function Dl({onBack:e,onCancel:t}){var n,r;return((r=(n=window==null?void 0:window.Telegram)==null?void 0:n.WebApp)==null?void 0:r.platform)!=="unknown"?x.jsx("div",{className:"h-3",children:x.jsx(z0,{onClick:e})}):x.jsxs("header",{className:"relative flex items-center justify-center h-[64px]",children:[t&&x.jsx("button",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:t,children:"Отмена"}),e&&x.jsxs("button",{className:"flex items-center gap-[5px] absolute left-4 top-1/2 -translate-y-1/2 text-link hover:brightness-[1.2] active:brightness-[1.4] transition-all",onClick:e,children:[x.jsx(B0,{}),x.jsx("span",{children:"Назад"})]}),x.jsxs("div",{className:"flex flex-col items-center justify-center gap-0.5",children:[x.jsx("div",{className:"text-[17px] leading-[22px] font-semibold",children:"Split"}),x.jsx("div",{className:"text-hint text-[13px] leading-[18px] font-semibold opacity-70",children:"бот"})]})]})}const $0=e=>{const t=e?e.split(" "):[];return`${t[0]?t[0][0]:""}${t[1]?t[1][0]:""}`},q0=e=>{};function H0({url:e,fullName:t,size:n=40}){const r=q0(t),{isDarkTheme:i}=qm(),s=!e&&t?r+"22":i?"#9AA6AC":"#EEF0F2",l=!e&&t?$0(t):null;return x.jsx("div",{className:"flex items-center justify-center rounded-full bg-cover bg-center",style:{width:n,height:n,backgroundColor:s,backgroundImage:`url(${e})`},children:l&&x.jsx("div",{className:"uppercase font-semibold text-main",style:{fontSize:.35*n+"px",lineHeight:.6*n+"px",color:r},children:l})})}function Nc({user:e,size:t=40}){const n=[...e!=null&&e.first_name?[e.first_name]:[],...e!=null&&e.last_name?[e.last_name]:[]].join(" ");return x.jsxs("div",{className:"w-full flex gap-2 items-center truncate",children:[x.jsx(H0,{url:e==null?void 0:e.profile_photo,size:t,fullName:n}),x.jsx("div",{className:"flex flex-col -gap-0.5 flex-1 text-left truncate text-[16px] leading-[20px]",children:e?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"truncate",children:[e.first_name," ",e.last_name]}),e.username&&x.jsxs("div",{className:"text-[14px] leading-[18px] text-hint truncate",children:["@",e.username]})]}):x.jsx("div",{className:"text-hint truncate",children:"(выберите)"})})]})}const jn=4,Zr=2,Cu=[{id:"RUB",title:"Рубль",symbol:"₽",in:"В рублях",decimals:jn,visible_decimals:Zr},{id:"GEL",title:"Лари",symbol:"₾",in:"В лари",decimals:jn,visible_decimals:Zr},{id:"TRY",title:"Лира",symbol:"₺",in:"В лирах",decimals:jn,visible_decimals:Zr},{id:"EUR",title:"Евро",symbol:"€",in:"В евро",decimals:jn,visible_decimals:Zr}],Q0=e=>{const t={Ё:"YO",Й:"I",Ц:"TS",У:"U",К:"K",Е:"E",Н:"N",Г:"G",Ш:"SH",Щ:"SCH",З:"Z",Х:"H",Ъ:"",ё:"yo",й:"i",ц:"ts",у:"u",к:"k",е:"e",н:"n",г:"g",ш:"sh",щ:"sch",з:"z",х:"h",ъ:"",Ф:"F",Ы:"I",В:"V",А:"A",П:"P",Р:"R",О:"O",Л:"L",Д:"D",Ж:"ZH",Э:"E",ф:"f",ы:"i",в:"v",а:"a",п:"p",р:"r",о:"o",л:"l",д:"d",ж:"zh",э:"e",Я:"Ya",Ч:"CH",С:"S",М:"M",И:"I",Т:"T",Ь:"",Б:"B",Ю:"YU",я:"ya",ч:"ch",с:"s",м:"m",и:"i",т:"t",ь:"",б:"b",ю:"yu"};return e.split("").map(n=>t[n]||"").join("")},W0=e=>({id:Math.round(Math.random()*1e10),first_name:e,last_name:e,username:Math.random()>.2?Q0(e):void 0,profile_photo:`https://i.pravatar.cc/48/${Math.round(Math.random()*1e10)}`,_name:e}),V0=()=>{const e=["Александр","Дмитрий","Максим","Сергей","Андрей","Алексей","Артём","Илья","Кирилл","Михаил","Никита","Матвей","Роман","Егор","Арсений","Иван","Денис","Евгений","Тимофей","Владислав","Игорь","Владимир","Павел","Руслан","Марк","Константин","Тимур","Олег","Ярослав","Антон","Николай","Данил","Анастасия","Мария","Анна","Виктория","Екатерина","Наталья","Марина","Полина","София","Дарья","Алиса","Ксения","Александра","Елена"];return e[Math.floor(Math.random()*e.length)]},K0=e=>{const t=[];do{const n=V0();t.includes(n)||t.push(n)}while(t.length!==e);return t},G0=K0(6),Qm=G0.map(e=>W0(e)),Id=Qm.slice(0,4).map((e,t)=>({normalized_name:e._name,related_user_id:Math.random()>.3?e.id:void 0,is_payer:t<2,amount:Math.round(Math.random()*100)*10**jn})),Y0={id:"1",is_voice:!0,raw_text:Id.map(e=>`${e.normalized_name} ${e.is_payer?"заплатил":"должен"} ${(e.amount/10**jn).toFixed(0)}`).join(", "),shares:Id,is_confirmed:!1,currency_id:Cu[0].id},ao=e=>(e/10**jn).toFixed(Zr),Md=e=>parseFloat(e)*10**jn||0,X0=(e,t)=>{const n=Zr,r=10,i=/[^0-9.]/,o=t.replace(/,/g,".").replace(i,"");if(!/^\d*.?\d*$/.test(o)||o.length>r)return e;const[l,a]=e.split("."),[u,f]=o.split(".");return l==="0"&&u==="00"||a==="0".repeat(n-1)&&f==="0".repeat(n)||f&&f.length>n?e:e===""&&o==="."?"0.":e==="0."&&o==="0"?"":e!=="0."&&o==="0"?"0.":o};function J0({amount:e,onChange:t}){const[n,r]=M.useState(ao(e));M.useEffect(()=>{const s=Md(n);e!==s&&r(ao(e))},[e,n]);const i=s=>{const l=s.target.value,a=X0(n,l);r(a);const u=Md(a);t(u)},o=()=>{r(ao(e))};return x.jsx("input",{type:"text",className:"w-[117px] h-10 p-2 rounded-md border border-[#DDE2E4] dark:border-[#6E7C87] dark:bg-[#D5DADD] text-right text-[16px] text-text dark:text-[#48535B] leading-[24px] focus:ring-2 focus:ring-button focus:outline-none appearance-none transition-all selection:bg-button selection:text-buttonText",inputMode:"decimal",placeholder:"0",value:n,onFocus:s=>{s.target.select()},onBlur:o,onChange:i})}const Ld=e=>{let t;const n=new Set,r=(a,u)=>{const f=typeof a=="function"?a(t):a;if(!Object.is(f,t)){const h=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(d=>d(t,h))}},i=()=>t,l={setState:r,getState:i,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{n.clear()}};return t=e(r,i,l),l},Z0=e=>e?Ld(e):Ld;var Wm={exports:{}},Vm={};/** - * @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 Nl=M,e1=bm;function t1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var n1=typeof Object.is=="function"?Object.is:t1,r1=e1.useSyncExternalStore,i1=Nl.useRef,o1=Nl.useEffect,s1=Nl.useMemo,l1=Nl.useDebugValue;Vm.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=i1(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=s1(function(){function a(g){if(!u){if(u=!0,f=g,g=r(g),i!==void 0&&s.hasValue){var y=s.value;if(i(y,g))return h=y}return h=g}if(y=h,n1(f,g))return y;var S=r(g);return i!==void 0&&i(y,S)?y:(f=g,h=S)}var u=!1,f,h,d=n===void 0?null:n;return[function(){return a(t())},d===null?void 0:function(){return a(d())}]},[t,n,r,i]);var l=r1(e,o[0],o[1]);return o1(function(){s.hasValue=!0,s.value=l},[l]),l1(l),l};Wm.exports=Vm;var a1=Wm.exports;const u1=ll(a1),{useSyncExternalStoreWithSelector:c1}=u1;function f1(e,t=e.getState,n){const r=c1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const Ud=e=>{const t=typeof e=="function"?Z0(e):e,n=(r,i)=>f1(t,r,i);return Object.assign(n,t),n},d1=e=>e?Ud(e):Ud,Ar=d1((e,t)=>({users:Qm,setUsers:n=>e({users:n}),selectUserIndex:null,setSelectUserIndex:n=>e({selectUserIndex:n}),currencies:Cu,currency:Cu[0],setCurrency:n=>{e({transaction:{...t().transaction,currency_id:n}})},transaction:Y0,setTransaction:n=>e({transaction:n}),isSuccess:null,setSuccess:n=>e({isSuccess:n})})),Al=()=>{const{users:e,transaction:t,setTransaction:n,selectUserIndex:r}=Ar(),i=t.shares.map(f=>f.related_user_id),o=e.filter(f=>!i.includes(f.id)),s=t.shares.every(f=>f.related_user_id);return{users:e,unrelatedUsers:o,isRelationsComplete:s,getUserById:f=>e.find(h=>h.id===f),selectUser:f=>()=>{if(r!==null){const h=[...t.shares],d=h.findIndex(g=>g.related_user_id===f.id);h[r].related_user_id=f.id,~d&&(h[d].normalized_name?delete h[d].related_user_id:h.splice(d,1)),n({...t,shares:h})}else{const h=[...t.shares,{is_payer:!1,amount:0,related_user_id:f.id}];n({...t,shares:h})}history.back()},deleteUser:f=>()=>{const h=[...t.shares];h.splice(f,1),n({...t,shares:h}),history.back()}}};function Fd({related_user_id:e,amount:t,onChange:n}){const{getUserById:r}=Al(),i=e?r(e):void 0;return i?x.jsxs("div",{className:"flex gap-3",children:[x.jsx(Nc,{user:i,size:48}),x.jsx(J0,{amount:t,onChange:n})]}):null}function ai({children:e,className:t}){return x.jsx("div",{className:Gn("panel p-4 pb-6 rounded-3xl bg-bg",t),children:e})}function h1(){var n;const{transaction:e,users:t}=Ar();return x.jsxs(ai,{className:"mt-10 text-[12px] break-words opacity-40 overflow-x-auto",children:[x.jsx("h2",{children:"Debug"}),x.jsx("strong",{children:"href = "}),location.href,x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"transaction = "}),x.jsx("pre",{children:JSON.stringify(e,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"users = "}),x.jsx("pre",{children:JSON.stringify(t,null,2)}),x.jsx("br",{}),x.jsx("br",{}),x.jsx("strong",{children:"window.Telegram.Webapp = "}),x.jsx("pre",{children:JSON.stringify((n=window.Telegram)==null?void 0:n.WebApp,null,2)})]})}function Il({children:e,className:t}){return x.jsx("div",{className:Gn("fixed top-0 left-0 w-full h-full overflow-y-auto text-text bg-bg2",t),children:x.jsxs("div",{className:"limiter",children:[e,x.jsx(h1,{})]})})}var vn={DEBUG:!1,LIB_VERSION:"2.47.0"},Ee;if(typeof window>"u"){var jd={hostname:""};Ee={navigator:{userAgent:""},document:{location:jd,referrer:""},screen:{width:0,height:0},location:jd}}else Ee=window;var Ml=Array.prototype,p1=Function.prototype,Km=Object.prototype,bn=Ml.slice,Bo=Km.toString,Ll=Km.hasOwnProperty,Oe=Ee.console,zn=Ee.navigator,fe=Ee.document,as=Ee.opera,tl=Ee.screen,en=zn.userAgent,ha=p1.bind,bd=Ml.forEach,zd=Ml.indexOf,Bd=Ml.map,m1=Array.isArray,Tu={},c={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},ue={log:function(){if(vn.DEBUG&&!c.isUndefined(Oe)&&Oe)try{Oe.log.apply(Oe,arguments)}catch{c.each(arguments,function(t){Oe.log(t)})}},warn:function(){if(vn.DEBUG&&!c.isUndefined(Oe)&&Oe){var e=["Mixpanel warning:"].concat(c.toArray(arguments));try{Oe.warn.apply(Oe,e)}catch{c.each(e,function(n){Oe.warn(n)})}}},error:function(){if(vn.DEBUG&&!c.isUndefined(Oe)&&Oe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Oe.error.apply(Oe,e)}catch{c.each(e,function(n){Oe.error(n)})}}},critical:function(){if(!c.isUndefined(Oe)&&Oe){var e=["Mixpanel error:"].concat(c.toArray(arguments));try{Oe.error.apply(Oe,e)}catch{c.each(e,function(n){Oe.error(n)})}}}},pa=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(ue,arguments)}},Ac=function(e){return{log:pa(ue.log,e),error:pa(ue.error,e),critical:pa(ue.critical,e)}};c.bind=function(e,t){var n,r;if(ha&&e.bind===ha)return ha.apply(e,bn.call(arguments,1));if(!c.isFunction(e))throw new TypeError;return n=bn.call(arguments,2),r=function(){if(!(this instanceof r))return e.apply(t,n.concat(bn.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var s=e.apply(o,n.concat(bn.call(arguments)));return Object(s)===s?s:o},r};c.each=function(e,t,n){if(e!=null){if(bd&&e.forEach===bd)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r0&&(t[r]=n)}),t};c.truncate=function(e,t){var n;return typeof e=="string"?n=e.slice(0,t):c.isArray(e)?(n=[],c.each(e,function(r){n.push(c.truncate(r,t))})):c.isObject(e)?(n={},c.each(e,function(r,i){n[i]=c.truncate(r,t)})):n=e,n};c.JSONEncode=function(){return function(e){var t=e,n=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var a=s[l];return typeof a=="string"?a:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},r=function(i,o){var s="",l=" ",a=0,u="",f="",h=0,d=s,g=[],y=o[i];switch(y&&typeof y=="object"&&typeof y.toJSON=="function"&&(y=y.toJSON(i)),typeof y){case"string":return n(y);case"number":return isFinite(y)?String(y):"null";case"boolean":case"null":return String(y);case"object":if(!y)return"null";if(s+=l,g=[],Bo.apply(y)==="[object Array]"){for(h=y.length,a=0;a="0"&&t<="9";)y+=t,o();if(t===".")for(y+=".";o()&&t>="0"&&t<="9";)y+=t;if(t==="e"||t==="E")for(y+=t,o(),(t==="-"||t==="+")&&(y+=t,o());t>="0"&&t<="9";)y+=t,o();if(g=+y,!isFinite(g))i("Bad number");else return g},l=function(){var g,y,S="",E;if(t==='"')for(;o();){if(t==='"')return o(),S;if(t==="\\")if(o(),t==="u"){for(E=0,y=0;y<4&&(g=parseInt(o(),16),!!isFinite(g));y+=1)E=E*16+g;S+=String.fromCharCode(E)}else if(typeof n[t]=="string")S+=n[t];else break;else S+=t}i("Bad string")},a=function(){for(;t&&t<=" ";)o()},u=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},f,h=function(){var g=[];if(t==="["){if(o("["),a(),t==="]")return o("]"),g;for(;t;){if(g.push(f()),a(),t==="]")return o("]"),g;o(","),a()}}i("Bad array")},d=function(){var g,y={};if(t==="{"){if(o("{"),a(),t==="}")return o("}"),y;for(;t;){if(g=l(),a(),o(":"),Object.hasOwnProperty.call(y,g)&&i('Duplicate key "'+g+'"'),y[g]=f(),a(),t==="}")return o("}"),y;o(","),a()}}i("Bad object")};return f=function(){switch(a(),t){case"{":return d();case"[":return h();case'"':return l();case"-":return s();default:return t>="0"&&t<="9"?s():u()}},function(g){var y;return r=g,e=0,t=" ",y=f(),a(),t&&i("Syntax error"),y}}();c.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n,r,i,o,s,l,a,u,f=0,h=0,d="",g=[];if(!e)return e;e=c.utf8Encode(e);do n=e.charCodeAt(f++),r=e.charCodeAt(f++),i=e.charCodeAt(f++),u=n<<16|r<<8|i,o=u>>18&63,s=u>>12&63,l=u>>6&63,a=u&63,g[h++]=t.charAt(o)+t.charAt(s)+t.charAt(l)+t.charAt(a);while(f127&&s<2048?l=String.fromCharCode(s>>6|192,s&63|128):l=String.fromCharCode(s>>12|224,s>>6&63|128,s&63|128),l!==null&&(r>n&&(t+=e.substring(n,r)),t+=l,n=r=o+1)}return r>n&&(t+=e.substring(n,e.length)),t};c.UUID=function(){var e=function(){var r=1*new Date,i;if(Ee.performance&&Ee.performance.now)i=Ee.performance.now();else for(i=0;r==1*new Date;)i++;return r.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},n=function(){var r=en,i,o,s=[],l=0;function a(u,f){var h,d=0;for(h=0;h=4&&(l=a(l,s),s=[]);return s.length>0&&(l=a(l,s)),l.toString(16)};return function(){var r=(tl.height*tl.width).toString(16);return e()+"-"+t()+"-"+n()+"-"+r+"-"+e()}}();var $d=["ahrefsbot","baiduspider","bingbot","bingpreview","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];c.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<$d.length;t++)if(e.indexOf($d[t])!==-1)return!0;return!1};c.HTTPBuildQuery=function(e,t){var n,r,i=[];return c.isUndefined(t)&&(t="&"),c.each(e,function(o,s){n=encodeURIComponent(o.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+n}),i.join(t)};c.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var n="[\\?&]"+t+"=([^&#]*)",r=new RegExp(n),i=r.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{ue.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")};c.cookie={get:function(e){for(var t=e+"=",n=fe.cookie.split(";"),r=0;r=0}function r(i){if(!fe.getElementsByTagName)return[];var o=i.split(" "),s,l,a,u,f,h,d,g,y,S,E=[fe];for(h=0;h-1){l=s.split("#"),a=l[0];var m=l[1],p=fe.getElementById(m);if(!p||a&&p.nodeName.toLowerCase()!=a)return[];E=[p];continue}if(s.indexOf(".")>-1){l=s.split("."),a=l[0];var _=l[1];for(a||(a="*"),u=[],f=0,d=0;d-1};break;default:O=function(U){return U.getAttribute(P)}}for(E=[],S=0,d=0;d=3?t[2]:""},properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(en,zn.vendor,as),$referrer:fe.referrer,$referring_domain:c.info.referringDomain(fe.referrer),$device:c.info.device(en)}),{$current_url:Ee.location.href,$browser_version:c.info.browserVersion(en,zn.vendor,as),$screen_height:tl.height,$screen_width:tl.width,mp_lib:"web",$lib_version:vn.LIB_VERSION,$insert_id:Ic(),time:c.timestamp()/1e3})},people_properties:function(){return c.extend(c.strip_empty_properties({$os:c.info.os(),$browser:c.info.browser(en,zn.vendor,as)}),{$browser_version:c.info.browserVersion(en,zn.vendor,as)})},mpPageViewProperties:function(){return c.strip_empty_properties({current_page_title:fe.title,current_domain:Ee.location.hostname,current_url_path:Ee.location.pathname,current_url_protocol:Ee.location.protocol,current_url_search:Ee.location.search})}};var Ic=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},_1=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,S1=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,qd=function(e){var t=S1,n=e.split("."),r=n[n.length-1];(r.length>4||r==="com"||r==="org")&&(t=_1);var i=e.match(t);return i?i[0]:""},rl=null,il=null;typeof JSON<"u"&&(rl=JSON.stringify,il=JSON.parse);rl=rl||c.JSONEncode;il=il||c.JSONDecode;c.toArray=c.toArray;c.isObject=c.isObject;c.JSONEncode=c.JSONEncode;c.JSONDecode=c.JSONDecode;c.isBlockedUA=c.isBlockedUA;c.isEmptyObject=c.isEmptyObject;c.info=c.info;c.info.device=c.info.device;c.info.browser=c.info.browser;c.info.browserVersion=c.info.browserVersion;c.info.properties=c.info.properties;var xn=function(){};xn.prototype.create_properties=function(){};xn.prototype.event_handler=function(){};xn.prototype.after_track_handler=function(){};xn.prototype.init=function(e){return this.mp=e,this};xn.prototype.track=function(e,t,n,r){var i=this,o=c.dom_query(e);if(o.length===0){ue.error("The DOM query ("+e+") returned 0 elements");return}return c.each(o,function(s){c.register_event(s,this.override_event,function(l){var a={},u=i.create_properties(n,this),f=i.mp.get_config("track_links_timeout");i.event_handler(l,this,a),window.setTimeout(i.track_callback(r,u,a,!0),f),i.mp.track(t,u,i.track_callback(r,u,a))})},this),!0};xn.prototype.track_callback=function(e,t,n,r){r=r||!1;var i=this;return function(){n.callback_fired||(n.callback_fired=!0,!(e&&e(r,t)===!1)&&i.after_track_handler(t,n,r))}};xn.prototype.create_properties=function(e,t){var n;return typeof e=="function"?n=e(t):n=c.extend({},e),n};var yi=function(){this.override_event="click"};c.inherit(yi,xn);yi.prototype.create_properties=function(e,t){var n=yi.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n};yi.prototype.event_handler=function(e,t,n){n.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",n.href=t.href,n.new_tab||e.preventDefault()};yi.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var Ul=function(){this.override_event="submit"};c.inherit(Ul,xn);Ul.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()};Ul.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var w1=Ac("lock"),Gm=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Gm.prototype.withLock=function(e,t,n){!n&&typeof t!="function"&&(n=t,t=null);var r=n||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,s=this.pollIntervalMS,l=this.timeoutMS,a=this.storage,u=o+":X",f=o+":Y",h=o+":Z",d=function(p){t&&t(p)},g=function(p){if(new Date().getTime()-i>l){w1.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+r+"]"),a.removeItem(h),a.removeItem(f),E();return}setTimeout(function(){try{p()}catch(_){d(_)}},s*(Math.random()+.1))},y=function(p,_){p()?_():g(function(){y(p,_)})},S=function(){var p=a.getItem(f);if(p&&p!==r)return!1;if(a.setItem(f,r),a.getItem(f)===r)return!0;if(!nl(a,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},E=function(){a.setItem(u,r),y(S,function(){if(a.getItem(u)===r){m();return}g(function(){if(a.getItem(f)!==r){E();return}y(function(){return!a.getItem(h)},m)})})},m=function(){a.setItem(h,"1");try{e()}finally{a.removeItem(h),a.getItem(f)===r&&a.removeItem(f),a.getItem(u)===r&&a.removeItem(u)}};try{if(nl(a,!0))E();else throw new Error("localStorage support check failed")}catch(p){d(p)}};var Hd=Ac("batch"),ir=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||c.bind(Hd.error,Hd),this.lock=new Gm(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};ir.prototype.enqueue=function(e,t,n){var r={id:Ic(),flushAfter:new Date().getTime()+t*2,payload:e};this.lock.withLock(c.bind(function(){var o;try{var s=this.readFromStorage();s.push(r),o=this.saveToStorage(s),o&&this.memQueue.push(r)}catch{this.reportError("Error enqueueing item",e),o=!1}n&&n(o)},this),c.bind(function(o){this.reportError("Error acquiring storage lock",o),n&&n(!1)},this),this.pid)};ir.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.lengtho.flushAfter&&!r[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var Qd=function(e,t){var n=[];return c.each(e,function(r){r.id&&!t[r.id]&&n.push(r)}),n};ir.prototype.removeItemsByID=function(e,t){var n={};c.each(e,function(i){n[i]=!0}),this.memQueue=Qd(this.memQueue,n);var r=c.bind(function(){var i;try{var o=this.readFromStorage();if(o=Qd(o,n),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var s=0;s5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[d]}),h=!1):this.reportError("[dupe] found item with no ID",{item:u}),h&&o.push(f)}s[u.id]=f},this),o.length<1){this.resetFlush();return}this.requestInProgress=!0;var l=c.bind(function(u){this.requestInProgress=!1;try{var f=!1;if(e.unloading)this.queue.updatePayloads(s);else if(c.isObject(u)&&u.error==="timeout"&&new Date().getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(c.isObject(u)&&u.xhr_req&&(u.xhr_req.status>=500||u.xhr_req.status===429||u.error==="timeout")){var h=this.flushInterval*2,d=u.xhr_req.responseHeaders;if(d){var g=d["Retry-After"];g&&(h=parseInt(g,10)*1e3||h)}h=Math.min(E1,h),this.reportError("Error; retry in "+h+" ms"),this.scheduleFlush(h)}else if(c.isObject(u)&&u.xhr_req&&u.xhr_req.status===413)if(i.length>1){var y=Math.max(1,Math.floor(r/2));this.batchSize=Math.min(this.batchSize,y,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),f=!0;else f=!0;f&&(this.queue.removeItemsByID(c.map(i,function(S){return S.id}),c.bind(function(S){S?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),c.each(i,c.bind(function(S){var E=S.id;E?(this.itemIdsSentSuccessfully[E]=this.itemIdsSentSuccessfully[E]||0,this.itemIdsSentSuccessfully[E]++,this.itemIdsSentSuccessfully[E]>5&&this.reportError("[dupe] item ID sent too many times",{item:S,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[E]})):this.reportError("[dupe] found item with no ID while removing",{item:S})},this)))}catch(S){this.reportError("Error handling API response",S),this.resetFlush()}},this),a={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(a.transport="sendBeacon"),uo.log("MIXPANEL REQUEST:",o),this.sendRequest(o,a,l)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}};sn.prototype.reportError=function(e,t){if(uo.error.apply(uo.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){uo.error(n)}};var x1="__mp_opt_in_out_";function k1(e,t){Jm(!0,e,t)}function C1(e,t){Jm(!1,e,t)}function T1(e,t){return Xm(e,t)==="1"}function Ym(e,t){if(O1(t))return ue.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var n=Xm(e,t)==="0";return n&&ue.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function ki(e){return Uc(e,function(t){return this.get_config(t)})}function or(e){return Uc(e,function(t){return this._get_config(t)})}function Ci(e){return Uc(e,function(t){return this._get_config(t)})}function R1(e,t){t=t||{},Mc(t).remove(Lc(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Mc(e){return e=e||{},e.persistenceType==="localStorage"?c.localStorage:c.cookie}function Lc(e,t){return t=t||{},(t.persistencePrefix||x1)+e}function Xm(e,t){return Mc(t).get(Lc(e,t))}function O1(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Ee,n=t.navigator||{},r=!1;return c.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],function(i){c.includes([!0,1,"1","yes"],i)&&(r=!0)}),r}function Jm(e,t,n){if(!c.isString(t)||!t.length){ue.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}n=n||{},Mc(n).set(Lc(t,n),e?1:0,c.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})}function Uc(e,t){return function(){var n=!1;try{var r=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),s=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");r&&(n=Ym(r,{ignoreDnt:i,persistenceType:o,persistencePrefix:s,window:l}))}catch(u){ue.error("Unexpected error when checking tracking opt-out status: "+u)}if(!n)return e.apply(this,arguments);var a=arguments[arguments.length-1];typeof a=="function"&&a(0)}}var Zn="$set",_i="$set_once",$t="$unset",Or="$add",wn="$append",Pr="$union",er="$remove",P1="$delete",Zm={set_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[Zn]=r,n},unset_action:function(e){var t={},n=[];return c.isArray(e)||(e=[e]),c.each(e,function(r){this._is_reserved_property(r)||n.push(r)},this),t[$t]=n,t},set_once_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[_i]=r,n},union_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=c.isArray(i)?i:[i])},this):r[e]=c.isArray(t)?t:[t],n[Pr]=r,n},append_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[wn]=r,n},remove_action:function(e,t){var n={},r={};return c.isObject(e)?c.each(e,function(i,o){this._is_reserved_property(o)||(r[o]=i)},this):r[e]=t,n[er]=r,n},delete_action:function(){var e={};return e[P1]="",e}},ve=function(){};c.extend(ve.prototype,Zm);ve.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n};ve.prototype.set=Ci(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.set_once=Ci(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});ve.prototype.unset=Ci(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});ve.prototype.union=Ci(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});ve.prototype.delete=Ci(function(e){var t=this.delete_action();return this._send_request(t,e)});ve.prototype.remove=Ci(function(e,t,n){var r=this.remove_action(e,t);return this._send_request(r,n)});ve.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=c.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/groups/",batcher:this._mixpanel.request_batchers.groups},t)};ve.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};ve.prototype._get_config=function(e){return this._mixpanel.get_config(e)};ve.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};ve.prototype.remove=ve.prototype.remove;ve.prototype.set=ve.prototype.set;ve.prototype.set_once=ve.prototype.set_once;ve.prototype.union=ve.prototype.union;ve.prototype.unset=ve.prototype.unset;ve.prototype.toString=ve.prototype.toString;var G=function(){};c.extend(G.prototype,Zm);G.prototype._init=function(e){this._mixpanel=e};G.prototype.set=or(function(e,t,n){var r=this.set_action(e,t);return c.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),r[Zn]=c.extend({},c.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),r[Zn]),this._send_request(r,n)});G.prototype.set_once=or(function(e,t,n){var r=this.set_once_action(e,t);return c.isObject(e)&&(n=t),this._send_request(r,n)});G.prototype.unset=or(function(e,t){var n=this.unset_action(e);return this._send_request(n,t)});G.prototype.increment=or(function(e,t,n){var r={},i={};return c.isObject(e)?(c.each(e,function(o,s){if(!this._is_reserved_property(s))if(isNaN(parseFloat(o))){ue.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else i[s]=o},this),n=t):(c.isUndefined(t)&&(t=1),i[e]=t),r[Or]=i,this._send_request(r,n)});G.prototype.append=or(function(e,t,n){c.isObject(e)&&(n=t);var r=this.append_action(e,t);return this._send_request(r,n)});G.prototype.remove=or(function(e,t,n){c.isObject(e)&&(n=t);var r=this.remove_action(e,t);return this._send_request(r,n)});G.prototype.union=or(function(e,t,n){c.isObject(e)&&(n=t);var r=this.union_action(e,t);return this._send_request(r,n)});G.prototype.track_charge=or(function(e,t,n){if(!c.isNumber(e)&&(e=parseFloat(e),isNaN(e))){ue.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",c.extend({$amount:e},t),n)});G.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};G.prototype.delete_user=function(){if(!this._identify_called()){ue.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};G.prototype.toString=function(){return this._mixpanel.toString()+".people"};G.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),r=this._mixpanel.get_property("$user_id"),i=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=c.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:o,endpoint:this._get_config("api_host")+"/engage/",batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),c.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),c.truncate(o,255))};G.prototype._get_config=function(e){return this._mixpanel.get_config(e)};G.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};G.prototype._enqueue=function(e){Zn in e?this._mixpanel.persistence._add_to_people_queue(Zn,e):_i in e?this._mixpanel.persistence._add_to_people_queue(_i,e):$t in e?this._mixpanel.persistence._add_to_people_queue($t,e):Or in e?this._mixpanel.persistence._add_to_people_queue(Or,e):wn in e?this._mixpanel.persistence._add_to_people_queue(wn,e):er in e?this._mixpanel.persistence._add_to_people_queue(er,e):Pr in e?this._mixpanel.persistence._add_to_people_queue(Pr,e):ue.error("Invalid call to _enqueue():",e)};G.prototype._flush_one_queue=function(e,t,n,r){var i=this,o=c.extend({},this._mixpanel.persistence._get_queue(e)),s=o;!c.isUndefined(o)&&c.isObject(o)&&!c.isEmptyObject(o)&&(i._mixpanel.persistence._pop_from_people_queue(e,o),r&&(s=r(o)),t.call(i,s,function(l,a){l===0&&i._mixpanel.persistence._add_to_people_queue(e,o),c.isUndefined(n)||n(l,a)}))};G.prototype._flush=function(e,t,n,r,i,o,s){var l=this,a=this._mixpanel.persistence._get_queue(wn),u=this._mixpanel.persistence._get_queue(er);if(this._flush_one_queue(Zn,this.set,e),this._flush_one_queue(_i,this.set_once,r),this._flush_one_queue($t,this.unset,o,function(E){return c.keys(E)}),this._flush_one_queue(Or,this.increment,t),this._flush_one_queue(Pr,this.union,i),!c.isUndefined(a)&&c.isArray(a)&&a.length){for(var f,h=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(wn,f),c.isUndefined(n)||n(E,m)},d=a.length-1;d>=0;d--)f=a.pop(),c.isEmptyObject(f)||l.append(f,h);l._mixpanel.persistence.save()}if(!c.isUndefined(u)&&c.isArray(u)&&u.length){for(var g,y=function(E,m){E===0&&l._mixpanel.persistence._add_to_people_queue(er,g),c.isUndefined(s)||s(E,m)},S=u.length-1;S>=0;S--)g=u.pop(),c.isEmptyObject(g)||l.remove(g,y);l._mixpanel.persistence.save()}};G.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};G.prototype.set=G.prototype.set;G.prototype.set_once=G.prototype.set_once;G.prototype.unset=G.prototype.unset;G.prototype.increment=G.prototype.increment;G.prototype.append=G.prototype.append;G.prototype.remove=G.prototype.remove;G.prototype.union=G.prototype.union;G.prototype.track_charge=G.prototype.track_charge;G.prototype.clear_charges=G.prototype.clear_charges;G.prototype.delete_user=G.prototype.delete_user;G.prototype.toString=G.prototype.toString;var Fc="__mps",jc="__mpso",bc="__mpus",zc="__mpa",Bc="__mpap",$c="__mpr",qc="__mpu",ev="$people_distinct_id",ol="__alias",No="__timers",D1=[Fc,jc,bc,zc,Bc,$c,qc,ev,ol,No],J=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(ue.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&c.localStorage.is_supported()?this.storage=c.localStorage:this.storage=c.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};J.prototype.properties=function(){var e={};return c.each(this.props,function(t,n){c.include(D1,n)||(e[n]=t)}),e};J.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=c.extend({},e))}};J.prototype.upgrade=function(e){var t=e.upgrade,n,r;t&&(n="mp_super_properties",typeof t=="string"&&(n=t),r=this.storage.parse(n),this.storage.remove(n),this.storage.remove(n,!0),r&&(this.props=c.extend(this.props,r.all,r.events))),!e.cookie_name&&e.name!=="mixpanel"&&(n="mp_"+e.token+"_"+e.name,r=this.storage.parse(n),r&&(this.storage.remove(n),this.storage.remove(n,!0),this.register_once(r))),this.storage===c.localStorage&&(r=c.cookie.parse(this.name),c.cookie.remove(this.name),c.cookie.remove(this.name,!0),r&&this.register_once(r))};J.prototype.save=function(){this.disabled||this.storage.set(this.name,c.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};J.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};J.prototype.clear=function(){this.remove(),this.props={}};J.prototype.register_once=function(e,t,n){return c.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof n>"u"?this.default_expiry:n,c.each(e,function(r,i){(!this.props.hasOwnProperty(i)||this.props[i]===t)&&(this.props[i]=r)},this),this.save(),!0):!1};J.prototype.register=function(e,t){return c.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,c.extend(this.props,e),this.save(),!0):!1};J.prototype.unregister=function(e){e in this.props&&(delete this.props[e],this.save())};J.prototype.update_search_keyword=function(e){this.register(c.info.searchInfo(e))};J.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:c.info.referringDomain(e)||"$direct"},"")};J.prototype.get_referrer_info=function(){return c.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};J.prototype.safe_merge=function(e){return c.each(this.props,function(t,n){n in e||(e[n]=t)}),e};J.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};J.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};J.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};J.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};J.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};J.prototype.get_cross_subdomain=function(){return this.cross_subdomain};J.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};J.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),r=t[e],i=this._get_or_create_queue(Zn),o=this._get_or_create_queue(_i),s=this._get_or_create_queue($t),l=this._get_or_create_queue(Or),a=this._get_or_create_queue(Pr),u=this._get_or_create_queue(er,[]),f=this._get_or_create_queue(wn,[]);n===Fc?(c.extend(i,r),this._pop_from_people_queue(Or,r),this._pop_from_people_queue(Pr,r),this._pop_from_people_queue($t,r)):n===jc?(c.each(r,function(h,d){d in o||(o[d]=h)}),this._pop_from_people_queue($t,r)):n===bc?c.each(r,function(h){c.each([i,o,l,a],function(d){h in d&&delete d[h]}),c.each(f,function(d){h in d&&delete d[h]}),s[h]=!0}):n===zc?(c.each(r,function(h,d){d in i?i[d]+=h:(d in l||(l[d]=0),l[d]+=h)},this),this._pop_from_people_queue($t,r)):n===qc?(c.each(r,function(h,d){c.isArray(h)&&(d in a||(a[d]=[]),a[d]=a[d].concat(h))}),this._pop_from_people_queue($t,r)):n===$c?(u.push(r),this._pop_from_people_queue(wn,r)):n===Bc&&(f.push(r),this._pop_from_people_queue($t,r)),ue.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),ue.log(t),this.save()};J.prototype._pop_from_people_queue=function(e,t){var n=this._get_queue(e);c.isUndefined(n)||(c.each(t,function(r,i){e===wn||e===er?c.each(n,function(o){o[i]===r&&delete o[i]}):delete n[i]},this),this.save())};J.prototype._get_queue_key=function(e){if(e===Zn)return Fc;if(e===_i)return jc;if(e===$t)return bc;if(e===Or)return zc;if(e===wn)return Bc;if(e===er)return $c;if(e===Pr)return qc;ue.error("Invalid queue:",e)};J.prototype._get_queue=function(e){return this.props[this._get_queue_key(e)]};J.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=c.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)};J.prototype.set_event_timer=function(e,t){var n=this.props[No]||{};n[e]=t,this.props[No]=n,this.save()};J.prototype.remove_event_timer=function(e){var t=this.props[No]||{},n=t[e];return c.isUndefined(n)||(delete this.props[No][e],this.save()),n};var Hc,We,tv=0,N1=1,A1=function(e){return e},Ao=function(){},Rt="mixpanel",nv="base64",I1="json",Qc="$device:",ui=Ee.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,rv=!ui&&en.indexOf("MSIE")===-1&&en.indexOf("Mozilla")===-1,sl=null;zn.sendBeacon&&(sl=function(){return zn.sendBeacon.apply(zn,arguments)});var Vd={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:nv,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:Ao,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:Ao,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{}},iv=!1,D=function(){},Ru=function(e,t,n){var r,i=n===Rt?We:We[n];if(i&&Hc===tv)r=i;else{if(i&&!c.isArray(i)){ue.error("You have already initialized "+n);return}r=new D}if(r._cached_groups={},r._init(e,t,n),r.people=new G,r.people._init(r),!r.get_config("skip_first_touch_marketing")){var o=c.info.campaignParams(null),s={},l=!1;c.each(o,function(a,u){s["initial_"+u]=a,a&&(l=!0)}),l&&r.people.set_once(s)}return vn.DEBUG=vn.DEBUG||r.get_config("debug"),!c.isUndefined(i)&&c.isArray(i)&&(r._execute_array.call(r.people,i.people),r._execute_array(i)),r};D.prototype.init=function(e,t,n){if(c.isUndefined(n)){this.report_error("You must name your new library: init(token, config, name)");return}if(n===Rt){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var r=Ru(e,t,n);return We[n]=r,r._loaded(),r};D.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var r={};if(!("api_payload_format"in t)){var i=t.api_host||Vd.api_host;i.match(/\.mixpanel\.com/)&&(r.api_payload_format=I1)}if(this.set_config(c.extend({},Vd,r,t,{name:n,token:e,callback_fn:(n===Rt?n:Rt+"."+n)+"._jsc"})),this._jsc=Ao,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!c.localStorage.is_supported(!0)||!ui)this._batch_requests=!1,ue.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.init_batchers(),sl&&Ee.addEventListener){var o=c.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);Ee.addEventListener("pagehide",function(l){l.persisted&&o()}),Ee.addEventListener("visibilitychange",function(){fe.visibilityState==="hidden"&&o()})}}this.persistence=this.cookie=new J(this.config),this.unpersisted_superprops={},this._gdpr_init();var s=c.UUID();this.get_distinct_id()||this.register_once({distinct_id:Qc+s,$device_id:s},""),this.get_config("track_pageview")&&this.track_pageview()};D.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};D.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(fe.referrer),this.get_config("store_google")&&this.register(c.info.campaignParams(),{persistent:!1}),this.get_config("save_referrer")&&this.persistence.update_referrer_info(fe.referrer)};D.prototype._dom_loaded=function(){c.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||c.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};D.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!iv)return this.__dom_loaded_queue.push([e,t]),!1;var n=new e().init(this);return n.track.apply(n,t)};D.prototype._prepare_callback=function(e,t){if(c.isUndefined(e))return null;if(ui){var n=function(s){e(s,t)};return n}else{var r=this._jsc,i=""+Math.floor(Math.random()*1e8),o=this.get_config("callback_fn")+"["+i+"]";return r[i]=function(s){delete r[i],e(s,t)},o}};D.prototype._send_request=function(e,t,n,r){var i=!0;if(rv)return this.__request_queue.push(arguments),i;var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},s=null;!r&&(c.isFunction(n)||typeof n=="string")&&(r=n,n=null),n=c.extend(o,n||{}),ui||(n.method="GET");var l=n.method==="POST",a=sl&&l&&n.transport.toLowerCase()==="sendbeacon",u=n.verbose;t.verbose&&(u=!0),this.get_config("test")&&(t.test=1),u&&(t.verbose=1),this.get_config("img")&&(t.img=1),ui||(r?t.callback=r:(u||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),l&&(s="data="+encodeURIComponent(t.data),delete t.data),e+="?"+c.HTTPBuildQuery(t);var f=this;if("img"in t){var h=fe.createElement("img");h.src=e,fe.body.appendChild(h)}else if(a){try{i=sl(e,s)}catch(m){f.report_error(m),i=!1}try{r&&r(i?1:0)}catch(m){f.report_error(m)}}else if(ui)try{var d=new XMLHttpRequest;d.open(n.method,e,!0);var g=this.get_config("xhr_headers");if(l&&(g["Content-Type"]="application/x-www-form-urlencoded"),c.each(g,function(m,p){d.setRequestHeader(p,m)}),n.timeout_ms&&typeof d.timeout<"u"){d.timeout=n.timeout_ms;var y=new Date().getTime()}d.withCredentials=!0,d.onreadystatechange=function(){if(d.readyState===4)if(d.status===200){if(r)if(u){var m;try{m=c.JSONDecode(d.responseText)}catch(_){if(f.report_error(_),n.ignore_json_errors)m=d.responseText;else return}r(m)}else r(Number(d.responseText))}else{var p;d.timeout&&!d.status&&new Date().getTime()-y>=d.timeout?p="timeout":p="Bad HTTP status: "+d.status+" "+d.statusText,f.report_error(p),r&&r(u?{status:0,error:p,xhr_req:d}:0)}},d.send(s)}catch(m){f.report_error(m),i=!1}else{var S=fe.createElement("script");S.type="text/javascript",S.async=!0,S.defer=!0,S.src=e;var E=fe.getElementsByTagName("script")[0];E.parentNode.insertBefore(S,E)}return i};D.prototype._execute_array=function(e){var t,n=[],r=[],i=[];c.each(e,function(s){s&&(t=s[0],c.isArray(t)?i.push(s):typeof s=="function"?s.call(this):c.isArray(s)&&t==="alias"?n.push(s):c.isArray(s)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?i.push(s):r.push(s))},this);var o=function(s,l){c.each(s,function(a){if(c.isArray(a[0])){var u=l;c.each(a,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[a[0]].apply(this,a.slice(1))},l)};o(n,this),o(r,this),o(i,this)};D.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};D.prototype.init_batchers=function(){var e=this.get_config("token");if(!this.are_batchers_initialized()){var t=c.bind(function(n){return new sn("__mpq_"+e+n.queue_suffix,{libConfig:this.config,sendRequestFunc:c.bind(function(r,i,o){this._send_request(this.get_config("api_host")+n.endpoint,this._encode_data_for_request(r),i,this._prepare_callback(o,r))},this),beforeSendHook:c.bind(function(r){return this._run_hook("before_send_"+n.type,r)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:c.bind(this.stop_batch_senders,this)})},this);this.request_batchers={events:t({type:"events",endpoint:"/track/",queue_suffix:"_ev"}),people:t({type:"people",endpoint:"/engage/",queue_suffix:"_pp"}),groups:t({type:"groups",endpoint:"/groups/",queue_suffix:"_gr"})}}this.get_config("batch_autostart")&&this.start_batch_senders()};D.prototype.start_batch_senders=function(){this.are_batchers_initialized()&&(this._batch_requests=!0,c.each(this.request_batchers,function(e){e.start()}))};D.prototype.stop_batch_senders=function(){this._batch_requests=!1,c.each(this.request_batchers,function(e){e.stop(),e.clear()})};D.prototype.push=function(e){this._execute_array([e])};D.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};D.prototype._encode_data_for_request=function(e){var t=c.JSONEncode(e);return this.get_config("api_payload_format")===nv&&(t=c.base64Encode(t)),{data:t}};D.prototype._track_or_batch=function(e,t){var n=c.truncate(e.data,255),r=e.endpoint,i=e.batcher,o=e.should_send_immediately,s=e.send_request_options||{};t=t||Ao;var l=!0,a=c.bind(function(){return s.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(ue.log("MIXPANEL REQUEST:"),ue.log(n),this._send_request(r,this._encode_data_for_request(n),s,this._prepare_callback(t,n))):null},this);return this._batch_requests&&!o?i.enqueue(n,function(u){u?t(1,n):a()}):l=a(),l&&n};D.prototype.track=ki(function(e,t,n,r){!r&&typeof n=="function"&&(r=n,n=null),n=n||{};var i=n.transport;i&&(n.transport=i);var o=n.send_immediately;if(typeof r!="function"&&(r=Ao),c.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){r(0);return}t=t||{},t.token=this.get_config("token");var s=this.persistence.remove_event_timer(e);if(!c.isUndefined(s)){var l=new Date().getTime()-s;t.$duration=parseFloat((l/1e3).toFixed(3))}this._set_default_superprops();var a=this.get_config("track_marketing")?c.info.marketingParams():{};t=c.extend({},c.info.properties(),a,this.persistence.properties(),this.unpersisted_superprops,t);var u=this.get_config("property_blacklist");c.isArray(u)?c.each(u,function(d){delete t[d]}):this.report_error("Invalid value for property_blacklist config: "+u);var f={event:e,properties:t},h=this._track_or_batch({type:"events",data:f,endpoint:this.get_config("api_host")+"/track/",batcher:this.request_batchers.events,should_send_immediately:o,send_request_options:n},r);return h});D.prototype.set_group=ki(function(e,t,n){c.isArray(t)||(t=[t]);var r={};return r[e]=t,this.register(r),this.people.set(e,t,n)});D.prototype.add_group=ki(function(e,t,n){var r=this.get_property(e);if(r===void 0){var i={};i[e]=[t],this.register(i)}else r.indexOf(t)===-1&&(r.push(t),this.register(i));return this.people.union(e,t,n)});D.prototype.remove_group=ki(function(e,t,n){var r=this.get_property(e);if(r!==void 0){var i=r.indexOf(t);i>-1&&(r.splice(i,1),this.register({group_key:r})),r.length===0&&this.unregister(e)}return this.people.remove(e,t,n)});D.prototype.track_with_groups=ki(function(e,t,n,r){var i=c.extend({},t||{});return c.each(n,function(o,s){o!=null&&(i[s]=o)}),this.track(e,i,r)});D.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};D.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};D.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),r=this._cached_groups[n];return(r===void 0||r._group_key!==e||r._group_id!==t)&&(r=new ve,r._init(this,e,t),this._cached_groups[n]=r),r};D.prototype.track_pageview=ki(function(e,t){typeof e!="object"&&(e={}),t=t||{};var n=t.event_name||"$mp_web_page_view",r=c.extend(c.info.mpPageViewProperties(),c.info.campaignParams(),c.info.clickParams()),i=c.extend({},r,e);return this.track(n,i)});D.prototype.track_links=function(){return this._track_dom.call(this,yi,arguments)};D.prototype.track_forms=function(){return this._track_dom.call(this,Ul,arguments)};D.prototype.time_event=function(e){if(c.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var M1={persistent:!0},Wc=function(e){var t;return c.isObject(e)?t=e:c.isUndefined(e)?t={}:t={days:e},c.extend({},M1,t)};D.prototype.register=function(e,t){var n=Wc(t);n.persistent?this.persistence.register(e,n.days):c.extend(this.unpersisted_superprops,e)};D.prototype.register_once=function(e,t,n){var r=Wc(n);r.persistent?this.persistence.register_once(e,t,r.days):(typeof t>"u"&&(t="None"),c.each(e,function(i,o){(!this.unpersisted_superprops.hasOwnProperty(o)||this.unpersisted_superprops[o]===t)&&(this.unpersisted_superprops[o]=i)},this))};D.prototype.unregister=function(e,t){t=Wc(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};D.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)};D.prototype.identify=function(e,t,n,r,i,o,s,l){var a=this.get_distinct_id();if(e&&a!==e){if(typeof e=="string"&&e.indexOf(Qc)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var u=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:u},"")}e!==a&&e!==this.get_property(ol)&&(this.unregister(ol),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,r,i,o,s,l),e!==a&&this.track("$identify",{distinct_id:e,$anon_distinct_id:a},{skip_hooks:!0})};D.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=c.UUID();this.register_once({distinct_id:Qc+e,$device_id:e},"")};D.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};D.prototype.alias=function(e,t){if(e===this.get_property(ev))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return c.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(ol,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){n.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};D.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};D.prototype.set_config=function(e){if(c.isObject(e)){c.extend(this.config,e);var t=e.batch_size;t&&c.each(this.request_batchers,function(n){n.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),vn.DEBUG=vn.DEBUG||this.get_config("debug")}};D.prototype.get_config=function(e){return this.config[e]};D.prototype._run_hook=function(e){var t=(this.config.hooks[e]||A1).apply(this,bn.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};D.prototype.get_property=function(e){return this.persistence.props[e]};D.prototype.toString=function(){var e=this.get_config("name");return e!==Rt&&(e=Rt+"."+e),e};D.prototype._event_is_disabled=function(e){return c.isBlockedUA(en)||this._flags.disable_all_events||c.include(this.__disabled_events,e)};D.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&c.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||c.cookie.get("mp_optout"))&&(c.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};D.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t&&c.each(this.request_batchers,function(n){n.clear()})};D.prototype._gdpr_call_func=function(e,t){return t=c.extend({track:c.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),c.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};D.prototype.opt_in_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(k1,e),this._gdpr_update_persistence(e)};D.prototype.opt_out_tracking=function(e){e=c.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(C1,e),this._gdpr_update_persistence(e)};D.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(T1,e)};D.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(Ym,e)};D.prototype.clear_opt_in_out_tracking=function(e){e=c.extend({enable_persistence:!0},e),this._gdpr_call_func(R1,e),this._gdpr_update_persistence(e)};D.prototype.report_error=function(e,t){ue.error.apply(ue.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){ue.error(n)}};D.prototype.init=D.prototype.init;D.prototype.reset=D.prototype.reset;D.prototype.disable=D.prototype.disable;D.prototype.time_event=D.prototype.time_event;D.prototype.track=D.prototype.track;D.prototype.track_links=D.prototype.track_links;D.prototype.track_forms=D.prototype.track_forms;D.prototype.track_pageview=D.prototype.track_pageview;D.prototype.register=D.prototype.register;D.prototype.register_once=D.prototype.register_once;D.prototype.unregister=D.prototype.unregister;D.prototype.identify=D.prototype.identify;D.prototype.alias=D.prototype.alias;D.prototype.name_tag=D.prototype.name_tag;D.prototype.set_config=D.prototype.set_config;D.prototype.get_config=D.prototype.get_config;D.prototype.get_property=D.prototype.get_property;D.prototype.get_distinct_id=D.prototype.get_distinct_id;D.prototype.toString=D.prototype.toString;D.prototype.opt_out_tracking=D.prototype.opt_out_tracking;D.prototype.opt_in_tracking=D.prototype.opt_in_tracking;D.prototype.has_opted_out_tracking=D.prototype.has_opted_out_tracking;D.prototype.has_opted_in_tracking=D.prototype.has_opted_in_tracking;D.prototype.clear_opt_in_out_tracking=D.prototype.clear_opt_in_out_tracking;D.prototype.get_group=D.prototype.get_group;D.prototype.set_group=D.prototype.set_group;D.prototype.add_group=D.prototype.add_group;D.prototype.remove_group=D.prototype.remove_group;D.prototype.track_with_groups=D.prototype.track_with_groups;D.prototype.start_batch_senders=D.prototype.start_batch_senders;D.prototype.stop_batch_senders=D.prototype.stop_batch_senders;J.prototype.properties=J.prototype.properties;J.prototype.update_search_keyword=J.prototype.update_search_keyword;J.prototype.update_referrer_info=J.prototype.update_referrer_info;J.prototype.get_cross_subdomain=J.prototype.get_cross_subdomain;J.prototype.clear=J.prototype.clear;var ei={},L1=function(){c.each(ei,function(e,t){t!==Rt&&(We[t]=e)}),We._=c},U1=function(){We.init=function(e,t,n){if(n)return We[n]||(We[n]=ei[n]=Ru(e,t,n),We[n]._loaded()),We[n];var r=We;ei[Rt]?r=ei[Rt]:e&&(r=Ru(e,t,Rt),r._loaded(),ei[Rt]=r),We=r,Hc===N1&&(Ee[Rt]=We),L1()}},F1=function(){function e(){e.done||(e.done=!0,iv=!0,rv=!1,c.each(ei,function(r){r._dom_loaded()}))}function t(){try{fe.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(fe.addEventListener)fe.readyState==="complete"?e():fe.addEventListener("DOMContentLoaded",e,!1);else if(fe.attachEvent){fe.attachEvent("onreadystatechange",e);var n=!1;try{n=Ee.frameElement===null}catch{}fe.documentElement.doScroll&&n&&t()}c.register_event(Ee,"load",e,!0)};function j1(){return Hc=tv,We=new D,U1(),We.init(),F1(),We}var b1=j1(),z1=b1;const ov=ll(z1),B1="9b5c61bf2bf4c48916655fe862e8fcbd",$1=B1,sv={OPEN_WEBAPP:"open_webapp",SEND_TRANSACTION:"send_transaction"},lv=async e=>{console.info("[mixpanel]",e),await ov.track(e)};ov.init($1,{loaded:()=>{lv(sv.OPEN_WEBAPP)}});const av="https://jsonplaceholder.typicode.com",q1=()=>b0({queryKey:["currencies"],queryFn:()=>fetch(`${av}/users`).then(e=>e.json()),onSuccess:e=>{console.log("data",e)},staleTime:60*1e3}),H1=e=>fetch(`${av}/posts/1`,{method:"PATCH",body:JSON.stringify(e),headers:{"Content-type":"application/json"}});function Q1(){const e=Rc(),[t,n]=M.useState(!1),{currencies:r,transaction:i,setTransaction:o,setSuccess:s}=Ar(),l=r.find(k=>k.id===i.currency_id),a=(k,T)=>{const O=[...i.shares],U=O.findIndex(B=>B.related_user_id===k);O[U].amount=T,o({...i,shares:O})},u=i.shares.filter(k=>k.is_payer).reduce((k,T)=>k+T.amount,0),f=ao(u),h=i.shares.filter(k=>!k.is_payer).reduce((k,T)=>k+T.amount,0),d=ao(h),g=1,y=uh+g,m=i.shares.filter(k=>k.related_user_id&&k.is_payer),p=i.shares.filter(k=>k.related_user_id&&!k.is_payer),_=p.every(k=>k.amount===p[0].amount),v=()=>{const k=Math.round(u/p.length),T=[...i.shares];o({...i,shares:T.map(O=>O.is_payer?O:{...O,amount:k})})},P=async()=>{var T,O;const k={...i,is_confirmed:!0};n(!0);try{await lv(sv.SEND_TRANSACTION),console.log(JSON.stringify(k,null,2));const U=await H1(k);console.log("res",U);const B=await U.json();console.log("res json",B),U.ok?(s(!0),(O=(T=window==null?void 0:window.Telegram)==null?void 0:T.WebApp)==null||O.close()):s(!1)}catch{s(!1)}finally{n(!1)}};return x.jsxs(Il,{children:[x.jsx(Dl,{onBack:()=>{e("/")}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:"Проверить траты"}),x.jsx(lo,{theme:"text",onClick:()=>{e("/select-currency")},children:l?l.in:"Выберите валюту"})]}),x.jsxs(ai,{className:"!pb-4",children:[x.jsxs("h3",{className:Gn(!S&&"text-error"),children:[y&&"Не хватает",S&&"Всё верно",E&&"Перебор"]}),x.jsxs("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:["Заплатили ",f," ",l==null?void 0:l.symbol,", должны ",d," ",l==null?void 0:l.symbol]})]}),x.jsxs(ai,{children:[x.jsx("h3",{children:"Заплатили"}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!m.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),m.map(k=>x.jsx(Fd,{...k,onChange:T=>{a(k.related_user_id,T)}},k.related_user_id))]})]}),x.jsxs(ai,{children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h3",{children:"Должны"}),!!p.length&&(!_||!S)&&x.jsx(lo,{theme:"text",onClick:v,children:"Поровну"})]}),x.jsxs("div",{className:"mt-4 flex flex-col gap-3",children:[!p.length&&x.jsx("span",{className:"opacity-40",children:"(Пусто)"}),p.map(k=>x.jsx(Fd,{...k,onChange:T=>{a(k.related_user_id,T)}},k.related_user_id))]}),x.jsx("div",{className:"mt-8 py-2",children:x.jsx(lo,{onClick:P,disabled:!S,isBusy:t,children:"Сохранить"})})]})]})}function Vc(){return x.jsx("div",{className:"h-[1px] -my-[0.5px] mx-4 bg-[#E5E9EB] dark:bg-[#84919A]"})}function W1(){var u;const{users:e,unrelatedUsers:t,selectUser:n,deleteUser:r}=Al(),{selectUserIndex:i,transaction:o}=Ar(),s=i!==null?e:t,l=i!==null?(u=o.shares[i])==null?void 0:u.normalized_name:null,a=l?`Выберите, кто "${l}"`:"Выберите человека";return x.jsxs(Il,{className:"!bg-bg",children:[x.jsx(Dl,{onBack:()=>{history.back()}}),x.jsxs("div",{className:"mb-2 px-4 flex items-center justify-between gap-3",children:[x.jsx("h2",{className:"pt-[2px] pb-[6px]",children:a}),i!==null&&x.jsx(lo,{theme:"text",onClick:r(i),children:"Удалить"})]}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:s.map((f,h,d)=>x.jsxs(x.Fragment,{children:[x.jsx("button",{className:"w-full px-4 py-2 hover:bg-text/5 active:bg-text/10 transition-all",onClick:n(f),children:x.jsx(Nc,{user:f})}),hi(n),children:[x.jsx("input",{className:"hidden",id:`${e}-${n}`,name:e,checked:r}),x.jsx("div",{className:"p-1.5",children:x.jsx("div",{className:Gn("flex items-center justify-center w-5 h-5 border-2 rounded-full text-hint",r&&"!text-link"),children:x.jsx("div",{className:Gn("w-[10px] h-[10px] rounded-full bg-link opacity-0 transition-all",r&&"!opacity-100")})})}),x.jsx("div",{className:"flex-1",children:t})]})}function K1(){const e=Rc(),{currencies:t,transaction:n,setCurrency:r}=Ar(),i=o=>{r(o),e("/check")};return x.jsxs(Il,{className:"!bg-bg",children:[x.jsx(Dl,{onBack:()=>{history.back()}}),x.jsx("div",{className:"px-4",children:x.jsx("h2",{children:"Выберите валюту"})}),x.jsx("div",{className:"mt-4 overflow-y-auto",children:t.map((o,s)=>x.jsxs("div",{children:[x.jsx(V1,{group:"currencies",label:`${o.symbol} ${o.title}`,value:o.id,checked:(n==null?void 0:n.currency_id)===o.id,onChange:i},`currencies-${o.id}`),sM.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{d:"M8 1C8 0.447715 7.55228 0 7 0C6.44772 0 6 0.447715 6 1V6H1C0.447715 6 0 6.44771 0 7C0 7.55228 0.447715 8 1 8H6V13C6 13.5523 6.44772 14 7 14C7.55228 14 8 13.5523 8 13V8H13C13.5523 8 14 7.55228 14 7C14 6.44772 13.5523 6 13 6H8V1Z",fill:"currentColor"}));/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:uv,setPrototypeOf:Kd,isFrozen:Y1,getPrototypeOf:X1,getOwnPropertyDescriptor:J1}=Object;let{freeze:Je,seal:Wt,create:Z1}=Object,{apply:Ou,construct:Pu}=typeof Reflect<"u"&&Reflect;Ou||(Ou=function(t,n,r){return t.apply(n,r)});Je||(Je=function(t){return t});Wt||(Wt=function(t){return t});Pu||(Pu=function(t,n){return new t(...n)});const eS=At(Array.prototype.forEach),Gd=At(Array.prototype.pop),Hi=At(Array.prototype.push),Cs=At(String.prototype.toLowerCase),va=At(String.prototype.toString),tS=At(String.prototype.match),Ft=At(String.prototype.replace),nS=At(String.prototype.indexOf),rS=At(String.prototype.trim),ht=At(RegExp.prototype.test),Qi=iS(TypeError);function At(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i/gm),uS=Wt(/\${[\w\W]*}/gm),cS=Wt(/^data-[\-\w.\u00B7-\uFFFF]/),fS=Wt(/^aria-[\-\w]+$/),cv=Wt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dS=Wt(/^(?:\w+script|data):/i),hS=Wt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fv=Wt(/^html$/i);var eh=Object.freeze({__proto__:null,MUSTACHE_EXPR:lS,ERB_EXPR:aS,TMPLIT_EXPR:uS,DATA_ATTR:cS,ARIA_ATTR:fS,IS_ALLOWED_URI:cv,IS_SCRIPT_OR_DATA:dS,ATTR_WHITESPACE:hS,DOCTYPE_NAME:fv});const pS=()=>typeof window>"u"?null:window,mS=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function dv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pS();const t=q=>dv(q);if(t.version="3.0.5",t.removed=[],!e||!e.document||e.document.nodeType!==9)return t.isSupported=!1,t;const n=e.document,r=n.currentScript;let{document:i}=e;const{DocumentFragment:o,HTMLTemplateElement:s,Node:l,Element:a,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:d,trustedTypes:g}=e,y=a.prototype,S=us(y,"cloneNode"),E=us(y,"nextSibling"),m=us(y,"childNodes"),p=us(y,"parentNode");if(typeof s=="function"){const q=i.createElement("template");q.content&&q.content.ownerDocument&&(i=q.content.ownerDocument)}let _,v="";const{implementation:P,createNodeIterator:k,createDocumentFragment:T,getElementsByTagName:O}=i,{importNode:U}=n;let B={};t.isSupported=typeof uv=="function"&&typeof p=="function"&&P&&P.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:he,ERB_EXPR:ne,TMPLIT_EXPR:tt,DATA_ATTR:kn,ARIA_ATTR:Vt,IS_SCRIPT_OR_DATA:at,ATTR_WHITESPACE:ut}=eh;let{IS_ALLOWED_URI:L}=eh,j=null;const V=X({},[...Yd,...ga,...ya,..._a,...Xd]);let Y=null;const _e=X({},[...Jd,...Sa,...Zd,...cs]);let le=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,ct=null,ft=!0,Kt=!0,It=!1,$o=!0,Cn=!1,Gt=!1,Ti=!1,Ri=!1,Tn=!1,Yt=!1,sr=!1,Ir=!0,lr=!1;const Oi="user-content-";let St=!0,Rn=!1,ln={},an=null;const qo=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Pi=null;const ar=X({},["audio","video","img","source","image","track"]);let Mr=null;const Lr=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",ur="http://www.w3.org/2000/svg",Mt="http://www.w3.org/1999/xhtml";let un=Mt,Di=!1,C=null;const R=X({},[Ur,ur,Mt],va);let N;const z=["application/xhtml+xml","text/html"],K="text/html";let $,W=null;const Q=i.createElement("form"),H=function(w){return w instanceof RegExp||w instanceof Function},oe=function(w){if(!(W&&W===w)){if((!w||typeof w!="object")&&(w={}),w=jr(w),N=z.indexOf(w.PARSER_MEDIA_TYPE)===-1?N=K:N=w.PARSER_MEDIA_TYPE,$=N==="application/xhtml+xml"?va:Cs,j="ALLOWED_TAGS"in w?X({},w.ALLOWED_TAGS,$):V,Y="ALLOWED_ATTR"in w?X({},w.ALLOWED_ATTR,$):_e,C="ALLOWED_NAMESPACES"in w?X({},w.ALLOWED_NAMESPACES,va):R,Mr="ADD_URI_SAFE_ATTR"in w?X(jr(Lr),w.ADD_URI_SAFE_ATTR,$):Lr,Pi="ADD_DATA_URI_TAGS"in w?X(jr(ar),w.ADD_DATA_URI_TAGS,$):ar,an="FORBID_CONTENTS"in w?X({},w.FORBID_CONTENTS,$):qo,ie="FORBID_TAGS"in w?X({},w.FORBID_TAGS,$):{},ct="FORBID_ATTR"in w?X({},w.FORBID_ATTR,$):{},ln="USE_PROFILES"in w?w.USE_PROFILES:!1,ft=w.ALLOW_ARIA_ATTR!==!1,Kt=w.ALLOW_DATA_ATTR!==!1,It=w.ALLOW_UNKNOWN_PROTOCOLS||!1,$o=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Cn=w.SAFE_FOR_TEMPLATES||!1,Gt=w.WHOLE_DOCUMENT||!1,Tn=w.RETURN_DOM||!1,Yt=w.RETURN_DOM_FRAGMENT||!1,sr=w.RETURN_TRUSTED_TYPE||!1,Ri=w.FORCE_BODY||!1,Ir=w.SANITIZE_DOM!==!1,lr=w.SANITIZE_NAMED_PROPS||!1,St=w.KEEP_CONTENT!==!1,Rn=w.IN_PLACE||!1,L=w.ALLOWED_URI_REGEXP||cv,un=w.NAMESPACE||Mt,le=w.CUSTOM_ELEMENT_HANDLING||{},w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=w.CUSTOM_ELEMENT_HANDLING.tagNameCheck),w.CUSTOM_ELEMENT_HANDLING&&H(w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=w.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(le.allowCustomizedBuiltInElements=w.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Cn&&(Kt=!1),Yt&&(Tn=!0),ln&&(j=X({},[...Xd]),Y=[],ln.html===!0&&(X(j,Yd),X(Y,Jd)),ln.svg===!0&&(X(j,ga),X(Y,Sa),X(Y,cs)),ln.svgFilters===!0&&(X(j,ya),X(Y,Sa),X(Y,cs)),ln.mathMl===!0&&(X(j,_a),X(Y,Zd),X(Y,cs))),w.ADD_TAGS&&(j===V&&(j=jr(j)),X(j,w.ADD_TAGS,$)),w.ADD_ATTR&&(Y===_e&&(Y=jr(Y)),X(Y,w.ADD_ATTR,$)),w.ADD_URI_SAFE_ATTR&&X(Mr,w.ADD_URI_SAFE_ATTR,$),w.FORBID_CONTENTS&&(an===qo&&(an=jr(an)),X(an,w.FORBID_CONTENTS,$)),St&&(j["#text"]=!0),Gt&&X(j,["html","head","body"]),j.table&&(X(j,["tbody"]),delete ie.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=w.TRUSTED_TYPES_POLICY,v=_.createHTML("")}else _===void 0&&(_=mS(g,r)),_!==null&&typeof v=="string"&&(v=_.createHTML(""));Je&&Je(w),W=w}},te=X({},["mi","mo","mn","ms","mtext"]),qe=X({},["foreignobject","desc","title","annotation-xml"]),Re=X({},["title","style","font","a","script"]),Ae=X({},ga);X(Ae,ya),X(Ae,oS);const nt=X({},_a);X(nt,sS);const cr=function(w){let A=p(w);(!A||!A.tagName)&&(A={namespaceURI:un,tagName:"template"});const F=Cs(w.tagName),ae=Cs(A.tagName);return C[w.namespaceURI]?w.namespaceURI===ur?A.namespaceURI===Mt?F==="svg":A.namespaceURI===Ur?F==="svg"&&(ae==="annotation-xml"||te[ae]):!!Ae[F]:w.namespaceURI===Ur?A.namespaceURI===Mt?F==="math":A.namespaceURI===ur?F==="math"&&qe[ae]:!!nt[F]:w.namespaceURI===Mt?A.namespaceURI===ur&&!qe[ae]||A.namespaceURI===Ur&&!te[ae]?!1:!nt[F]&&(Re[F]||!Ae[F]):!!(N==="application/xhtml+xml"&&C[w.namespaceURI]):!1},Lt=function(w){Hi(t.removed,{element:w});try{w.parentNode.removeChild(w)}catch{w.remove()}},On=function(w,A){try{Hi(t.removed,{attribute:A.getAttributeNode(w),from:A})}catch{Hi(t.removed,{attribute:null,from:A})}if(A.removeAttribute(w),w==="is"&&!Y[w])if(Tn||Yt)try{Lt(A)}catch{}else try{A.setAttribute(w,"")}catch{}},wt=function(w){let A,F;if(Ri)w=""+w;else{const Et=tS(w,/^[\r\n\t ]+/);F=Et&&Et[0]}N==="application/xhtml+xml"&&un===Mt&&(w=''+w+"");const ae=_?_.createHTML(w):w;if(un===Mt)try{A=new d().parseFromString(ae,N)}catch{}if(!A||!A.documentElement){A=P.createDocument(un,"template",null);try{A.documentElement.innerHTML=Di?v:ae}catch{}}const Fe=A.body||A.documentElement;return w&&F&&Fe.insertBefore(i.createTextNode(F),Fe.childNodes[0]||null),un===Mt?O.call(A,Gt?"html":"body")[0]:Gt?A.documentElement:Fe},fr=function(w){return k.call(w.ownerDocument||w,w,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Ni=function(w){return w instanceof h&&(typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||!(w.attributes instanceof f)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function")},Pn=function(w){return typeof l=="object"?w instanceof l:w&&typeof w=="object"&&typeof w.nodeType=="number"&&typeof w.nodeName=="string"},dt=function(w,A,F){B[w]&&eS(B[w],ae=>{ae.call(t,A,F,W)})},dr=function(w){let A;if(dt("beforeSanitizeElements",w,null),Ni(w))return Lt(w),!0;const F=$(w.nodeName);if(dt("uponSanitizeElement",w,{tagName:F,allowedTags:j}),w.hasChildNodes()&&!Pn(w.firstElementChild)&&(!Pn(w.content)||!Pn(w.content.firstElementChild))&&ht(/<[/\w]/g,w.innerHTML)&&ht(/<[/\w]/g,w.textContent))return Lt(w),!0;if(!j[F]||ie[F]){if(!ie[F]&&Ge(F)&&(le.tagNameCheck instanceof RegExp&&ht(le.tagNameCheck,F)||le.tagNameCheck instanceof Function&&le.tagNameCheck(F)))return!1;if(St&&!an[F]){const ae=p(w)||w.parentNode,Fe=m(w)||w.childNodes;if(Fe&&ae){const Et=Fe.length;for(let Se=Et-1;Se>=0;--Se)ae.insertBefore(S(Fe[Se],!0),E(w))}}return Lt(w),!0}return w instanceof a&&!cr(w)||(F==="noscript"||F==="noembed"||F==="noframes")&&ht(/<\/no(script|embed|frames)/i,w.innerHTML)?(Lt(w),!0):(Cn&&w.nodeType===3&&(A=w.textContent,A=Ft(A,he," "),A=Ft(A,ne," "),A=Ft(A,tt," "),w.textContent!==A&&(Hi(t.removed,{element:w.cloneNode()}),w.textContent=A)),dt("afterSanitizeElements",w,null),!1)},ce=function(w,A,F){if(Ir&&(A==="id"||A==="name")&&(F in i||F in Q))return!1;if(!(Kt&&!ct[A]&&ht(kn,A))){if(!(ft&&ht(Vt,A))){if(!Y[A]||ct[A]){if(!(Ge(w)&&(le.tagNameCheck instanceof RegExp&&ht(le.tagNameCheck,w)||le.tagNameCheck instanceof Function&&le.tagNameCheck(w))&&(le.attributeNameCheck instanceof RegExp&&ht(le.attributeNameCheck,A)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(A))||A==="is"&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&ht(le.tagNameCheck,F)||le.tagNameCheck instanceof Function&&le.tagNameCheck(F))))return!1}else if(!Mr[A]){if(!ht(L,Ft(F,ut,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&w!=="script"&&nS(F,"data:")===0&&Pi[w])){if(!(It&&!ht(at,Ft(F,ut,"")))){if(F)return!1}}}}}}return!0},Ge=function(w){return w.indexOf("-")>0},cn=function(w){let A,F,ae,Fe;dt("beforeSanitizeAttributes",w,null);const{attributes:Et}=w;if(!Et)return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Y};for(Fe=Et.length;Fe--;){A=Et[Fe];const{name:Xt,namespaceURI:Fl}=A;if(F=Xt==="value"?A.value:rS(A.value),ae=$(Xt),Se.attrName=ae,Se.attrValue=F,Se.keepAttr=!0,Se.forceKeepAttr=void 0,dt("uponSanitizeAttribute",w,Se),F=Se.attrValue,Se.forceKeepAttr||(On(Xt,w),!Se.keepAttr))continue;if(!$o&&ht(/\/>/i,F)){On(Xt,w);continue}Cn&&(F=Ft(F,he," "),F=Ft(F,ne," "),F=Ft(F,tt," "));const Kc=$(w.nodeName);if(ce(Kc,ae,F)){if(lr&&(ae==="id"||ae==="name")&&(On(Xt,w),F=Oi+F),_&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Fl)switch(g.getAttributeType(Kc,ae)){case"TrustedHTML":{F=_.createHTML(F);break}case"TrustedScriptURL":{F=_.createScriptURL(F);break}}try{Fl?w.setAttributeNS(Fl,Xt,F):w.setAttribute(Xt,F),Gd(t.removed)}catch{}}}dt("afterSanitizeAttributes",w,null)},Ie=function q(w){let A;const F=fr(w);for(dt("beforeSanitizeShadowDOM",w,null);A=F.nextNode();)dt("uponSanitizeShadowNode",A,null),!dr(A)&&(A.content instanceof o&&q(A.content),cn(A));dt("afterSanitizeShadowDOM",w,null)};return t.sanitize=function(q){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A,F,ae,Fe;if(Di=!q,Di&&(q=""),typeof q!="string"&&!Pn(q))if(typeof q.toString=="function"){if(q=q.toString(),typeof q!="string")throw Qi("dirty is not a string, aborting")}else throw Qi("toString is not a function");if(!t.isSupported)return q;if(Ti||oe(w),t.removed=[],typeof q=="string"&&(Rn=!1),Rn){if(q.nodeName){const Xt=$(q.nodeName);if(!j[Xt]||ie[Xt])throw Qi("root node is forbidden and cannot be sanitized in-place")}}else if(q instanceof l)A=wt(""),F=A.ownerDocument.importNode(q,!0),F.nodeType===1&&F.nodeName==="BODY"||F.nodeName==="HTML"?A=F:A.appendChild(F);else{if(!Tn&&!Cn&&!Gt&&q.indexOf("<")===-1)return _&&sr?_.createHTML(q):q;if(A=wt(q),!A)return Tn?null:sr?v:""}A&&Ri&&Lt(A.firstChild);const Et=fr(Rn?q:A);for(;ae=Et.nextNode();)dr(ae)||(ae.content instanceof o&&Ie(ae.content),cn(ae));if(Rn)return q;if(Tn){if(Yt)for(Fe=T.call(A.ownerDocument);A.firstChild;)Fe.appendChild(A.firstChild);else Fe=A;return(Y.shadowroot||Y.shadowrootmode)&&(Fe=U.call(n,Fe,!0)),Fe}let Se=Gt?A.outerHTML:A.innerHTML;return Gt&&j["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&ht(fv,A.ownerDocument.doctype.name)&&(Se=" -`+Se),Cn&&(Se=Ft(Se,he," "),Se=Ft(Se,ne," "),Se=Ft(Se,tt," ")),_&&sr?_.createHTML(Se):Se},t.setConfig=function(q){oe(q),Ti=!0},t.clearConfig=function(){W=null,Ti=!1},t.isValidAttribute=function(q,w,A){W||oe({});const F=$(q),ae=$(w);return ce(F,ae,A)},t.addHook=function(q,w){typeof w=="function"&&(B[q]=B[q]||[],Hi(B[q],w))},t.removeHook=function(q){if(B[q])return Gd(B[q])},t.removeHooks=function(q){B[q]&&(B[q]=[])},t.removeAllHooks=function(){B={}},t}var vS=dv();const gS=({string:e,allowedTags:t})=>{const n=vS.sanitize(e,{ALLOWED_TAGS:t});return x.jsx("span",{dangerouslySetInnerHTML:{__html:n}})},yS=e=>M.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},M.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 6.29289C9.68342 5.90237 10.3166 5.90237 10.7071 6.29289L15.7071 11.2929C16.0976 11.6834 16.0976 12.3166 15.7071 12.7071L10.7071 17.7071C10.3166 18.0976 9.68342 18.0976 9.29289 17.7071C8.90237 17.3166 8.90237 16.6834 9.29289 16.2929L13.5858 12L9.29289 7.70711C8.90237 7.31658 8.90237 6.68342 9.29289 6.29289Z",fill:"currentColor"}));function _S({normalized_name:e,related_user_id:t,onClick:n}){const{getUserById:r}=Al(),i=t?r(t):void 0;return x.jsxs("button",{className:"w-full flex gap-3 text-left items-center px-4 py-2.5 truncate hover:bg-text/5 active:bg-text/10 transition-all",onClick:n,children:[x.jsx("div",{className:"flex w-[35%] truncate",children:e?x.jsx("div",{className:"truncate",children:e}):x.jsx("div",{className:"truncate opacity-30",children:"(доп.)"})}),x.jsx("div",{className:"flex w-[55%] truncate",children:x.jsx(Nc,{user:i})}),x.jsx("div",{className:"h-6 w-6 text-hint opacity-50",children:x.jsx(yS,{})})]})}function wa(){const e=Rc(),{transaction:t,setSelectUserIndex:n}=Ar(),{unrelatedUsers:r,isRelationsComplete:i}=Al(),o=a=>{n(a),e("/select-user")},s=()=>{n(null),e("/select-user")},l=()=>{alert("close webapp...")};return x.jsxs(Il,{children:[x.jsx(Dl,{onCancel:l}),x.jsxs(ai,{children:[x.jsx("div",{className:"text-[12px] leading-[1.33em] font-medium text-hint",children:"Сообщение"}),x.jsxs("div",{className:"mt-1",children:[!!t.is_voice&&x.jsx("span",{children:"🎙 "}),t.formatted_text?x.jsx(gS,{allowedTags:["b","strong"],string:t.formatted_text}):x.jsx("strong",{children:t.raw_text})]})]}),x.jsxs(ai,{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Соотнесите людей"}),x.jsx("div",{className:"mt-1 text-[14px] leading-[20px] text-hint",children:"Со временем мы запомним соотношения"}),x.jsx("div",{className:"mt-2 -mx-4 overflow-y-auto",children:t.shares.map((a,u)=>x.jsxs("div",{children:[x.jsx(_S,{...a,onClick:()=>o(u)},`UserRelation-${u}`),u{e("/check")},children:"Далее"})})]})]})}function SS(){const{isLoading:e,error:t}=q1(),n=e,r=t,{isSuccess:i}=Ar(),o=n||r||i;return x.jsx("div",{className:Gn("fixed top-0 left-0 w-full h-full overflow-y-auto bg-bg2 transition-all",o?"opacity-100":"pointer-events-none opacity-0"),children:x.jsxs("div",{className:"flex items-center justify-center w-full min-h-full",children:[n&&x.jsx(Hm,{size:50}),!!r&&x.jsxs("div",{className:"p-4 text-center text-[#c00]",children:["Ошибка: ",r.message]}),!!i&&x.jsx("div",{className:"p-4 text-center text-button text-[24px]",children:"Успешно!"}),i===!1&&x.jsx("div",{className:"p-4 text-center text-[#c00] text-[24px]",children:"Ошибка сохранения"})]})})}const wS=new c0;function ES(){const{isDarkTheme:e}=qm(),t=V_([{path:"/",element:x.jsx(wa,{}),errorElement:x.jsx(wa,{})},{path:"*",element:x.jsx(wa,{})},{path:"/select-user",element:x.jsx(W1,{})},{path:"/check",element:x.jsx(Q1,{})},{path:"/select-currency",element:x.jsx(K1,{})}]);return x.jsx(C0,{client:wS,children:x.jsxs("div",{className:Gn(e?"theme-dark":"theme-light"),children:[x.jsx(q_,{router:t}),x.jsx(SS,{})]})})}Ea.createRoot(document.getElementById("root")).render(x.jsx(ch.StrictMode,{children:x.jsx(ES,{})})); diff --git a/index.html b/index.html index 2d93dfd..a43a197 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@ - +