function Rb(t,e){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.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)}})();var kb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var L0={exports:{}},$c={},M0={exports:{}},ge={};/** * @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 cl=Symbol.for("react.element"),Ob=Symbol.for("react.portal"),Db=Symbol.for("react.fragment"),Vb=Symbol.for("react.strict_mode"),Lb=Symbol.for("react.profiler"),Mb=Symbol.for("react.provider"),Fb=Symbol.for("react.context"),jb=Symbol.for("react.forward_ref"),zb=Symbol.for("react.suspense"),Ub=Symbol.for("react.memo"),Bb=Symbol.for("react.lazy"),Sg=Symbol.iterator;function $b(t){return t===null||typeof t!="object"?null:(t=Sg&&t[Sg]||t["@@iterator"],typeof t=="function"?t:null)}var F0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j0=Object.assign,z0={};function ys(t,e,n){this.props=t,this.context=e,this.refs=z0,this.updater=n||F0}ys.prototype.isReactComponent={};ys.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};ys.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function U0(){}U0.prototype=ys.prototype;function fp(t,e,n){this.props=t,this.context=e,this.refs=z0,this.updater=n||F0}var hp=fp.prototype=new U0;hp.constructor=fp;j0(hp,ys.prototype);hp.isPureReactComponent=!0;var bg=Array.isArray,B0=Object.prototype.hasOwnProperty,dp={current:null},$0={key:!0,ref:!0,__self:!0,__source:!0};function H0(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)B0.call(e,r)&&!$0.hasOwnProperty(r)&&(i[r]=e[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,ee=z[ne];if(0>>1;nei(ot,J))sti(St,ot)?(z[ne]=St,z[st]=J,ne=st):(z[ne]=ot,z[Ie]=J,ne=Ie);else if(sti(St,J))z[ne]=St,z[st]=J,ne=st;else break e}}return G}function i(z,G){var J=z.sortIndex-G.sortIndex;return J!==0?J:z.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var u=[],c=[],h=1,p=null,d=3,g=!1,v=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(z){for(var G=n(c);G!==null;){if(G.callback===null)r(c);else if(G.startTime<=z)r(c),G.sortIndex=G.expirationTime,e(u,G);else break;G=n(c)}}function k(z){if(E=!1,S(z),!v)if(n(u)!==null)v=!0,it(D);else{var G=n(c);G!==null&&ke(k,G.startTime-z)}}function D(z,G){v=!1,E&&(E=!1,x(y),y=-1),g=!0;var J=d;try{for(S(G),p=n(u);p!==null&&(!(p.expirationTime>G)||z&&!C());){var ne=p.callback;if(typeof ne=="function"){p.callback=null,d=p.priorityLevel;var ee=ne(p.expirationTime<=G);G=t.unstable_now(),typeof ee=="function"?p.callback=ee:p===n(u)&&r(u),S(G)}else r(u);p=n(u)}if(p!==null)var mt=!0;else{var Ie=n(c);Ie!==null&&ke(k,Ie.startTime-G),mt=!1}return mt}finally{p=null,d=J,g=!1}}var N=!1,w=null,y=-1,b=5,I=-1;function C(){return!(t.unstable_now()-Iz||125ne?(z.sortIndex=J,e(c,z),n(u)===null&&z===n(c)&&(E?(x(y),y=-1):E=!0,ke(k,J-ne))):(z.sortIndex=ee,e(u,z),v||g||(v=!0,it(D))),z},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(z){var G=d;return function(){var J=d;d=G;try{return z.apply(this,arguments)}finally{d=J}}}})(Q0);K0.exports=Q0;var tT=K0.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 nT=O,Cn=tT;function B(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xh=Object.prototype.hasOwnProperty,rT=/^[: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]*$/,xg={},Ig={};function iT(t){return xh.call(Ig,t)?!0:xh.call(xg,t)?!1:rT.test(t)?Ig[t]=!0:(xg[t]=!0,!1)}function oT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function sT(t,e,n,r){if(e===null||typeof e>"u"||oT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function on(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var Lt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Lt[t]=new on(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Lt[e]=new on(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Lt[t]=new on(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Lt[t]=new on(t,2,!1,t,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(t){Lt[t]=new on(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Lt[t]=new on(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Lt[t]=new on(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Lt[t]=new on(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Lt[t]=new on(t,5,!1,t.toLowerCase(),null,!1,!1)});var mp=/[\-:]([a-z])/g;function gp(t){return t[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(t){var e=t.replace(mp,gp);Lt[e]=new on(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(mp,gp);Lt[e]=new on(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(mp,gp);Lt[e]=new on(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Lt[t]=new on(t,1,!1,t.toLowerCase(),null,!1,!1)});Lt.xlinkHref=new on("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Lt[t]=new on(t,1,!1,t.toLowerCase(),null,!0,!0)});function vp(t,e,n,r){var i=Lt.hasOwnProperty(e)?Lt[e]:null;(i!==null?i.type!==0:r||!(2l||i[s]!==o[l]){var u=` `+i[s].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=s&&0<=l);break}}}finally{Lf=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Zs(t):""}function aT(t){switch(t.tag){case 5:return Zs(t.type);case 16:return Zs("Lazy");case 13:return Zs("Suspense");case 19:return Zs("SuspenseList");case 0:case 2:case 15:return t=Mf(t.type,!1),t;case 11:return t=Mf(t.type.render,!1),t;case 1:return t=Mf(t.type,!0),t;default:return""}}function Ph(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Po:return"Fragment";case Ao:return"Portal";case Ih:return"Profiler";case yp:return"StrictMode";case Ch:return"Suspense";case Ah:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case J0:return(t.displayName||"Context")+".Consumer";case X0:return(t._context.displayName||"Context")+".Provider";case wp:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Ep:return e=t.displayName||null,e!==null?e:Ph(t.type)||"Memo";case Hr:e=t._payload,t=t._init;try{return Ph(t(e))}catch{}}return null}function lT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ph(e);case 8:return e===yp?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function gi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ew(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function uT(t){var e=ew(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ll(t){t._valueTracker||(t._valueTracker=uT(t))}function tw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=ew(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function qu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Rh(t,e){var n=e.checked;return et({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function Ag(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=gi(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function nw(t,e){e=e.checked,e!=null&&vp(t,"checked",e,!1)}function kh(t,e){nw(t,e);var n=gi(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Nh(t,e.type,n):e.hasOwnProperty("defaultValue")&&Nh(t,e.type,gi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Pg(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Nh(t,e,n){(e!=="number"||qu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var ea=Array.isArray;function Uo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Ml.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Fa(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var fa={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},cT=["Webkit","ms","Moz","O"];Object.keys(fa).forEach(function(t){cT.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),fa[e]=fa[t]})});function sw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||fa.hasOwnProperty(t)&&fa[t]?(""+e).trim():e+"px"}function aw(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=sw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var fT=et({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 Vh(t,e){if(e){if(fT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(B(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(B(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(B(61))}if(e.style!=null&&typeof e.style!="object")throw Error(B(62))}}function Lh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 Mh=null;function _p(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Fh=null,Bo=null,$o=null;function Ng(t){if(t=dl(t)){if(typeof Fh!="function")throw Error(B(280));var e=t.stateNode;e&&(e=Kc(e),Fh(t.stateNode,t.type,e))}}function lw(t){Bo?$o?$o.push(t):$o=[t]:Bo=t}function uw(){if(Bo){var t=Bo,e=$o;if($o=Bo=null,Ng(t),e)for(t=0;t>>=0,t===0?32:31-(ST(t)/bT|0)|0}var Fl=64,jl=4194304;function ta(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Yu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var l=s&~i;l!==0?r=ta(l):(o&=s,o!==0&&(r=ta(o)))}else s=n&~i,s!==0?r=ta(s):o!==0&&(r=ta(o));if(r===0)return 0;if(e!==0&&e!==r&&!(e&i)&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function fl(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Yn(e),t[e]=n}function CT(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=da),Ug=" ",Bg=!1;function Pw(t,e){switch(t){case"keyup":return tx.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rw(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ro=!1;function rx(t,e){switch(t){case"compositionend":return Rw(e);case"keypress":return e.which!==32?null:(Bg=!0,Ug);case"textInput":return t=e.data,t===Ug&&Bg?null:t;default:return null}}function ix(t,e){if(Ro)return t==="compositionend"||!Pp&&Pw(t,e)?(t=Cw(),Su=Ip=Xr=null,Ro=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=qg(n)}}function Dw(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Dw(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Vw(){for(var t=window,e=qu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=qu(t.document)}return e}function Rp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function dx(t){var e=Vw(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Dw(n.ownerDocument.documentElement,n)){if(r!==null&&Rp(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=Gg(n,o);var s=Gg(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ko=null,Hh=null,ma=null,Wh=!1;function Kg(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wh||ko==null||ko!==qu(r)||(r=ko,"selectionStart"in r&&Rp(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}),ma&&Ha(ma,r)||(ma=r,r=Zu(Hh,"onSelect"),0Do||(t.current=Xh[Do],Xh[Do]=null,Do--)}function ze(t,e){Do++,Xh[Do]=t.current,t.current=e}var vi={},Qt=xi(vi),hn=xi(!1),no=vi;function ns(t,e){var n=t.type.contextTypes;if(!n)return vi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function dn(t){return t=t.childContextTypes,t!=null}function tc(){We(hn),We(Qt)}function tv(t,e,n){if(Qt.current!==vi)throw Error(B(168));ze(Qt,e),ze(hn,n)}function Hw(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(B(108,lT(t)||"Unknown",i));return et({},n,r)}function nc(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||vi,no=Qt.current,ze(Qt,t),ze(hn,hn.current),!0}function nv(t,e,n){var r=t.stateNode;if(!r)throw Error(B(169));n?(t=Hw(t,e,no),r.__reactInternalMemoizedMergedChildContext=t,We(hn),We(Qt),ze(Qt,t)):We(hn),ze(hn,n)}var Sr=null,Qc=!1,Xf=!1;function Ww(t){Sr===null?Sr=[t]:Sr.push(t)}function xx(t){Qc=!0,Ww(t)}function Ii(){if(!Xf&&Sr!==null){Xf=!0;var t=0,e=Oe;try{var n=Sr;for(Oe=1;t>=s,i-=s,br=1<<32-Yn(e)+i|n<y?(b=w,w=null):b=w.sibling;var I=d(x,w,S[y],k);if(I===null){w===null&&(w=b);break}t&&w&&I.alternate===null&&e(x,w),_=o(I,_,y),N===null?D=I:N.sibling=I,N=I,w=b}if(y===S.length)return n(x,w),Ke&&zi(x,y),D;if(w===null){for(;yy?(b=w,w=null):b=w.sibling;var C=d(x,w,I.value,k);if(C===null){w===null&&(w=b);break}t&&w&&C.alternate===null&&e(x,w),_=o(C,_,y),N===null?D=C:N.sibling=C,N=C,w=b}if(I.done)return n(x,w),Ke&&zi(x,y),D;if(w===null){for(;!I.done;y++,I=S.next())I=p(x,I.value,k),I!==null&&(_=o(I,_,y),N===null?D=I:N.sibling=I,N=I);return Ke&&zi(x,y),D}for(w=r(x,w);!I.done;y++,I=S.next())I=g(w,x,y,I.value,k),I!==null&&(t&&I.alternate!==null&&w.delete(I.key===null?y:I.key),_=o(I,_,y),N===null?D=I:N.sibling=I,N=I);return t&&w.forEach(function(R){return e(x,R)}),Ke&&zi(x,y),D}function A(x,_,S,k){if(typeof S=="object"&&S!==null&&S.type===Po&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case Vl:e:{for(var D=S.key,N=_;N!==null;){if(N.key===D){if(D=S.type,D===Po){if(N.tag===7){n(x,N.sibling),_=i(N,S.props.children),_.return=x,x=_;break e}}else if(N.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===Hr&&ov(D)===N.type){n(x,N.sibling),_=i(N,S.props),_.ref=Ws(x,N,S),_.return=x,x=_;break e}n(x,N);break}else e(x,N);N=N.sibling}S.type===Po?(_=Qi(S.props.children,x.mode,k,S.key),_.return=x,x=_):(k=Ru(S.type,S.key,S.props,null,x.mode,k),k.ref=Ws(x,_,S),k.return=x,x=k)}return s(x);case Ao:e:{for(N=S.key;_!==null;){if(_.key===N)if(_.tag===4&&_.stateNode.containerInfo===S.containerInfo&&_.stateNode.implementation===S.implementation){n(x,_.sibling),_=i(_,S.children||[]),_.return=x,x=_;break e}else{n(x,_);break}else e(x,_);_=_.sibling}_=oh(S,x.mode,k),_.return=x,x=_}return s(x);case Hr:return N=S._init,A(x,_,N(S._payload),k)}if(ea(S))return v(x,_,S,k);if(zs(S))return E(x,_,S,k);ql(x,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,_!==null&&_.tag===6?(n(x,_.sibling),_=i(_,S),_.return=x,x=_):(n(x,_),_=ih(S,x.mode,k),_.return=x,x=_),s(x)):n(x,_)}return A}var is=Qw(!0),Yw=Qw(!1),oc=xi(null),sc=null,Mo=null,Dp=null;function Vp(){Dp=Mo=sc=null}function Lp(t){var e=oc.current;We(oc),t._currentValue=e}function ed(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Wo(t,e){sc=t,Dp=Mo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(fn=!0),t.firstContext=null)}function jn(t){var e=t._currentValue;if(Dp!==t)if(t={context:t,memoizedValue:e,next:null},Mo===null){if(sc===null)throw Error(B(308));Mo=t,sc.dependencies={lanes:0,firstContext:t}}else Mo=Mo.next=t;return e}var Wi=null;function Mp(t){Wi===null?Wi=[t]:Wi.push(t)}function Xw(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Mp(e)):(n.next=i.next,i.next=n),e.interleaved=n,Ar(t,r)}function Ar(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Wr=!1;function Fp(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jw(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function xr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ai(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,xe&2){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,Ar(t,n)}return i=r.interleaved,i===null?(e.next=e,Mp(r)):(e.next=i.next,i.next=e),r.interleaved=e,Ar(t,n)}function Tu(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bp(t,n)}}function sv(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function ac(t,e,n,r){var i=t.updateQueue;Wr=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var u=l,c=u.next;u.next=null,s===null?o=c:s.next=c,s=u;var h=t.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==s&&(l===null?h.firstBaseUpdate=c:l.next=c,h.lastBaseUpdate=u))}if(o!==null){var p=i.baseState;s=0,h=c=u=null,l=o;do{var d=l.lane,g=l.eventTime;if((r&d)===d){h!==null&&(h=h.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=t,E=l;switch(d=e,g=n,E.tag){case 1:if(v=E.payload,typeof v=="function"){p=v.call(g,p,d);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=E.payload,d=typeof v=="function"?v.call(g,p,d):v,d==null)break e;p=et({},p,d);break e;case 2:Wr=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,d=i.effects,d===null?i.effects=[l]:d.push(l))}else g={eventTime:g,lane:d,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(c=h=g,u=p):h=h.next=g,s|=d;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;d=l,l=d.next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}while(!0);if(h===null&&(u=p),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=h,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);oo|=s,t.lanes=s,t.memoizedState=p}}function av(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=Zf.transition;Zf.transition={};try{t(!1),e()}finally{Oe=n,Zf.transition=r}}function mE(){return zn().memoizedState}function Px(t,e,n){var r=ui(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gE(t))vE(e,n);else if(n=Xw(t,e,n,r),n!==null){var i=nn();Xn(n,t,r,i),yE(n,e,r)}}function Rx(t,e,n){var r=ui(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gE(t))vE(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,l=o(s,n);if(i.hasEagerState=!0,i.eagerState=l,Jn(l,s)){var u=e.interleaved;u===null?(i.next=i,Mp(e)):(i.next=u.next,u.next=i),e.interleaved=i;return}}catch{}finally{}n=Xw(t,e,i,r),n!==null&&(i=nn(),Xn(n,t,r,i),yE(n,e,r))}}function gE(t){var e=t.alternate;return t===Je||e!==null&&e===Je}function vE(t,e){ga=uc=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function yE(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,bp(t,n)}}var cc={readContext:jn,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},kx={readContext:jn,useCallback:function(t,e){return lr().memoizedState=[t,e===void 0?null:e],t},useContext:jn,useEffect:uv,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Iu(4194308,4,cE.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Iu(4194308,4,t,e)},useInsertionEffect:function(t,e){return Iu(4,2,t,e)},useMemo:function(t,e){var n=lr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=lr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=Px.bind(null,Je,t),[r.memoizedState,t]},useRef:function(t){var e=lr();return t={current:t},e.memoizedState=t},useState:lv,useDebugValue:qp,useDeferredValue:function(t){return lr().memoizedState=t},useTransition:function(){var t=lv(!1),e=t[0];return t=Ax.bind(null,t[1]),lr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Je,i=lr();if(Ke){if(n===void 0)throw Error(B(407));n=n()}else{if(n=e(),Pt===null)throw Error(B(349));io&30||nE(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,uv(iE.bind(null,r,o,t),[t]),r.flags|=2048,Ja(9,rE.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=lr(),e=Pt.identifierPrefix;if(Ke){var n=Tr,r=br;n=(r&~(1<<32-Yn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ya++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[cr]=e,t[Ga]=r,AE(t,e,!1,!1),e.stateNode=t;e:{switch(s=Lh(n,r),n){case"dialog":$e("cancel",t),$e("close",t),i=r;break;case"iframe":case"object":case"embed":$e("load",t),i=r;break;case"video":case"audio":for(i=0;ias&&(e.flags|=128,r=!0,qs(o,!1),e.lanes=4194304)}else{if(!r)if(t=lc(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),qs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Ke)return zt(e),null}else 2*lt()-o.renderingStartTime>as&&n!==1073741824&&(e.flags|=128,r=!0,qs(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=lt(),e.sibling=null,n=Ye.current,ze(Ye,r?n&1|2:n&1),e):(zt(e),null);case 22:case 23:return Jp(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Tn&1073741824&&(zt(e),e.subtreeFlags&6&&(e.flags|=8192)):zt(e),null;case 24:return null;case 25:return null}throw Error(B(156,e.tag))}function jx(t,e){switch(Np(e),e.tag){case 1:return dn(e.type)&&tc(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return os(),We(hn),We(Qt),Up(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return zp(e),null;case 13:if(We(Ye),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(B(340));rs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return We(Ye),null;case 4:return os(),null;case 10:return Lp(e.type._context),null;case 22:case 23:return Jp(),null;case 24:return null;default:return null}}var Kl=!1,qt=!1,zx=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Fo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){rt(t,e,r)}else n.current=null}function ud(t,e,n){try{n()}catch(r){rt(t,e,r)}}var Ev=!1;function Ux(t,e){if(qh=Xu,t=Vw(),Rp(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.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,u=-1,c=0,h=0,p=t,d=null;t:for(;;){for(var g;p!==n||i!==0&&p.nodeType!==3||(l=s+i),p!==o||r!==0&&p.nodeType!==3||(u=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(g=p.firstChild)!==null;)d=p,p=g;for(;;){if(p===t)break t;if(d===n&&++c===i&&(l=s),d===o&&++h===r&&(u=s),(g=p.nextSibling)!==null)break;p=d,d=p.parentNode}p=g}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Gh={focusedElem:t,selectionRange:n},Xu=!1,Y=e;Y!==null;)if(e=Y,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Y=t;else for(;Y!==null;){e=Y;try{var v=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var E=v.memoizedProps,A=v.memoizedState,x=e.stateNode,_=x.getSnapshotBeforeUpdate(e.elementType===e.type?E:Hn(e.type,E),A);x.__reactInternalSnapshotBeforeUpdate=_}break;case 3:var S=e.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(k){rt(e,e.return,k)}if(t=e.sibling,t!==null){t.return=e.return,Y=t;break}Y=e.return}return v=Ev,Ev=!1,v}function va(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&ud(e,n,o)}i=i.next}while(i!==r)}}function Jc(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function cd(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kE(t){var e=t.alternate;e!==null&&(t.alternate=null,kE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[cr],delete e[Ga],delete e[Yh],delete e[bx],delete e[Tx])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function NE(t){return t.tag===5||t.tag===3||t.tag===4}function _v(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||NE(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function fd(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=ec));else if(r!==4&&(t=t.child,t!==null))for(fd(t,e,n),t=t.sibling;t!==null;)fd(t,e,n),t=t.sibling}function hd(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(hd(t,e,n),t=t.sibling;t!==null;)hd(t,e,n),t=t.sibling}var Nt=null,qn=!1;function $r(t,e,n){for(n=n.child;n!==null;)OE(t,e,n),n=n.sibling}function OE(t,e,n){if(pr&&typeof pr.onCommitFiberUnmount=="function")try{pr.onCommitFiberUnmount(Hc,n)}catch{}switch(n.tag){case 5:qt||Fo(n,e);case 6:var r=Nt,i=qn;Nt=null,$r(t,e,n),Nt=r,qn=i,Nt!==null&&(qn?(t=Nt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Nt.removeChild(n.stateNode));break;case 18:Nt!==null&&(qn?(t=Nt,n=n.stateNode,t.nodeType===8?Yf(t.parentNode,n):t.nodeType===1&&Yf(t,n),Ba(t)):Yf(Nt,n.stateNode));break;case 4:r=Nt,i=qn,Nt=n.stateNode.containerInfo,qn=!0,$r(t,e,n),Nt=r,qn=i;break;case 0:case 11:case 14:case 15:if(!qt&&(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)&&ud(n,e,s),i=i.next}while(i!==r)}$r(t,e,n);break;case 1:if(!qt&&(Fo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){rt(n,e,l)}$r(t,e,n);break;case 21:$r(t,e,n);break;case 22:n.mode&1?(qt=(r=qt)||n.memoizedState!==null,$r(t,e,n),qt=r):$r(t,e,n);break;default:$r(t,e,n)}}function Sv(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new zx),e.forEach(function(r){var i=Yx.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function $n(t,e){var n=e.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$x(r/1960))-r,10t?16:t,Jr===null)var r=!1;else{if(t=Jr,Jr=null,dc=0,xe&6)throw Error(B(331));var i=xe;for(xe|=4,Y=t.current;Y!==null;){var o=Y,s=o.child;if(Y.flags&16){var l=o.deletions;if(l!==null){for(var u=0;ult()-Yp?Ki(t,0):Qp|=n),pn(t,e)}function UE(t,e){e===0&&(t.mode&1?(e=jl,jl<<=1,!(jl&130023424)&&(jl=4194304)):e=1);var n=nn();t=Ar(t,e),t!==null&&(fl(t,e,n),pn(t,n))}function Qx(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),UE(t,n)}function Yx(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(e),UE(t,n)}var BE;BE=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||hn.current)fn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return fn=!1,Mx(t,e,n);fn=!!(t.flags&131072)}else fn=!1,Ke&&e.flags&1048576&&qw(e,ic,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Cu(t,e),t=e.pendingProps;var i=ns(e,Qt.current);Wo(e,n),i=$p(null,e,r,t,i,n);var o=Hp();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,dn(r)?(o=!0,nc(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Fp(e),i.updater=Xc,e.stateNode=i,i._reactInternals=e,nd(e,r,t,n),e=od(null,e,r,!0,o,n)):(e.tag=0,Ke&&o&&kp(e),Xt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Cu(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=Jx(r),t=Hn(r,t),i){case 0:e=id(null,e,r,t,n);break e;case 1:e=vv(null,e,r,t,n);break e;case 11:e=mv(null,e,r,t,n);break e;case 14:e=gv(null,e,r,Hn(r.type,t),n);break e}throw Error(B(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Hn(r,i),id(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Hn(r,i),vv(t,e,r,i,n);case 3:e:{if(xE(e),t===null)throw Error(B(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Jw(t,e),ac(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=ss(Error(B(423)),e),e=yv(t,e,r,n,i);break e}else if(r!==i){i=ss(Error(B(424)),e),e=yv(t,e,r,n,i);break e}else for(xn=si(e.stateNode.containerInfo.firstChild),In=e,Ke=!0,Gn=null,n=Yw(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(rs(),r===i){e=Pr(t,e,n);break e}Xt(t,e,r,n)}e=e.child}return e;case 5:return Zw(e),t===null&&Zh(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Kh(r,i)?s=null:o!==null&&Kh(r,o)&&(e.flags|=32),TE(t,e),Xt(t,e,s,n),e.child;case 6:return t===null&&Zh(e),null;case 13:return IE(t,e,n);case 4:return jp(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=is(e,null,r,n):Xt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Hn(r,i),mv(t,e,r,i,n);case 7:return Xt(t,e,e.pendingProps,n),e.child;case 8:return Xt(t,e,e.pendingProps.children,n),e.child;case 12:return Xt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,ze(oc,r._currentValue),r._currentValue=s,o!==null)if(Jn(o.value,s)){if(o.children===i.children&&!hn.current){e=Pr(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var l=o.dependencies;if(l!==null){s=o.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=xr(-1,n&-n),u.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?u.next=u:(u.next=h.next,h.next=u),c.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),ed(o.return,n,e),l.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(B(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),ed(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Xt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Wo(e,n),i=jn(i),r=r(i),e.flags|=1,Xt(t,e,r,n),e.child;case 14:return r=e.type,i=Hn(r,e.pendingProps),i=Hn(r.type,i),gv(t,e,r,i,n);case 15:return SE(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:Hn(r,i),Cu(t,e),e.tag=1,dn(r)?(t=!0,nc(e)):t=!1,Wo(e,n),wE(e,r,i),nd(e,r,i,n),od(null,e,r,!0,t,n);case 19:return CE(t,e,n);case 22:return bE(t,e,n)}throw Error(B(156,e.tag))};function $E(t,e){return gw(t,e)}function Xx(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,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 Mn(t,e,n,r){return new Xx(t,e,n,r)}function em(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Jx(t){if(typeof t=="function")return em(t)?1:0;if(t!=null){if(t=t.$$typeof,t===wp)return 11;if(t===Ep)return 14}return 2}function ci(t,e){var n=t.alternate;return n===null?(n=Mn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Ru(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")em(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Po:return Qi(n.children,i,o,e);case yp:s=8,i|=8;break;case Ih:return t=Mn(12,n,e,i|2),t.elementType=Ih,t.lanes=o,t;case Ch:return t=Mn(13,n,e,i),t.elementType=Ch,t.lanes=o,t;case Ah:return t=Mn(19,n,e,i),t.elementType=Ah,t.lanes=o,t;case Z0:return ef(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case X0:s=10;break e;case J0:s=9;break e;case wp:s=11;break e;case Ep:s=14;break e;case Hr:s=16,r=null;break e}throw Error(B(130,t==null?t:typeof t,""))}return e=Mn(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Qi(t,e,n,r){return t=Mn(7,t,r,e),t.lanes=n,t}function ef(t,e,n,r){return t=Mn(22,t,r,e),t.elementType=Z0,t.lanes=n,t.stateNode={isHidden:!1},t}function ih(t,e,n){return t=Mn(6,t,null,e),t.lanes=n,t}function oh(t,e,n){return e=Mn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Zx(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jf(0),this.expirationTimes=jf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function tm(t,e,n,r,i,o,s,l,u){return t=new Zx(t,e,n,l,u),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Mn(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fp(o),t}function eI(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(GE)}catch(t){console.error(t)}}GE(),G0.exports=An;var KE=G0.exports,QE,Rv=KE;QE=Rv.createRoot,Rv.hydrateRoot;var X={},vd={exports:{}};(function(t,e){(function(n,r){var i="1.0.41",o="",s="?",l="function",u="undefined",c="object",h="string",p="major",d="model",g="name",v="type",E="vendor",A="version",x="architecture",_="console",S="mobile",k="tablet",D="smarttv",N="wearable",w="embedded",y=500,b="Amazon",I="Apple",C="ASUS",R="BlackBerry",P="Browser",ie="Chrome",Ee="Edge",it="Firefox",ke="Google",z="Honor",G="Huawei",J="Lenovo",ne="LG",ee="Microsoft",mt="Motorola",Ie="Nvidia",ot="OnePlus",st="Opera",St="OPPO",kn="Samsung",Or="Sharp",Zn="Sony",Dr="Xiaomi",Ft="Zebra",vn="Facebook",wr="Chromium OS",yn="Mac OS",wn=" Browser",Nn=function(fe,le){var te={};for(var Ce in fe)le[Ce]&&le[Ce].length%2===0?te[Ce]=le[Ce].concat(fe[Ce]):te[Ce]=fe[Ce];return te},sn=function(fe){for(var le={},te=0;te0?U.length===2?typeof U[1]==l?this[U[0]]=U[1].call(this,pe):this[U[0]]=U[1]:U.length===3?typeof U[1]===l&&!(U[1].exec&&U[1].test)?this[U[0]]=pe?U[1].call(this,pe,U[2]):r:this[U[0]]=pe?pe.replace(U[1],U[2]):r:U.length===4&&(this[U[0]]=pe?U[3].call(this,pe.replace(U[1],U[2])):r):this[U]=pe||r;te+=2}},Rt=function(fe,le){for(var te in le)if(typeof le[te]===c&&le[te].length>0){for(var Ce=0;Ce2&&($[d]="iPad",$[v]=k),$},this.getEngine=function(){var $={};return $[g]=r,$[A]=r,En.call($,Ce,Q.engine),$},this.getOS=function(){var $={};return $[g]=r,$[A]=r,En.call($,Ce,Q.os),U&&!$[g]&&F&&F.platform&&F.platform!="Unknown"&&($[g]=F.platform.replace(/chrome os/i,wr).replace(/macos/i,yn)),$},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Ce},this.setUA=function($){return Ce=typeof $===h&&$.length>y?Bn($,y):$,this},this.setUA(Ce),this};Fe.VERSION=i,Fe.BROWSER=sn([g,A,p]),Fe.CPU=sn([x]),Fe.DEVICE=sn([d,E,v,_,S,D,k,N,w]),Fe.ENGINE=Fe.OS=sn([g,A]),t.exports&&(e=t.exports=Fe),e.UAParser=Fe;var Ge=typeof n!==u&&(n.jQuery||n.Zepto);if(Ge&&!Ge.ua){var Er=new Fe;Ge.ua=Er.getResult(),Ge.ua.get=function(){return Er.getUA()},Ge.ua.set=function(fe){Er.setUA(fe);var le=Er.getResult();for(var te in le)Ge.ua[te]=le[te]}}})(typeof window=="object"?window:kb)})(vd,vd.exports);var oI=vd.exports;Object.defineProperty(X,"__esModule",{value:!0});function sI(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Kt=O,Ue=sI(Kt),YE=oI,Ci=new YE,Yt=Ci.getBrowser(),aI=Ci.getCPU(),Rn=Ci.getDevice(),om=Ci.getEngine(),Ai=Ci.getOS(),ml=Ci.getUA(),XE=function(e){return Ci.setUA(e)},gl=function(e){if(!e){console.error("No userAgent string was provided");return}var n=new YE(e);return{UA:n,browser:n.getBrowser(),cpu:n.getCPU(),device:n.getDevice(),engine:n.getEngine(),os:n.getOS(),ua:n.getUA(),setUserAgent:function(i){return n.setUA(i)}}},JE=Object.freeze({ClientUAInstance:Ci,browser:Yt,cpu:aI,device:Rn,engine:om,os:Ai,ua:ml,setUa:XE,parseUserAgent:gl});function kv(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lI(t){for(var e=1;e=0)&&(n[i]=t[i]);return n}function Un(t,e){if(t==null)return{};var n=pI(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function ku(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mI(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ku(t)}function gI(t,e){return vI(t)||yI(t,e)||wI(t,e)||EI()}function vI(t){if(Array.isArray(t))return t}function yI(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,l;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(u){o=!0,l=u}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw l}}return r}}function wI(t,e){if(t){if(typeof t=="string")return Nv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nv(t,e)}}function Nv(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&arguments[1]!==void 0?arguments[1]:"none";return e||n},sm=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},am=function(e){var n=sm();return n&&n.platform&&(n.platform.indexOf(e)!==-1||n.platform==="MacIntel"&&n.maxTouchPoints>1&&!window.MSStream)},TI=function(e,n,r,i,o){return{isBrowser:e,browserMajorVersion:oe(n.major),browserFullVersion:oe(n.version),browserName:oe(n.name),engineName:oe(r.name),engineVersion:oe(r.version),osName:oe(i.name),osVersion:oe(i.version),userAgent:oe(o)}},Ov=function(e,n,r,i){return lI({},e,{vendor:oe(n.vendor),model:oe(n.model),os:oe(r.name),osVersion:oe(r.version),ua:oe(i)})},xI=function(e,n,r,i){return{isSmartTV:e,engineName:oe(n.name),engineVersion:oe(n.version),osName:oe(r.name),osVersion:oe(r.version),userAgent:oe(i)}},II=function(e,n,r,i){return{isConsole:e,engineName:oe(n.name),engineVersion:oe(n.version),osName:oe(r.name),osVersion:oe(r.version),userAgent:oe(i)}},CI=function(e,n,r,i){return{isWearable:e,engineName:oe(n.name),engineVersion:oe(n.version),osName:oe(r.name),osVersion:oe(r.version),userAgent:oe(i)}},AI=function(e,n,r,i,o){return{isEmbedded:e,vendor:oe(n.vendor),model:oe(n.model),engineName:oe(r.name),engineVersion:oe(r.version),osName:oe(i.name),osVersion:oe(i.version),userAgent:oe(o)}};function PI(t){var e=t?gl(t):JE,n=e.device,r=e.browser,i=e.engine,o=e.os,s=e.ua,l=SI(n.type),u=l.isBrowser,c=l.isMobile,h=l.isTablet,p=l.isSmartTV,d=l.isConsole,g=l.isWearable,v=l.isEmbedded;if(u)return TI(u,r,i,o,s);if(p)return xI(p,i,o,s);if(d)return II(d,i,o,s);if(c||h)return Ov(l,n,o,s);if(g)return CI(g,i,o,s);if(v)return AI(v,n,i,o,s)}var ZE=function(e){var n=e.type;return n===Wt.Mobile},e_=function(e){var n=e.type;return n===Wt.Tablet},t_=function(e){var n=e.type;return n===Wt.Mobile||n===Wt.Tablet},n_=function(e){var n=e.type;return n===Wt.SmartTv},gc=function(e){var n=e.type;return n===Wt.Browser},r_=function(e){var n=e.type;return n===Wt.Wearable},i_=function(e){var n=e.type;return n===Wt.Console},o_=function(e){var n=e.type;return n===Wt.Embedded},s_=function(e){var n=e.vendor;return oe(n)},a_=function(e){var n=e.model;return oe(n)},l_=function(e){var n=e.type;return oe(n,"browser")},u_=function(e){var n=e.name;return n===_s.Android},c_=function(e){var n=e.name;return n===_s.Windows},f_=function(e){var n=e.name;return n===_s.MAC_OS},h_=function(e){var n=e.name;return n===_s.WindowsPhone},d_=function(e){var n=e.name;return n===_s.IOS},p_=function(e){var n=e.version;return oe(n)},m_=function(e){var n=e.name;return oe(n)},g_=function(e){var n=e.name;return n===mn.Chrome},v_=function(e){var n=e.name;return n===mn.Firefox},y_=function(e){var n=e.name;return n===mn.Chromium},vc=function(e){var n=e.name;return n===mn.Edge},w_=function(e){var n=e.name;return n===mn.Yandex},E_=function(e){var n=e.name;return n===mn.Safari||n===mn.MobileSafari},__=function(e){var n=e.name;return n===mn.MobileSafari},S_=function(e){var n=e.name;return n===mn.Opera},b_=function(e){var n=e.name;return n===mn.InternetExplorer||n===mn.Ie},T_=function(e){var n=e.name;return n===mn.MIUI},x_=function(e){var n=e.name;return n===mn.SamsungBrowser},I_=function(e){var n=e.version;return oe(n)},C_=function(e){var n=e.major;return oe(n)},A_=function(e){var n=e.name;return oe(n)},P_=function(e){var n=e.name;return oe(n)},R_=function(e){var n=e.version;return oe(n)},k_=function(){var e=sm(),n=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof n=="string"?/electron/.test(n):!1},Go=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},N_=function(){var e=sm();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},fr=function(){return am("iPad")},O_=function(){return am("iPhone")},D_=function(){return am("iPod")},V_=function(e){return oe(e)};function L_(t){var e=t||JE,n=e.device,r=e.browser,i=e.os,o=e.engine,s=e.ua;return{isSmartTV:n_(n),isConsole:i_(n),isWearable:r_(n),isEmbedded:o_(n),isMobileSafari:__(r)||fr(),isChromium:y_(r),isMobile:t_(n)||fr(),isMobileOnly:ZE(n),isTablet:e_(n)||fr(),isBrowser:gc(n),isDesktop:gc(n),isAndroid:u_(i),isWinPhone:h_(i),isIOS:d_(i)||fr(),isChrome:g_(r),isFirefox:v_(r),isSafari:E_(r),isOpera:S_(r),isIE:b_(r),osVersion:p_(i),osName:m_(i),fullBrowserVersion:I_(r),browserVersion:C_(r),browserName:A_(r),mobileVendor:s_(n),mobileModel:a_(n),engineName:P_(o),engineVersion:R_(o),getUA:V_(s),isEdge:vc(r)||Go(s),isYandex:w_(r),deviceType:l_(n),isIOS13:N_(),isIPad13:fr(),isIPhone13:O_(),isIPod13:D_(),isElectron:k_(),isEdgeChromium:Go(s),isLegacyEdge:vc(r)&&!Go(s),isWindows:c_(i),isMacOs:f_(i),isMIUI:T_(r),isSamsungBrowser:x_(r)}}var M_=n_(Rn),F_=i_(Rn),j_=r_(Rn),RI=o_(Rn),kI=__(Yt)||fr(),NI=y_(Yt),sf=t_(Rn)||fr(),z_=ZE(Rn),U_=e_(Rn)||fr(),B_=gc(Rn),OI=gc(Rn),$_=u_(Ai),H_=h_(Ai),W_=d_(Ai)||fr(),DI=g_(Yt),VI=v_(Yt),LI=E_(Yt),MI=S_(Yt),q_=b_(Yt),FI=p_(Ai),jI=m_(Ai),zI=I_(Yt),UI=C_(Yt),BI=A_(Yt),$I=s_(Rn),HI=a_(Rn),WI=P_(om),qI=R_(om),GI=V_(ml),KI=vc(Yt)||Go(ml),QI=w_(Yt),YI=l_(Rn),XI=N_(),JI=fr(),ZI=O_(),eC=D_(),tC=k_(),nC=Go(ml),rC=vc(Yt)&&!Go(ml),iC=c_(Ai),oC=f_(Ai),sC=T_(Yt),aC=x_(Yt),lC=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var n=gl(e),r=n.device,i=n.browser,o=n.os,s=n.engine,l=n.ua;return L_({device:r,browser:i,os:o,engine:s,ua:l})},uC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return $_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},cC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return B_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},fC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return q_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},hC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return W_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},dC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return sf?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},pC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return U_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},mC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return H_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},gC=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=Un(e,["renderWithFragment","children","viewClassName","style"]);return z_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},vC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return M_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},yC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return F_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},wC=function(e){var n=e.renderWithFragment,r=e.children,i=Un(e,["renderWithFragment","children"]);return j_?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",i,r):null},EC=function(e){var n=e.renderWithFragment,r=e.children;e.viewClassName,e.style;var i=e.condition,o=Un(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?n?Ue.createElement(Kt.Fragment,null,r):Ue.createElement("div",o,r):null};function _C(t){return function(e){dI(n,e);function n(r){var i;return uI(this,n),i=mI(this,wd(n).call(this,r)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(ku(i)),i.onOrientationChange=i.onOrientationChange.bind(ku(i)),i.onPageLoad=i.onPageLoad.bind(ku(i)),i.state={isLandscape:!1,isPortrait:!1},i}return fI(n,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":Ea(window))!==void 0&&sf&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return Ue.createElement(t,yd({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),n}(Ue.Component)}function SC(){var t=Kt.useState(function(){var o=window.innerWidth>window.innerHeight?90:0;return{isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"}}),e=gI(t,2),n=e[0],r=e[1],i=Kt.useCallback(function(){var o=window.innerWidth>window.innerHeight?90:0,s={isPortrait:o===0,isLandscape:o===90,orientation:o===0?"portrait":"landscape"};n.orientation!==s.orientation&&r(s)},[n.orientation]);return Kt.useEffect(function(){return(typeof window>"u"?"undefined":Ea(window))!==void 0&&sf&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),n}function G_(t){var e=t||window.navigator.userAgent;return gl(e)}function bC(t){var e=t||window.navigator.userAgent,n=G_(e),r=L_(n);return[r,n]}X.AndroidView=uC;X.BrowserTypes=mn;var Nu=X.BrowserView=cC;X.ConsoleView=yC;X.CustomView=EC;X.IEView=fC;X.IOSView=hC;X.MobileOnlyView=gC;var Ou=X.MobileView=dC;X.OsTypes=_s;X.SmartTVView=vC;X.TabletView=pC;X.WearableView=wC;X.WinPhoneView=mC;X.browserName=BI;X.browserVersion=UI;X.deviceDetect=PI;X.deviceType=YI;X.engineName=WI;X.engineVersion=qI;X.fullBrowserVersion=zI;X.getSelectorsByUserAgent=lC;X.getUA=GI;X.isAndroid=$_;X.isBrowser=B_;X.isChrome=DI;X.isChromium=NI;X.isConsole=F_;X.isDesktop=OI;X.isEdge=KI;X.isEdgeChromium=nC;X.isElectron=tC;X.isEmbedded=RI;X.isFirefox=VI;X.isIE=q_;X.isIOS=W_;X.isIOS13=XI;X.isIPad13=JI;X.isIPhone13=ZI;X.isIPod13=eC;X.isLegacyEdge=rC;X.isMIUI=sC;X.isMacOs=oC;X.isMobile=sf;X.isMobileOnly=z_;X.isMobileSafari=kI;X.isOpera=MI;X.isSafari=LI;X.isSamsungBrowser=aC;X.isSmartTV=M_;X.isTablet=U_;X.isWearable=j_;X.isWinPhone=H_;X.isWindows=iC;X.isYandex=QI;X.mobileModel=HI;X.mobileVendor=$I;X.osName=jI;X.osVersion=FI;X.parseUserAgent=gl;X.setUserAgent=bI;X.useDeviceData=G_;X.useDeviceSelectors=bC;X.useMobileOrientation=SC;X.withOrientationChange=_C;var TC=xC()?O.useLayoutEffect:O.useEffect;function xC(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function IC(){var t=O.useState(Object.create(null)),e=t[1];return O.useCallback(function(){e(Object.create(null))},[])}var CC=function(e){var n=e.children,r=e.type,i=r===void 0?"reach-portal":r,o=O.useRef(null),s=O.useRef(null),l=IC();return TC(function(){if(o.current){var u=o.current.ownerDocument;return s.current=u==null?void 0:u.createElement(i),u.body.appendChild(s.current),l(),function(){s.current&&s.current.ownerDocument&&s.current.ownerDocument.body.removeChild(s.current)}}},[i,l]),s.current?KE.createPortal(n,s.current):O.createElement("span",{ref:o})};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var q=function(){return q=Object.assign||function(e){for(var n,r=1,i=arguments.length;r=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pe(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function He(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,o;r"u"||typeof r=="string"||us(r)?{target:r,event:t}:q(q({},r),{event:t})});return n}function HC(t){if(!(t===void 0||t===OC))return Wn(t)}function nS(t,e,n,r,i){var o=t.options.guards,s={state:i,cond:e,_event:r};if(e.type===bd)return((o==null?void 0:o[e.name])||e.predicate)(n,r.data,s);var l=o==null?void 0:o[e.type];if(!l)throw new Error("Guard '".concat(e.type,"' is not implemented on machine '").concat(t.id,"'."));return l(n,r.data,s)}function rS(t){return typeof t=="string"?{type:t}:t}function Vu(t,e,n){var r=function(){},i=typeof t=="object",o=i?t:null;return{next:((i?t.next:t)||r).bind(o),error:((i?t.error:e)||r).bind(o),complete:((i?t.complete:n)||r).bind(o)}}function Jl(t,e){return"".concat(t,":invocation[").concat(e,"]")}function xd(t){return(t.type===vl||t.type===af&&t.to===ls.Internal)&&typeof t.delay!="number"}var Ko=Ot({type:PC});function Id(t,e){return e&&e[t]||void 0}function el(t,e){var n;if(Ne(t)||typeof t=="number"){var r=Id(t,e);Re(r)?n={type:t,exec:r}:r?n=r:n={type:t,exec:void 0}}else if(Re(t))n={type:t.name||t.toString(),exec:t};else{var r=Id(t.type,e);if(Re(r))n=q(q({},t),{exec:r});else if(r){var i=r.type||t.type;n=q(q(q({},r),t),{type:i})}else n=t}return n}var Qr=function(t,e){if(!t)return[];var n=Ss(t)?t:[t];return n.map(function(r){return el(r,e)})};function hm(t){var e=el(t);return q(q({id:Ne(t)?t:e.id},e),{type:e.type})}function WC(t,e){return{type:vl,event:typeof t=="function"?t:lf(t),delay:e?e.delay:void 0,id:e==null?void 0:e.id}}function qC(t,e,n,r){var i={_event:n},o=Ot(Re(t.event)?t.event(e,n.data,i):t.event),s;if(Ne(t.delay)){var l=r&&r[t.delay];s=Re(l)?l(e,n.data,i):l}else s=Re(t.delay)?t.delay(e,n.data,i):t.delay;return q(q({},t),{type:vl,_event:o,delay:s})}function GC(t,e){return{to:e?e.to:void 0,type:af,event:Re(t)?t:lf(t),delay:e?e.delay:void 0,id:e&&e.id!==void 0?e.id:Re(t)?t.name:J_(t)}}function KC(t,e,n,r){var i={_event:n},o=Ot(Re(t.event)?t.event(e,n.data,i):t.event),s;if(Ne(t.delay)){var l=r&&r[t.delay];s=Re(l)?l(e,n.data,i):l}else s=Re(t.delay)?t.delay(e,n.data,i):t.delay;var u=Re(t.to)?t.to(e,n.data,i):t.to;return q(q({},t),{to:u,_event:o,event:o.data,delay:s})}var QC=function(t,e,n){return q(q({},t),{value:Ne(t.expr)?t.expr:t.expr(e,n.data,{_event:n})})},YC=function(t){return{type:K_,sendId:t}};function XC(t){var e=hm(t);return{type:De.Start,activity:e,exec:void 0}}function JC(t){var e=Re(t)?t:hm(t);return{type:De.Stop,activity:e,exec:void 0}}function ZC(t,e,n){var r=Re(t.activity)?t.activity(e,n.data):t.activity,i=typeof r=="string"?{id:r}:r,o={type:De.Stop,activity:i};return o}var eA=function(t){return{type:cm,assignment:t}};function tA(t,e){var n=e?"#".concat(e):"";return"".concat(De.After,"(").concat(t,")").concat(n)}function Zl(t,e){var n="".concat(De.DoneState,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function Lu(t,e){var n="".concat(De.DoneInvoke,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}function ia(t,e){var n="".concat(De.ErrorPlatform,".").concat(t),r={type:n,data:e};return r.toString=function(){return n},r}var nA=function(t){var e,n,r=[];try{for(var i=ye(t),o=i.next();!o.done;o=i.next())for(var s=o.value,l=0;l0;){var c=i.shift();n=t.transition(n,c,u),r.forEach(function(h){return h.next(n)})}o=!1}},l=sA({id:e.id,send:function(c){i.push(c),s()},getSnapshot:function(){return n},subscribe:function(c,h,p){var d=Vu(c,h,p);return r.add(d),d.next(n),{unsubscribe:function(){r.delete(d)}}}}),u={parent:e.parent,self:l,id:e.id||"anonymous",observers:r};return n=t.start?t.start(u):n,l}var vA={sync:!1,autoForward:!1},It;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(It||(It={}));var yA=function(){function t(e,n){n===void 0&&(n=t.defaultOptions);var r=this;this.machine=e,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=It.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(h,p){if(Ss(h))return r.batch(h),r.state;var d=Ot(lf(h,p));if(r.status===It.Stopped)return r.state;if(r.status!==It.Running&&!r.options.deferEvents)throw new Error('Event "'.concat(d.name,'" was sent to uninitialized service "').concat(r.machine.id,`". Make sure .start() is called for this service, or set { deferEvents: true } in the service options. Event: `).concat(JSON.stringify(d.data)));return r.scheduler.schedule(function(){r.forward(d);var g=r._nextState(d);r.update(g,d)}),r._state},this.sendTo=function(h,p,d){var g=r.parent&&(p===ls.Parent||r.parent.id===p),v=g?r.parent:Ne(p)?p===ls.Internal?r:r.children.get(p)||Ks.get(p):$C(p)?p:void 0;if(!v){if(!g)throw new Error("Unable to send event to child '".concat(p,"' from service '").concat(r.id,"'."));return}if("machine"in v){if(r.status!==It.Stopped||r.parent!==v||r.state.done){var E=q(q({},h),{name:h.name===RC?"".concat(ia(r.id)):h.name,origin:r.sessionId});!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([v,E]):v.send(E)}}else!d&&r.machine.config.predictableActionArguments?r._outgoingQueue.push([v,h.data]):v.send(h.data)},this._exec=function(h,p,d,g){g===void 0&&(g=r.machine.options.actions);var v=h.exec||Id(h.type,g),E=Re(v)?v:v?v.exec:h.exec;if(E)try{return E(p,d.data,r.machine.config.predictableActionArguments?{action:h,_event:d}:{action:h,state:r.state,_event:d})}catch(ie){throw r.parent&&r.parent.send({type:"xstate.error",data:ie}),ie}switch(h.type){case vl:{var A=h;r.defer(A);break}case af:var x=h;if(typeof x.delay=="number"){r.defer(x);return}else x.to?r.sendTo(x._event,x.to,d===Ko):r.send(x._event);break;case K_:r.cancel(h.sendId);break;case _d:{if(r.status!==It.Running)return;var _=h.activity;if(!r.machine.config.predictableActionArguments&&!r.state.activities[_.id||_.type])break;if(_.type===De.Invoke){var S=rS(_.src),k=r.machine.options.services?r.machine.options.services[S.type]:void 0,D=_.id,N=_.data,w="autoForward"in _?_.autoForward:!!_.forward;if(!k)return;var y=N?wc(N,p,d):void 0;if(typeof k=="string")return;var b=Re(k)?k(p,d.data,{data:y,src:S,meta:_.meta}):k;if(!b)return;var I=void 0;us(b)&&(b=y?b.withContext(y):b,I={autoForward:w}),r.spawn(b,D,I)}else r.spawnActivity(_);break}case um:{r.stopChild(h.activity.id);break}case Q_:var C=h,R=C.label,P=C.value;R?r.logger(R,P):r.logger(P);break}};var i=q(q({},t.defaultOptions),n),o=i.clock,s=i.logger,l=i.parent,u=i.id,c=u!==void 0?u:e.id;this.id=c,this.logger=s,this.clock=o,this.parent=l,this.options=i,this.scheduler=new zv({deferEvents:this.options.deferEvents}),this.sessionId=Ks.bookId()}return Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:bo(this,function(){return e._initialState=e.machine.initialState,e._initialState})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.execute=function(e,n){var r,i;try{for(var o=ye(e.actions),s=o.next();!s.done;s=o.next()){var l=s.value;this.exec(l,e,n)}}catch(u){r={error:u}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},t.prototype.update=function(e,n){var r,i,o,s,l,u,c,h,p=this;if(e._sessionid=this.sessionId,this._state=e,(!this.machine.config.predictableActionArguments||n===Ko)&&this.options.execute)this.execute(this.state);else for(var d=void 0;d=this._outgoingQueue.shift();)d[0].send(d[1]);if(this.children.forEach(function(b){p.state.children[b.id]=b}),this.devTools&&this.devTools.send(n.data,e),e.event)try{for(var g=ye(this.eventListeners),v=g.next();!v.done;v=g.next()){var E=v.value;E(e.event)}}catch(b){r={error:b}}finally{try{v&&!v.done&&(i=g.return)&&i.call(g)}finally{if(r)throw r.error}}try{for(var A=ye(this.listeners),x=A.next();!x.done;x=A.next()){var E=x.value;E(e,e.event)}}catch(b){o={error:b}}finally{try{x&&!x.done&&(s=A.return)&&s.call(A)}finally{if(o)throw o.error}}try{for(var _=ye(this.contextListeners),S=_.next();!S.done;S=_.next()){var k=S.value;k(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(b){l={error:b}}finally{try{S&&!S.done&&(u=_.return)&&u.call(_)}finally{if(l)throw l.error}}if(this.state.done){var D=e.configuration.find(function(b){return b.type==="final"&&b.parent===p.machine}),N=D&&D.doneData?wc(D.doneData,e.context,n):void 0;this._doneEvent=Lu(this.id,N);try{for(var w=ye(this.doneListeners),y=w.next();!y.done;y=w.next()){var E=y.value;E(this._doneEvent)}}catch(b){c={error:b}}finally{try{y&&!y.done&&(h=w.return)&&h.call(w)}finally{if(c)throw c.error}}this._stop(),this._stopChildren(),Ks.free(this.sessionId)}},t.prototype.onTransition=function(e){return this.listeners.add(e),this.status===It.Running&&e(this.state,this.state.event),this},t.prototype.subscribe=function(e,n,r){var i=this,o=Vu(e,n,r);this.listeners.add(o.next),this.status!==It.NotStarted&&o.next(this.state);var s=function(){i.doneListeners.delete(s),i.stopListeners.delete(s),o.complete()};return this.status===It.Stopped?o.complete():(this.onDone(s),this.onStop(s)),{unsubscribe:function(){i.listeners.delete(o.next),i.doneListeners.delete(s),i.stopListeners.delete(s)}}},t.prototype.onEvent=function(e){return this.eventListeners.add(e),this},t.prototype.onSend=function(e){return this.sendListeners.add(e),this},t.prototype.onChange=function(e){return this.contextListeners.add(e),this},t.prototype.onStop=function(e){return this.stopListeners.add(e),this},t.prototype.onDone=function(e){return this.status===It.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},t.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},t.prototype.start=function(e){var n=this;if(this.status===It.Running)return this;this.machine._init(),Ks.register(this.sessionId,this),this.initialized=!0,this.status=It.Running;var r=e===void 0?this.initialState:bo(this,function(){return cA(e)?n.machine.resolveState(e):n.machine.resolveState(Dn.from(e,n.machine.context))});return this.options.devTools&&this.attachDev(),this.scheduler.initialize(function(){n.update(r,Ko)}),this},t.prototype._stopChildren=function(){this.children.forEach(function(e){Re(e.stop)&&e.stop()}),this.children.clear()},t.prototype._stop=function(){var e,n,r,i,o,s,l,u,c,h;try{for(var p=ye(this.listeners),d=p.next();!d.done;d=p.next()){var g=d.value;this.listeners.delete(g)}}catch(w){e={error:w}}finally{try{d&&!d.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}try{for(var v=ye(this.stopListeners),E=v.next();!E.done;E=v.next()){var g=E.value;g(),this.stopListeners.delete(g)}}catch(w){r={error:w}}finally{try{E&&!E.done&&(i=v.return)&&i.call(v)}finally{if(r)throw r.error}}try{for(var A=ye(this.contextListeners),x=A.next();!x.done;x=A.next()){var g=x.value;this.contextListeners.delete(g)}}catch(w){o={error:w}}finally{try{x&&!x.done&&(s=A.return)&&s.call(A)}finally{if(o)throw o.error}}try{for(var _=ye(this.doneListeners),S=_.next();!S.done;S=_.next()){var g=S.value;this.doneListeners.delete(g)}}catch(w){l={error:w}}finally{try{S&&!S.done&&(u=_.return)&&u.call(_)}finally{if(l)throw l.error}}if(!this.initialized)return this;this.initialized=!1,this.status=It.Stopped,this._initialState=void 0;try{for(var k=ye(Object.keys(this.delayedEventsMap)),D=k.next();!D.done;D=k.next()){var N=D.value;this.clock.clearTimeout(this.delayedEventsMap[N])}}catch(w){c={error:w}}finally{try{D&&!D.done&&(h=k.return)&&h.call(k)}finally{if(c)throw c.error}}this.scheduler.clear(),this.scheduler=new zv({deferEvents:this.options.deferEvents})},t.prototype.stop=function(){var e=this,n=this.scheduler;return this._stop(),n.schedule(function(){var r;if(!(!((r=e._state)===null||r===void 0)&&r.done)){var i=Ot({type:"xstate.stop"}),o=bo(e,function(){var s=Qe(He([],Pe(e.state.configuration),!1).sort(function(p,d){return d.order-p.order}).map(function(p){return Qr(p.onExit,e.machine.options.actions)})),l=Pe(Ec(e.machine,e.state,e.state.context,i,[{type:"exit",actions:s}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),u=l[0],c=l[1],h=new Dn({value:e.state.value,context:c,_event:i,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:u.filter(function(p){return!xd(p)}),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return h.changed=!0,h});e.update(o,i),e._stopChildren(),Ks.free(e.sessionId)}}),this},t.prototype.batch=function(e){var n=this;if(!(this.status===It.NotStarted&&this.options.deferEvents)){if(this.status!==It.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'))}if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule(function(){var i,o,s=n.state,l=!1,u=[],c=function(g){var v=Ot(g);n.forward(v),s=bo(n,function(){return n.machine.transition(s,v,void 0,r||void 0)}),u.push.apply(u,He([],Pe(n.machine.config.predictableActionArguments?s.actions:s.actions.map(function(E){return fA(E,s)})),!1)),l=l||!!s.changed};try{for(var h=ye(e),p=h.next();!p.done;p=h.next()){var d=p.value;c(d)}}catch(g){i={error:g}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}s.changed=l,s.actions=u,n.update(s,Ot(e[e.length-1]))})}},t.prototype.sender=function(e){return this.send.bind(this,e)},t.prototype._nextState=function(e,n){var r=this;n===void 0&&(n=!!this.machine.config.predictableActionArguments&&this._exec);var i=Ot(e);if(i.name.indexOf(Dv)===0&&!this.state.nextEvents.some(function(s){return s.indexOf(Dv)===0}))throw i.data.data;var o=bo(this,function(){return r.machine.transition(r.state,i,void 0,n||void 0)});return o},t.prototype.nextState=function(e){return this._nextState(e,!1)},t.prototype.forward=function(e){var n,r;try{for(var i=ye(this.forwardTo),o=i.next();!o.done;o=i.next()){var s=o.value,l=this.children.get(s);if(!l)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(s,"'."));l.send(e)}}catch(u){n={error:u}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}},t.prototype.defer=function(e){var n=this,r=this.clock.setTimeout(function(){"to"in e&&e.to?n.sendTo(e._event,e.to,!0):n.send(e._event)},e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},t.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},t.prototype.exec=function(e,n,r){r===void 0&&(r=this.machine.options.actions),this._exec(e,n.context,n._event,r)},t.prototype.removeChild=function(e){var n;this.children.delete(e),this.forwardTo.delete(e),(n=this.state)===null||n===void 0||delete n.children[e]},t.prototype.stopChild=function(e){var n=this.children.get(e);n&&(this.removeChild(e),Re(n.stop)&&n.stop())},t.prototype.spawn=function(e,n,r){if(this.status!==It.Running)return oS(e,n);if(Mv(e))return this.spawnPromise(Promise.resolve(e),n);if(Re(e))return this.spawnCallback(e,n);if(oA(e))return this.spawnActor(e,n);if(BC(e))return this.spawnObservable(e,n);if(us(e))return this.spawnMachine(e,q(q({},r),{id:n}));if(FC(e))return this.spawnBehavior(e,n);throw new Error('Unable to spawn entity "'.concat(n,'" of type "').concat(typeof e,'".'))},t.prototype.spawnMachine=function(e,n){var r=this;n===void 0&&(n={});var i=new t(e,q(q({},this.options),{parent:this,id:n.id||e.id})),o=q(q({},vA),n);o.sync&&i.onTransition(function(l){r.send(Y_,{state:l,id:i.id})});var s=i;return this.children.set(i.id,s),o.autoForward&&this.forwardTo.add(i.id),i.onDone(function(l){r.removeChild(i.id),r.send(Ot(l,{origin:i.id}))}).start(),s},t.prototype.spawnBehavior=function(e,n){var r=gA(e,{id:n,parent:this});return this.children.set(n,r),r},t.prototype.spawnPromise=function(e,n){var r,i=this,o=!1,s;e.then(function(u){o||(s=u,i.removeChild(n),i.send(Ot(Lu(n,u),{origin:n})))},function(u){if(!o){i.removeChild(n);var c=ia(n,u);try{i.send(Ot(c,{origin:n}))}catch{i.devTools&&i.devTools.send(c,i.state),i.machine.strict&&i.stop()}}});var l=(r={id:n,send:function(){},subscribe:function(u,c,h){var p=Vu(u,c,h),d=!1;return e.then(function(g){d||(p.next(g),!d&&p.complete())},function(g){d||p.error(g)}),{unsubscribe:function(){return d=!0}}},stop:function(){o=!0},toJSON:function(){return{id:n}},getSnapshot:function(){return s}},r[Kr]=function(){return this},r);return this.children.set(n,l),l},t.prototype.spawnCallback=function(e,n){var r,i=this,o=!1,s=new Set,l=new Set,u,c=function(d){u=d,l.forEach(function(g){return g(d)}),!o&&i.send(Ot(d,{origin:n}))},h;try{h=e(c,function(d){s.add(d)})}catch(d){this.send(ia(n,d))}if(Mv(h))return this.spawnPromise(h,n);var p=(r={id:n,send:function(d){return s.forEach(function(g){return g(d)})},subscribe:function(d){var g=Vu(d);return l.add(g.next),{unsubscribe:function(){l.delete(g.next)}}},stop:function(){o=!0,Re(h)&&h()},toJSON:function(){return{id:n}},getSnapshot:function(){return u}},r[Kr]=function(){return this},r);return this.children.set(n,p),p},t.prototype.spawnObservable=function(e,n){var r,i=this,o,s=e.subscribe(function(u){o=u,i.send(Ot(u,{origin:n}))},function(u){i.removeChild(n),i.send(Ot(ia(n,u),{origin:n}))},function(){i.removeChild(n),i.send(Ot(Lu(n),{origin:n}))}),l=(r={id:n,send:function(){},subscribe:function(u,c,h){return e.subscribe(u,c,h)},stop:function(){return s.unsubscribe()},getSnapshot:function(){return o},toJSON:function(){return{id:n}}},r[Kr]=function(){return this},r);return this.children.set(n,l),l},t.prototype.spawnActor=function(e,n){return this.children.set(n,e),e},t.prototype.spawnActivity=function(e){var n=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(n){var r=n(this.state.context,e);this.spawnEffect(e.id,r)}},t.prototype.spawnEffect=function(e,n){var r;this.children.set(e,(r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:n||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}},r[Kr]=function(){return this},r))},t.prototype.attachDev=function(){var e=dm();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var n=typeof this.options.devTools=="object"?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect(q(q({name:this.id,autoPause:!0,stateSanitizer:function(r){return{value:r.value,context:r.context,actions:r.actions}}},n),{features:q({jump:!1,skip:!1},n?n.features:void 0)}),this.machine),this.devTools.init(this.state)}mA(this)}},t.prototype.toJSON=function(){return{id:this.id}},t.prototype[Kr]=function(){return this},t.prototype.getSnapshot=function(){return this.status===It.NotStarted?this.initialState:this._state},t.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,n){return setTimeout(e,n)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},t.interpret=cS,t}();function cS(t,e){var n=new yA(t,e);return n}function wA(t){if(typeof t=="string"){var e={type:t};return e.toString=function(){return t},e}return t}function eu(t){return q(q({type:Sd},t),{toJSON:function(){t.onDone,t.onError;var e=lm(t,["onDone","onError"]);return q(q({},e),{type:Sd,src:wA(t.src)})}})}var tu="",Ad="#",ah="*",wo={},Eo=function(t){return t[0]===Ad},EA=function(){return{actions:{},guards:{},services:{},activities:{},delays:{}}},_A=function(){function t(e,n,r,i){r===void 0&&(r="context"in e?e.context:void 0);var o=this,s;this.config=e,this._context=r,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign(EA(),n),this.parent=i==null?void 0:i.parent,this.key=this.config.key||(i==null?void 0:i.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:X_),this.id=this.config.id||He([this.machine.key],Pe(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:(s=this.config.schema)!==null&&s!==void 0?s:{},this.description=this.config.description,this.initial=this.config.initial,this.states=this.config.states?ra(this.config.states,function(c,h){var p,d=new t(c,{},void 0,{parent:o,key:h});return Object.assign(o.idMap,q((p={},p[d.id]=d,p),d.idMap)),d}):wo;var l=0;function u(c){var h,p;c.order=l++;try{for(var d=ye(sS(c)),g=d.next();!g.done;g=d.next()){var v=g.value;u(v)}}catch(E){h={error:E}}finally{try{g&&!g.done&&(p=d.return)&&p.call(d)}finally{if(h)throw h.error}}}u(this),this.history=this.config.history===!0?"shallow":this.config.history||!1,this._transient=!!this.config.always||(this.config.on?Array.isArray(this.config.on)?this.config.on.some(function(c){var h=c.event;return h===tu}):tu in this.config.on:!1),this.strict=!!this.config.strict,this.onEntry=Wn(this.config.entry||this.config.onEntry).map(function(c){return el(c)}),this.onExit=Wn(this.config.exit||this.config.onExit).map(function(c){return el(c)}),this.meta=this.config.meta,this.doneData=this.type==="final"?this.config.data:void 0,this.invoke=Wn(this.config.invoke).map(function(c,h){var p,d;if(us(c)){var g=Jl(o.id,h);return o.machine.options.services=q((p={},p[g]=c,p),o.machine.options.services),eu({src:g,id:g})}else if(Ne(c.src)){var g=c.id||Jl(o.id,h);return eu(q(q({},c),{id:g,src:c.src}))}else if(us(c.src)||Re(c.src)){var g=c.id||Jl(o.id,h);return o.machine.options.services=q((d={},d[g]=c.src,d),o.machine.options.services),eu(q(q({id:g},c),{src:g}))}else{var v=c.src;return eu(q(q({id:Jl(o.id,h)},c),{src:v}))}}),this.activities=Wn(this.config.activities).concat(this.invoke).map(function(c){return hm(c)}),this.transition=this.transition.bind(this),this.tags=Wn(this.config.tags)}return t.prototype._init=function(){this.__cache.transitions||aS(this).forEach(function(e){return e.on})},t.prototype.withConfig=function(e,n){var r=this.options,i=r.actions,o=r.activities,s=r.guards,l=r.services,u=r.delays;return new t(this.config,{actions:q(q({},i),e.actions),activities:q(q({},o),e.activities),guards:q(q({},s),e.guards),services:q(q({},l),e.services),delays:q(q({},u),e.delays)},n??this.context)},t.prototype.withContext=function(e){return new t(this.config,this.options,e)},Object.defineProperty(t.prototype,"context",{get:function(){return Re(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:ra(this.states,function(e){return e.definition}),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return this.definition},Object.defineProperty(t.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce(function(n,r){return n[r.eventType]=n[r.eventType]||[],n[r.eventType].push(r),n},{})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),t.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var n=e===tu,r=this.transitions.filter(function(i){var o=i.eventType===e;return n?o:o||i.eventType===ah});return this.__cache.candidates[e]=r,r},t.prototype.getDelayedTransitions=function(){var e=this,n=this.config.after;if(!n)return[];var r=function(o,s){var l=Re(o)?"".concat(e.id,":delay[").concat(s,"]"):o,u=tA(l,e.id);return e.onEntry.push(GC(u,{delay:o})),e.onExit.push(YC(u)),u},i=Ss(n)?n.map(function(o,s){var l=r(o.delay,s);return q(q({},o),{event:l})}):Qe(Object.keys(n).map(function(o,s){var l=n[o],u=Ne(l)?{target:l}:l,c=isNaN(+o)?o:+o,h=r(c,s);return Wn(u).map(function(p){return q(q({},p),{event:h,delay:c})})}));return i.map(function(o){var s=o.delay;return q(q({},e.formatTransition(o)),{delay:s})})},t.prototype.getStateNodes=function(e){var n,r=this;if(!e)return[];var i=e instanceof Dn?e.value:_a(e,this.delimiter);if(Ne(i)){var o=this.getStateNode(i).initial;return o!==void 0?this.getStateNodes((n={},n[i]=o,n)):[this,this.states[i]]}var s=Object.keys(i),l=[this];return l.push.apply(l,He([],Pe(Qe(s.map(function(u){return r.getStateNode(u).getStateNodes(i[u])}))),!1)),l},t.prototype.handles=function(e){var n=J_(e);return this.events.includes(n)},t.prototype.resolveState=function(e){var n=e instanceof Dn?e:Dn.create(e),r=Array.from(oa([],this.getStateNodes(n.value)));return new Dn(q(q({},n),{value:this.resolve(n.value),configuration:r,done:Mu(r,this),tags:jv(r),machine:this.machine}))},t.prototype.transitionLeafNode=function(e,n,r){var i=this.getStateNode(e),o=i.next(n,r);return!o||!o.transitions.length?this.next(n,r):o},t.prototype.transitionCompoundNode=function(e,n,r){var i=Object.keys(e),o=this.getStateNode(i[0]),s=o._transition(e[i[0]],n,r);return!s||!s.transitions.length?this.next(n,r):s},t.prototype.transitionParallelNode=function(e,n,r){var i,o,s={};try{for(var l=ye(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value,h=e[c];if(h){var p=this.getStateNode(c),d=p._transition(h,n,r);d&&(s[c]=d)}}}catch(x){i={error:x}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}var g=Object.keys(s).map(function(x){return s[x]}),v=Qe(g.map(function(x){return x.transitions})),E=g.some(function(x){return x.transitions.length>0});if(!E)return this.next(n,r);var A=Qe(Object.keys(s).map(function(x){return s[x].configuration}));return{transitions:v,exitSet:Qe(g.map(function(x){return x.exitSet})),configuration:A,source:n,actions:Qe(Object.keys(s).map(function(x){return s[x].actions}))}},t.prototype._transition=function(e,n,r){return Ne(e)?this.transitionLeafNode(e,n,r):Object.keys(e).length===1?this.transitionCompoundNode(e,n,r):this.transitionParallelNode(e,n,r)},t.prototype.getTransitionData=function(e,n){return this._transition(e.value,e,Ot(n))},t.prototype.next=function(e,n){var r,i,o=this,s=n.name,l=[],u=[],c;try{for(var h=ye(this.getCandidates(s)),p=h.next();!p.done;p=h.next()){var d=p.value,g=d.cond,v=d.in,E=e.context,A=v?Ne(v)&&Eo(v)?e.matches(_a(this.getStateNodeById(v).path,this.delimiter)):fm(_a(v,this.delimiter),VC(this.path.slice(0,-2))(e.value)):!0,x=!1;try{x=!g||nS(this.machine,g,E,n,e)}catch(k){throw new Error("Unable to evaluate guard '".concat(g.name||g.type,"' in transition for event '").concat(s,"' in state node '").concat(this.id,`': `).concat(k.message))}if(x&&A){d.target!==void 0&&(u=d.target),l.push.apply(l,He([],Pe(d.actions),!1)),c=d;break}}}catch(k){r={error:k}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}if(c){if(!u.length)return{transitions:[c],exitSet:[],configuration:e.value?[this]:[],source:e,actions:l};var _=Qe(u.map(function(k){return o.getRelativeStateNodes(k,e.historyValue)})),S=!!c.internal;return{transitions:[c],exitSet:S?[]:Qe(u.map(function(k){return o.getPotentiallyReenteringNodes(k)})),configuration:_,source:e,actions:l}}},t.prototype.getPotentiallyReenteringNodes=function(e){if(this.order0,g=d?e.configuration:n?n.configuration:[],v=Mu(g,this),E=d?aA(this.machine,p):void 0,A=n?n.historyValue?n.historyValue:e.source?this.machine.historyValue(n.value):void 0:void 0,x=this.getActions(new Set(g),v,e,r,o,n,i),_=n?q({},n.activities):{};try{for(var S=ye(x),k=S.next();!k.done;k=S.next()){var D=k.value;try{for(var N=(u=void 0,ye(D.actions)),w=N.next();!w.done;w=N.next()){var y=w.value;y.type===_d?_[y.activity.id||y.activity.type]=y:y.type===um&&(_[y.activity.id||y.activity.type]=!1)}}catch(Ie){u={error:Ie}}finally{try{w&&!w.done&&(c=N.return)&&c.call(N)}finally{if(u)throw u.error}}}}catch(Ie){s={error:Ie}}finally{try{k&&!k.done&&(l=S.return)&&l.call(S)}finally{if(s)throw s.error}}var b=Pe(Ec(this,n,r,o,x,i,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),I=b[0],C=b[1],R=Pe(jC(I,xd),2),P=R[0],ie=R[1],Ee=I.filter(function(Ie){var ot;return Ie.type===_d&&((ot=Ie.activity)===null||ot===void 0?void 0:ot.type)===Sd}),it=Ee.reduce(function(Ie,ot){return Ie[ot.activity.id]=rA(ot.activity,h.machine,C,o),Ie},n?q({},n.children):{}),ke=new Dn({value:E||n.value,context:C,_event:o,_sessionid:n?n._sessionid:null,historyValue:E?A?zC(A,E):void 0:n?n.historyValue:void 0,history:!E||e.source?n:void 0,actions:E?ie:[],activities:E?_:n?n.activities:{},events:[],configuration:g,transitions:e.transitions,children:it,done:v,tags:jv(g),machine:this}),z=r!==C;ke.changed=o.name===Y_||z;var G=ke.history;G&&delete G.history;var J=!v&&(this._transient||p.some(function(Ie){return Ie._transient}));if(!d&&(!J||o.name===tu))return ke;var ne=ke;if(!v)for(J&&(ne=this.resolveRaisedTransition(ne,{type:AC},o,i));P.length;){var ee=P.shift();ne=this.resolveRaisedTransition(ne,ee._event,o,i)}var mt=ne.changed||(G?!!ne.actions.length||z||typeof G.value!=typeof ne.value||!uS(ne.value,G.value):void 0);return ne.changed=mt,ne.history=G,ne},t.prototype.getStateNode=function(e){if(Eo(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var n=this.states[e];if(!n)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return n},t.prototype.getStateNodeById=function(e){var n=Eo(e)?e.slice(Ad.length):e;if(n===this.id)return this;var r=this.machine.idMap[n];if(!r)throw new Error("Child state node '#".concat(n,"' does not exist on machine '").concat(this.id,"'"));return r},t.prototype.getStateNodeByPath=function(e){if(typeof e=="string"&&Eo(e))try{return this.getStateNodeById(e.slice(1))}catch{}for(var n=Td(e,this.delimiter).slice(),r=this;n.length;){var i=n.shift();if(!i.length)break;r=r.getStateNode(i)}return r},t.prototype.resolve=function(e){var n,r=this;if(!e)return this.initialStateValue||wo;switch(this.type){case"parallel":return ra(this.initialStateValue,function(o,s){return o?r.getStateNode(s).resolve(e[s]||o):wo});case"compound":if(Ne(e)){var i=this.getStateNode(e);return i.type==="parallel"||i.type==="compound"?(n={},n[e]=i.initialStateValue,n):e}return Object.keys(e).length?ra(e,function(o,s){return o?r.getStateNode(s).resolve(o):wo}):this.initialStateValue||{};default:return e||wo}},t.prototype.getResolvedPath=function(e){if(Eo(e)){var n=this.machine.idMap[e.slice(Ad.length)];if(!n)throw new Error("Unable to find state node '".concat(e,"'"));return n.path}return Td(e,this.delimiter)},Object.defineProperty(t.prototype,"initialStateValue",{get:function(){var e;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;var n;if(this.type==="parallel")n=Lv(this.states,function(r){return r.initialStateValue||wo},function(r){return r.type!=="history"});else if(this.initial!==void 0){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));n=_c(this.states[this.initial])?this.initial:(e={},e[this.initial]=this.states[this.initial].initialStateValue,e)}else n={};return this.__cache.initialStateValue=n,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),t.prototype.getInitialState=function(e,n){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,n??this.machine.context,void 0)},Object.defineProperty(t.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){var e;if(this.type==="history"){var n=this.config;Ne(n.target)?e=Eo(n.target)?yc(this.machine.getStateNodeById(n.target).path.slice(this.path.length-1)):n.target:e=n.target}return e},enumerable:!1,configurable:!0}),t.prototype.getRelativeStateNodes=function(e,n,r){return r===void 0&&(r=!0),r?e.type==="history"?e.resolveHistory(n):e.initialStateNodes:[e]},Object.defineProperty(t.prototype,"initialStateNodes",{get:function(){var e=this;if(_c(this))return[this];if(this.type==="compound"&&!this.initial)return[this];var n=Du(this.initialStateValue);return Qe(n.map(function(r){return e.getFromRelativePath(r)}))},enumerable:!1,configurable:!0}),t.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var n=Pe(e),r=n[0],i=n.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var o=this.getStateNode(r);if(o.type==="history")return o.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},t.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:Lv(this.states,function(n,r){if(!e)return n.historyValue();var i=Ne(e)?void 0:e[r];return n.historyValue(i||n.initialStateValue)},function(n){return!n.history})}},t.prototype.resolveHistory=function(e){var n=this;if(this.type!=="history")return[this];var r=this.parent;if(!e){var i=this.target;return i?Qe(Du(i).map(function(s){return r.getFromRelativePath(s)})):r.initialStateNodes}var o=LC(r.path,"states")(e).current;return Ne(o)?[r.getStateNode(o)]:Qe(Du(o).map(function(s){return n.history==="deep"?r.getFromRelativePath(s):[r.states[s[0]]]}))},Object.defineProperty(t.prototype,"stateIds",{get:function(){var e=this,n=Qe(Object.keys(this.states).map(function(r){return e.states[r].stateIds}));return[this.id].concat(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"events",{get:function(){var e,n,r,i;if(this.__cache.events)return this.__cache.events;var o=this.states,s=new Set(this.ownEvents);if(o)try{for(var l=ye(Object.keys(o)),u=l.next();!u.done;u=l.next()){var c=u.value,h=o[c];if(h.states)try{for(var p=(r=void 0,ye(h.events)),d=p.next();!d.done;d=p.next()){var g=d.value;s.add("".concat(g))}}catch(v){r={error:v}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}}}catch(v){e={error:v}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(s)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter(function(n){return!(!n.target&&!n.actions.length&&n.internal)}).map(function(n){return n.eventType}));return Array.from(e)},enumerable:!1,configurable:!0}),t.prototype.resolveTarget=function(e){var n=this;if(e!==void 0)return e.map(function(r){if(!Ne(r))return r;var i=r[0]===n.delimiter;if(i&&!n.parent)return n.getStateNodeByPath(r.slice(1));var o=i?n.key+r:r;if(n.parent)try{var s=n.parent.getStateNodeByPath(o);return s}catch(l){throw new Error("Invalid transition definition for state node '".concat(n.id,`': `).concat(l.message))}else return n.getStateNodeByPath(o)})},t.prototype.formatTransition=function(e){var n=this,r=HC(e.target),i="internal"in e?e.internal:r?r.some(function(u){return Ne(u)&&u[0]===n.delimiter}):!0,o=this.machine.options.guards,s=this.resolveTarget(r),l=q(q({},e),{actions:Qr(Wn(e.actions)),cond:tS(e.cond,o),target:s,source:this,internal:i,eventType:e.event,toJSON:function(){return q(q({},l),{target:l.target?l.target.map(function(u){return"#".concat(u.id)}):void 0,source:"#".concat(n.id)})}});return l},t.prototype.formatTransitions=function(){var e,n,r=this,i;if(!this.config.on)i=[];else if(Array.isArray(this.config.on))i=this.config.on;else{var o=this.config.on,s=ah,l=o[s],u=l===void 0?[]:l,c=lm(o,[typeof s=="symbol"?s:s+""]);i=Qe(Object.keys(c).map(function(_){var S=yo(_,c[_]);return S}).concat(yo(ah,u)))}var h=this.config.always?yo("",this.config.always):[],p=this.config.onDone?yo(String(Zl(this.id)),this.config.onDone):[],d=Qe(this.invoke.map(function(_){var S=[];return _.onDone&&S.push.apply(S,He([],Pe(yo(String(Lu(_.id)),_.onDone)),!1)),_.onError&&S.push.apply(S,He([],Pe(yo(String(ia(_.id)),_.onError)),!1)),S})),g=this.after,v=Qe(He(He(He(He([],Pe(p),!1),Pe(d),!1),Pe(i),!1),Pe(h),!1).map(function(_){return Wn(_).map(function(S){return r.formatTransition(S)})}));try{for(var E=ye(g),A=E.next();!A.done;A=E.next()){var x=A.value;v.push(x)}}catch(_){e={error:_}}finally{try{A&&!A.done&&(n=E.return)&&n.call(E)}finally{if(e)throw e.error}}return v},t}();function SA(t,e,n){return n===void 0&&(n=t.context),new _A(t,e,n)}var bA=eA,Pd;(function(t){t[t.Effect=1]="Effect",t[t.LayoutEffect=2]="LayoutEffect"})(Pd||(Pd={}));var Sa=O.useLayoutEffect;function Uv(t){var e=O.useRef();return e.current||(e.current={v:t()}),e.current.v}var TA=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},xA=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function IA(t,e){var n,r,i=TA([[],[]],2),o=i[0],s=i[1];try{for(var l=xA(t),u=l.next();!u.done;u=l.next()){var c=u.value;e(c)?o.push(c):s.push(c)}}catch(h){n={error:h}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return[o,s]}var Qs=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o},Bv=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r0)&&!(i=r.next()).done;)o.push(i.value)}catch(l){s={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o};function NA(t,e){e===void 0&&(e={});var n=O.useCallback(function(l){var u=l.changed===void 0&&Object.keys(l.children).length;(l.changed||u)&&s(l)},[]),r=RA(t,e,n),i=kA(O.useState(function(){var l=r.machine.initialState;return e.state?Dn.create(e.state):l}),2),o=i[0],s=i[1];return[o,r.send,r]}function nt(){return nt=Object.assign?Object.assign.bind():function(t){for(var e=1;eObject.prototype.toString.call(t)==="[object Object]",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0,nul:t=>t===null,set:t=>t instanceof Set,map:t=>t instanceof Map,equ(t,e){if(typeof t!=typeof e)return!1;if(me.str(t)||me.num(t))return t===e;if(me.obj(t)&&me.obj(e)&&Object.keys(t).length+Object.keys(e).length===0)return!0;let n;for(n in t)if(!(n in e))return!1;for(n in e)if(t[n]!==e[n])return!1;return me.und(n)?t===e:!0}};function OA(t,e){return n=>(me.arr(n)?n:Object.keys(n)).reduce((r,i)=>{const o=i;return r[o]=t(o),r},t)}function DA(){const t=O.useState(!1),e=t[1];return O.useCallback(()=>e(r=>!r),[])}function ji(t,e){return me.und(t)||me.nul(t)?e:t}function nu(t){return me.und(t)?[]:me.arr(t)?t:[t]}function zo(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;rme.und(e[i])?nt({},r,{[i]:t[i]}):r,{});return nt({to:e},n)}function LA(t,e){return e&&(me.fun(e)?e(t):me.obj(e)&&(e.current=t)),t}class Kn{constructor(){this.payload=void 0,this.children=[]}getAnimatedValue(){return this.getValue()}getPayload(){return this.payload||this}attach(){}detach(){}getChildren(){return this.children}addChild(e){this.children.length===0&&this.attach(),this.children.push(e)}removeChild(e){const n=this.children.indexOf(e);this.children.splice(n,1),this.children.length===0&&this.detach()}}class Rd extends Kn{constructor(){super(...arguments),this.payload=[],this.attach=()=>this.payload.forEach(e=>e instanceof Kn&&e.addChild(this)),this.detach=()=>this.payload.forEach(e=>e instanceof Kn&&e.removeChild(this))}}class fS extends Kn{constructor(){super(...arguments),this.payload={},this.attach=()=>Object.values(this.payload).forEach(e=>e instanceof Kn&&e.addChild(this)),this.detach=()=>Object.values(this.payload).forEach(e=>e instanceof Kn&&e.removeChild(this))}getValue(e){e===void 0&&(e=!1);const n={};for(const r in this.payload){const i=this.payload[r];e&&!(i instanceof Kn)||(n[r]=i instanceof Kn?i[e?"getAnimatedValue":"getValue"]():i)}return n}getAnimatedValue(){return this.getValue(!0)}}let pm;function MA(t,e){pm={fn:t,transform:e}}let hS;function FA(t){hS=t}let dS=t=>typeof window<"u"?window.requestAnimationFrame(t):-1,Sc;function jA(t){Sc=t}let pS=()=>Date.now(),zA=t=>t.current,mS;function UA(t){mS=t}class BA extends fS{constructor(e,n){super(),this.update=void 0,this.payload=e.style?nt({},e,{style:mS(e.style)}):e,this.update=n,this.attach()}}const $A=t=>me.fun(t)&&!(t.prototype instanceof Jt.Component),HA=t=>O.forwardRef((n,r)=>{const i=DA(),o=O.useRef(!0),s=O.useRef(null),l=O.useRef(null),u=O.useCallback(d=>{const g=s.current,v=()=>{let E=!1;l.current&&(E=pm.fn(l.current,s.current.getAnimatedValue())),(!l.current||E===!1)&&i()};s.current=new BA(d,v),g&&g.detach()},[]);O.useEffect(()=>()=>{o.current=!1,s.current&&s.current.detach()},[]),O.useImperativeHandle(r,()=>zA(l)),u(n);const c=s.current.getValue();c.scrollTop,c.scrollLeft;const h=Qo(c,["scrollTop","scrollLeft"]),p=$A(t)?void 0:d=>l.current=LA(d,r);return Jt.createElement(t,nt({},h,{ref:p}))});let Ta=!1;const Yi=new Set,gS=()=>{if(!Ta)return!1;let t=pS();for(let e of Yi){let n=!1;for(let r=0;r=u.startTime+i.duration;else if(i.decay)p=c+g/(1-.998)*(1-Math.exp(-.0020000000000000018*(t-u.startTime))),o=Math.abs(u.lastPosition-p)<.1,o&&(h=p);else{s=u.lastTime!==void 0?u.lastTime:t,g=u.lastVelocity!==void 0?u.lastVelocity:i.initialVelocity,t>s+64&&(s=t);let v=Math.floor(t-s);for(let _=0;_h:p{Yi.has(t)||Yi.add(t),Ta||(Ta=!0,dS(gS))},qA=t=>{Yi.has(t)&&Yi.delete(t)};function bc(t,e,n){if(typeof t=="function")return t;if(Array.isArray(t))return bc({range:t,output:e,extrapolate:n});if(Sc&&typeof t.output[0]=="string")return Sc(t);const r=t,i=r.output,o=r.range||[0,1],s=r.extrapolateLeft||r.extrapolate||"extend",l=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||(c=>c);return c=>{const h=KA(c,o);return GA(c,o[h],o[h+1],i[h],i[h+1],u,s,l,r.map)}}function GA(t,e,n,r,i,o,s,l,u){let c=u?u(t):t;if(cn){if(l==="identity")return c;l==="clamp"&&(c=n)}return r===i?r:e===n?t<=e?r:i:(e===-1/0?c=-c:n===1/0?c=c-e:c=(c-e)/(n-e),c=o(c),r===-1/0?c=-c:i===1/0?c=c+r:c=c*(i-r)+r,c)}function KA(t,e){for(var n=1;n=t);++n);return n-1}class cs extends Rd{constructor(e,n,r,i){super(),this.calc=void 0,this.payload=e instanceof Rd&&!(e instanceof cs)?e.getPayload():Array.isArray(e)?e:[e],this.calc=bc(n,r,i)}getValue(){return this.calc(...this.payload.map(e=>e.getValue()))}updateConfig(e,n,r){this.calc=bc(e,n,r)}interpolate(e,n,r){return new cs(this,e,n,r)}}const _o=(t,e,n)=>t&&new cs(t,e,n),QA={default:{tension:170,friction:26}};function vS(t,e){"update"in t?e.add(t):t.getChildren().forEach(n=>vS(n,e))}class kd extends Kn{constructor(e){var n;super(),n=this,this.animatedStyles=new Set,this.value=void 0,this.startPosition=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.startTime=void 0,this.lastTime=void 0,this.done=!1,this.setValue=function(r,i){i===void 0&&(i=!0),n.value=r,i&&n.flush()},this.value=e,this.startPosition=e,this.lastPosition=e}flush(){this.animatedStyles.size===0&&vS(this,this.animatedStyles),this.animatedStyles.forEach(e=>e.update())}clearStyles(){this.animatedStyles.clear()}getValue(){return this.value}interpolate(e,n,r){return new cs(this,e,n,r)}}class YA extends Rd{constructor(e){super(),this.payload=e.map(n=>new kd(n))}setValue(e,n){n===void 0&&(n=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((r,i)=>this.payload[i].setValue(r,n)):this.payload.forEach(r=>r.setValue(e,n))}getValue(){return this.payload.map(e=>e.getValue())}interpolate(e,n){return new cs(this,e,n)}}let XA=0,JA=class{constructor(){this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=()=>this.interpolations,this.id=XA++}update(e){if(!e)return this;const n=lh(e),r=n.delay,i=r===void 0?0:r,o=n.to,s=Qo(n,["delay","to"]);if(me.arr(o)||me.fun(o))this.queue.push(nt({},s,{delay:i,to:o}));else if(o){let l={};Object.entries(o).forEach(u=>{let c=u[0],h=u[1];const p=nt({to:{[c]:h},delay:zo(i,c)},s),d=l[p.delay]&&l[p.delay].to;l[p.delay]=nt({},l[p.delay],p,{to:nt({},d,p.to)})}),this.queue=Object.values(l)}return this.queue=this.queue.sort((l,u)=>l.delay-u.delay),this.diff(s),this}start(e){if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach(i=>{let o=i.from,s=o===void 0?{}:o,l=i.to,u=l===void 0?{}:l;me.obj(s)&&(this.merged=nt({},s,this.merged)),me.obj(u)&&(this.merged=nt({},this.merged,u))});const n=this.local=++this.guid,r=this.localQueue=this.queue;this.queue=[],r.forEach((i,o)=>{let s=i.delay,l=Qo(i,["delay"]);const u=h=>{o===r.length-1&&n===this.guid&&h&&(this.idle=!0,this.props.onRest&&this.props.onRest(this.merged)),e&&e()};let c=me.arr(l.to)||me.fun(l.to);s?setTimeout(()=>{n===this.guid&&(c?this.runAsync(l,u):this.diff(l).start(u))},s):c?this.runAsync(l,u):this.diff(l).start(u)})}else me.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),WA(this);return this}stop(e){return this.listeners.forEach(n=>n(e)),this.listeners=[],this}pause(e){return this.stop(!0),e&&qA(this),this}runAsync(e,n){var r=this;e.delay;let i=Qo(e,["delay"]);const o=this.local;let s=Promise.resolve(void 0);if(me.arr(i.to))for(let l=0;l{if(o===this.guid)return new Promise(h=>this.diff(c).start(h))})}else if(me.fun(i.to)){let l=0,u;s=s.then(()=>i.to(c=>{const h=nt({},i,lh(c));if(me.arr(h.config)&&(h.config=h.config[l]),l++,o===this.guid)return u=new Promise(p=>this.diff(h).start(p))},function(c){return c===void 0&&(c=!0),r.stop(c)}).then(()=>u))}s.then(n)}diff(e){this.props=nt({},this.props,e);let n=this.props,r=n.from,i=r===void 0?{}:r,o=n.to,s=o===void 0?{}:o,l=n.config,u=l===void 0?{}:l,c=n.reverse,h=n.attach,p=n.reset,d=n.immediate;if(c){var g=[s,i];i=g[0],s=g[1]}this.merged=nt({},i,this.merged,s),this.hasChanged=!1;let v=h&&h(this);if(this.animations=Object.entries(this.merged).reduce((E,A)=>{let x=A[0],_=A[1],S=E[x]||{};const k=me.num(_),D=me.str(_)&&!_.startsWith("#")&&!/\d/.test(_)&&!hS[_],N=me.arr(_),w=!k&&!N&&!D;let y=me.und(i[x])?_:i[x],b=k||N||D?_:1,I=zo(u,x);v&&(b=v.animations[x].parent);let C=S.parent,R=S.interpolation,P=nu(v?b.getPayload():b),ie,Ee=_;w&&(Ee=Sc({range:[0,1],output:[_,_]})(1));let it=R&&R.getValue();const z=!me.und(C)&&S.animatedValues.some(ee=>!ee.done),G=!me.equ(Ee,it),J=!me.equ(Ee,S.previous),ne=!me.equ(I,S.config);if(p||J&&G||ne){if(k||D)C=R=S.parent||new kd(y);else if(N)C=R=S.parent||new YA(y);else if(w){let ee=S.interpolation&&S.interpolation.calc(S.parent.value);ee=ee!==void 0&&!p?ee:y,S.parent?(C=S.parent,C.setValue(0,!1)):C=new kd(0);const mt={output:[ee,_]};S.interpolation?(R=S.interpolation,S.interpolation.updateConfig(mt)):R=C.interpolate(mt)}return P=nu(v?b.getPayload():b),ie=nu(C.getPayload()),p&&!w&&C.setValue(y,!1),this.hasChanged=!0,ie.forEach(ee=>{ee.startPosition=ee.value,ee.lastPosition=ee.value,ee.lastVelocity=z?ee.lastVelocity:void 0,ee.lastTime=z?ee.lastTime:void 0,ee.startTime=pS(),ee.done=!1,ee.animatedStyles.clear()}),zo(d,x)&&C.setValue(w?b:_,!1),nt({},E,{[x]:nt({},S,{name:x,parent:C,interpolation:R,animatedValues:ie,toValues:P,previous:Ee,config:I,fromValues:nu(C.getValue()),immediate:zo(d,x),initialVelocity:ji(I.velocity,0),clamp:ji(I.clamp,!1),precision:ji(I.precision,.01),tension:ji(I.tension,170),friction:ji(I.friction,26),mass:ji(I.mass,1),duration:I.duration,easing:ji(I.easing,ee=>ee),decay:I.decay})})}else return G?E:(w&&(C.setValue(1,!1),R.updateConfig({output:[Ee,Ee]})),C.done=!0,this.hasChanged=!0,nt({},E,{[x]:nt({},E[x],{previous:Ee})}))},this.animations),this.hasChanged){this.configs=Object.values(this.animations),this.values={},this.interpolations={};for(let E in this.animations)this.interpolations[E]=this.animations[E].interpolation,this.values[E]=this.animations[E].interpolation.getValue()}return this}destroy(){this.stop(),this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.local=0}};const ZA=(t,e)=>{const n=O.useRef(!1),r=O.useRef(),i=me.fun(e),o=O.useMemo(()=>{r.current&&(r.current.map(p=>p.destroy()),r.current=void 0);let h;return[new Array(t).fill().map((p,d)=>{const g=new JA,v=i?zo(e,d,g):e[d];return d===0&&(h=v.ref),g.update(v),h||g.start(),g}),h]},[t]),s=o[0],l=o[1];r.current=s,O.useImperativeHandle(l,()=>({start:()=>Promise.all(r.current.map(h=>new Promise(p=>h.start(p)))),stop:h=>r.current.forEach(p=>p.stop(h)),get controllers(){return r.current}}));const u=O.useMemo(()=>h=>r.current.map((p,d)=>{p.update(i?zo(h,d,p):h[d]),l||p.start()}),[t]);O.useEffect(()=>{n.current?i||u(e):l||r.current.forEach(h=>h.start())}),O.useEffect(()=>(n.current=!0,()=>r.current.forEach(h=>h.destroy())),[]);const c=r.current.map(h=>h.getValues());return i?[c,u,h=>r.current.forEach(p=>p.pause(h))]:c},eP=t=>{const e=me.fun(t),n=ZA(1,e?t:[t]),r=n[0],i=n[1],o=n[2];return e?[r[0],i,o]:r};class tP extends fS{constructor(e){e===void 0&&(e={}),super(),e.transform&&!(e.transform instanceof Kn)&&(e=pm.transform(e)),this.payload=e}}const Tc={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Qn="[-+]?\\d*\\.?\\d+",xc=Qn+"%";function uf(){for(var t=arguments.length,e=new Array(t),n=0;n>>0===t&&t>=0&&t<=4294967295?t:null:(e=lP.exec(t))?parseInt(e[1]+"ff",16)>>>0:Tc.hasOwnProperty(t)?Tc[t]:(e=nP.exec(t))?(So(e[1])<<24|So(e[2])<<16|So(e[3])<<8|255)>>>0:(e=rP.exec(t))?(So(e[1])<<24|So(e[2])<<16|So(e[3])<<8|qv(e[4]))>>>0:(e=sP.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=uP.exec(t))?parseInt(e[1],16)>>>0:(e=aP.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=iP.exec(t))?(Hv(Wv(e[1]),ru(e[2]),ru(e[3]))|255)>>>0:(e=oP.exec(t))?(Hv(Wv(e[1]),ru(e[2]),ru(e[3]))|qv(e[4]))>>>0:null}function uh(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Hv(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,i=2*n-r,o=uh(i,r,t+1/3),s=uh(i,r,t),l=uh(i,r,t-1/3);return Math.round(o*255)<<24|Math.round(s*255)<<16|Math.round(l*255)<<8}function So(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Wv(t){return(parseFloat(t)%360+360)%360/360}function qv(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function ru(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Gv(t){let e=cP(t);if(e===null)return t;e=e||0;let n=(e&4278190080)>>>24,r=(e&16711680)>>>16,i=(e&65280)>>>8,o=(e&255)/255;return`rgba(${n}, ${r}, ${i}, ${o})`}const iu=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,fP=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,hP=new RegExp(`(${Object.keys(Tc).join("|")})`,"g"),dP=t=>{const e=t.output.map(i=>i.replace(fP,Gv)).map(i=>i.replace(hP,Gv)),n=e[0].match(iu).map(()=>[]);e.forEach(i=>{i.match(iu).forEach((o,s)=>n[s].push(+o))});const r=e[0].match(iu).map((i,o)=>bc(nt({},t,{output:n[o]})));return i=>{let o=0;return e[0].replace(iu,()=>r[o++](i)).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(s,l,u,c,h)=>`rgba(${Math.round(l)}, ${Math.round(u)}, ${Math.round(c)}, ${h})`)}};let xa={animationIterationCount:!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,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};const pP=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),mP=["Webkit","Ms","Moz","O"];xa=Object.keys(xa).reduce((t,e)=>(mP.forEach(n=>t[pP(n,e)]=t[e]),t),xa);function gP(t,e,n){return e==null||typeof e=="boolean"||e===""?"":!n&&typeof e=="number"&&e!==0&&!(xa.hasOwnProperty(t)&&xa[t])?e+"px":(""+e).trim()}const Kv={};UA(t=>new tP(t));jA(dP);FA(Tc);MA((t,e)=>{if(t.nodeType&&t.setAttribute!==void 0){const i=e.style,o=e.children,s=e.scrollTop,l=e.scrollLeft,u=Qo(e,["style","children","scrollTop","scrollLeft"]),c=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter";s!==void 0&&(t.scrollTop=s),l!==void 0&&(t.scrollLeft=l),o!==void 0&&(t.textContent=o);for(let h in i)if(i.hasOwnProperty(h)){var n=h.indexOf("--")===0,r=gP(h,i[h],n);h==="float"&&(h="cssFloat"),n?t.style.setProperty(h,r):t.style[h]=r}for(let h in u){const p=c?h:Kv[h]||(Kv[h]=h.replace(/([A-Z])/g,d=>"-"+d.toLowerCase()));typeof t.getAttribute(p)<"u"&&t.setAttribute(p,u[h])}return}else return!1},t=>t);const vP=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],yP=OA(HA),wP=yP(vP);function Qv(t,e){return t.map(function(n,r){return n+e[r]})}function yS(t,e){return t.map(function(n,r){return n-e[r]})}function Nd(t){return Math.hypot.apply(Math,t)}function EP(t,e,n){var r=Nd(e),i=r===0?0:1/r,o=n===0?0:1/n,s=o*r,l=e.map(function(h){return o*h}),u=e.map(function(h){return i*h}),c=Nd(t);return{velocities:l,velocity:s,distance:c,direction:u}}function Od(t){return Math.sign?Math.sign(t):+(t>0)-+(t<0)||+t}function _P(t,e,n){return Math.max(e,Math.min(t,n))}function SP(t,e){return Math.pow(t,e*5)}function Yv(t,e,n){return e===0||Math.abs(e)===1/0?SP(t,n):t*e*n/(e+n*t)}function Ia(t,e,n,r){return r===void 0&&(r=.15),r===0?_P(t,e,n):tn?+Yv(t-n,n-e,r)+n:t}function bP(t,e){for(var n=0;n=0)&&(n[i]=t[i]);return n}function ou(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function IP(t,e){if(t){if(typeof t=="string")return Xv(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xv(t,e)}}function Xv(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n"u"||t[Symbol.iterator]==null){if(Array.isArray(t)||(n=IP(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=t[Symbol.iterator](),n.next.bind(n)}function ES(){}function _S(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r0,h},swipeVelocity:function(e){return e===void 0&&(e=PP),Yr(e)},swipeDistance:function(e){return e===void 0&&(e=RP),Yr(e)},delay:function(e){switch(e===void 0&&(e=0),e){case!0:return CP;case!1:return 0;default:return e}}});function VP(t){return t===void 0&&(t={}),mm(t,OP)}function LP(t){return t===void 0&&(t={}),mm(t,DP)}function MP(t){var e=t.domTarget,n=t.eventOptions,r=t.window,i=t.enabled,o=xP(t,["domTarget","eventOptions","window","enabled"]),s=VP({domTarget:e,eventOptions:n,window:r,enabled:i});return s.drag=LP(o),s}function Ys(t){return en({_active:!1,_blocked:!1,_intentional:[!1,!1],_movement:[0,0],_initial:[0,0],_bounds:[[-1/0,1/0],[-1/0,1/0]],_lastEventType:void 0,event:void 0,intentional:!1,values:[0,0],velocities:[0,0],delta:[0,0],movement:[0,0],offset:[0,0],lastOffset:[0,0],direction:[0,0],initial:[0,0],previous:[0,0],first:!1,last:!1,active:!1,timeStamp:0,startTime:0,elapsedTime:0,cancel:ES,canceled:!1,memo:void 0,args:void 0},t)}function bS(){var t={hovering:!1,scrolling:!1,wheeling:!1,dragging:!1,moving:!1,pinching:!1,touches:0,buttons:0,down:!1,shiftKey:!1,altKey:!1,metaKey:!1,ctrlKey:!1},e=Ys({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0,_isTap:!0,_delayedEvent:!1,_pointerId:void 0,tap:!1,swipe:[0,0]}),n=Ys({da:[0,0],vdva:[0,0],origin:void 0,turns:0}),r=Ys({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),i=Ys({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0}),o=Ys({axis:void 0,xy:[0,0],vxvy:[0,0],velocity:0,distance:0});return{shared:t,drag:e,pinch:n,wheel:r,move:i,scroll:o}}var Bi=new Map,FP=function(){function t(n,r){var i=this;r===void 0&&(r=[]),this.controller=n,this.args=r,this.debounced=!0,this.setTimeout=function(o,s){var l;s===void 0&&(s=140),clearTimeout(i.controller.timeouts[i.stateKey]);for(var u=arguments.length,c=new Array(u>2?u-2:0),h=2;h=e?Od(t)*e:!1}function Zv(t,e,n){var r=e[0],i=e[1],o=n[0],s=n[1],l=t[0],u=l[0],c=l[1],h=t[1],p=h[0],d=h[1];return[Ia(r,u,c,o),Ia(i,p,d,s)]}function ch(t,e,n){var r=t.state,i=t.args,o=e.timeStamp,s=e.type,l=r.values,u=n?0:o-r.startTime;return{_lastEventType:s,event:e,timeStamp:o,elapsedTime:u,args:i,previous:l}}function jP(t,e,n){var r=t.state.offset,i=n.timeStamp;return en({},bS()[t.stateKey],{_active:!0,values:e,initial:e,offset:r,lastOffset:r,startTime:i})}function zP(t,e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;ou?"x":l0?e:n}return null}function ey(t){var e="buttons"in t?t.buttons:0,n=CS(t),r=n&&n.length||0,i=r>0||e>0,o=t.shiftKey,s=t.altKey,l=t.metaKey,u=t.ctrlKey;return{touches:r,down:i,buttons:e,shiftKey:o,altKey:s,metaKey:l,ctrlKey:u}}function ty(t){var e=CS(t),n=e?e[0]:t,r=n.clientX,i=n.clientY;return[r,i]}var XP=3,JP=220,ZP=function(t){wS(e,t);function e(){var r;return r=t.apply(this,arguments)||this,r.ingKey="dragging",r.stateKey="drag",r.onDragStart=function(i){!r.enabled||r.state._active||(HP(r.controller,r.stateKey,[["pointermove",r.onDragChange],["pointerup",r.onDragEnd],["pointercancel",r.onDragEnd]]),r.updateGestureState({_pointerId:i.pointerId}),r.config.delay>0?(r.state._delayedEvent=!0,"persist"in i&&typeof i.persist=="function"&&i.persist(),r.setTimeout(r.startDrag.bind(ou(r)),r.config.delay,i)):r.startDrag(i))},r.onDragChange=function(i){if(!r.state.canceled&&i.pointerId===r.state._pointerId){if(!r.state._active){r.state._delayedEvent&&(r.clearTimeout(),r.startDrag(i));return}var o=ey(i);if(!o.down){r.onDragEnd(i);return}r.updateSharedState(o);var s=ty(i),l=r.getKinematics(s,i),u=ch(ou(r),i),c=r.state._isTap,h=Nd(l._movement);c&&h>=XP&&(c=!1),r.updateGestureState(en({},u,l,{_isTap:c})),r.fireGestureHandler()}},r.onDragEnd=function(i){if(i.pointerId===r.state._pointerId){r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0});var o=r.state._isTap,s=r.state.velocities,l=s[0],u=s[1],c=r.state.movement,h=c[0],p=c[1],d=r.state._intentional,g=d[0],v=d[1],E=r.config.swipeVelocity,A=E[0],x=E[1],_=r.config.swipeDistance,S=_[0],k=_[1],D=en({},ch(ou(r),i),r.getMovement(r.state.values)),N=[0,0];D.elapsedTimeA&&Math.abs(h)>S&&(N[0]=Od(l)),v!==!1&&Math.abs(u)>x&&Math.abs(p)>k&&(N[1]=Od(u))),r.updateGestureState(en({},D,{tap:o,swipe:N})),r.fireGestureHandler(o===!0)}},r.clean=function(){t.prototype.clean.call(ou(r)),r.state._delayedEvent=!1,$P(r.controller,r.stateKey)},r.onCancel=function(){r.state.canceled||(r.updateGestureState({canceled:!0}),r.state._active=!1,r.updateSharedState({down:!1,buttons:0,touches:0}),requestAnimationFrame(function(){return r.fireGestureHandler()}))},r.onClick=function(i){r.state._isTap||i.stopPropagation()},r}var n=e.prototype;return n.startDrag=function(i){var o=ty(i);this.updateSharedState(ey(i)),this.updateGestureState(en({},jP(this,o,i),ch(this,i,!0),{_pointerId:i.pointerId,cancel:this.onCancel})),this.updateGestureState(this.getMovement(o)),this.fireGestureHandler()},n.addBindings=function(i){if(Dd(i,"onPointerDown",this.onDragStart),this.config.filterTaps){var o=this.controller.config.eventOptions.capture?"onClick":"onClickCapture";Dd(i,o,this.onClick)}},e}(YP);function eR(t,e){var n,r=[],i,o=!1;function s(){for(var l=arguments.length,u=new Array(l),c=0;csummary:first-of-type","details"],Ic=AS.join(","),PS=typeof Element>"u",ao=PS?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Vd=!PS&&Element.prototype.getRootNode?function(t){return t.getRootNode()}:function(t){return t.ownerDocument},RS=function(e,n,r){var i=Array.prototype.slice.apply(e.querySelectorAll(Ic));return n&&ao.call(e,Ic)&&i.unshift(e),i=i.filter(r),i},kS=function t(e,n,r){for(var i=[],o=Array.from(e);o.length;){var s=o.shift();if(s.tagName==="SLOT"){var l=s.assignedElements(),u=l.length?l:s.children,c=t(u,!0,r);r.flatten?i.push.apply(i,c):i.push({scope:s,candidates:c})}else{var h=ao.call(s,Ic);h&&r.filter(s)&&(n||!e.includes(s))&&i.push(s);var p=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!r.shadowRootFilter||r.shadowRootFilter(s);if(p&&d){var g=t(p===!0?s.children:p.children,!0,r);r.flatten?i.push.apply(i,g):i.push({scope:s,candidates:g})}else o.unshift.apply(o,s.children)}}return i},NS=function(e,n){return e.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},rR=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},OS=function(e){return e.tagName==="INPUT"},iR=function(e){return OS(e)&&e.type==="hidden"},oR=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},sR=function(e,n){for(var r=0;rsummary:first-of-type"),s=o?e.parentElement:e;if(ao.call(s,"details:not([open]) *"))return!0;var l=Vd(e).host,u=(l==null?void 0:l.ownerDocument.contains(l))||e.ownerDocument.contains(e);if(!r||r==="full"){if(typeof i=="function"){for(var c=e;e;){var h=e.parentElement,p=Vd(e);if(h&&!h.shadowRoot&&i(h)===!0)return ny(e);e.assignedSlot?e=e.assignedSlot:!h&&p!==e.ownerDocument?e=p.host:e=h}e=c}if(u)return!e.getClientRects().length}else if(r==="non-zero-area")return ny(e);return!1},fR=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r=0)},dR=function t(e){var n=[],r=[];return e.forEach(function(i,o){var s=!!i.scope,l=s?i.scope:i,u=NS(l,s),c=s?t(i.candidates):l;u===0?s?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:i,isScope:s,content:c})}),r.sort(rR).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pR=function(e,n){n=n||{};var r;return n.getShadowRoot?r=kS([e],n.includeContainer,{filter:Ld.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:hR}):r=RS(e,n.includeContainer,Ld.bind(null,n)),dR(r)},mR=function(e,n){n=n||{};var r;return n.getShadowRoot?r=kS([e],n.includeContainer,{filter:Cc.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=RS(e,n.includeContainer,Cc.bind(null,n)),r},au=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return ao.call(e,Ic)===!1?!1:Ld(n,e)},gR=AS.concat("iframe").join(","),fh=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return ao.call(e,gR)===!1?!1:Cc(n,e)};/*! * focus-trap 6.9.4 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE */function ry(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function iy(t){for(var e=1;e0){var r=t[t.length-1];r!==n&&r.pause()}var i=t.indexOf(n);i===-1||t.splice(i,1),t.push(n)},deactivateTrap:function(n){var r=t.indexOf(n);r!==-1&&t.splice(r,1),t.length>0&&t[t.length-1].unpause()}}}(),yR=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},wR=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},ER=function(e){return e.key==="Tab"||e.keyCode===9},sy=function(e){return setTimeout(e,0)},ay=function(e,n){var r=-1;return e.every(function(i,o){return n(i)?(r=o,!1):!0}),r},Xs=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i1?y-1:0),I=1;I=0)N=r.activeElement;else{var w=o.tabbableGroups[0],y=w&&w.firstTabbableNode;N=y||c("fallbackFocus")}if(!N)throw new Error("Your focus-trap needs to have at least one focusable element");return N},p=function(){if(o.containerGroups=o.containers.map(function(N){var w=pR(N,i.tabbableOptions),y=mR(N,i.tabbableOptions);return{container:N,tabbableNodes:w,focusableNodes:y,firstTabbableNode:w.length>0?w[0]:null,lastTabbableNode:w.length>0?w[w.length-1]:null,nextTabbableNode:function(I){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,R=y.findIndex(function(P){return P===I});if(!(R<0))return C?y.slice(R+1).find(function(P){return au(P,i.tabbableOptions)}):y.slice(0,R).reverse().find(function(P){return au(P,i.tabbableOptions)})}}}),o.tabbableGroups=o.containerGroups.filter(function(N){return N.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!c("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},d=function D(N){if(N!==!1&&N!==r.activeElement){if(!N||!N.focus){D(h());return}N.focus({preventScroll:!!i.preventScroll}),o.mostRecentlyFocusedNode=N,yR(N)&&N.select()}},g=function(N){var w=c("setReturnFocus",N);return w||(w===!1?!1:N)},v=function(N){var w=lu(N);if(!(u(w)>=0)){if(Xs(i.clickOutsideDeactivates,N)){s.deactivate({returnFocus:i.returnFocusOnDeactivate&&!fh(w,i.tabbableOptions)});return}Xs(i.allowOutsideClick,N)||N.preventDefault()}},E=function(N){var w=lu(N),y=u(w)>=0;y||w instanceof Document?y&&(o.mostRecentlyFocusedNode=w):(N.stopImmediatePropagation(),d(o.mostRecentlyFocusedNode||h()))},A=function(N){var w=lu(N);p();var y=null;if(o.tabbableGroups.length>0){var b=u(w),I=b>=0?o.containerGroups[b]:void 0;if(b<0)N.shiftKey?y=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:y=o.tabbableGroups[0].firstTabbableNode;else if(N.shiftKey){var C=ay(o.tabbableGroups,function(ke){var z=ke.firstTabbableNode;return w===z});if(C<0&&(I.container===w||fh(w,i.tabbableOptions)&&!au(w,i.tabbableOptions)&&!I.nextTabbableNode(w,!1))&&(C=b),C>=0){var R=C===0?o.tabbableGroups.length-1:C-1,P=o.tabbableGroups[R];y=P.lastTabbableNode}}else{var ie=ay(o.tabbableGroups,function(ke){var z=ke.lastTabbableNode;return w===z});if(ie<0&&(I.container===w||fh(w,i.tabbableOptions)&&!au(w,i.tabbableOptions)&&!I.nextTabbableNode(w))&&(ie=b),ie>=0){var Ee=ie===o.tabbableGroups.length-1?0:ie+1,it=o.tabbableGroups[Ee];y=it.firstTabbableNode}}}else y=c("fallbackFocus");y&&(N.preventDefault(),d(y))},x=function(N){if(wR(N)&&Xs(i.escapeDeactivates,N)!==!1){N.preventDefault(),s.deactivate();return}if(ER(N)){A(N);return}},_=function(N){var w=lu(N);u(w)>=0||Xs(i.clickOutsideDeactivates,N)||Xs(i.allowOutsideClick,N)||(N.preventDefault(),N.stopImmediatePropagation())},S=function(){if(o.active)return oy.activateTrap(s),o.delayInitialFocusTimer=i.delayInitialFocus?sy(function(){d(h())}):d(h()),r.addEventListener("focusin",E,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",_,{capture:!0,passive:!1}),r.addEventListener("keydown",x,{capture:!0,passive:!1}),s},k=function(){if(o.active)return r.removeEventListener("focusin",E,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",_,!0),r.removeEventListener("keydown",x,!0),s};return s={get active(){return o.active},get paused(){return o.paused},activate:function(N){if(o.active)return this;var w=l(N,"onActivate"),y=l(N,"onPostActivate"),b=l(N,"checkCanFocusTrap");b||p(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,w&&w();var I=function(){b&&p(),S(),y&&y()};return b?(b(o.containers.concat()).then(I,I),this):(I(),this)},deactivate:function(N){if(!o.active)return this;var w=iy({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},N);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,k(),o.active=!1,o.paused=!1,oy.deactivateTrap(s);var y=l(w,"onDeactivate"),b=l(w,"onPostDeactivate"),I=l(w,"checkCanReturnFocus"),C=l(w,"returnFocus","returnFocusOnDeactivate");y&&y();var R=function(){sy(function(){C&&d(g(o.nodeFocusedBeforeActivation)),b&&b()})};return C&&I?(I(g(o.nodeFocusedBeforeActivation)).then(R,R),this):(R(),this)},pause:function(){return o.paused||!o.active?this:(o.paused=!0,k(),this)},unpause:function(){return!o.paused||!o.active?this:(o.paused=!1,p(),S(),this)},updateContainerElements:function(N){var w=[].concat(N).filter(Boolean);return o.containers=w.map(function(y){return typeof y=="string"?r.querySelector(y):y}),o.active&&p(),this}},s.updateContainerElements(e),s};function SR(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e1),Zr=[],Ac=!1,VS=-1,Ca=void 0,Aa=void 0,LS=function(e){return Zr.some(function(n){return!!(n.options.allowTouchMove&&n.options.allowTouchMove(e))})},Pc=function(e){var n=e||window.event;return LS(n.target)||n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)},bR=function(e){if(Aa===void 0){var n=!!e&&e.reserveScrollBarGap===!0,r=window.innerWidth-document.documentElement.clientWidth;n&&r>0&&(Aa=document.body.style.paddingRight,document.body.style.paddingRight=r+"px")}Ca===void 0&&(Ca=document.body.style.overflow,document.body.style.overflow="hidden")},TR=function(){Aa!==void 0&&(document.body.style.paddingRight=Aa,Aa=void 0),Ca!==void 0&&(document.body.style.overflow=Ca,Ca=void 0)},xR=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},IR=function(e,n){var r=e.targetTouches[0].clientY-VS;return LS(e.target)?!1:n&&n.scrollTop===0&&r>0||xR(n)&&r<0?Pc(e):(e.stopPropagation(),!0)},CR=function(e,n){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Zr.some(function(i){return i.targetElement===e})){var r={targetElement:e,options:n||{}};Zr=[].concat(SR(Zr),[r]),DS?(e.ontouchstart=function(i){i.targetTouches.length===1&&(VS=i.targetTouches[0].clientY)},e.ontouchmove=function(i){i.targetTouches.length===1&&IR(i,e)},Ac||(document.addEventListener("touchmove",Pc,gm?{passive:!1}:void 0),Ac=!0)):bR(n)}},AR=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Zr=Zr.filter(function(n){return n.targetElement!==e}),DS?(e.ontouchstart=null,e.ontouchmove=null,Ac&&Zr.length===0&&(document.removeEventListener("touchmove",Pc,gm?{passive:!1}:void 0),Ac=!1)):Zr.length||TR()},Xi=[],PR=function(){return Xi.some(function(t){return t.activeTargets.length>0})},RR=function(){return Xi.some(function(t){return t.skippedTargets.length>0})},uy="ResizeObserver loop completed with undelivered notifications.",kR=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:uy}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=uy),window.dispatchEvent(t)},nl;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(nl||(nl={}));var Ji=function(t){return Object.freeze(t)},NR=function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Ji(this)}return t}(),MS=function(){function t(e,n,r,i){return this.x=e,this.y=n,this.width=r,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ji(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,i=e.top,o=e.right,s=e.bottom,l=e.left,u=e.width,c=e.height;return{x:n,y:r,top:i,right:o,bottom:s,left:l,width:u,height:c}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t}(),vm=function(t){return t instanceof SVGElement&&"getBBox"in t},FS=function(t){if(vm(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var i=t,o=i.offsetWidth,s=i.offsetHeight;return!(o||s||t.getClientRects().length)},cy=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},OR=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Pa=typeof window<"u"?window:{},uu=new WeakMap,fy=/auto|scroll/,DR=/^tb|vertical/,VR=/msie|trident/i.test(Pa.navigator&&Pa.navigator.userAgent),ar=function(t){return parseFloat(t||"0")},Yo=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new NR((n?e:t)||0,(n?t:e)||0)},hy=Ji({devicePixelContentBoxSize:Yo(),borderBoxSize:Yo(),contentBoxSize:Yo(),contentRect:new MS(0,0,0,0)}),jS=function(t,e){if(e===void 0&&(e=!1),uu.has(t)&&!e)return uu.get(t);if(FS(t))return uu.set(t,hy),hy;var n=getComputedStyle(t),r=vm(t)&&t.ownerSVGElement&&t.getBBox(),i=!VR&&n.boxSizing==="border-box",o=DR.test(n.writingMode||""),s=!r&&fy.test(n.overflowY||""),l=!r&&fy.test(n.overflowX||""),u=r?0:ar(n.paddingTop),c=r?0:ar(n.paddingRight),h=r?0:ar(n.paddingBottom),p=r?0:ar(n.paddingLeft),d=r?0:ar(n.borderTopWidth),g=r?0:ar(n.borderRightWidth),v=r?0:ar(n.borderBottomWidth),E=r?0:ar(n.borderLeftWidth),A=p+c,x=u+h,_=E+g,S=d+v,k=l?t.offsetHeight-S-t.clientHeight:0,D=s?t.offsetWidth-_-t.clientWidth:0,N=i?A+_:0,w=i?x+S:0,y=r?r.width:ar(n.width)-N-D,b=r?r.height:ar(n.height)-w-k,I=y+A+D+_,C=b+x+k+S,R=Ji({devicePixelContentBoxSize:Yo(Math.round(y*devicePixelRatio),Math.round(b*devicePixelRatio),o),borderBoxSize:Yo(I,C,o),contentBoxSize:Yo(y,b,o),contentRect:new MS(p,u,y,b)});return uu.set(t,R),R},zS=function(t,e,n){var r=jS(t,n),i=r.borderBoxSize,o=r.contentBoxSize,s=r.devicePixelContentBoxSize;switch(e){case nl.DEVICE_PIXEL_CONTENT_BOX:return s;case nl.BORDER_BOX:return i;default:return o}},LR=function(){function t(e){var n=jS(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Ji([n.borderBoxSize]),this.contentBoxSize=Ji([n.contentBoxSize]),this.devicePixelContentBoxSize=Ji([n.devicePixelContentBoxSize])}return t}(),US=function(t){if(FS(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},MR=function(){var t=1/0,e=[];Xi.forEach(function(s){if(s.activeTargets.length!==0){var l=[];s.activeTargets.forEach(function(c){var h=new LR(c.target),p=US(c.target);l.push(h),c.lastReportedSize=zS(c.target,c.observedBox),pt?n.activeTargets.push(i):n.skippedTargets.push(i))})})},FR=function(){var t=0;for(dy(t);PR();)t=MR(),dy(t);return RR()&&kR(),t>0},hh,BS=[],jR=function(){return BS.splice(0).forEach(function(t){return t()})},zR=function(t){if(!hh){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return jR()}).observe(n,r),hh=function(){n.textContent="".concat(e?e--:e++)}}BS.push(t),hh()},UR=function(t){zR(function(){requestAnimationFrame(t)})},ju=0,BR=function(){return!!ju},$R=250,HR={attributes:!0,characterData:!0,childList:!0,subtree:!0},py=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],my=function(t){return t===void 0&&(t=0),Date.now()+t},dh=!1,WR=function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=$R),!dh){dh=!0;var r=my(e);UR(function(){var i=!1;try{i=FR()}finally{if(dh=!1,e=r-my(),!BR())return;i?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,HR)};document.body?n():Pa.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),py.forEach(function(n){return Pa.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),py.forEach(function(n){return Pa.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t}(),Md=new WR,gy=function(t){!ju&&t>0&&Md.start(),ju+=t,!ju&&Md.stop()},qR=function(t){return!vm(t)&&!OR(t)&&getComputedStyle(t).display==="inline"},GR=function(){function t(e,n){this.target=e,this.observedBox=n||nl.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=zS(this.target,this.observedBox,!0);return qR(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t}(),KR=function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t}(),cu=new WeakMap,vy=function(t,e){for(var n=0;n=0&&(o&&Xi.splice(Xi.indexOf(r),1),r.observationTargets.splice(i,1),gy(-1))},t.disconnect=function(e){var n=this,r=cu.get(e);r.observationTargets.slice().forEach(function(i){return n.unobserve(e,i.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t}(),QR=function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");fu.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!cy(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");fu.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!cy(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");fu.unobserve(this,e)},t.prototype.disconnect=function(){fu.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t}();function $t(){return $t=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}var Ra=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Js(t,e,n){return e=(e=+e)==e?e:0,n=(n=+n)==n?n:0,(t=+t)==t&&(t=(t=t<=n?t:n)>=e?t:e),t}function hu(t){var e=Math.round(t);if(Number.isNaN(t))throw new TypeError("Found a NaN! Check your snapPoints / defaultSnap / snapTo ");return e}var YR={box:"border-box"};function ph(t,e){var n=e.label,r=e.enabled,i=e.resizeSourceRef,o=O.useState(0),s=o[0],l=o[1];O.useDebugValue(n+": "+s);var u=O.useCallback(function(c){l(c[0].borderBoxSize[0].blockSize),i.current="element"},[i]);return Ra(function(){if(t.current&&r){var c=new QR(u);return c.observe(t.current,YR),function(){c.disconnect()}}},[t,u,r]),r?s:0}function Ut(t){return t===void 0&&(t=1e3),new Promise(function(e){return setTimeout(e,t)})}var yy={DRAG:{target:"#overlay.dragging",actions:"onOpenEnd"}},wy={RESIZE:{target:"#overlay.resizing",actions:"onOpenEnd"}},XR=SA({id:"overlay",initial:"closed",context:{initialState:"CLOSED"},states:{closed:{on:{OPEN:"opening",CLOSE:void 0}},opening:{initial:"start",states:{start:{invoke:{src:"onOpenStart",onDone:"transition"}},transition:{always:[{target:"immediately",cond:"initiallyOpen"},{target:"smoothly",cond:"initiallyClosed"}]},immediately:{initial:"open",states:{open:{invoke:{src:"openImmediately",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"#overlay.opening.end"},on:$t({},yy,wy)}}},smoothly:{initial:"visuallyHidden",states:{visuallyHidden:{invoke:{src:"renderVisuallyHidden",onDone:"activating"}},activating:{invoke:{src:"activate",onDone:"open"}},open:{invoke:{src:"openSmoothly",onDone:"#overlay.opening.end"},on:$t({},yy,wy)}}},end:{invoke:{src:"onOpenEnd",onDone:"done"},on:{CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:$t({},{CLOSE:{target:"#overlay.closing",actions:"onOpenCancel"}}),onDone:"open"},open:{on:{DRAG:"#overlay.dragging",SNAP:"snapping",RESIZE:"resizing"}},dragging:{on:{SNAP:"snapping"}},snapping:{initial:"start",states:{start:{invoke:{src:"onSnapStart",onDone:"snappingSmoothly"},entry:[bA({y:function(t,e){return e.payload.y},velocity:function(t,e){return e.payload.velocity},snapSource:function(t,e){var n=e.payload.source;return n===void 0?"custom":n}})]},snappingSmoothly:{invoke:{src:"snapSmoothly",onDone:"end"}},end:{invoke:{src:"onSnapEnd",onDone:"done"},on:{RESIZE:"#overlay.resizing",SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{SNAP:{target:"snapping",actions:"onSnapEnd"},RESIZE:{target:"#overlay.resizing",actions:"onSnapCancel"},DRAG:{target:"#overlay.dragging",actions:"onSnapCancel"},CLOSE:{target:"#overlay.closing",actions:"onSnapCancel"}},onDone:"open"},resizing:{initial:"start",states:{start:{invoke:{src:"onResizeStart",onDone:"resizingSmoothly"}},resizingSmoothly:{invoke:{src:"resizeSmoothly",onDone:"end"}},end:{invoke:{src:"onResizeEnd",onDone:"done"},on:{SNAP:"#overlay.snapping",CLOSE:"#overlay.closing",DRAG:"#overlay.dragging"}},done:{type:"final"}},on:{RESIZE:{target:"resizing",actions:"onResizeEnd"},SNAP:{target:"snapping",actions:"onResizeCancel"},DRAG:{target:"#overlay.dragging",actions:"onResizeCancel"},CLOSE:{target:"#overlay.closing",actions:"onResizeCancel"}},onDone:"open"},closing:{initial:"start",states:{start:{invoke:{src:"onCloseStart",onDone:"deactivating"},on:{OPEN:{target:"#overlay.open",actions:"onCloseCancel"}}},deactivating:{invoke:{src:"deactivate",onDone:"closingSmoothly"}},closingSmoothly:{invoke:{src:"closeSmoothly",onDone:"end"}},end:{invoke:{src:"onCloseEnd",onDone:"done"},on:{OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}}},done:{type:"final"}},on:{CLOSE:void 0,OPEN:{target:"#overlay.opening",actions:"onCloseCancel"}},onDone:"closed"}},on:{CLOSE:"closing"}},{actions:{onOpenCancel:function(t,e){},onSnapCancel:function(t,e){},onResizeCancel:function(t,e){},onCloseCancel:function(t,e){},onOpenEnd:function(t,e){},onSnapEnd:function(t,e){},onRezizeEnd:function(t,e){}},services:{onSnapStart:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenStart:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseStart:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeStart:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onSnapEnd:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onOpenEnd:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onCloseEnd:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},onResizeEnd:function(){try{return Promise.resolve(Ut()).then(function(){})}catch(t){return Promise.reject(t)}},renderVisuallyHidden:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},activate:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},deactivate:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},openSmoothly:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},openImmediately:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},snapSmoothly:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},resizeSmoothly:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}},closeSmoothly:function(t,e){try{return Promise.resolve(Ut()).then(function(){})}catch(n){return Promise.reject(n)}}},guards:{initiallyClosed:function(t){return t.initialState==="CLOSED"},initiallyOpen:function(t){return t.initialState==="OPEN"}}}),JR=["children","sibling","className","footer","header","open","initialState","lastSnapRef","initialFocusRef","onDismiss","maxHeight","defaultSnap","snapPoints","blocking","scrollLocking","style","onSpringStart","onSpringCancel","onSpringEnd","reserveScrollBarGap","expandOnContentDrag"],ZR=["velocity"],e2=["onRest","config"],$S=QA.default,t2=$S.tension,du=$S.friction,n2=Jt.forwardRef(function(t,e){var n=t.children,r=t.sibling,i=t.className,o=t.footer,s=t.header,l=t.open,u=t.initialState,c=t.lastSnapRef,h=t.initialFocusRef,p=t.onDismiss,d=t.maxHeight,g=t.defaultSnap,v=g===void 0?i2:g,E=t.snapPoints,A=E===void 0?o2:E,x=t.blocking,_=x===void 0||x,S=t.scrollLocking,k=S===void 0||S,D=t.style,N=t.onSpringStart,w=t.onSpringCancel,y=t.onSpringEnd,b=t.reserveScrollBarGap,I=b===void 0?_:b,C=t.expandOnContentDrag,R=C!==void 0&&C,P=zu(t,JR),ie=function(){var F=O.useState(!1),Q=F[0],U=F[1],$=O.useState({}),pe=$[0],he=$[1],Ae=O.useCallback(function(ce){return he(function(je){var se;return $t({},je,((se={})[ce]=!1,se))}),function(){he(function(je){var se;return $t({},je,((se={})[ce]=!0,se))})}},[]);return O.useEffect(function(){var ce=Object.values(pe);ce.length!==0&&ce.every(Boolean)&&U(!0)},[pe]),{ready:Q,registerReady:Ae}}(),Ee=ie.ready,it=ie.registerReady,ke=O.useRef(!1),z=O.useRef(N),G=O.useRef(w),J=O.useRef(y);O.useEffect(function(){z.current=N,G.current=w,J.current=y},[w,N,y]);var ne,ee,mt=eP(function(){return{y:0,ready:0,maxHeight:0,minSnap:0,maxSnap:0}}),Ie=mt[0],ot=mt[1],st=O.useRef(null),St=O.useRef(null),kn=O.useRef(null),Or=O.useRef(null),Zn=O.useRef(null),Dr=O.useRef(null),Ft=O.useRef(0),vn=O.useRef(),wr=O.useRef(!1),yn=(ne=O.useMemo(function(){return typeof window<"u"?window.matchMedia("(prefers-reduced-motion: reduce)"):null},[]),ee=O.useRef(ne==null?void 0:ne.matches),O.useDebugValue(ee.current?"reduce":"no-preference"),O.useEffect(function(){var F=function(Q){ee.current=Q.matches};return ne==null||ne.addListener(F),function(){return ne==null?void 0:ne.removeListener(F)}},[ne]),ee),wn=function(F){var Q=F.targetRef,U=F.enabled,$=F.reserveScrollBarGap,pe=O.useRef({activate:function(){throw new TypeError("Tried to activate scroll lock too early")},deactivate:function(){}});return O.useDebugValue(U?"Enabled":"Disabled"),O.useEffect(function(){if(!U)return pe.current.deactivate(),void(pe.current={activate:function(){},deactivate:function(){}});var he=Q.current,Ae=!1;pe.current={activate:function(){Ae||(Ae=!0,CR(he,{allowTouchMove:function(ce){return ce.closest("[data-body-scroll-lock-ignore]")},reserveScrollBarGap:$}))},deactivate:function(){Ae&&(Ae=!1,AR(he))}}},[U,Q,$]),pe}({targetRef:St,enabled:Ee&&k,reserveScrollBarGap:I}),Nn=function(F){var Q=F.targetRef,U=F.enabled,$=O.useRef({activate:function(){throw new TypeError("Tried to activate aria hider too early")},deactivate:function(){}});return O.useDebugValue(U?"Enabled":"Disabled"),O.useEffect(function(){if(!U)return $.current.deactivate(),void($.current={activate:function(){},deactivate:function(){}});var pe=Q.current,he=!1,Ae=[],ce=[];$.current={activate:function(){if(!he){he=!0;var je=pe.parentNode;document.querySelectorAll("body > *").forEach(function(se){if(se!==je){var ve=se.getAttribute("aria-hidden");ve!==null&&ve!=="false"||(Ae.push(ve),ce.push(se),se.setAttribute("aria-hidden","true"))}})}},deactivate:function(){he&&(he=!1,ce.forEach(function(je,se){var ve=Ae[se];ve===null?je.removeAttribute("aria-hidden"):je.setAttribute("aria-hidden",ve)}),Ae=[],ce=[])}}},[Q,U]),$}({targetRef:st,enabled:Ee&&_}),sn=function(F){var Q=F.targetRef,U=F.fallbackRef,$=F.initialFocusRef,pe=F.enabled,he=O.useRef({activate:function(){throw new TypeError("Tried to activate focus trap too early")},deactivate:function(){}});return O.useDebugValue(pe?"Enabled":"Disabled"),O.useEffect(function(){if(!pe)return he.current.deactivate(),void(he.current={activate:function(){},deactivate:function(){}});var Ae=U.current,ce=_R(Q.current,{onActivate:void 0,initialFocus:$?function(){return($==null?void 0:$.current)||Ae}:void 0,fallbackFocus:Ae,escapeDeactivates:!1,clickOutsideDeactivates:!1}),je=!1;he.current={activate:function(){try{return je?Promise.resolve():(je=!0,Promise.resolve(ce.activate()).then(function(){return Promise.resolve(new Promise(function(se){return setTimeout(function(){return se(void 0)},0)})).then(function(){})}))}catch(se){return Promise.reject(se)}},deactivate:function(){je&&(je=!1,ce.deactivate())}}},[pe,U,$,Q]),he}({targetRef:st,fallbackRef:Dr,initialFocusRef:h||void 0,enabled:Ee&&_&&h!==!1}),qe=function(F){var Q=F.getSnapPoints,U=F.heightRef,$=F.lastSnapRef,pe=F.ready,he=function(gt){var _n=gt.contentRef,ln=gt.controlledMaxHeight,Tt=gt.footerEnabled,tr=gt.footerRef,nr=gt.headerEnabled,kt=gt.headerRef,Pi=gt.registerReady,Sn=gt.resizeSourceRef,Cs=O.useMemo(function(){return Pi("contentHeight")},[Pi]),As=function(ki,Ni,Oi){var Lr=O.useMemo(function(){return Ni("maxHeight")},[Ni]),Mr=O.useState(function(){return hu(ki)||typeof window<"u"?window.innerHeight:0}),rr=Mr[0],Di=Mr[1],xl=rr>0,Vi=O.useRef(0);return O.useDebugValue(ki?"controlled":"auto"),O.useEffect(function(){xl&&Lr()},[xl,Lr]),Ra(function(){if(ki)return Di(hu(ki)),void(Oi.current="maxheightprop");var Rs=function(){Vi.current||(Vi.current=requestAnimationFrame(function(){Di(window.innerHeight),Oi.current="window",Vi.current=0}))};return window.addEventListener("resize",Rs),Di(window.innerHeight),Oi.current="window",Lr(),function(){window.removeEventListener("resize",Rs),cancelAnimationFrame(Vi.current)}},[ki,Lr,Oi]),rr}(ln,Pi,Sn),Ri=ph(kt,{label:"headerHeight",enabled:nr,resizeSourceRef:Sn}),ho=ph(_n,{label:"contentHeight",enabled:!0,resizeSourceRef:Sn}),po=ph(tr,{label:"footerHeight",enabled:Tt,resizeSourceRef:Sn}),Tl=Math.min(As-Ri-po,ho)+Ri+po;O.useDebugValue("minHeight: "+Tl);var Ps=ho>0;return O.useEffect(function(){Ps&&Cs()},[Ps,Cs]),{maxHeight:As,minHeight:Tl,headerHeight:Ri,footerHeight:po}}({contentRef:F.contentRef,controlledMaxHeight:F.controlledMaxHeight,footerEnabled:F.footerEnabled,footerRef:F.footerRef,headerEnabled:F.headerEnabled,headerRef:F.headerRef,registerReady:F.registerReady,resizeSourceRef:F.resizeSourceRef}),Ae=he.maxHeight,ce=he.minHeight,je=he.headerHeight,se=he.footerHeight,ve=function(gt,_n){var ln=[].concat(gt).map(hu).reduce(function(kt,Pi){return kt.add(Js(Pi,0,_n)),kt},new Set),Tt=Array.from(ln),tr=Math.min.apply(Math,Tt);if(Number.isNaN(tr))throw new TypeError("minSnap is NaN");var nr=Math.max.apply(Math,Tt);if(Number.isNaN(nr))throw new TypeError("maxSnap is NaN");return{snapPoints:Tt,minSnap:tr,maxSnap:nr}}(pe?Q({height:U.current,footerHeight:se,headerHeight:je,minHeight:ce,maxHeight:Ae}):[0],Ae),an=ve.snapPoints,Vr=ve.minSnap,bt=ve.maxSnap;return O.useDebugValue("minSnap: "+Vr+", maxSnap:"+bt),{minSnap:Vr,maxSnap:bt,findSnap:function(gt){var _n=hu(typeof gt=="function"?gt({footerHeight:se,headerHeight:je,height:U.current,minHeight:ce,maxHeight:Ae,snapPoints:an,lastSnap:$.current}):gt);return an.reduce(function(ln,Tt){return Math.abs(Tt-_n)0&&Tt+tr=Me.current&&(kt=Me.current),bt===Me.current&&St.current.scrollTop>0&&(kt=Me.current),wr.current=kt.05?_n:1,source:"dragging"}}),bt):(ot({y:kt,ready:1,maxHeight:Rt.current,maxSnap:Me.current,minSnap:ct.current,immediate:!0,config:{velocity:_n}}),bt)},{filterTaps:!0});if(Number.isNaN(Me.current))throw new TypeError("maxSnapRef is NaN!!");if(Number.isNaN(ct.current))throw new TypeError("minSnapRef is NaN!!");var Ce=function(F){var Q,U=F.spring,$=_o([U.y,U.maxHeight],function(se,ve){return Math.round(Js(ve-se,0,16))+"px"}),pe=_o([U.y,U.minSnap,U.maxSnap],function(se,ve,an){return Js(se,ve,an)+"px"}),he=_o([U.y,U.minSnap,U.maxSnap],function(se,ve,an){return sean?an-se+"px":"0px"}),Ae=_o([U.y,U.maxSnap],function(se,ve){return se>=ve?Math.ceil(se-ve):0}),ce=_o([U.y,U.minSnap],function(se,ve){if(!ve)return 0;var an=Math.max(ve/2-45,0);return Js((se-an)*(1/(Math.min(ve/2+45,ve)-an)+0),0,1)}),je=_o([U.y,U.minSnap],function(se,ve){return ve?Js(se/ve,0,1):0});return(Q={})["--rsbs-content-opacity"]=ce,Q["--rsbs-backdrop-opacity"]=je,Q["--rsbs-antigap-scale-y"]=Ae,Q["--rsbs-overlay-translate-y"]=he,Q["--rsbs-overlay-rounded"]=$,Q["--rsbs-overlay-h"]=pe,Q}({spring:Ie});return Jt.createElement(wP.div,$t({},P,{"data-rsbs-root":!0,"data-rsbs-state":r2.find(fe.matches),"data-rsbs-is-blocking":_,"data-rsbs-is-dismissable":!!p,"data-rsbs-has-header":!!s,"data-rsbs-has-footer":!!o,className:i,ref:st,style:$t({},Ce,D,{opacity:Ie.ready})}),r,_&&Jt.createElement("div",$t({key:"backdrop","data-rsbs-backdrop":!0},te({closeOnTap:!0}))),Jt.createElement("div",{key:"overlay","aria-modal":"true",role:"dialog","data-rsbs-overlay":!0,tabIndex:-1,ref:Dr,onKeyDown:function(F){F.key==="Escape"&&(F.stopPropagation(),p&&p())}},s!==!1&&Jt.createElement("div",$t({key:"header","data-rsbs-header":!0,ref:Or},te()),s),Jt.createElement("div",$t({key:"scroll","data-rsbs-scroll":!0,ref:St},R?te({isContentDragging:!0}):{}),Jt.createElement("div",{"data-rsbs-content":!0,ref:kn},n)),o&&Jt.createElement("div",$t({key:"footer",ref:Zn,"data-rsbs-footer":!0},te()),o)))}),r2=["closed","opening","open","closing","dragging","snapping","resizing"];function i2(t){var e=t.lastSnap;return e??Math.min.apply(Math,t.snapPoints)}function o2(t){return t.minHeight}var s2=["onSpringStart","onSpringEnd","skipInitialTransition"],a2=O.forwardRef(function(t,e){var n=t.onSpringStart,r=t.onSpringEnd,i=t.skipInitialTransition,o=zu(t,s2),s=O.useState(!1),l=s[0],u=s[1],c=O.useRef(),h=O.useRef(null),p=O.useRef(i&&o.open?"OPEN":"CLOSED");Ra(function(){if(o.open)return cancelAnimationFrame(c.current),u(!0),function(){p.current="CLOSED"}},[o.open]);var d=O.useCallback(function(v){return Promise.resolve(n==null?void 0:n(v)).then(function(){v.type==="OPEN"&&cancelAnimationFrame(c.current)})},[n]),g=O.useCallback(function(v){return Promise.resolve(r==null?void 0:r(v)).then(function(){v.type==="CLOSE"&&(c.current=requestAnimationFrame(function(){return u(!1)}))})},[r]);return l?Jt.createElement(CC,{"data-rsbs-portal":!0},Jt.createElement(n2,$t({},o,{lastSnapRef:h,ref:e,initialState:p.current,onSpringStart:d,onSpringEnd:g}))):null});function l2(){const[t,e]=O.useState(!1);return M.jsxs(M.Fragment,{children:[M.jsx(Nu,{children:M.jsx("nav",{className:"bg-white shadow-xl sticky rounded-xl px-4",children:M.jsxs("div",{className:"container mx-auto px-6 py-4 flex justify-between items-center",children:[M.jsx("h1",{onClick:()=>window.location.href="proxy.php?url=https%3A%2F%2Femrd.github.io%2F",className:"text-4xl font-bold text-gray-800 hover:cursor-pointer hover:text-blue-500 transition-transform transform",children:"EmrD"}),M.jsxs("ul",{className:"flex space-x-12",children:[M.jsx("li",{children:M.jsx("a",{onClick:()=>window.scrollTo({top:550,behavior:"smooth"}),className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full cursor-pointer`,children:"About Me"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>window.scrollTo({top:1150,behavior:"smooth"}),className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full cursor-pointer`,children:"Projects"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>window.scrollTo({top:1950,behavior:"smooth"}),className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full cursor-pointer`,children:"Technologies"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>window.scrollTo({top:5e3,behavior:"smooth"}),className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full cursor-pointer`,children:"Contact"})})]})]})})}),M.jsxs(Ou,{children:[M.jsx("nav",{className:"bg-white shadow-xl sticky rounded-xl px-4",children:M.jsxs("div",{className:"container mx-auto px-6 py-4 flex justify-between items-center",children:[M.jsx("h1",{onClick:()=>window.location.href="proxy.php?url=https%3A%2F%2Femrd.github.io%2F",className:"text-4xl font-bold text-gray-800 hover:cursor-pointer hover:text-blue-500 transition-transform transform",children:"EmrD"}),M.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",width:"1em",height:"1em",className:"cursor-pointer",onClick:()=>e(!0),children:M.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 2H.5m13 5H.5m13 5H.5"})})]})}),M.jsx(a2,{open:t,onDismiss:()=>e(!1),children:M.jsxs("ul",{className:"flex flex-col space-y-4 text-center px-4 py-8",children:[M.jsx("li",{children:M.jsx("a",{onClick:()=>{window.scrollTo({top:550,behavior:"smooth"}),e(!1)},className:`font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full focus:outline-none`,children:"About Me"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>{window.scrollTo({top:1700,behavior:"smooth"}),e(!1)},className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full`,children:"Projects"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>{window.scrollTo({top:3090,behavior:"smooth"}),e(!1)},className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full`,children:"Technologies"})}),M.jsx("li",{children:M.jsx("a",{onClick:()=>{window.scrollTo({top:5e3,behavior:"smooth"}),e(!1)},className:`relative font-bold inline-block text-gray-800 hover:text-blue-500 transition-transform transform hover:scale-110 after:content-[''] after:absolute after:left-1/2 after:bottom-0 after:-translate-x-1/2 after:w-0 after:h-[2px] after:bg-blue-500 after:transition-all after:duration-300 hover:after:w-full`,children:"Contact"})})]})})]})]})}function u2(){const t=[{id:1,name:"Development Experience",value:"+5 Years"},{id:2,name:"GitHub Repositories",value:"+200"},{id:3,name:"Events - Projects - Courses",value:"+50"},{id:4,name:"Technologies",value:"+25"},{id:5,name:"Developer Tools Published",value:"+8"}],e=["Python","JavaScript","Java","C#","C++","C","Flutter","React","Java Spring Boot","J2EE Servlet","Node.JS Express","Hibernate ORM","Git",".NET"],n=["Gradle","Maven","Docker","Kubernetes","Apache Kafka","RabbitMQ","MongoDB","PostgreSQL","DB2","Firebase / Google Cloud","ElasticSearch","Redis","Cisco Packet Tracer","IBM Mainframe (COBOL, z/OS JCL etc.)"];return M.jsxs(M.Fragment,{children:[M.jsxs("header",{className:"flex flex-col items-center justify-center text-center flex-grow px-6 bg-white-500 py-12",children:[M.jsx("img",{src:"https://avatars.githubusercontent.com/u/127445447?v=4",alt:"profil",className:"rounded-full w-32 h-32 mb-4 shadow-lg"}),M.jsx("h2",{className:"text-4xl sm:text-5xl md:text-6xl lg:text-7xl font-bold mb-6 bg-gradient-to-r from-blue-400 via-cyan-500 to-teal-400 bg-clip-text text-transparent",children:"I'm EmrD..."}),M.jsx("p",{className:"mt-2 text-gray-600 max-w-md text-2xl font-bold",children:"Full-Stack Developer, Vulnerability Researcher"}),M.jsx("a",{onClick:()=>window.scrollTo({top:500,behavior:"smooth"}),className:"font-bold mt-6 px-6 py-3 bg-blue-500 text-white rounded-lg shadow hover:bg-blue-600 transition cursor-pointer",children:"Get More Information"})]}),M.jsxs("div",{className:"mt-24",id:"about",children:[M.jsx("div",{className:"text-center font-bold text-4xl mt-4 mb-4 bg-gradient-to-r from-blue-400 via-cyan-500 to-teal-400 bg-clip-text text-transparent",children:"About Me"}),M.jsx("p",{className:"mt-2 text-gray-600 text-center",children:"I started learning in 2019. I am a passionate software developer who loves turning ideas into reality. With a strong curiosity for technology and innovation, I strive to create applications that make a positive impact. I am motivated by continuous learning and enjoy exploring new possibilities to bring creative solutions to life. I can speak Türkçe, English and Deutsch."}),M.jsx("div",{className:"text-left mt-8 px-8 font-bold",children:M.jsx("div",{className:"bg-white-900 py-24 sm:py-32",children:M.jsx("div",{className:"mx-auto max-w-7xl px-6 lg:px-8",children:M.jsx("dl",{className:"grid grid-cols-1 gap-x-8 gap-y-16 text-center lg:grid-cols-5",children:t.map(r=>M.jsxs("div",{className:"mx-auto flex max-w-xs flex-col gap-y-4 text-zinc-950",children:[M.jsx("dt",{className:"text-base/7 text-zinc-400",children:r.name}),M.jsx("dd",{className:"order-first text-3xl font-semibold tracking-tight text-zinc-950 sm:text-5xl",children:r.value})]},r.id))})})})}),M.jsx("div",{className:"text-center font-bold text-4xl mt-4 mb-4 bg-gradient-to-r from-blue-400 via-cyan-500 to-teal-400 bg-clip-text text-transparent pb-4",children:"Highlighted Projects"}),M.jsx(Nu,{children:M.jsx("div",{className:"flex items-center justify-center",children:M.jsxs("div",{className:"grid grid-cols-3 justify-center gap-x-8 gap-y-8 mt-8 px-8",children:[M.jsxs("a",{href:"https://github.com/EmrD/Sound-Sharing",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"Sound Sharing"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can listen your computer's sound on your phone. This project is useful for computers which does not have Bluetooth support."})]}),M.jsxs("a",{href:"#",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"Remotive"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can control your computer with out eyes and optionally with your phone app."})]}),M.jsxs("a",{href:"https://marketplace.visualstudio.com/items?itemName=EmrD.doublespacetoenter",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"Double Space to Enter"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can double click to space to enter with this extention. You can access on Visual Studio Marketplace."})]}),M.jsxs("a",{href:"https://marketplace.visualstudio.com/items?itemName=EmrD.clean-from-text",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"Clean # From Text"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can simply use this extention to clean # from text. You can access on Visual Studio Marketplace. This extention is useful for Git commit messages."})]}),M.jsxs("a",{href:"https://github.com/EmrD/idx-react-template/releases",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"React + Tailwind CSS Google IDX Template"}),M.jsx("p",{className:"font-normal text-gray-700",children:"I developed Google IDX template to getting started with React and Tailwind at the same time."})]}),M.jsxs("a",{href:"https://www.npmjs.com/package/todo-cli-package/v/latest",className:"block w-[300px] h-[250px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"Todo CLI Package"}),M.jsx("p",{className:"font-normal text-gray-700",children:"To manage your project's todos, you can use this CLI package. I published on npmjs.org"})]})]})})}),M.jsx(Ou,{children:M.jsx("div",{className:"flex items-center justify-center px-4 mt-8",children:M.jsxs("div",{className:"grid grid-cols-1 gap-y-6 w-full max-w-md",children:[M.jsxs("a",{href:"https://github.com/EmrD/Sound-Sharing",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"Sound Sharing"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can listen your computer's sound on your phone. This project is useful for computers which does not have Bluetooth support."})]}),M.jsxs("a",{href:"#",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"Remotive"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can control your computer with out eyes and optionally with your phone app."})]}),M.jsxs("a",{href:"https://marketplace.visualstudio.com/items?itemName=EmrD.doublespacetoenter",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"Double Space to Enter"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can double click to space to enter with this extention. You can access on Visual Studio Marketplace."})]}),M.jsxs("a",{href:"https://marketplace.visualstudio.com/items?itemName=EmrD.clean-from-text",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"Clean # From Text"}),M.jsx("p",{className:"font-normal text-gray-700",children:"You can simply use this extention to clean # from text. You can access on Visual Studio Marketplace. This extention is useful for Git commit messages."})]}),M.jsxs("a",{href:"https://github.com/EmrD/idx-react-template/releases",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"React + Tailwind CSS Google IDX Template"}),M.jsx("p",{className:"font-normal text-gray-700",children:"I developed Google IDX template to getting started with React and Tailwind at the same time."})]}),M.jsxs("a",{href:"https://www.npmjs.com/package/todo-cli-package/v/latest",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"Todo CLI Package"}),M.jsx("p",{className:"font-normal text-gray-700",children:"To manage your project's todos, you can use this CLI package. I published on npmjs.org"})]})]})})}),M.jsx("div",{className:"text-center font-bold text-4xl mt-4 mb-4 bg-gradient-to-r from-blue-400 via-cyan-500 to-teal-400 bg-clip-text text-transparent pb-4 pt-8",children:"Technologies that I use"}),M.jsx(Nu,{children:M.jsx("div",{className:"flex justify-center items-center mt-8",children:M.jsxs("div",{className:"grid grid-cols-2 gap-x-4",children:[M.jsx("ul",{className:"list-disc",children:e.map((r,i)=>M.jsx("li",{className:"text-xl font-bold",children:r},i))}),M.jsx("ul",{className:"list-disc",children:n.map((r,i)=>M.jsx("li",{className:"text-xl font-bold",children:r},i))})]})})}),M.jsx(Ou,{children:M.jsxs("ul",{className:"list-disc text-center",children:[e.map((r,i)=>M.jsx("li",{className:"text-xl font-bold",children:r},i)),n.map((r,i)=>M.jsx("li",{className:"text-xl font-bold",children:r},i))]})}),M.jsx("div",{className:"text-center font-bold text-4xl mt-4 mb-4 bg-gradient-to-r from-blue-400 via-cyan-500 to-teal-400 bg-clip-text text-transparent pb-4 pt-8",children:"Contact"}),M.jsx(Nu,{children:M.jsx("div",{className:"flex items-center justify-center",children:M.jsx("div",{className:"grid grid-cols-1 justify-center gap-x-8 gap-y-8 mt-8 px-8",children:M.jsxs("a",{href:"#",className:"block w-[300px] h-[120px] p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-2xl font-bold tracking-tight text-gray-900",children:"GitHub"}),M.jsx("a",{className:"font-normal text-blue-700",href:"https://github.com/EmrD",children:"GitHub Page"})]})})})}),M.jsx(Ou,{children:M.jsx("div",{className:"flex items-center justify-center px-4 mt-8",children:M.jsx("div",{className:"grid grid-cols-1 gap-y-6 w-full max-w-md",children:M.jsxs("a",{href:"#",className:"block w-full h-auto p-6 bg-white border-2 border-zinc-950 rounded-lg shadow-sm hover:bg-gray-100 text-center",children:[M.jsx("h5",{className:"mb-2 text-xl font-bold tracking-tight text-gray-900",children:"GitHub"}),M.jsx("a",{className:"font-normal text-blue-700",href:"https://github.com/EmrD",children:"GitHub Page"})]})})})})]})]})}const c2=()=>{};var Ey={};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const HS=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=i&63|128):(i&64512)===55296&&r+1>18|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128,e[n++]=i&63|128):(e[n++]=i>>12|224,e[n++]=i>>6&63|128,e[n++]=i&63|128)}return e},f2=function(t){const e=[];let n=0,r=0;for(;n191&&i<224){const o=t[n++];e[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=t[n++],s=t[n++],l=t[n++],u=((i&7)<<18|(o&63)<<12|(s&63)<<6|l&63)-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(u&1023))}else{const o=t[n++],s=t[n++];e[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|s&63)}}return e.join("")},WS={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i>2,p=(o&3)<<4|l>>4;let d=(l&15)<<2|c>>6,g=c&63;u||(g=64,s||(d=64)),r.push(n[h],n[p],n[d],n[g])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(HS(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):f2(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i>4;if(r.push(d),c!==64){const g=l<<4&240|c>>2;if(r.push(g),p!==64){const v=c<<6&192|p;r.push(v)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class h2 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const d2=function(t){const e=HS(t);return WS.encodeByteArray(e,!0)},Rc=function(t){return d2(t).replace(/\./g,"")},p2=function(t){try{return WS.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function m2(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const g2=()=>m2().__FIREBASE_DEFAULTS__,v2=()=>{if(typeof process>"u"||typeof Ey>"u")return;const t=Ey.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},y2=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&p2(t[1]);return e&&JSON.parse(e)},ym=()=>{try{return c2()||g2()||v2()||y2()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},w2=t=>{var e,n;return(n=(e=ym())==null?void 0:e.emulatorHosts)==null?void 0:n[t]},E2=t=>{const e=w2(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},qS=()=>{var t;return(t=ym())==null?void 0:t.config};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _2{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** * @license * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function wm(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function S2(t){return(await fetch(t,{credentials:"include"})).ok}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function b2(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",i=t.iat||0,o=t.sub||t.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s={iss:`https://securetoken.google.com/${r}`,aud:r,iat:i,exp:i+3600,auth_time:i,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}},...t};return[Rc(JSON.stringify(n)),Rc(JSON.stringify(s)),""].join(".")}const ka={};function T2(){const t={prod:[],emulator:[]};for(const e of Object.keys(ka))ka[e]?t.emulator.push(e):t.prod.push(e);return t}function x2(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let _y=!1;function I2(t,e){if(typeof window>"u"||typeof document>"u"||!wm(window.location.host)||ka[t]===e||ka[t]||_y)return;ka[t]=e;function n(d){return`__firebase__banner__${d}`}const r="__firebase__banner",o=T2().prod.length>0;function s(){const d=document.getElementById(r);d&&d.remove()}function l(d){d.style.display="flex",d.style.background="#7faaf0",d.style.position="fixed",d.style.bottom="5px",d.style.left="5px",d.style.padding=".5em",d.style.borderRadius="5px",d.style.alignItems="center"}function u(d,g){d.setAttribute("width","24"),d.setAttribute("id",g),d.setAttribute("height","24"),d.setAttribute("viewBox","0 0 24 24"),d.setAttribute("fill","none"),d.style.marginLeft="-6px"}function c(){const d=document.createElement("span");return d.style.cursor="pointer",d.style.marginLeft="16px",d.style.fontSize="24px",d.innerHTML=" ×",d.onclick=()=>{_y=!0,s()},d}function h(d,g){d.setAttribute("id",g),d.innerText="Learn more",d.href="proxy.php?url=https%3A%2F%2Ffirebase.google.com%2Fdocs%2Fstudio%2Fpreview-apps%23preview-backend",d.setAttribute("target","__blank"),d.style.paddingLeft="5px",d.style.textDecoration="underline"}function p(){const d=x2(r),g=n("text"),v=document.getElementById(g)||document.createElement("span"),E=n("learnmore"),A=document.getElementById(E)||document.createElement("a"),x=n("preprendIcon"),_=document.getElementById(x)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(d.created){const S=d.element;l(S),h(A,E);const k=c();u(_,x),S.append(_,v,A,k),document.body.appendChild(S)}o?(v.innerText="Preview backend disconnected.",_.innerHTML=` `):(_.innerHTML=` `,v.innerText="Preview backend running in this workspace."),v.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",p):p()}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function C2(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function A2(){var e;const t=(e=ym())==null?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function P2(){return!A2()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function R2(){try{return typeof indexedDB=="object"}catch{return!1}}function k2(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;e(((o=i.error)==null?void 0:o.message)||"")}}catch(n){e(n)}})}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const N2="FirebaseError";class bs extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=N2,Object.setPrototypeOf(this,bs.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,GS.prototype.create)}}class GS{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},i=`${this.service}/${e}`,o=this.errors[e],s=o?O2(o,r):"Error",l=`${this.serviceName}: ${s} (${i}).`;return new bs(i,l,r)}}function O2(t,e){return t.replace(D2,(n,r)=>{const i=e[r];return i!=null?String(i):`<${r}?>`})}const D2=/\{\$([^}]+)}/g;function kc(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const i of n){if(!r.includes(i))return!1;const o=t[i],s=e[i];if(Sy(o)&&Sy(s)){if(!kc(o,s))return!1}else if(o!==s)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function Sy(t){return t!==null&&typeof t=="object"}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function V2(t){return t&&t._delegate?t._delegate:t}class rl{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $i="[DEFAULT]";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class L2{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new _2;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(i){if(r)return null;throw i}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(F2(e))try{this.getOrInitializeService({instanceIdentifier:$i})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch{}}}}clearInstance(e=$i){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=$i){return this.instances.has(e)}getOptions(e=$i){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,s]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(o);r===l&&s.resolve(i)}return i}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),i=this.onInitCallbacks.get(r)??new Set;i.add(e),this.onInitCallbacks.set(r,i);const o=this.instances.get(r);return o&&e(o,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:M2(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=$i){return this.component?this.component.multipleInstances?e:$i:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function M2(t){return t===$i?void 0:t}function F2(t){return t.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j2{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new L2(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Se;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Se||(Se={}));const z2={debug:Se.DEBUG,verbose:Se.VERBOSE,info:Se.INFO,warn:Se.WARN,error:Se.ERROR,silent:Se.SILENT},U2=Se.INFO,B2={[Se.DEBUG]:"log",[Se.VERBOSE]:"log",[Se.INFO]:"info",[Se.WARN]:"warn",[Se.ERROR]:"error"},$2=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let by,Ty;function W2(){return by||(by=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function q2(){return Ty||(Ty=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const QS=new WeakMap,Fd=new WeakMap,YS=new WeakMap,mh=new WeakMap,Em=new WeakMap;function G2(t){const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("success",o),t.removeEventListener("error",s)},o=()=>{n(fi(t.result)),i()},s=()=>{r(t.error),i()};t.addEventListener("success",o),t.addEventListener("error",s)});return e.then(n=>{n instanceof IDBCursor&&QS.set(n,t)}).catch(()=>{}),Em.set(e,t),e}function K2(t){if(Fd.has(t))return;const e=new Promise((n,r)=>{const i=()=>{t.removeEventListener("complete",o),t.removeEventListener("error",s),t.removeEventListener("abort",s)},o=()=>{n(),i()},s=()=>{r(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",o),t.addEventListener("error",s),t.addEventListener("abort",s)});Fd.set(t,e)}let jd={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return Fd.get(t);if(e==="objectStoreNames")return t.objectStoreNames||YS.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return fi(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function Q2(t){jd=t(jd)}function Y2(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(gh(this),e,...n);return YS.set(r,e.sort?e.sort():[e]),fi(r)}:q2().includes(t)?function(...e){return t.apply(gh(this),e),fi(QS.get(this))}:function(...e){return fi(t.apply(gh(this),e))}}function X2(t){return typeof t=="function"?Y2(t):(t instanceof IDBTransaction&&K2(t),H2(t,W2())?new Proxy(t,jd):t)}function fi(t){if(t instanceof IDBRequest)return G2(t);if(mh.has(t))return mh.get(t);const e=X2(t);return e!==t&&(mh.set(t,e),Em.set(e,t)),e}const gh=t=>Em.get(t);function J2(t,e,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const s=indexedDB.open(t,e),l=fi(s);return r&&s.addEventListener("upgradeneeded",u=>{r(fi(s.result),u.oldVersion,u.newVersion,fi(s.transaction),u)}),n&&s.addEventListener("blocked",u=>n(u.oldVersion,u.newVersion,u)),l.then(u=>{o&&u.addEventListener("close",()=>o()),i&&u.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),l}const Z2=["get","getKey","getAll","getAllKeys","count"],ek=["put","add","delete","clear"],vh=new Map;function xy(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(vh.get(e))return vh.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,i=ek.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||Z2.includes(n)))return;const o=async function(s,...l){const u=this.transaction(s,i?"readwrite":"readonly");let c=u.store;return r&&(c=c.index(l.shift())),(await Promise.all([c[n](...l),i&&u.done]))[0]};return vh.set(e,o),o}Q2(t=>({...t,get:(e,n,r)=>xy(e,n)||t.get(e,n,r),has:(e,n)=>!!xy(e,n)||t.has(e,n)}));/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class tk{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(nk(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function nk(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const zd="@firebase/app",Iy="0.14.6";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Rr=new KS("@firebase/app"),rk="@firebase/app-compat",ik="@firebase/analytics-compat",ok="@firebase/analytics",sk="@firebase/app-check-compat",ak="@firebase/app-check",lk="@firebase/auth",uk="@firebase/auth-compat",ck="@firebase/database",fk="@firebase/data-connect",hk="@firebase/database-compat",dk="@firebase/functions",pk="@firebase/functions-compat",mk="@firebase/installations",gk="@firebase/installations-compat",vk="@firebase/messaging",yk="@firebase/messaging-compat",wk="@firebase/performance",Ek="@firebase/performance-compat",_k="@firebase/remote-config",Sk="@firebase/remote-config-compat",bk="@firebase/storage",Tk="@firebase/storage-compat",xk="@firebase/firestore",Ik="@firebase/ai",Ck="@firebase/firestore-compat",Ak="firebase",Pk="12.6.0";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ud="[DEFAULT]",Rk={[zd]:"fire-core",[rk]:"fire-core-compat",[ok]:"fire-analytics",[ik]:"fire-analytics-compat",[ak]:"fire-app-check",[sk]:"fire-app-check-compat",[lk]:"fire-auth",[uk]:"fire-auth-compat",[ck]:"fire-rtdb",[fk]:"fire-data-connect",[hk]:"fire-rtdb-compat",[dk]:"fire-fn",[pk]:"fire-fn-compat",[mk]:"fire-iid",[gk]:"fire-iid-compat",[vk]:"fire-fcm",[yk]:"fire-fcm-compat",[wk]:"fire-perf",[Ek]:"fire-perf-compat",[_k]:"fire-rc",[Sk]:"fire-rc-compat",[bk]:"fire-gcs",[Tk]:"fire-gcs-compat",[xk]:"fire-fst",[Ck]:"fire-fst-compat",[Ik]:"fire-vertex","fire-js":"fire-js",[Ak]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Nc=new Map,kk=new Map,Bd=new Map;function Cy(t,e){try{t.container.addComponent(e)}catch(n){Rr.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Oc(t){const e=t.name;if(Bd.has(e))return Rr.debug(`There were multiple attempts to register component ${e}.`),!1;Bd.set(e,t);for(const n of Nc.values())Cy(n,t);for(const n of kk.values())Cy(n,t);return!0}function Nk(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Ok(t){return t==null?!1:t.settings!==void 0}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Dk={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},hi=new GS("app","Firebase",Dk);/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Vk{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new rl("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw hi.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Lk=Pk;function XS(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:Ud,automaticDataCollectionEnabled:!0,...e},i=r.name;if(typeof i!="string"||!i)throw hi.create("bad-app-name",{appName:String(i)});if(n||(n=qS()),!n)throw hi.create("no-options");const o=Nc.get(i);if(o){if(kc(n,o.options)&&kc(r,o.config))return o;throw hi.create("duplicate-app",{appName:i})}const s=new j2(i);for(const u of Bd.values())s.addComponent(u);const l=new Vk(n,r,s);return Nc.set(i,l),l}function Mk(t=Ud){const e=Nc.get(t);if(!e&&t===Ud&&qS())return XS();if(!e)throw hi.create("no-app",{appName:t});return e}function Xo(t,e,n){let r=Rk[t]??t;n&&(r+=`-${n}`);const i=r.match(/\s|\//),o=e.match(/\s|\//);if(i||o){const s=[`Unable to register library "${r}" with version "${e}":`];i&&s.push(`library name "${r}" contains illegal characters (whitespace or "/")`),i&&o&&s.push("and"),o&&s.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Rr.warn(s.join(" "));return}Oc(new rl(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Fk="firebase-heartbeat-database",jk=1,il="firebase-heartbeat-store";let yh=null;function JS(){return yh||(yh=J2(Fk,jk,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(il)}catch(n){console.warn(n)}}}}).catch(t=>{throw hi.create("idb-open",{originalErrorMessage:t.message})})),yh}async function zk(t){try{const n=(await JS()).transaction(il),r=await n.objectStore(il).get(ZS(t));return await n.done,r}catch(e){if(e instanceof bs)Rr.warn(e.message);else{const n=hi.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Rr.warn(n.message)}}}async function Ay(t,e){try{const r=(await JS()).transaction(il,"readwrite");await r.objectStore(il).put(e,ZS(t)),await r.done}catch(n){if(n instanceof bs)Rr.warn(n.message);else{const r=hi.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Rr.warn(r.message)}}}function ZS(t){return`${t.name}!${t.options.appId}`}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Uk=1024,Bk=30;class $k{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new Wk(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const i=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Py();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(s=>s.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:i}),this._heartbeatsCache.heartbeats.length>Bk){const s=qk(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Rr.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Py(),{heartbeatsToSend:r,unsentEntries:i}=Hk(this._heartbeatsCache.heartbeats),o=Rc(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return Rr.warn(n),""}}}function Py(){return new Date().toISOString().substring(0,10)}function Hk(t,e=Uk){const n=[];let r=t.slice();for(const i of t){const o=n.find(s=>s.agent===i.agent);if(o){if(o.dates.push(i.date),Ry(n)>e){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),Ry(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class Wk{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return R2()?k2().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await zk(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Ay(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return Ay(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function Ry(t){return Rc(JSON.stringify({version:2,heartbeats:t})).length}function qk(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;rnew tk(e),"PRIVATE")),Oc(new rl("heartbeat",e=>new $k(e),"PRIVATE")),Xo(zd,Iy,t),Xo(zd,Iy,"esm2020"),Xo("fire-js","")}Gk("");var Kk="firebase",Qk="12.6.0";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Xo(Kk,Qk,"app");var ky=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var di,e1;(function(){var t;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */function e(w,y){function b(){}b.prototype=y.prototype,w.F=y.prototype,w.prototype=new b,w.prototype.constructor=w,w.D=function(I,C,R){for(var P=Array(arguments.length-2),ie=2;ie>>25),P=R+(C^y&(b^C))+I[1]+3905402710&4294967295,R=y+(P<<12&4294967295|P>>>20),P=C+(b^R&(y^b))+I[2]+606105819&4294967295,C=R+(P<<17&4294967295|P>>>15),P=b+(y^C&(R^y))+I[3]+3250441966&4294967295,b=C+(P<<22&4294967295|P>>>10),P=y+(R^b&(C^R))+I[4]+4118548399&4294967295,y=b+(P<<7&4294967295|P>>>25),P=R+(C^y&(b^C))+I[5]+1200080426&4294967295,R=y+(P<<12&4294967295|P>>>20),P=C+(b^R&(y^b))+I[6]+2821735955&4294967295,C=R+(P<<17&4294967295|P>>>15),P=b+(y^C&(R^y))+I[7]+4249261313&4294967295,b=C+(P<<22&4294967295|P>>>10),P=y+(R^b&(C^R))+I[8]+1770035416&4294967295,y=b+(P<<7&4294967295|P>>>25),P=R+(C^y&(b^C))+I[9]+2336552879&4294967295,R=y+(P<<12&4294967295|P>>>20),P=C+(b^R&(y^b))+I[10]+4294925233&4294967295,C=R+(P<<17&4294967295|P>>>15),P=b+(y^C&(R^y))+I[11]+2304563134&4294967295,b=C+(P<<22&4294967295|P>>>10),P=y+(R^b&(C^R))+I[12]+1804603682&4294967295,y=b+(P<<7&4294967295|P>>>25),P=R+(C^y&(b^C))+I[13]+4254626195&4294967295,R=y+(P<<12&4294967295|P>>>20),P=C+(b^R&(y^b))+I[14]+2792965006&4294967295,C=R+(P<<17&4294967295|P>>>15),P=b+(y^C&(R^y))+I[15]+1236535329&4294967295,b=C+(P<<22&4294967295|P>>>10),P=y+(C^R&(b^C))+I[1]+4129170786&4294967295,y=b+(P<<5&4294967295|P>>>27),P=R+(b^C&(y^b))+I[6]+3225465664&4294967295,R=y+(P<<9&4294967295|P>>>23),P=C+(y^b&(R^y))+I[11]+643717713&4294967295,C=R+(P<<14&4294967295|P>>>18),P=b+(R^y&(C^R))+I[0]+3921069994&4294967295,b=C+(P<<20&4294967295|P>>>12),P=y+(C^R&(b^C))+I[5]+3593408605&4294967295,y=b+(P<<5&4294967295|P>>>27),P=R+(b^C&(y^b))+I[10]+38016083&4294967295,R=y+(P<<9&4294967295|P>>>23),P=C+(y^b&(R^y))+I[15]+3634488961&4294967295,C=R+(P<<14&4294967295|P>>>18),P=b+(R^y&(C^R))+I[4]+3889429448&4294967295,b=C+(P<<20&4294967295|P>>>12),P=y+(C^R&(b^C))+I[9]+568446438&4294967295,y=b+(P<<5&4294967295|P>>>27),P=R+(b^C&(y^b))+I[14]+3275163606&4294967295,R=y+(P<<9&4294967295|P>>>23),P=C+(y^b&(R^y))+I[3]+4107603335&4294967295,C=R+(P<<14&4294967295|P>>>18),P=b+(R^y&(C^R))+I[8]+1163531501&4294967295,b=C+(P<<20&4294967295|P>>>12),P=y+(C^R&(b^C))+I[13]+2850285829&4294967295,y=b+(P<<5&4294967295|P>>>27),P=R+(b^C&(y^b))+I[2]+4243563512&4294967295,R=y+(P<<9&4294967295|P>>>23),P=C+(y^b&(R^y))+I[7]+1735328473&4294967295,C=R+(P<<14&4294967295|P>>>18),P=b+(R^y&(C^R))+I[12]+2368359562&4294967295,b=C+(P<<20&4294967295|P>>>12),P=y+(b^C^R)+I[5]+4294588738&4294967295,y=b+(P<<4&4294967295|P>>>28),P=R+(y^b^C)+I[8]+2272392833&4294967295,R=y+(P<<11&4294967295|P>>>21),P=C+(R^y^b)+I[11]+1839030562&4294967295,C=R+(P<<16&4294967295|P>>>16),P=b+(C^R^y)+I[14]+4259657740&4294967295,b=C+(P<<23&4294967295|P>>>9),P=y+(b^C^R)+I[1]+2763975236&4294967295,y=b+(P<<4&4294967295|P>>>28),P=R+(y^b^C)+I[4]+1272893353&4294967295,R=y+(P<<11&4294967295|P>>>21),P=C+(R^y^b)+I[7]+4139469664&4294967295,C=R+(P<<16&4294967295|P>>>16),P=b+(C^R^y)+I[10]+3200236656&4294967295,b=C+(P<<23&4294967295|P>>>9),P=y+(b^C^R)+I[13]+681279174&4294967295,y=b+(P<<4&4294967295|P>>>28),P=R+(y^b^C)+I[0]+3936430074&4294967295,R=y+(P<<11&4294967295|P>>>21),P=C+(R^y^b)+I[3]+3572445317&4294967295,C=R+(P<<16&4294967295|P>>>16),P=b+(C^R^y)+I[6]+76029189&4294967295,b=C+(P<<23&4294967295|P>>>9),P=y+(b^C^R)+I[9]+3654602809&4294967295,y=b+(P<<4&4294967295|P>>>28),P=R+(y^b^C)+I[12]+3873151461&4294967295,R=y+(P<<11&4294967295|P>>>21),P=C+(R^y^b)+I[15]+530742520&4294967295,C=R+(P<<16&4294967295|P>>>16),P=b+(C^R^y)+I[2]+3299628645&4294967295,b=C+(P<<23&4294967295|P>>>9),P=y+(C^(b|~R))+I[0]+4096336452&4294967295,y=b+(P<<6&4294967295|P>>>26),P=R+(b^(y|~C))+I[7]+1126891415&4294967295,R=y+(P<<10&4294967295|P>>>22),P=C+(y^(R|~b))+I[14]+2878612391&4294967295,C=R+(P<<15&4294967295|P>>>17),P=b+(R^(C|~y))+I[5]+4237533241&4294967295,b=C+(P<<21&4294967295|P>>>11),P=y+(C^(b|~R))+I[12]+1700485571&4294967295,y=b+(P<<6&4294967295|P>>>26),P=R+(b^(y|~C))+I[3]+2399980690&4294967295,R=y+(P<<10&4294967295|P>>>22),P=C+(y^(R|~b))+I[10]+4293915773&4294967295,C=R+(P<<15&4294967295|P>>>17),P=b+(R^(C|~y))+I[1]+2240044497&4294967295,b=C+(P<<21&4294967295|P>>>11),P=y+(C^(b|~R))+I[8]+1873313359&4294967295,y=b+(P<<6&4294967295|P>>>26),P=R+(b^(y|~C))+I[15]+4264355552&4294967295,R=y+(P<<10&4294967295|P>>>22),P=C+(y^(R|~b))+I[6]+2734768916&4294967295,C=R+(P<<15&4294967295|P>>>17),P=b+(R^(C|~y))+I[13]+1309151649&4294967295,b=C+(P<<21&4294967295|P>>>11),P=y+(C^(b|~R))+I[4]+4149444226&4294967295,y=b+(P<<6&4294967295|P>>>26),P=R+(b^(y|~C))+I[11]+3174756917&4294967295,R=y+(P<<10&4294967295|P>>>22),P=C+(y^(R|~b))+I[2]+718787259&4294967295,C=R+(P<<15&4294967295|P>>>17),P=b+(R^(C|~y))+I[9]+3951481745&4294967295,w.g[0]=w.g[0]+y&4294967295,w.g[1]=w.g[1]+(C+(P<<21&4294967295|P>>>11))&4294967295,w.g[2]=w.g[2]+C&4294967295,w.g[3]=w.g[3]+R&4294967295}r.prototype.v=function(w,y){y===void 0&&(y=w.length);const b=y-this.blockSize,I=this.C;let C=this.h,R=0;for(;R>>I&255;return w};function o(w,y){var b=l;return Object.prototype.hasOwnProperty.call(b,w)?b[w]:b[w]=y(w)}function s(w,y){this.h=y;const b=[];let I=!0;for(let C=w.length-1;C>=0;C--){const R=w[C]|0;I&&R==y||(b[C]=R,I=!1)}this.g=b}var l={};function u(w){return-128<=w&&w<128?o(w,function(y){return new s([y|0],y<0?-1:0)}):new s([w|0],w<0?-1:0)}function c(w){if(isNaN(w)||!isFinite(w))return p;if(w<0)return A(c(-w));const y=[];let b=1;for(let I=0;w>=b;I++)y[I]=w/b|0,b*=4294967296;return new s(y,0)}function h(w,y){if(w.length==0)throw Error("number format error: empty string");if(y=y||10,y<2||36=0)throw Error('number format error: interior "-" character');const b=c(Math.pow(y,8));let I=p;for(let R=0;R=0?I:4294967296+I)*y,y*=4294967296}return w},t.toString=function(w){if(w=w||10,w<2||360?b.g[0]:b.h)>>>0).toString(w);if(b=C,v(b))return R+I;for(;R.length<6;)R="0"+R;I=R+I}},t.i=function(w){return w<0?0:w>>16)+(this.i(C)>>>16)+(w.i(C)>>>16);I=P>>>16,R&=65535,P&=65535,b[C]=P<<16|R}return new s(b,b[b.length-1]&-2147483648?-1:0)};function x(w,y){return w.add(A(y))}t.j=function(w){if(v(this)||v(w))return p;if(E(this))return E(w)?A(this).j(A(w)):A(A(this).j(w));if(E(w))return A(this.j(A(w)));if(this.l(g)<0&&w.l(g)<0)return c(this.m()*w.m());const y=this.g.length+w.g.length,b=[];for(var I=0;I<2*y;I++)b[I]=0;for(I=0;I>>16,P=this.i(I)&65535,ie=w.i(C)>>>16,Ee=w.i(C)&65535;b[2*I+2*C]+=P*Ee,_(b,2*I+2*C),b[2*I+2*C+1]+=R*Ee,_(b,2*I+2*C+1),b[2*I+2*C+1]+=P*ie,_(b,2*I+2*C+1),b[2*I+2*C+2]+=R*ie,_(b,2*I+2*C+2)}for(w=0;w>>16,w[y]&=65535,y++}function S(w,y){this.g=w,this.h=y}function k(w,y){if(v(y))throw Error("division by zero");if(v(w))return new S(p,p);if(E(w))return y=k(A(w),y),new S(A(y.g),A(y.h));if(E(y))return y=k(w,A(y)),new S(A(y.g),y.h);if(w.g.length>30){if(E(w)||E(y))throw Error("slowDivide_ only works with positive integers.");for(var b=d,I=y;I.l(w)<=0;)b=D(b),I=D(I);var C=N(b,1),R=N(I,1);for(I=N(I,2),b=N(b,2);!v(I);){var P=R.add(I);P.l(w)<=0&&(C=C.add(b),R=P),I=N(I,1),b=N(b,1)}return y=x(w,C.j(y)),new S(C,y)}for(C=p;w.l(y)>=0;){for(b=Math.max(1,Math.floor(w.m()/y.m())),I=Math.ceil(Math.log(b)/Math.LN2),I=I<=48?1:Math.pow(2,I-48),R=c(b),P=R.j(y);E(P)||P.l(w)>0;)b-=I,R=c(b),P=R.j(y);v(R)&&(R=d),C=C.add(R),w=x(w,P)}return new S(C,w)}t.B=function(w){return k(this,w).h},t.and=function(w){const y=Math.max(this.g.length,w.g.length),b=[];for(let I=0;I>>31;return new s(b,w.h)}function N(w,y){const b=y>>5;y%=32;const I=w.g.length-b,C=[];for(let R=0;R0?w.i(R+b)>>>y|w.i(R+b+1)<<32-y:w.i(R+b);return new s(C,w.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,e1=r,s.prototype.add=s.prototype.add,s.prototype.multiply=s.prototype.j,s.prototype.modulo=s.prototype.B,s.prototype.compare=s.prototype.l,s.prototype.toNumber=s.prototype.m,s.prototype.toString=s.prototype.toString,s.prototype.getBits=s.prototype.i,s.fromNumber=c,s.fromString=h,di=s}).apply(typeof ky<"u"?ky:typeof self<"u"?self:typeof window<"u"?window:{});var pu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var t1,aa,n1,Uu,$d,r1,i1,o1;(function(){var t,e=Object.defineProperty;function n(a){a=[typeof globalThis=="object"&&globalThis,a,typeof window=="object"&&window,typeof self=="object"&&self,typeof pu=="object"&&pu];for(var f=0;fa&&AsyncContext.Snapshot.wrap(a):a=>a;function g(a){const f=a.length;if(f>0){const m=Array(f);for(let T=0;T0?(this.h--,f=this.g,this.g=f.next,f.next=null):f=this.i(),f}}function A(a){s.setTimeout(()=>{throw a},0)}function x(){var a=w;let f=null;return a.g&&(f=a.g,a.g=a.g.next,a.g||(a.h=null),f.next=null),f}class _{constructor(){this.h=this.g=null}add(f,m){const T=S.get();T.set(f,m),this.h?this.h.next=T:this.g=T,this.h=T}}var S=new E(()=>new k,a=>a.reset());class k{constructor(){this.next=this.g=this.h=null}set(f,m){this.h=f,this.g=m,this.next=null}reset(){this.next=this.g=this.h=null}}let D,N=!1,w=new _,y=()=>{const a=Promise.resolve(void 0);D=()=>{a.then(b)}};function b(){for(var a;a=x();){try{a.h.call(a.g)}catch(m){A(m)}var f=S;f.j(a),f.h<100&&(f.h++,a.next=f.g,f.g=a)}N=!1}function I(){this.u=this.u,this.C=this.C}I.prototype.u=!1,I.prototype.dispose=function(){this.u||(this.u=!0,this.N())},I.prototype[Symbol.dispose]=function(){this.dispose()},I.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function C(a,f){this.type=a,this.g=this.target=f,this.defaultPrevented=!1}C.prototype.h=function(){this.defaultPrevented=!0};var R=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var a=!1,f=Object.defineProperty({},"passive",{get:function(){a=!0}});try{const m=()=>{};s.addEventListener("test",m,f),s.removeEventListener("test",m,f)}catch{}return a}();function P(a){return/^[\s\xa0]*$/.test(a)}function ie(a,f){C.call(this,a?a.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,a&&this.init(a,f)}p(ie,C),ie.prototype.init=function(a,f){const m=this.type=a.type,T=a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:null;this.target=a.target||a.srcElement,this.g=f,f=a.relatedTarget,f||(m=="mouseover"?f=a.fromElement:m=="mouseout"&&(f=a.toElement)),this.relatedTarget=f,T?(this.clientX=T.clientX!==void 0?T.clientX:T.pageX,this.clientY=T.clientY!==void 0?T.clientY:T.pageY,this.screenX=T.screenX||0,this.screenY=T.screenY||0):(this.clientX=a.clientX!==void 0?a.clientX:a.pageX,this.clientY=a.clientY!==void 0?a.clientY:a.pageY,this.screenX=a.screenX||0,this.screenY=a.screenY||0),this.button=a.button,this.key=a.key||"",this.ctrlKey=a.ctrlKey,this.altKey=a.altKey,this.shiftKey=a.shiftKey,this.metaKey=a.metaKey,this.pointerId=a.pointerId||0,this.pointerType=a.pointerType,this.state=a.state,this.i=a,a.defaultPrevented&&ie.Z.h.call(this)},ie.prototype.h=function(){ie.Z.h.call(this);const a=this.i;a.preventDefault?a.preventDefault():a.returnValue=!1};var Ee="closure_listenable_"+(Math.random()*1e6|0),it=0;function ke(a,f,m,T,V){this.listener=a,this.proxy=null,this.src=f,this.type=m,this.capture=!!T,this.ha=V,this.key=++it,this.da=this.fa=!1}function z(a){a.da=!0,a.listener=null,a.proxy=null,a.src=null,a.ha=null}function G(a,f,m){for(const T in a)f.call(m,a[T],T,a)}function J(a,f){for(const m in a)f.call(void 0,a[m],m,a)}function ne(a){const f={};for(const m in a)f[m]=a[m];return f}const ee="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function mt(a,f){let m,T;for(let V=1;V-1?(f=a[W],m||(f.fa=!1)):(f=new ke(f,this.src,L,!!T,V),f.fa=m,a.push(f)),f};function ot(a,f){const m=f.type;if(m in a.g){var T=a.g[m],V=Array.prototype.indexOf.call(T,f,void 0),L;(L=V>=0)&&Array.prototype.splice.call(T,V,1),L&&(z(f),a.g[m].length==0&&(delete a.g[m],a.h--))}}function st(a,f,m,T){for(let V=0;V-1&&(z(f[m]),Array.prototype.splice.call(f,m,1),f.length==0&&(delete a.g[L],a.h--)))):a&&(a=wn(a))&&(f=a.g[f.toString()],a=-1,f&&(a=st(f,m,T,V)),(m=a>-1?f[a]:null)&&vn(m))}function vn(a){if(typeof a!="number"&&a&&!a.da){var f=a.src;if(f&&f[Ee])ot(f.i,a);else{var m=a.type,T=a.proxy;f.removeEventListener?f.removeEventListener(m,T,a.capture):f.detachEvent?f.detachEvent(wr(m),T):f.addListener&&f.removeListener&&f.removeListener(T),(m=wn(f))?(ot(m,a),m.h==0&&(m.src=null,f[St]=null)):z(a)}}}function wr(a){return a in kn?kn[a]:kn[a]="on"+a}function yn(a,f){if(a.da)a=!0;else{f=new ie(f,this);const m=a.listener,T=a.ha||a.src;a.fa&&vn(a),a=m.call(T,f)}return a}function wn(a){return a=a[St],a instanceof Ie?a:null}var Nn="__closure_events_fn_"+(Math.random()*1e9>>>0);function sn(a){return typeof a=="function"?a:(a[Nn]||(a[Nn]=function(f){return a.handleEvent(f)}),a[Nn])}function qe(){I.call(this),this.i=new Ie(this),this.M=this,this.G=null}p(qe,I),qe.prototype[Ee]=!0,qe.prototype.removeEventListener=function(a,f,m,T){Ft(this,a,f,m,T)};function Ve(a,f){var m,T=a.G;if(T)for(m=[];T;T=T.G)m.push(T);if(a=a.M,T=f.type||f,typeof f=="string")f=new C(f,a);else if(f instanceof C)f.target=f.target||a;else{var V=f;f=new C(T,a),mt(f,V)}V=!0;let L,W;if(m)for(W=m.length-1;W>=0;W--)L=f.g=m[W],V=On(L,T,!0,f)&&V;if(L=f.g=a,V=On(L,T,!0,f)&&V,V=On(L,T,!1,f)&&V,m)for(W=0;W2147483647?-1:s.setTimeout(a,f||0)}function En(a){a.g=Bn(()=>{a.g=null,a.i&&(a.i=!1,En(a))},a.l);const f=a.h;a.h=null,a.m.apply(null,f)}class Rt extends I{constructor(f,m){super(),this.m=f,this.l=m,this.h=null,this.i=!1,this.g=null}j(f){this.h=arguments,this.g?this.i=!0:En(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ct(a){I.call(this),this.h=a,this.g={}}p(ct,I);var Me=[];function er(a){G(a.g,function(f,m){this.g.hasOwnProperty(m)&&vn(f)},a),a.g={}}ct.prototype.N=function(){ct.Z.N.call(this),er(this)},ct.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Fe=s.JSON.stringify,Ge=s.JSON.parse,Er=class{stringify(a){return s.JSON.stringify(a,void 0)}parse(a){return s.JSON.parse(a,void 0)}};function fe(){}function le(){}var te={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function Ce(){C.call(this,"d")}p(Ce,C);function F(){C.call(this,"c")}p(F,C);var Q={},U=null;function $(){return U=U||new qe}Q.Ia="serverreachability";function pe(a){C.call(this,Q.Ia,a)}p(pe,C);function he(a){const f=$();Ve(f,new pe(f))}Q.STAT_EVENT="statevent";function Ae(a,f){C.call(this,Q.STAT_EVENT,a),this.stat=f}p(Ae,C);function ce(a){const f=$();Ve(f,new Ae(f,a))}Q.Ja="timingevent";function je(a,f){C.call(this,Q.Ja,a),this.size=f}p(je,C);function se(a,f){if(typeof a!="function")throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){a()},f)}function ve(){this.g=!0}ve.prototype.ua=function(){this.g=!1};function an(a,f,m,T,V,L){a.info(function(){if(a.g)if(L){var W="",de=L.split("&");for(let Le=0;Le1){const xt=vt[0];vt=vt[1];const or=xt.split("_");W=or.length>=2&&or[1]=="type"?W+(xt+"="+vt+"&"):W+(xt+"=redacted&")}}}else W=null;else W=L;return"XMLHTTP REQ ("+T+") [attempt "+V+"]: "+f+` `+m+` `+W})}function Vr(a,f,m,T,V,L,W){a.info(function(){return"XMLHTTP RESP ("+T+") [ attempt "+V+"]: "+f+` `+m+` `+L+" "+W})}function bt(a,f,m,T){a.info(function(){return"XMLHTTP TEXT ("+f+"): "+_n(a,m)+(T?" "+T:"")})}function gt(a,f){a.info(function(){return"TIMEOUT: "+f})}ve.prototype.info=function(){};function _n(a,f){if(!a.g)return f;if(!f)return null;try{const L=JSON.parse(f);if(L){for(a=0;a0&&a.length;)m.push(a.shift()),f--;return a.length&&m.push(a.join(":")),m}function Sn(a,f,m,T){this.j=a,this.i=f,this.l=m,this.S=T||1,this.V=new ct(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new Cs}function Cs(){this.i=null,this.g="",this.h=!1}var As={},Ri={};function ho(a,f,m){a.M=1,a.A=Il(ir(f)),a.u=m,a.R=!0,po(a,null)}function po(a,f){a.F=Date.now(),Ni(a),a.B=ir(a.A);var m=a.B,T=a.S;Array.isArray(T)||(T=[String(T)]),eg(m.i,"t",T),a.C=0,m=a.j.L,a.h=new Cs,a.g=yg(a.j,m?f:null,!a.u),a.P>0&&(a.O=new Rt(c(a.Y,a,a.g),a.P)),f=a.V,m=a.g,T=a.ba;var V="readystatechange";Array.isArray(V)||(V&&(Me[0]=V.toString()),V=Me);for(let L=0;L0&&!this.W){this.W=!0;var W=this.j;W.g==this&&W.aa&&!W.P&&(W.j.info("Great, no buffering proxy detected. Bytes received: "+m.length),Nf(W),W.P=!0,ce(11))}}else bt(this.i,this.l,m,null),Di(this,m);de==4&&rr(this),this.o&&!this.K&&(de==4?pg(this.j,this):(this.o=!1,Ni(this)))}else Ab(this.g),f==400&&m.indexOf("Unknown SID")>0?(this.m=3,ce(12)):(this.m=0,ce(13)),rr(this),Mr(this)}}}catch{}finally{}};function Tl(a){if(!Ps(a))return a.g.la();const f=ag(a.g);if(f==="")return"";let m="";const T=f.length,V=zr(a.g)==4;if(!a.h.i){if(typeof TextDecoder>"u")return rr(a),Mr(a),"";a.h.i=new s.TextDecoder}for(let L=0;Lf.length?Ri:(f=f.slice(T,T+m),a.C=T+m,f)))}Sn.prototype.cancel=function(){this.K=!0,rr(this)};function Ni(a){a.T=Date.now()+a.H,Oi(a,a.H)}function Oi(a,f){if(a.D!=null)throw Error("WatchDog timer not null");a.D=se(c(a.aa,a),f)}function Lr(a){a.D&&(s.clearTimeout(a.D),a.D=null)}Sn.prototype.aa=function(){this.D=null;const a=Date.now();a-this.T>=0?(gt(this.i,this.B),this.M!=2&&(he(),ce(17)),rr(this),this.m=2,Mr(this)):Oi(this,this.T-a)};function Mr(a){a.j.I==0||a.K||pg(a.j,a)}function rr(a){Lr(a);var f=a.O;f&&typeof f.dispose=="function"&&f.dispose(),a.O=null,er(a.V),a.g&&(f=a.g,a.g=null,f.abort(),f.dispose())}function Di(a,f){try{var m=a.j;if(m.I!=0&&(m.g==a||xf(m.h,a))){if(!a.L&&xf(m.h,a)&&m.I==3){try{var T=m.Ba.g.parse(f)}catch{T=null}if(Array.isArray(T)&&T.length==3){var V=T;if(V[0]==0){e:if(!m.v){if(m.g)if(m.g.F+3e30&&(T=1.5*Ur,m.O=T,m.j.info("backChannelRequestTimeoutMs_="+T)),T=m;const Br=a.g;if(Br){const Ol=Br.g?Br.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Ol){var L=T.h;L.g||Ol.indexOf("spdy")==-1&&Ol.indexOf("quic")==-1&&Ol.indexOf("h2")==-1||(L.j=L.l,L.g=new Set,L.h&&(If(L,L.h),L.h=null))}if(T.G){const Of=Br.g?Br.g.getResponseHeader("X-HTTP-Session-Id"):null;Of&&(T.wa=Of,Be(T.J,T.G,Of))}}m.I=3,m.l&&m.l.ra(),m.aa&&(m.T=Date.now()-a.F,m.j.info("Handshake RTT: "+m.T+"ms")),T=m;var W=a;if(T.na=vg(T,T.L?T.ba:null,T.W),W.L){Gm(T.h,W);var de=W,vt=T.O;vt&&(de.H=vt),de.D&&(Lr(de),Ni(de)),T.g=W}else hg(T);m.i.length>0&&Rl(m)}else Le[0]!="stop"&&Le[0]!="close"||Mi(m,7);else m.I==3&&(Le[0]=="stop"||Le[0]=="close"?Le[0]=="stop"?Mi(m,7):Rf(m):Le[0]!="noop"&&m.l&&m.l.qa(Le),m.A=0)}}he(4)}catch{}}var xl=class{constructor(a,f){this.g=a,this.map=f}};function Vi(a){this.l=a||10,s.PerformanceNavigationTiming?(a=s.performance.getEntriesByType("navigation"),a=a.length>0&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(s.chrome&&s.chrome.loadTimes&&s.chrome.loadTimes()&&s.chrome.loadTimes().wasFetchedViaSpdy),this.j=a?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function Rs(a){return a.h?!0:a.g?a.g.size>=a.j:!1}function qm(a){return a.h?1:a.g?a.g.size:0}function xf(a,f){return a.h?a.h==f:a.g?a.g.has(f):!1}function If(a,f){a.g?a.g.add(f):a.h=f}function Gm(a,f){a.h&&a.h==f?a.h=null:a.g&&a.g.has(f)&&a.g.delete(f)}Vi.prototype.cancel=function(){if(this.i=Km(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const a of this.g.values())a.cancel();this.g.clear()}};function Km(a){if(a.h!=null)return a.i.concat(a.h.G);if(a.g!=null&&a.g.size!==0){let f=a.i;for(const m of a.g.values())f=f.concat(m.G);return f}return g(a.i)}var Qm=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function gb(a,f){if(a){a=a.split("&");for(let m=0;m=0?(V=a[m].substring(0,T),L=a[m].substring(T+1)):V=a[m],f(V,L?decodeURIComponent(L.replace(/\+/g," ")):"")}}}function Fr(a){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let f;a instanceof Fr?(this.l=a.l,ks(this,a.j),this.o=a.o,this.g=a.g,Ns(this,a.u),this.h=a.h,Cf(this,tg(a.i)),this.m=a.m):a&&(f=String(a).match(Qm))?(this.l=!1,ks(this,f[1]||"",!0),this.o=Os(f[2]||""),this.g=Os(f[3]||"",!0),Ns(this,f[4]),this.h=Os(f[5]||"",!0),Cf(this,f[6]||"",!0),this.m=Os(f[7]||"")):(this.l=!1,this.i=new Vs(null,this.l))}Fr.prototype.toString=function(){const a=[];var f=this.j;f&&a.push(Ds(f,Ym,!0),":");var m=this.g;return(m||f=="file")&&(a.push("//"),(f=this.o)&&a.push(Ds(f,Ym,!0),"@"),a.push(kt(m).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),m=this.u,m!=null&&a.push(":",String(m))),(m=this.h)&&(this.g&&m.charAt(0)!="/"&&a.push("/"),a.push(Ds(m,m.charAt(0)=="/"?wb:yb,!0))),(m=this.i.toString())&&a.push("?",m),(m=this.m)&&a.push("#",Ds(m,_b)),a.join("")},Fr.prototype.resolve=function(a){const f=ir(this);let m=!!a.j;m?ks(f,a.j):m=!!a.o,m?f.o=a.o:m=!!a.g,m?f.g=a.g:m=a.u!=null;var T=a.h;if(m)Ns(f,a.u);else if(m=!!a.h){if(T.charAt(0)!="/")if(this.g&&!this.h)T="/"+T;else{var V=f.h.lastIndexOf("/");V!=-1&&(T=f.h.slice(0,V+1)+T)}if(V=T,V==".."||V==".")T="";else if(V.indexOf("./")!=-1||V.indexOf("/.")!=-1){T=V.lastIndexOf("/",0)==0,V=V.split("/");const L=[];for(let W=0;W1||L.length==1&&L[0]!="")&&L.pop(),T&&W==V.length&&L.push("")):(L.push(de),T=!0)}T=L.join("/")}else T=V}return m?f.h=T:m=a.i.toString()!=="",m?Cf(f,tg(a.i)):m=!!a.m,m&&(f.m=a.m),f};function ir(a){return new Fr(a)}function ks(a,f,m){a.j=m?Os(f,!0):f,a.j&&(a.j=a.j.replace(/:$/,""))}function Ns(a,f){if(f){if(f=Number(f),isNaN(f)||f<0)throw Error("Bad port number "+f);a.u=f}else a.u=null}function Cf(a,f,m){f instanceof Vs?(a.i=f,Sb(a.i,a.l)):(m||(f=Ds(f,Eb)),a.i=new Vs(f,a.l))}function Be(a,f,m){a.i.set(f,m)}function Il(a){return Be(a,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),a}function Os(a,f){return a?f?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function Ds(a,f,m){return typeof a=="string"?(a=encodeURI(a).replace(f,vb),m&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function vb(a){return a=a.charCodeAt(0),"%"+(a>>4&15).toString(16)+(a&15).toString(16)}var Ym=/[#\/\?@]/g,yb=/[#\?:]/g,wb=/[#\?]/g,Eb=/[#\?@]/g,_b=/#/g;function Vs(a,f){this.h=this.g=null,this.i=a||null,this.j=!!f}function Li(a){a.g||(a.g=new Map,a.h=0,a.i&&gb(a.i,function(f,m){a.add(decodeURIComponent(f.replace(/\+/g," ")),m)}))}t=Vs.prototype,t.add=function(a,f){Li(this),this.i=null,a=mo(this,a);let m=this.g.get(a);return m||this.g.set(a,m=[]),m.push(f),this.h+=1,this};function Xm(a,f){Li(a),f=mo(a,f),a.g.has(f)&&(a.i=null,a.h-=a.g.get(f).length,a.g.delete(f))}function Jm(a,f){return Li(a),f=mo(a,f),a.g.has(f)}t.forEach=function(a,f){Li(this),this.g.forEach(function(m,T){m.forEach(function(V){a.call(f,V,T,this)},this)},this)};function Zm(a,f){Li(a);let m=[];if(typeof f=="string")Jm(a,f)&&(m=m.concat(a.g.get(mo(a,f))));else for(a=Array.from(a.g.values()),f=0;f0?String(a[0]):f):f};function eg(a,f,m){Xm(a,f),m.length>0&&(a.i=null,a.g.set(mo(a,f),g(m)),a.h+=m.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const a=[],f=Array.from(this.g.keys());for(let T=0;T{T.abort(),jr(m,"TestPingServer: timeout",!1,f)},1e4);fetch(a,{signal:T.signal}).then(L=>{clearTimeout(V),L.ok?jr(m,"TestPingServer: ok",!0,f):jr(m,"TestPingServer: server error",!1,f)}).catch(()=>{clearTimeout(V),jr(m,"TestPingServer: error",!1,f)})}function jr(a,f,m,T,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),T(m)}catch{}}function xb(){this.g=new Er}function Af(a){this.i=a.Sb||null,this.h=a.ab||!1}p(Af,fe),Af.prototype.g=function(){return new Cl(this.i,this.h)};function Cl(a,f){qe.call(this),this.H=a,this.o=f,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}p(Cl,qe),t=Cl.prototype,t.open=function(a,f){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=a,this.D=f,this.readyState=1,Ms(this)},t.send=function(a){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const f={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};a&&(f.body=a),(this.H||s).fetch(new Request(this.D,f)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Ls(this)),this.readyState=0},t.Pa=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,Ms(this)),this.g&&(this.readyState=3,Ms(this),this.g)))if(this.responseType==="arraybuffer")a.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof s.ReadableStream<"u"&&"body"in a){if(this.j=a.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;ng(this)}else a.text().then(this.Oa.bind(this),this.ga.bind(this))};function ng(a){a.j.read().then(a.Ma.bind(a)).catch(a.ga.bind(a))}t.Ma=function(a){if(this.g){if(this.o&&a.value)this.response.push(a.value);else if(!this.o){var f=a.value?a.value:new Uint8Array(0);(f=this.B.decode(f,{stream:!a.done}))&&(this.response=this.responseText+=f)}a.done?Ls(this):Ms(this),this.readyState==3&&ng(this)}},t.Oa=function(a){this.g&&(this.response=this.responseText=a,Ls(this))},t.Na=function(a){this.g&&(this.response=a,Ls(this))},t.ga=function(){this.g&&Ls(this)};function Ls(a){a.readyState=4,a.l=null,a.j=null,a.B=null,Ms(a)}t.setRequestHeader=function(a,f){this.A.append(a,f)},t.getResponseHeader=function(a){return this.h&&this.h.get(a.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const a=[],f=this.h.entries();for(var m=f.next();!m.done;)m=m.value,a.push(m[0]+": "+m[1]),m=f.next();return a.join(`\r `)};function Ms(a){a.onreadystatechange&&a.onreadystatechange.call(a)}Object.defineProperty(Cl.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(a){this.m=a?"include":"same-origin"}});function rg(a){let f="";return G(a,function(m,T){f+=T,f+=":",f+=m,f+=`\r `}),f}function Pf(a,f,m){e:{for(T in m){var T=!1;break e}T=!0}T||(m=rg(m),typeof a=="string"?m!=null&&kt(m):Be(a,f,m))}function tt(a){qe.call(this),this.headers=new Map,this.L=a||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}p(tt,qe);var Ib=/^https?$/i,Cb=["POST","PUT"];t=tt.prototype,t.Fa=function(a){this.H=a},t.ea=function(a,f,m,T){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+a);f=f?f.toUpperCase():"GET",this.D=a,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():tr.g(),this.g.onreadystatechange=d(c(this.Ca,this));try{this.B=!0,this.g.open(f,String(a),!0),this.B=!1}catch(L){ig(this,L);return}if(a=m||"",m=new Map(this.headers),T)if(Object.getPrototypeOf(T)===Object.prototype)for(var V in T)m.set(V,T[V]);else if(typeof T.keys=="function"&&typeof T.get=="function")for(const L of T.keys())m.set(L,T.get(L));else throw Error("Unknown input type for opt_headers: "+String(T));T=Array.from(m.keys()).find(L=>L.toLowerCase()=="content-type"),V=s.FormData&&a instanceof s.FormData,!(Array.prototype.indexOf.call(Cb,f,void 0)>=0)||T||V||m.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[L,W]of m)this.g.setRequestHeader(L,W);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(a),this.v=!1}catch(L){ig(this,L)}};function ig(a,f){a.h=!1,a.g&&(a.j=!0,a.g.abort(),a.j=!1),a.l=f,a.o=5,og(a),Al(a)}function og(a){a.A||(a.A=!0,Ve(a,"complete"),Ve(a,"error"))}t.abort=function(a){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=a||7,Ve(this,"complete"),Ve(this,"abort"),Al(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Al(this,!0)),tt.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?sg(this):this.Xa())},t.Xa=function(){sg(this)};function sg(a){if(a.h&&typeof o<"u"){if(a.v&&zr(a)==4)setTimeout(a.Ca.bind(a),0);else if(Ve(a,"readystatechange"),zr(a)==4){a.h=!1;try{const L=a.ca();e:switch(L){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var f=!0;break e;default:f=!1}var m;if(!(m=f)){var T;if(T=L===0){let W=String(a.D).match(Qm)[1]||null;!W&&s.self&&s.self.location&&(W=s.self.location.protocol.slice(0,-1)),T=!Ib.test(W?W.toLowerCase():"")}m=T}if(m)Ve(a,"complete"),Ve(a,"success");else{a.o=6;try{var V=zr(a)>2?a.g.statusText:""}catch{V=""}a.l=V+" ["+a.ca()+"]",og(a)}}finally{Al(a)}}}}function Al(a,f){if(a.g){a.m&&(clearTimeout(a.m),a.m=null);const m=a.g;a.g=null,f||Ve(a,"ready");try{m.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function zr(a){return a.g?a.g.readyState:0}t.ca=function(){try{return zr(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(a){if(this.g){var f=this.g.responseText;return a&&f.indexOf(a)==0&&(f=f.substring(a.length)),Ge(f)}};function ag(a){try{if(!a.g)return null;if("response"in a.g)return a.g.response;switch(a.F){case"":case"text":return a.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in a.g)return a.g.mozResponseArrayBuffer}return null}catch{return null}}function Ab(a){const f={};a=(a.g&&zr(a)>=2&&a.g.getAllResponseHeaders()||"").split(`\r `);for(let T=0;T0&&(this.ia=a.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=lg.prototype,t.ka=8,t.I=1,t.connect=function(a,f,m,T){ce(0),this.W=a,this.H=f||{},m&&T!==void 0&&(this.H.OSID=m,this.H.OAID=T),this.F=this.X,this.J=vg(this,null,this.W),Rl(this)};function Rf(a){if(ug(a),a.I==3){var f=a.V++,m=ir(a.J);if(Be(m,"SID",a.M),Be(m,"RID",f),Be(m,"TYPE","terminate"),js(a,m),f=new Sn(a,a.j,f),f.M=2,f.A=Il(ir(m)),m=!1,s.navigator&&s.navigator.sendBeacon)try{m=s.navigator.sendBeacon(f.A.toString(),"")}catch{}!m&&s.Image&&(new Image().src=f.A,m=!0),m||(f.g=yg(f.j,null),f.g.ea(f.A)),f.F=Date.now(),Ni(f)}gg(a)}function Pl(a){a.g&&(Nf(a),a.g.cancel(),a.g=null)}function ug(a){Pl(a),a.v&&(s.clearTimeout(a.v),a.v=null),kl(a),a.h.cancel(),a.m&&(typeof a.m=="number"&&s.clearTimeout(a.m),a.m=null)}function Rl(a){if(!Rs(a.h)&&!a.m){a.m=!0;var f=a.Ea;D||y(),N||(D(),N=!0),w.add(f,a),a.D=0}}function Pb(a,f){return qm(a.h)>=a.h.j-(a.m?1:0)?!1:a.m?(a.i=f.G.concat(a.i),!0):a.I==1||a.I==2||a.D>=(a.Sa?0:a.Ta)?!1:(a.m=se(c(a.Ea,a,f),mg(a,a.D)),a.D++,!0)}t.Ea=function(a){if(this.m)if(this.m=null,this.I==1){if(!a){this.V=Math.floor(Math.random()*1e5),a=this.V++;const V=new Sn(this,this.j,a);let L=this.o;if(this.U&&(L?(L=ne(L),mt(L,this.U)):L=this.U),this.u!==null||this.R||(V.J=L,L=null),this.S)e:{for(var f=0,m=0;m4096){f=m;break e}if(f===4096||m===this.i.length-1){f=m+1;break e}}f=1e3}else f=1e3;f=fg(this,V,f),m=ir(this.J),Be(m,"RID",a),Be(m,"CVER",22),this.G&&Be(m,"X-HTTP-Session-Id",this.G),js(this,m),L&&(this.R?f="headers="+kt(rg(L))+"&"+f:this.u&&Pf(m,this.u,L)),If(this.h,V),this.Ra&&Be(m,"TYPE","init"),this.S?(Be(m,"$req",f),Be(m,"SID","null"),V.U=!0,ho(V,m,null)):ho(V,m,f),this.I=2}}else this.I==3&&(a?cg(this,a):this.i.length==0||Rs(this.h)||cg(this))};function cg(a,f){var m;f?m=f.l:m=a.V++;const T=ir(a.J);Be(T,"SID",a.M),Be(T,"RID",m),Be(T,"AID",a.K),js(a,T),a.u&&a.o&&Pf(T,a.u,a.o),m=new Sn(a,a.j,m,a.D+1),a.u===null&&(m.J=a.o),f&&(a.i=f.G.concat(a.i)),f=fg(a,m,1e3),m.H=Math.round(a.va*.5)+Math.round(a.va*.5*Math.random()),If(a.h,m),ho(m,T,f)}function js(a,f){a.H&&G(a.H,function(m,T){Be(f,T,m)}),a.l&&G({},function(m,T){Be(f,T,m)})}function fg(a,f,m){m=Math.min(a.i.length,m);const T=a.l?c(a.l.Ka,a.l,a):null;e:{var V=a.i;let de=-1;for(;;){const vt=["count="+m];de==-1?m>0?(de=V[0].g,vt.push("ofs="+de)):de=0:vt.push("ofs="+de);let Le=!0;for(let xt=0;xt=3?!1:(a.Y++,a.v=se(c(a.Da,a),mg(a,a.A)),a.A++,!0)}t.Da=function(){if(this.v=null,dg(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var a=4*this.T;this.j.info("BP detection timer enabled: "+a),this.B=se(c(this.Wa,this),a)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,ce(10),Pl(this),dg(this))};function Nf(a){a.B!=null&&(s.clearTimeout(a.B),a.B=null)}function dg(a){a.g=new Sn(a,a.j,"rpc",a.Y),a.u===null&&(a.g.J=a.o),a.g.P=0;var f=ir(a.na);Be(f,"RID","rpc"),Be(f,"SID",a.M),Be(f,"AID",a.K),Be(f,"CI",a.F?"0":"1"),!a.F&&a.ia&&Be(f,"TO",a.ia),Be(f,"TYPE","xmlhttp"),js(a,f),a.u&&a.o&&Pf(f,a.u,a.o),a.O&&(a.g.H=a.O);var m=a.g;a=a.ba,m.M=1,m.A=Il(ir(f)),m.u=null,m.R=!0,po(m,a)}t.Va=function(){this.C!=null&&(this.C=null,Pl(this),kf(this),ce(19))};function kl(a){a.C!=null&&(s.clearTimeout(a.C),a.C=null)}function pg(a,f){var m=null;if(a.g==f){kl(a),Nf(a),a.g=null;var T=2}else if(xf(a.h,f))m=f.G,Gm(a.h,f),T=1;else return;if(a.I!=0){if(f.o)if(T==1){m=f.u?f.u.length:0,f=Date.now()-f.F;var V=a.D;T=$(),Ve(T,new je(T,m)),Rl(a)}else hg(a);else if(V=f.m,V==3||V==0&&f.X>0||!(T==1&&Pb(a,f)||T==2&&kf(a)))switch(m&&m.length>0&&(f=a.h,f.i=f.i.concat(m)),V){case 1:Mi(a,5);break;case 4:Mi(a,10);break;case 3:Mi(a,6);break;default:Mi(a,2)}}}function mg(a,f){let m=a.Qa+Math.floor(Math.random()*a.Za);return a.isActive()||(m*=2),m*f}function Mi(a,f){if(a.j.info("Error code "+f),f==2){var m=c(a.bb,a),T=a.Ua;const V=!T;T=new Fr(T||"//www.google.com/images/cleardot.gif"),s.location&&s.location.protocol=="http"||ks(T,"https"),Il(T),V?bb(T.toString(),m):Tb(T.toString(),m)}else ce(2);a.I=0,a.l&&a.l.pa(f),gg(a),ug(a)}t.bb=function(a){a?(this.j.info("Successfully pinged google.com"),ce(2)):(this.j.info("Failed to ping google.com"),ce(1))};function gg(a){if(a.I=0,a.ja=[],a.l){const f=Km(a.h);(f.length!=0||a.i.length!=0)&&(v(a.ja,f),v(a.ja,a.i),a.h.i.length=0,g(a.i),a.i.length=0),a.l.oa()}}function vg(a,f,m){var T=m instanceof Fr?ir(m):new Fr(m);if(T.g!="")f&&(T.g=f+"."+T.g),Ns(T,T.u);else{var V=s.location;T=V.protocol,f=f?f+"."+V.hostname:V.hostname,V=+V.port;const L=new Fr(null);T&&ks(L,T),f&&(L.g=f),V&&Ns(L,V),m&&(L.h=m),T=L}return m=a.G,f=a.wa,m&&f&&Be(T,m,f),Be(T,"VER",a.ka),js(a,T),T}function yg(a,f,m){if(f&&!a.L)throw Error("Can't create secondary domain capable XhrIo object.");return f=a.Aa&&!a.ma?new tt(new Af({ab:m})):new tt(a.ma),f.Fa(a.L),f}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function wg(){}t=wg.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function Nl(){}Nl.prototype.g=function(a,f){return new bn(a,f)};function bn(a,f){qe.call(this),this.g=new lg(f),this.l=a,this.h=f&&f.messageUrlParams||null,a=f&&f.messageHeaders||null,f&&f.clientProtocolHeaderRequired&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"}),this.g.o=a,a=f&&f.initMessageHeaders||null,f&&f.messageContentType&&(a?a["X-WebChannel-Content-Type"]=f.messageContentType:a={"X-WebChannel-Content-Type":f.messageContentType}),f&&f.sa&&(a?a["X-WebChannel-Client-Profile"]=f.sa:a={"X-WebChannel-Client-Profile":f.sa}),this.g.U=a,(a=f&&f.Qb)&&!P(a)&&(this.g.u=a),this.A=f&&f.supportsCrossDomainXhr||!1,this.v=f&&f.sendRawJson||!1,(f=f&&f.httpSessionIdParam)&&!P(f)&&(this.g.G=f,a=this.h,a!==null&&f in a&&(a=this.h,f in a&&delete a[f])),this.j=new go(this)}p(bn,qe),bn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},bn.prototype.close=function(){Rf(this.g)},bn.prototype.o=function(a){var f=this.g;if(typeof a=="string"){var m={};m.__data__=a,a=m}else this.v&&(m={},m.__data__=Fe(a),a=m);f.i.push(new xl(f.Ya++,a)),f.I==3&&Rl(f)},bn.prototype.N=function(){this.g.l=null,delete this.j,Rf(this.g),delete this.g,bn.Z.N.call(this)};function Eg(a){Ce.call(this),a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var f=a.__sm__;if(f){e:{for(const m in f){a=m;break e}a=void 0}(this.i=a)&&(a=this.i,f=f!==null&&a in f?f[a]:void 0),this.data=f}else this.data=a}p(Eg,Ce);function _g(){F.call(this),this.status=1}p(_g,F);function go(a){this.g=a}p(go,wg),go.prototype.ra=function(){Ve(this.g,"a")},go.prototype.qa=function(a){Ve(this.g,new Eg(a))},go.prototype.pa=function(a){Ve(this.g,new _g)},go.prototype.oa=function(){Ve(this.g,"b")},Nl.prototype.createWebChannel=Nl.prototype.g,bn.prototype.send=bn.prototype.o,bn.prototype.open=bn.prototype.m,bn.prototype.close=bn.prototype.close,o1=function(){return new Nl},i1=function(){return $()},r1=Q,$d={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},ln.NO_ERROR=0,ln.TIMEOUT=8,ln.HTTP_ERROR=6,Uu=ln,Tt.COMPLETE="complete",n1=Tt,le.EventType=te,te.OPEN="a",te.CLOSE="b",te.ERROR="c",te.MESSAGE="d",qe.prototype.listen=qe.prototype.J,aa=le,tt.prototype.listenOnce=tt.prototype.K,tt.prototype.getLastError=tt.prototype.Ha,tt.prototype.getLastErrorCode=tt.prototype.ya,tt.prototype.getStatus=tt.prototype.ca,tt.prototype.getResponseJson=tt.prototype.La,tt.prototype.getResponseText=tt.prototype.la,tt.prototype.send=tt.prototype.ea,tt.prototype.setWithCredentials=tt.prototype.Fa,t1=tt}).apply(typeof pu<"u"?pu:typeof self<"u"?self:typeof window<"u"?window:{});const Ny="@firebase/firestore",Oy="4.9.2";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ht{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Ht.UNAUTHENTICATED=new Ht(null),Ht.GOOGLE_CREDENTIALS=new Ht("google-credentials-uid"),Ht.FIRST_PARTY=new Ht("first-party-uid"),Ht.MOCK_USER=new Ht("mock-user");/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Ts="12.3.0";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const lo=new KS("@firebase/firestore");function To(){return lo.logLevel}function K(t,...e){if(lo.logLevel<=Se.DEBUG){const n=e.map(_m);lo.debug(`Firestore (${Ts}): ${t}`,...n)}}function kr(t,...e){if(lo.logLevel<=Se.ERROR){const n=e.map(_m);lo.error(`Firestore (${Ts}): ${t}`,...n)}}function fs(t,...e){if(lo.logLevel<=Se.WARN){const n=e.map(_m);lo.warn(`Firestore (${Ts}): ${t}`,...n)}}function _m(t){if(typeof t=="string")return t;try{/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */return function(n){return JSON.stringify(n)}(t)}catch{return t}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function ue(t,e,n){let r="Unexpected state";typeof e=="string"?r=e:n=e,s1(t,r,n)}function s1(t,e,n){let r=`FIRESTORE (${Ts}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw kr(r),new Error(r)}function Ze(t,e,n,r){let i="Unexpected state";typeof n=="string"?i=n:r=n,t||s1(e,i,r)}function be(t,e){return t}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const H={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Z extends bs{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zi{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class a1{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Yk{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Ht.UNAUTHENTICATED))}shutdown(){}}class Xk{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class Jk{constructor(e){this.t=e,this.currentUser=Ht.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){Ze(this.o===void 0,42304);let r=this.i;const i=u=>this.i!==r?(r=this.i,n(u)):Promise.resolve();let o=new Zi;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Zi,e.enqueueRetryable(()=>i(this.currentUser))};const s=()=>{const u=o;e.enqueueRetryable(async()=>{await u.promise,await i(this.currentUser)})},l=u=>{K("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(u=>l(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?l(u):(K("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Zi)}},0),s()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(K("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ze(typeof r.accessToken=="string",31837,{l:r}),new a1(r.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Ze(e===null||typeof e=="string",2055,{h:e}),new Ht(e)}}class Zk{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=Ht.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class eN{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new Zk(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(Ht.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Dy{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class tN{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Ok(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){Ze(this.o===void 0,3512);const r=o=>{o.error!=null&&K("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const s=o.token!==this.m;return this.m=o.token,K("FirebaseAppCheckTokenProvider",`Received ${s?"new":"existing"} token.`),s?n(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>r(o))};const i=o=>{K("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.V.getImmediate({optional:!0});o?i(o):K("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new Dy(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(Ze(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new Dy(n.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function nN(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function Hd(t,e){const n=Math.min(t.length,e.length);for(let r=0;r=rN&&e<=iN}function hs(t,e,n){return t.length===e.length&&t.every((r,i)=>n(r,e[i]))}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Vy="__name__";class ur{constructor(e,n,r){n===void 0?n=0:n>e.length&&ue(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&ue(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return ur.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof ur?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length=0)throw new Z(H.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(i=>i.length>0))}return new Xe(n)}static emptyPath(){return new Xe([])}}const oN=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Zt extends ur{construct(e,n,r){return new Zt(e,n,r)}static isValidIdentifier(e){return oN.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Zt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===Vy}static keyField(){return new Zt([Vy])}static fromServerFormat(e){const n=[];let r="",i=0;const o=()=>{if(r.length===0)throw new Z(H.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let s=!1;for(;i=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&Xe.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return Xe.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new re(new Xe(e.slice()))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function sN(t,e,n){if(!n)throw new Z(H.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function aN(t,e,n,r){if(e===!0&&r===!0)throw new Z(H.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Ly(t){if(!re.isDocumentKey(t))throw new Z(H.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function lN(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function uN(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":ue(12329,{type:typeof t})}function Wd(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Z(H.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=uN(t);throw new Z(H.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}/** * @license * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function pt(t,e){const n={typeString:t};return e&&(n.value=e),n}function wl(t,e){if(!lN(t))throw new Z(H.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const i=e[r].typeString,o="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const s=t[r];if(i&&typeof s!==i){n=`JSON field '${r}' must be a ${i}.`;break}if(o!==void 0&&s!==o.value){n=`Expected '${r}' field to equal '${o.value}'`;break}}if(n)throw new Z(H.INVALID_ARGUMENT,n);return!0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const My=-62135596800,Fy=1e6;class ht{static now(){return ht.fromMillis(Date.now())}static fromDate(e){return ht.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*Fy);return new ht(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new Z(H.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new Z(H.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e=253402300800)throw new Z(H.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/Fy}_compareTo(e){return this.seconds===e.seconds?we(this.nanoseconds,e.nanoseconds):we(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:ht._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(wl(e,ht._jsonSchema))return new ht(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-My;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}ht._jsonSchemaVersion="firestore/timestamp/1.0",ht._jsonSchema={type:pt("string",ht._jsonSchemaVersion),seconds:pt("number"),nanoseconds:pt("number")};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ae{static fromTimestamp(e){return new ae(e)}static min(){return new ae(new ht(0,0))}static max(){return new ae(new ht(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const ol=-1;function cN(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,i=ae.fromTimestamp(r===1e9?new ht(n+1,0):new ht(n,r));return new yi(i,re.empty(),e)}function fN(t){return new yi(t.readTime,t.key,ol)}class yi{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new yi(ae.min(),re.empty(),ol)}static max(){return new yi(ae.max(),re.empty(),ol)}}function hN(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=re.comparator(t.documentKey,e.documentKey),n!==0?n:we(t.largestBatchId,e.largestBatchId))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const dN="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class pN{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function ff(t){if(t.code!==H.FAILED_PRECONDITION||t.message!==dN)throw t;K("LocalStore","Unexpectedly lost primary lease")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&ue(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new j((r,i)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(r,i)},this.catchCallback=o=>{this.wrapFailure(n,o).next(r,i)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof j?n:j.resolve(n)}catch(n){return j.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):j.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):j.reject(n)}static resolve(e){return new j((n,r)=>{n(e)})}static reject(e){return new j((n,r)=>{r(e)})}static waitFor(e){return new j((n,r)=>{let i=0,o=0,s=!1;e.forEach(l=>{++i,l.next(()=>{++o,s&&o===i&&n()},u=>r(u))}),s=!0,o===i&&n()})}static or(e){let n=j.resolve(!1);for(const r of e)n=n.next(i=>i?j.resolve(i):r());return n}static forEach(e,n){const r=[];return e.forEach((i,o)=>{r.push(n.call(this,i,o))}),this.waitFor(r)}static mapArray(e,n){return new j((r,i)=>{const o=e.length,s=new Array(o);let l=0;for(let u=0;u{s[c]=h,++l,l===o&&r(s)},h=>i(h))}})}static doWhile(e,n){return new j((r,i)=>{const o=()=>{e()===!0?n().next(()=>{o()},i):r()};o()})}}function mN(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function xs(t){return t.name==="IndexedDbTransactionError"}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hf{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}hf.ce=-1;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const gN=-1;function df(t){return t==null}function qd(t){return t===0&&1/t==-1/0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const l1="";function vN(t){let e="";for(let n=0;n0&&(e=jy(e)),e=yN(t.get(n),e);return jy(e)}function yN(t,e){let n=e;const r=t.length;for(let i=0;i0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const i=this.comparator(e,r.key);if(i===0)return n+r.left.size;i<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new mu(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new mu(this.root,e,this.comparator,!1)}getReverseIterator(){return new mu(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new mu(this.root,e,this.comparator,!0)}}class mu{constructor(e,n,r,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=n?r(e.key,n):1,n&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(o===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Dt{constructor(e,n,r,i,o){this.key=e,this.value=n,this.color=r??Dt.RED,this.left=i??Dt.EMPTY,this.right=o??Dt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,i,o){return new Dt(e??this.key,n??this.value,r??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let i=this;const o=r(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,n,r),null):o===0?i.copy(null,n,null,null,null):i.copy(null,null,null,null,i.right.insert(e,n,r)),i.fixUp()}removeMin(){if(this.left.isEmpty())return Dt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,i=this;if(n(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,n),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),n(e,i.key)===0){if(i.right.isEmpty())return Dt.EMPTY;r=i.right.min(),i=i.copy(r.key,r.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,n))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Dt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Dt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw ue(43730,{key:this.key,value:this.value});if(this.right.isRed())throw ue(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw ue(27949);return e+(this.isRed()?0:1)}}Dt.EMPTY=null,Dt.RED=!0,Dt.BLACK=!1;Dt.EMPTY=new class{constructor(){this.size=0}get key(){throw ue(57766)}get value(){throw ue(16141)}get color(){throw ue(16727)}get left(){throw ue(29726)}get right(){throw ue(36894)}copy(e,n,r,i,o){return this}insert(e,n,r){return new Dt(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _t{constructor(e){this.comparator=e,this.data=new ut(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const i=r.getNext();if(this.comparator(i.key,e[1])>=0)return;n(i.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new Uy(this.data.getIterator())}getIteratorFrom(e){return new Uy(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof _t)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const i=n.getNext().key,o=r.getNext().key;if(this.comparator(i,o)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new _t(this.comparator);return n.data=e,n}}class Uy{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ei{constructor(e){this.fields=e,e.sort(Zt.comparator)}static empty(){return new ei([])}unionWith(e){let n=new _t(Zt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new ei(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return hs(this.fields,e.fields,(n,r)=>n.isEqual(r))}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class u1 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Mt{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new u1("Invalid base64 string: "+o):o}}(e);return new Mt(n)}static fromUint8Array(e){const n=function(i){let o="";for(let s=0;sevr(n,e))!==void 0}function ds(t,e){if(t===e)return 0;const n=_i(t),r=_i(e);if(n!==r)return we(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return we(t.booleanValue,e.booleanValue);case 2:return function(o,s){const l=at(o.integerValue||o.doubleValue),u=at(s.integerValue||s.doubleValue);return lu?1:l===u?0:isNaN(l)?isNaN(u)?0:-1:1}(t,e);case 3:return By(t.timestampValue,e.timestampValue);case 4:return By(sl(t),sl(e));case 5:return Hd(t.stringValue,e.stringValue);case 6:return function(o,s){const l=Ei(o),u=Ei(s);return l.compareTo(u)}(t.bytesValue,e.bytesValue);case 7:return function(o,s){const l=o.split("/"),u=s.split("/");for(let c=0;ci+Bu(o),0)}(t.arrayValue);case 10:case 11:return function(r){let i=0;return El(r.fields,(o,s)=>{i+=o.length+Bu(s)}),i}(t.mapValue);default:throw ue(13486,{value:t})}}function Qd(t){return!!t&&"integerValue"in t}function Tm(t){return!!t&&"arrayValue"in t}function Hy(t){return!!t&&"nullValue"in t}function Wy(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Eh(t){return!!t&&"mapValue"in t}function xN(t){var n,r;return((r=(((n=t==null?void 0:t.mapValue)==null?void 0:n.fields)||{})[SN])==null?void 0:r.stringValue)===TN}function Na(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return El(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=Na(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Na(t.arrayValue.values[n]);return e}return{...t}}function IN(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===bN}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hr{constructor(e){this.value=e}static empty(){return new hr({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(l)){const u=this.getFieldsMap(n);this.applyChanges(u,r,i),r={},i=[],n=l.popLast()}s?r[l.lastSegment()]=Na(s):i.push(l.lastSegment())});const o=this.getFieldsMap(n);this.applyChanges(o,r,i)}delete(e){const n=this.field(e.popLast());Eh(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return vr(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[i]=o);for(const i of r)delete e[i]}clone(){return new hr(Na(this.value))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Gt{constructor(e,n,r,i,o,s,l){this.key=e,this.documentType=n,this.version=r,this.readTime=i,this.createTime=o,this.data=s,this.documentState=l}static newInvalidDocument(e){return new Gt(e,0,ae.min(),ae.min(),ae.min(),hr.empty(),0)}static newFoundDocument(e,n,r,i){return new Gt(e,1,n,ae.min(),r,i,0)}static newNoDocument(e,n){return new Gt(e,2,n,ae.min(),ae.min(),hr.empty(),0)}static newUnknownDocument(e,n){return new Gt(e,3,n,ae.min(),ae.min(),hr.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(ae.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=hr.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=hr.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ae.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof Gt&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Gt(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Vc{constructor(e,n){this.position=e,this.inclusive=n}}function qy(t,e,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return ue(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class yr extends p1{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new yr(e,n)}matches(e){return m1(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function m1(t){return t.op==="and"}function g1(t){return AN(t)&&m1(t)}function AN(t){for(const e of t.filters)if(e instanceof yr)return!1;return!0}function Yd(t){if(t instanceof wt)return t.field.canonicalString()+t.op.toString()+ps(t.value);if(g1(t))return t.filters.map(e=>Yd(e)).join(",");{const e=t.filters.map(n=>Yd(n)).join(",");return`${t.op}(${e})`}}function v1(t,e){return t instanceof wt?function(r,i){return i instanceof wt&&r.op===i.op&&r.field.isEqual(i.field)&&vr(r.value,i.value)}(t,e):t instanceof yr?function(r,i){return i instanceof yr&&r.op===i.op&&r.filters.length===i.filters.length?r.filters.reduce((o,s,l)=>o&&v1(s,i.filters[l]),!0):!1}(t,e):void ue(19439)}function y1(t){return t instanceof wt?function(n){return`${n.field.canonicalString()} ${n.op} ${ps(n.value)}`}(t):t instanceof yr?function(n){return n.op.toString()+" {"+n.getFilters().map(y1).join(" ,")+"}"}(t):"Filter"}class PN extends wt{constructor(e,n,r){super(e,n,r),this.key=re.fromName(r.referenceValue)}matches(e){const n=re.comparator(e.key,this.key);return this.matchesComparison(n)}}class RN extends wt{constructor(e,n){super(e,"in",n),this.keys=w1("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class kN extends wt{constructor(e,n){super(e,"not-in",n),this.keys=w1("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function w1(t,e){var n;return(((n=e.arrayValue)==null?void 0:n.values)||[]).map(r=>re.fromName(r.referenceValue))}class NN extends wt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return Tm(n)&&ll(n.arrayValue,this.value)}}class ON extends wt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&ll(this.value.arrayValue,n)}}class DN extends wt{constructor(e,n){super(e,"not-in",n)}matches(e){if(ll(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!ll(this.value.arrayValue,n)}}class VN extends wt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!Tm(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>ll(this.value.arrayValue,r))}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class LN{constructor(e,n=null,r=[],i=[],o=null,s=null,l=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=i,this.limit=o,this.startAt=s,this.endAt=l,this.Te=null}}function Ky(t,e=null,n=[],r=[],i=null,o=null,s=null){return new LN(t,e,n,r,i,o,s)}function xm(t){const e=be(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>Yd(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(o){return o.field.canonicalString()+o.dir}(r)).join(","),df(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>ps(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>ps(r)).join(",")),e.Te=n}return e.Te}function Im(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(s){let l=new _t(Zt.comparator);return s.filters.forEach(u=>{u.getFlattenedFilters().forEach(c=>{c.isInequality()&&(l=l.add(c.field))})}),l})(e).forEach(o=>{n.has(o.canonicalString())||o.isKeyField()||e.Ie.push(new Lc(o,r))}),n.has(Zt.keyField().canonicalString())||e.Ie.push(new Lc(Zt.keyField(),r))}return e.Ie}function gr(t){const e=be(t);return e.Ee||(e.Ee=jN(e,Oa(t))),e.Ee}function jN(t,e){if(t.limitType==="F")return Ky(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(i=>{const o=i.dir==="desc"?"asc":"desc";return new Lc(i.field,o)});const n=t.endAt?new Vc(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Vc(t.startAt.position,t.startAt.inclusive):null;return Ky(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function Jd(t,e,n){return new mf(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function gf(t,e){return Im(gr(t),gr(e))&&t.limitType===e.limitType}function E1(t){return`${xm(gr(t))}|lt:${t.limitType}`}function xo(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(i=>y1(i)).join(", ")}]`),df(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(i=>function(s){return`${s.field.canonicalString()} (${s.dir})`}(i)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(i=>ps(i)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(i=>ps(i)).join(",")),`Target(${r})`}(gr(t))}; limitType=${t.limitType})`}function vf(t,e){return e.isFoundDocument()&&function(r,i){const o=i.key.path;return r.collectionGroup!==null?i.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(o):re.isDocumentKey(r.path)?r.path.isEqual(o):r.path.isImmediateParentOf(o)}(t,e)&&function(r,i){for(const o of Oa(r))if(!o.field.isKeyField()&&i.data.field(o.field)===null)return!1;return!0}(t,e)&&function(r,i){for(const o of r.filters)if(!o.matches(i))return!1;return!0}(t,e)&&function(r,i){return!(r.startAt&&!function(s,l,u){const c=qy(s,l,u);return s.inclusive?c<=0:c<0}(r.startAt,Oa(r),i)||r.endAt&&!function(s,l,u){const c=qy(s,l,u);return s.inclusive?c>=0:c>0}(r.endAt,Oa(r),i))}(t,e)}function zN(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function _1(t){return(e,n)=>{let r=!1;for(const i of Oa(t)){const o=UN(i,e,n);if(o!==0)return o;r=r||i.field.isKeyField()}return 0}}function UN(t,e,n){const r=t.field.isKeyField()?re.comparator(e.key,n.key):function(o,s,l){const u=s.data.field(o),c=l.data.field(o);return u!==null&&c!==null?ds(u,c):ue(42886)}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return ue(19790,{direction:t.dir})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fo{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[i,o]of r)if(this.equalsFn(i,e))return o}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),i=this.inner[r];if(i===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let o=0;o{for(const[i,o]of r)e(i,o)})}isEmpty(){return wN(this.inner)}size(){return this.innerSize}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const BN=new ut(re.comparator);function Si(){return BN}const S1=new ut(re.comparator);function la(...t){let e=S1;for(const n of t)e=e.insert(n.key,n);return e}function $N(t){let e=S1;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function Gi(){return Da()}function b1(){return Da()}function Da(){return new fo(t=>t.toString(),(t,e)=>t.isEqual(e))}const HN=new _t(re.comparator);function Te(...t){let e=HN;for(const n of t)e=e.add(n);return e}const WN=new _t(we);function qN(){return WN}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function GN(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:qd(e)?"-0":e}}function KN(t){return{integerValue:""+t}}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yf{constructor(){this._=void 0}}function QN(t,e,n){return t instanceof Zd?function(i,o){const s={fields:{[f1]:{stringValue:c1},[d1]:{timestampValue:{seconds:i.seconds,nanos:i.nanoseconds}}}};return o&&bm(o)&&(o=pf(o)),o&&(s.fields[h1]=o),{mapValue:s}}(n,e):t instanceof Mc?T1(t,e):t instanceof Fc?x1(t,e):function(i,o){const s=XN(i,o),l=Yy(s)+Yy(i.Ae);return Qd(s)&&Qd(i.Ae)?KN(l):GN(i.serializer,l)}(t,e)}function YN(t,e,n){return t instanceof Mc?T1(t,e):t instanceof Fc?x1(t,e):n}function XN(t,e){return t instanceof ep?function(r){return Qd(r)||function(o){return!!o&&"doubleValue"in o}(r)}(e)?e:{integerValue:0}:null}class Zd extends yf{}class Mc extends yf{constructor(e){super(),this.elements=e}}function T1(t,e){const n=I1(e);for(const r of t.elements)n.some(i=>vr(i,r))||n.push(r);return{arrayValue:{values:n}}}class Fc extends yf{constructor(e){super(),this.elements=e}}function x1(t,e){let n=I1(e);for(const r of t.elements)n=n.filter(i=>!vr(i,r));return{arrayValue:{values:n}}}class ep extends yf{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function Yy(t){return at(t.integerValue||t.doubleValue)}function I1(t){return Tm(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}function JN(t,e){return t.field.isEqual(e.field)&&function(r,i){return r instanceof Mc&&i instanceof Mc||r instanceof Fc&&i instanceof Fc?hs(r.elements,i.elements,vr):r instanceof ep&&i instanceof ep?vr(r.Ae,i.Ae):r instanceof Zd&&i instanceof Zd}(t.transform,e.transform)}class eo{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new eo}static exists(e){return new eo(void 0,e)}static updateTime(e){return new eo(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function $u(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class Am{}function C1(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new eO(t.key,eo.none()):new Pm(t.key,t.data,eo.none());{const n=t.data,r=hr.empty();let i=new _t(Zt.comparator);for(let o of e.fields)if(!i.has(o)){let s=n.field(o);s===null&&o.length>1&&(o=o.popLast(),s=n.field(o)),s===null?r.delete(o):r.set(o,s),i=i.add(o)}return new wf(t.key,r,new ei(i.toArray()),eo.none())}}function ZN(t,e,n){t instanceof Pm?function(i,o,s){const l=i.value.clone(),u=Jy(i.fieldTransforms,o,s.transformResults);l.setAll(u),o.convertToFoundDocument(s.version,l).setHasCommittedMutations()}(t,e,n):t instanceof wf?function(i,o,s){if(!$u(i.precondition,o))return void o.convertToUnknownDocument(s.version);const l=Jy(i.fieldTransforms,o,s.transformResults),u=o.data;u.setAll(A1(i)),u.setAll(l),o.convertToFoundDocument(s.version,u).setHasCommittedMutations()}(t,e,n):function(i,o,s){o.convertToNoDocument(s.version).setHasCommittedMutations()}(0,e,n)}function Va(t,e,n,r){return t instanceof Pm?function(o,s,l,u){if(!$u(o.precondition,s))return l;const c=o.value.clone(),h=Zy(o.fieldTransforms,u,s);return c.setAll(h),s.convertToFoundDocument(s.version,c).setHasLocalMutations(),null}(t,e,n,r):t instanceof wf?function(o,s,l,u){if(!$u(o.precondition,s))return l;const c=Zy(o.fieldTransforms,u,s),h=s.data;return h.setAll(A1(o)),h.setAll(c),s.convertToFoundDocument(s.version,h).setHasLocalMutations(),l===null?null:l.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(p=>p.field))}(t,e,n,r):function(o,s,l){return $u(o.precondition,s)?(s.convertToNoDocument(s.version).setHasLocalMutations(),null):l}(t,e,n)}function Xy(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,i){return r===void 0&&i===void 0||!(!r||!i)&&hs(r,i,(o,s)=>JN(o,s))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Pm extends Am{constructor(e,n,r,i=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=i,this.type=0}getFieldMask(){return null}}class wf extends Am{constructor(e,n,r,i,o=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=i,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}}function A1(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function Jy(t,e,n){const r=new Map;Ze(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let i=0;i{const o=e.get(i.key),s=o.overlayedDocument;let l=this.applyToLocalView(s,o.mutatedFields);l=n.has(i.key)?null:l;const u=C1(s,l);u!==null&&r.set(i.key,u),s.isValidDocument()||s.convertToNoDocument(ae.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),Te())}isEqual(e){return this.batchId===e.batchId&&hs(this.mutations,e.mutations,(n,r)=>Xy(n,r))&&hs(this.baseMutations,e.baseMutations,(n,r)=>Xy(n,r))}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class nO{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{ largestBatchId: ${this.largestBatchId}, mutation: ${this.mutation.toString()} }`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rO{constructor(e,n){this.count=e,this.unchangedNames=n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var ft,_e;function P1(t){if(t===void 0)return kr("GRPC error has no .code"),H.UNKNOWN;switch(t){case ft.OK:return H.OK;case ft.CANCELLED:return H.CANCELLED;case ft.UNKNOWN:return H.UNKNOWN;case ft.DEADLINE_EXCEEDED:return H.DEADLINE_EXCEEDED;case ft.RESOURCE_EXHAUSTED:return H.RESOURCE_EXHAUSTED;case ft.INTERNAL:return H.INTERNAL;case ft.UNAVAILABLE:return H.UNAVAILABLE;case ft.UNAUTHENTICATED:return H.UNAUTHENTICATED;case ft.INVALID_ARGUMENT:return H.INVALID_ARGUMENT;case ft.NOT_FOUND:return H.NOT_FOUND;case ft.ALREADY_EXISTS:return H.ALREADY_EXISTS;case ft.PERMISSION_DENIED:return H.PERMISSION_DENIED;case ft.FAILED_PRECONDITION:return H.FAILED_PRECONDITION;case ft.ABORTED:return H.ABORTED;case ft.OUT_OF_RANGE:return H.OUT_OF_RANGE;case ft.UNIMPLEMENTED:return H.UNIMPLEMENTED;case ft.DATA_LOSS:return H.DATA_LOSS;default:return ue(39323,{code:t})}}(_e=ft||(ft={}))[_e.OK=0]="OK",_e[_e.CANCELLED=1]="CANCELLED",_e[_e.UNKNOWN=2]="UNKNOWN",_e[_e.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",_e[_e.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",_e[_e.NOT_FOUND=5]="NOT_FOUND",_e[_e.ALREADY_EXISTS=6]="ALREADY_EXISTS",_e[_e.PERMISSION_DENIED=7]="PERMISSION_DENIED",_e[_e.UNAUTHENTICATED=16]="UNAUTHENTICATED",_e[_e.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",_e[_e.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",_e[_e.ABORTED=10]="ABORTED",_e[_e.OUT_OF_RANGE=11]="OUT_OF_RANGE",_e[_e.UNIMPLEMENTED=12]="UNIMPLEMENTED",_e[_e.INTERNAL=13]="INTERNAL",_e[_e.UNAVAILABLE=14]="UNAVAILABLE",_e[_e.DATA_LOSS=15]="DATA_LOSS";/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function iO(){return new TextEncoder}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const oO=new di([4294967295,4294967295],0);function e0(t){const e=iO().encode(t),n=new e1;return n.update(e),new Uint8Array(n.digest())}function t0(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),i=e.getUint32(8,!0),o=e.getUint32(12,!0);return[new di([n,r],0),new di([i,o],0)]}class Rm{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new ua(`Invalid padding: ${n}`);if(r<0)throw new ua(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new ua(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new ua(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=di.fromNumber(this.ge)}ye(e,n,r){let i=e.add(n.multiply(di.fromNumber(r)));return i.compare(oO)===1&&(i=new di([i.getBits(0),i.getBits(1)],0)),i.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<s.insert(l)),s}insert(e){if(this.ge===0)return;const n=e0(e),[r,i]=t0(n);for(let o=0;o0&&(this.Oe=!0,this.Me=e)}ke(){let e=Te(),n=Te(),r=Te();return this.Fe.forEach((i,o)=>{switch(o){case 0:e=e.add(i);break;case 2:n=n.add(i);break;case 1:r=r.add(i);break;default:ue(38017,{changeType:o})}}),new _l(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=r0()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,Ze(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class sO{constructor(e){this.Ge=e,this.ze=new Map,this.je=Si(),this.Je=vu(),this.He=vu(),this.Ye=new ut(we)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:ue(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach((r,i)=>{this.rt(i)&&n(i)})}st(e){const n=e.targetId,r=e.Ce.count,i=this.ot(n);if(i){const o=i.target;if(Xd(o))if(r===0){const s=new re(o.path);this.et(n,s,Gt.newNoDocument(s,ae.min()))}else Ze(r===1,20013,{expectedCount:r});else{const s=this._t(n);if(s!==r){const l=this.ut(e),u=l?this.ct(l,e,s):1;if(u!==0){this.it(n);const c=u===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,c)}}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:i=0},hashCount:o=0}=n;let s,l;try{s=Ei(r).toUint8Array()}catch(u){if(u instanceof u1)return fs("Decoding the base64 bloom filter in existence filter failed ("+u.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw u}try{l=new Rm(s,i,o)}catch(u){return fs(u instanceof ua?"BloomFilter error: ":"Applying bloom filter failed: ",u),null}return l.ge===0?null:l}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let i=0;return r.forEach(o=>{const s=this.Ge.ht(),l=`projects/${s.projectId}/databases/${s.database}/documents/${o.path.canonicalString()}`;e.mightContain(l)||(this.et(n,o,null),i++)}),i}Tt(e){const n=new Map;this.ze.forEach((o,s)=>{const l=this.ot(s);if(l){if(o.current&&Xd(l.target)){const u=new re(l.target.path);this.It(u).has(s)||this.Et(s,u)||this.et(s,u,Gt.newNoDocument(u,e))}o.Be&&(n.set(s,o.ke()),o.qe())}});let r=Te();this.He.forEach((o,s)=>{let l=!0;s.forEachWhile(u=>{const c=this.ot(u);return!c||c.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)}),l&&(r=r.add(o))}),this.je.forEach((o,s)=>s.setReadTime(e));const i=new Ef(e,n,this.Ye,this.je,r);return this.je=Si(),this.Je=vu(),this.He=vu(),this.Ye=new ut(we),i}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const i=this.nt(e);this.Et(e,n)?i.Qe(n,1):i.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new n0,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new _t(we),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new _t(we),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||K("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new n0),this.Ge.getRemoteKeysForTarget(e).forEach(n=>{this.et(e,n,null)})}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function vu(){return new ut(re.comparator)}function r0(){return new ut(re.comparator)}const aO={asc:"ASCENDING",desc:"DESCENDING"},lO={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},uO={and:"AND",or:"OR"};class cO{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function tp(t,e){return t.useProto3Json||df(e)?e:{value:e}}function fO(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function hO(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Jo(t){return Ze(!!t,49232),ae.fromTimestamp(function(n){const r=wi(n);return new ht(r.seconds,r.nanos)}(t))}function dO(t,e){return np(t,e).canonicalString()}function np(t,e){const n=function(i){return new Xe(["projects",i.projectId,"databases",i.database])}(t).child("documents");return e===void 0?n:n.child(e)}function N1(t){const e=Xe.fromString(t);return Ze(M1(e),10190,{key:e.toString()}),e}function _h(t,e){const n=N1(e);if(n.get(1)!==t.databaseId.projectId)throw new Z(H.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Z(H.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new re(D1(n))}function O1(t,e){return dO(t.databaseId,e)}function pO(t){const e=N1(t);return e.length===4?Xe.emptyPath():D1(e)}function i0(t){return new Xe(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function D1(t){return Ze(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function mO(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(c){return c==="NO_CHANGE"?0:c==="ADD"?1:c==="REMOVE"?2:c==="CURRENT"?3:c==="RESET"?4:ue(39313,{state:c})}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],o=function(c,h){return c.useProto3Json?(Ze(h===void 0||typeof h=="string",58123),Mt.fromBase64String(h||"")):(Ze(h===void 0||h instanceof Buffer||h instanceof Uint8Array,16193),Mt.fromUint8Array(h||new Uint8Array))}(t,e.targetChange.resumeToken),s=e.targetChange.cause,l=s&&function(c){const h=c.code===void 0?H.UNKNOWN:P1(c.code);return new Z(h,c.message||"")}(s);n=new k1(r,i,o,l||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const i=_h(t,r.document.name),o=Jo(r.document.updateTime),s=r.document.createTime?Jo(r.document.createTime):ae.min(),l=new hr({mapValue:{fields:r.document.fields}}),u=Gt.newFoundDocument(i,o,s,l),c=r.targetIds||[],h=r.removedTargetIds||[];n=new Hu(c,h,u.key,u)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const i=_h(t,r.document),o=r.readTime?Jo(r.readTime):ae.min(),s=Gt.newNoDocument(i,o),l=r.removedTargetIds||[];n=new Hu([],l,s.key,s)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const i=_h(t,r.document),o=r.removedTargetIds||[];n=new Hu([],o,i,null)}else{if(!("filter"in e))return ue(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:i=0,unchangedNames:o}=r,s=new rO(i,o),l=r.targetId;n=new R1(l,s)}}return n}function gO(t,e){return{documents:[O1(t,e.path)]}}function vO(t,e){const n={structuredQuery:{}},r=e.path;let i;e.collectionGroup!==null?(i=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(i=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=O1(t,i);const o=function(c){if(c.length!==0)return L1(yr.create(c,"and"))}(e.filters);o&&(n.structuredQuery.where=o);const s=function(c){if(c.length!==0)return c.map(h=>function(d){return{field:Io(d.field),direction:EO(d.dir)}}(h))}(e.orderBy);s&&(n.structuredQuery.orderBy=s);const l=tp(t,e.limit);return l!==null&&(n.structuredQuery.limit=l),e.startAt&&(n.structuredQuery.startAt=function(c){return{before:c.inclusive,values:c.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(c){return{before:!c.inclusive,values:c.position}}(e.endAt)),{ft:n,parent:i}}function yO(t){let e=pO(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){Ze(r===1,65062);const h=n.from[0];h.allDescendants?i=h.collectionId:e=e.child(h.collectionId)}let o=[];n.where&&(o=function(p){const d=V1(p);return d instanceof yr&&g1(d)?d.getFilters():[d]}(n.where));let s=[];n.orderBy&&(s=function(p){return p.map(d=>function(v){return new Lc(Co(v.field),function(A){switch(A){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(v.direction))}(d))}(n.orderBy));let l=null;n.limit&&(l=function(p){let d;return d=typeof p=="object"?p.value:p,df(d)?null:d}(n.limit));let u=null;n.startAt&&(u=function(p){const d=!!p.before,g=p.values||[];return new Vc(g,d)}(n.startAt));let c=null;return n.endAt&&(c=function(p){const d=!p.before,g=p.values||[];return new Vc(g,d)}(n.endAt)),MN(e,i,s,o,l,"F",u,c)}function wO(t,e){const n=function(i){switch(i){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ue(28987,{purpose:i})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function V1(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=Co(n.unaryFilter.field);return wt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const i=Co(n.unaryFilter.field);return wt.create(i,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const o=Co(n.unaryFilter.field);return wt.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=Co(n.unaryFilter.field);return wt.create(s,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return ue(61313);default:return ue(60726)}}(t):t.fieldFilter!==void 0?function(n){return wt.create(Co(n.fieldFilter.field),function(i){switch(i){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return ue(58110);default:return ue(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return yr.create(n.compositeFilter.filters.map(r=>V1(r)),function(i){switch(i){case"AND":return"and";case"OR":return"or";default:return ue(1026)}}(n.compositeFilter.op))}(t):ue(30097,{filter:t})}function EO(t){return aO[t]}function _O(t){return lO[t]}function SO(t){return uO[t]}function Io(t){return{fieldPath:t.canonicalString()}}function Co(t){return Zt.fromServerFormat(t.fieldPath)}function L1(t){return t instanceof wt?function(n){if(n.op==="=="){if(Wy(n.value))return{unaryFilter:{field:Io(n.field),op:"IS_NAN"}};if(Hy(n.value))return{unaryFilter:{field:Io(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(Wy(n.value))return{unaryFilter:{field:Io(n.field),op:"IS_NOT_NAN"}};if(Hy(n.value))return{unaryFilter:{field:Io(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Io(n.field),op:_O(n.op),value:n.value}}}(t):t instanceof yr?function(n){const r=n.getFilters().map(i=>L1(i));return r.length===1?r[0]:{compositeFilter:{op:SO(n.op),filters:r}}}(t):ue(54877,{filter:t})}function M1(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ti{constructor(e,n,r,i,o=ae.min(),s=ae.min(),l=Mt.EMPTY_BYTE_STRING,u=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=i,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=l,this.expectedCount=u}withSequenceNumber(e){return new ti(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new ti(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ti(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ti(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bO{constructor(e){this.yt=e}}function TO(t){const e=yO({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?Jd(e,e.limit,"L"):e}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xO{constructor(){this.Cn=new IO}addToCollectionParentIndex(e,n){return this.Cn.add(n),j.resolve()}getCollectionParents(e,n){return j.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return j.resolve()}deleteFieldIndex(e,n){return j.resolve()}deleteAllFieldIndexes(e){return j.resolve()}createTargetIndexes(e,n){return j.resolve()}getDocumentsMatchingTarget(e,n){return j.resolve(null)}getIndexType(e,n){return j.resolve(0)}getFieldIndexes(e,n){return j.resolve([])}getNextCollectionGroupToUpdate(e){return j.resolve(null)}getMinOffset(e,n){return j.resolve(yi.min())}getMinOffsetFromCollectionGroup(e,n){return j.resolve(yi.min())}updateCollectionGroup(e,n,r){return j.resolve()}updateIndexEntries(e,n){return j.resolve()}}class IO{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n]||new _t(Xe.comparator),o=!i.has(r);return this.index[n]=i.add(r),o}has(e){const n=e.lastSegment(),r=e.popLast(),i=this.index[n];return i&&i.has(r)}getEntries(e){return(this.index[e]||new _t(Xe.comparator)).toArray()}}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const o0={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},F1=41943040;class un{static withCacheSize(e){return new un(e,un.DEFAULT_COLLECTION_PERCENTILE,un.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */un.DEFAULT_COLLECTION_PERCENTILE=10,un.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,un.DEFAULT=new un(F1,un.DEFAULT_COLLECTION_PERCENTILE,un.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),un.DISABLED=new un(-1,0,0);/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ms{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new ms(0)}static cr(){return new ms(-1)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const s0="LruGarbageCollector",CO=1048576;function a0([t,e],[n,r]){const i=we(t,n);return i===0?we(e,r):i}class AO{constructor(e){this.Ir=e,this.buffer=new _t(a0),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){xs(n)?K(s0,"Ignoring IndexedDB error during garbage collection: ",n):await ff(n)}await this.Vr(3e5)})}}class RO{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return j.resolve(hf.ce);const r=new AO(n);return this.mr.forEachTarget(e,i=>r.Ar(i.sequenceNumber)).next(()=>this.mr.pr(e,i=>r.Ar(i))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(K("LruGarbageCollector","Garbage collection skipped; disabled"),j.resolve(o0)):this.getCacheSize(e).next(r=>r(p>this.params.maximumSequenceNumbersToCollect?(K("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${p}`),i=this.params.maximumSequenceNumbersToCollect):i=p,s=Date.now(),this.nthSequenceNumber(e,i))).next(p=>(r=p,l=Date.now(),this.removeTargets(e,r,n))).next(p=>(o=p,u=Date.now(),this.removeOrphanedDocuments(e,r))).next(p=>(c=Date.now(),To()<=Se.DEBUG&&K("LruGarbageCollector",`LRU Garbage Collection Counted targets in ${s-h}ms Determined least recently used ${i} in `+(l-s)+`ms Removed ${o} targets in `+(u-l)+`ms Removed ${p} documents in `+(c-u)+`ms Total Duration: ${c-h}ms`),j.resolve({didRun:!0,sequenceNumbersCollected:i,targetsRemoved:o,documentsRemoved:p})))}}function kO(t,e){return new RO(t,e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class NO{constructor(){this.changes=new fo(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Gt.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?j.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class OO{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class DO{constructor(e,n,r,i){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=i}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(i=>(r=i,this.remoteDocumentCache.getEntry(e,n))).next(i=>(r!==null&&Va(r.mutation,i,ei.empty(),ht.now()),i))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,Te()).next(()=>r))}getLocalViewOfDocuments(e,n,r=Te()){const i=Gi();return this.populateOverlays(e,i,n).next(()=>this.computeViews(e,n,i,r).next(o=>{let s=la();return o.forEach((l,u)=>{s=s.insert(l,u.overlayedDocument)}),s}))}getOverlayedDocuments(e,n){const r=Gi();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,Te()))}populateOverlays(e,n,r){const i=[];return r.forEach(o=>{n.has(o)||i.push(o)}),this.documentOverlayCache.getOverlays(e,i).next(o=>{o.forEach((s,l)=>{n.set(s,l)})})}computeViews(e,n,r,i){let o=Si();const s=Da(),l=function(){return Da()}();return n.forEach((u,c)=>{const h=r.get(c.key);i.has(c.key)&&(h===void 0||h.mutation instanceof wf)?o=o.insert(c.key,c):h!==void 0?(s.set(c.key,h.mutation.getFieldMask()),Va(h.mutation,c,h.mutation.getFieldMask(),ht.now())):s.set(c.key,ei.empty())}),this.recalculateAndSaveOverlays(e,o).next(u=>(u.forEach((c,h)=>s.set(c,h)),n.forEach((c,h)=>l.set(c,new OO(h,s.get(c)??null))),l))}recalculateAndSaveOverlays(e,n){const r=Da();let i=new ut((s,l)=>s-l),o=Te();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(s=>{for(const l of s)l.keys().forEach(u=>{const c=n.get(u);if(c===null)return;let h=r.get(u)||ei.empty();h=l.applyToLocalView(c,h),r.set(u,h);const p=(i.get(l.batchId)||Te()).add(u);i=i.insert(l.batchId,p)})}).next(()=>{const s=[],l=i.getReverseIterator();for(;l.hasNext();){const u=l.getNext(),c=u.key,h=u.value,p=b1();h.forEach(d=>{if(!o.has(d)){const g=C1(n.get(d),r.get(d));g!==null&&p.set(d,g),o=o.add(d)}}),s.push(this.documentOverlayCache.saveOverlays(e,c,p))}return j.waitFor(s)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,i){return function(s){return re.isDocumentKey(s.path)&&s.collectionGroup===null&&s.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):FN(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,i):this.getDocumentsMatchingCollectionQuery(e,n,r,i)}getNextDocuments(e,n,r,i){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,i).next(o=>{const s=i-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,i-o.size):j.resolve(Gi());let l=ol,u=o;return s.next(c=>j.forEach(c,(h,p)=>(l{u=u.insert(h,d)}))).next(()=>this.populateOverlays(e,c,o)).next(()=>this.computeViews(e,u,c,Te())).next(h=>({batchId:l,changes:$N(h)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new re(n)).next(r=>{let i=la();return r.isFoundDocument()&&(i=i.insert(r.key,r)),i})}getDocumentsMatchingCollectionGroupQuery(e,n,r,i){const o=n.collectionGroup;let s=la();return this.indexManager.getCollectionParents(e,o).next(l=>j.forEach(l,u=>{const c=function(p,d){return new mf(d,null,p.explicitOrderBy.slice(),p.filters.slice(),p.limit,p.limitType,p.startAt,p.endAt)}(n,u.child(o));return this.getDocumentsMatchingCollectionQuery(e,c,r,i).next(h=>{h.forEach((p,d)=>{s=s.insert(p,d)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,n,r,i){let o;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(s=>(o=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,o,i))).next(s=>{o.forEach((u,c)=>{const h=c.getKey();s.get(h)===null&&(s=s.insert(h,Gt.newInvalidDocument(h)))});let l=la();return s.forEach((u,c)=>{const h=o.get(u);h!==void 0&&Va(h.mutation,c,ei.empty(),ht.now()),vf(n,c)&&(l=l.insert(u,c))}),l})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class VO{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return j.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,function(i){return{id:i.id,version:i.version,createTime:Jo(i.createTime)}}(n)),j.resolve()}getNamedQuery(e,n){return j.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,function(i){return{name:i.name,query:TO(i.bundledQuery),readTime:Jo(i.readTime)}}(n)),j.resolve()}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class LO{constructor(){this.overlays=new ut(re.comparator),this.qr=new Map}getOverlay(e,n){return j.resolve(this.overlays.get(n))}getOverlays(e,n){const r=Gi();return j.forEach(n,i=>this.getOverlay(e,i).next(o=>{o!==null&&r.set(i,o)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((i,o)=>{this.St(e,n,o)}),j.resolve()}removeOverlaysForBatchId(e,n,r){const i=this.qr.get(r);return i!==void 0&&(i.forEach(o=>this.overlays=this.overlays.remove(o)),this.qr.delete(r)),j.resolve()}getOverlaysForCollection(e,n,r){const i=Gi(),o=n.length+1,s=new re(n.child("")),l=this.overlays.getIteratorFrom(s);for(;l.hasNext();){const u=l.getNext().value,c=u.getKey();if(!n.isPrefixOf(c.path))break;c.path.length===o&&u.largestBatchId>r&&i.set(u.getKey(),u)}return j.resolve(i)}getOverlaysForCollectionGroup(e,n,r,i){let o=new ut((c,h)=>c-h);const s=this.overlays.getIterator();for(;s.hasNext();){const c=s.getNext().value;if(c.getKey().getCollectionGroup()===n&&c.largestBatchId>r){let h=o.get(c.largestBatchId);h===null&&(h=Gi(),o=o.insert(c.largestBatchId,h)),h.set(c.getKey(),c)}}const l=Gi(),u=o.getIterator();for(;u.hasNext()&&(u.getNext().value.forEach((c,h)=>l.set(c,h)),!(l.size()>=i)););return j.resolve(l)}St(e,n,r){const i=this.overlays.get(r.key);if(i!==null){const s=this.qr.get(i.largestBatchId).delete(r.key);this.qr.set(i.largestBatchId,s)}this.overlays=this.overlays.insert(r.key,new nO(n,r));let o=this.qr.get(n);o===void 0&&(o=Te(),this.qr.set(n,o)),this.qr.set(n,o.add(r.key))}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class MO{constructor(){this.sessionToken=Mt.EMPTY_BYTE_STRING}getSessionToken(e){return j.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,j.resolve()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class km{constructor(){this.Qr=new _t(Ct.$r),this.Ur=new _t(Ct.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new Ct(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.Gr(new Ct(e,n))}zr(e,n){e.forEach(r=>this.removeReference(r,n))}jr(e){const n=new re(new Xe([])),r=new Ct(n,e),i=new Ct(n,e+1),o=[];return this.Ur.forEachInRange([r,i],s=>{this.Gr(s),o.push(s.key)}),o}Jr(){this.Qr.forEach(e=>this.Gr(e))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new re(new Xe([])),r=new Ct(n,e),i=new Ct(n,e+1);let o=Te();return this.Ur.forEachInRange([r,i],s=>{o=o.add(s.key)}),o}containsKey(e){const n=new Ct(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class Ct{constructor(e,n){this.key=e,this.Yr=n}static $r(e,n){return re.comparator(e.key,n.key)||we(e.Yr,n.Yr)}static Kr(e,n){return we(e.Yr,n.Yr)||re.comparator(e.key,n.key)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class FO{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new _t(Ct.$r)}checkEmpty(e){return j.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,i){const o=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new tO(o,n,r,i);this.mutationQueue.push(s);for(const l of i)this.Zr=this.Zr.add(new Ct(l.key,o)),this.indexManager.addToCollectionParentIndex(e,l.key.path.popLast());return j.resolve(s)}lookupMutationBatch(e,n){return j.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,i=this.ei(r),o=i<0?0:i;return j.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return j.resolve(this.mutationQueue.length===0?gN:this.tr-1)}getAllMutationBatches(e){return j.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new Ct(n,0),i=new Ct(n,Number.POSITIVE_INFINITY),o=[];return this.Zr.forEachInRange([r,i],s=>{const l=this.Xr(s.Yr);o.push(l)}),j.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new _t(we);return n.forEach(i=>{const o=new Ct(i,0),s=new Ct(i,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([o,s],l=>{r=r.add(l.Yr)})}),j.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,i=r.length+1;let o=r;re.isDocumentKey(o)||(o=o.child(""));const s=new Ct(new re(o),0);let l=new _t(we);return this.Zr.forEachWhile(u=>{const c=u.key.path;return!!r.isPrefixOf(c)&&(c.length===i&&(l=l.add(u.Yr)),!0)},s),j.resolve(this.ti(l))}ti(e){const n=[];return e.forEach(r=>{const i=this.Xr(r);i!==null&&n.push(i)}),n}removeMutationBatch(e,n){Ze(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return j.forEach(n.mutations,i=>{const o=new Ct(i.key,n.batchId);return r=r.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,i.key)}).next(()=>{this.Zr=r})}ir(e){}containsKey(e,n){const r=new Ct(n,0),i=this.Zr.firstAfterOrEqual(r);return j.resolve(n.isEqual(i&&i.key))}performConsistencyCheck(e){return this.mutationQueue.length,j.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jO{constructor(e){this.ri=e,this.docs=function(){return new ut(re.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,i=this.docs.get(r),o=i?i.size:0,s=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:s}),this.size+=s-o,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return j.resolve(r?r.document.mutableCopy():Gt.newInvalidDocument(n))}getEntries(e,n){let r=Si();return n.forEach(i=>{const o=this.docs.get(i);r=r.insert(i,o?o.document.mutableCopy():Gt.newInvalidDocument(i))}),j.resolve(r)}getDocumentsMatchingQuery(e,n,r,i){let o=Si();const s=n.path,l=new re(s.child("__id-9223372036854775808__")),u=this.docs.getIteratorFrom(l);for(;u.hasNext();){const{key:c,value:{document:h}}=u.getNext();if(!s.isPrefixOf(c.path))break;c.path.length>s.length+1||hN(fN(h),r)<=0||(i.has(h.key)||vf(n,h))&&(o=o.insert(h.key,h.mutableCopy()))}return j.resolve(o)}getAllFromCollectionGroup(e,n,r,i){ue(9500)}ii(e,n){return j.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new zO(this)}getSize(e){return j.resolve(this.size)}}class zO extends NO{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];return this.changes.forEach((r,i)=>{i.isValidDocument()?n.push(this.Nr.addEntry(e,i)):this.Nr.removeEntry(r)}),j.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class UO{constructor(e){this.persistence=e,this.si=new fo(n=>xm(n),Im),this.lastRemoteSnapshotVersion=ae.min(),this.highestTargetId=0,this.oi=0,this._i=new km,this.targetCount=0,this.ai=ms.ur()}forEachTarget(e,n){return this.si.forEach((r,i)=>n(i)),j.resolve()}getLastRemoteSnapshotVersion(e){return j.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return j.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),j.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),j.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new ms(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,j.resolve()}updateTargetData(e,n){return this.Pr(n),j.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,j.resolve()}removeTargets(e,n,r){let i=0;const o=[];return this.si.forEach((s,l)=>{l.sequenceNumber<=n&&r.get(l.targetId)===null&&(this.si.delete(s),o.push(this.removeMatchingKeysForTargetId(e,l.targetId)),i++)}),j.waitFor(o).next(()=>i)}getTargetCount(e){return j.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return j.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),j.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const i=this.persistence.referenceDelegate,o=[];return i&&n.forEach(s=>{o.push(i.markPotentiallyOrphaned(e,s))}),j.waitFor(o)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),j.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return j.resolve(r)}containsKey(e,n){return j.resolve(this._i.containsKey(n))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j1{constructor(e,n){this.ui={},this.overlays={},this.ci=new hf(0),this.li=!1,this.li=!0,this.hi=new MO,this.referenceDelegate=e(this),this.Pi=new UO(this),this.indexManager=new xO,this.remoteDocumentCache=function(i){return new jO(i)}(r=>this.referenceDelegate.Ti(r)),this.serializer=new bO(n),this.Ii=new VO(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new LO,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new FO(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){K("MemoryPersistence","Starting transaction:",e);const i=new BO(this.ci.next());return this.referenceDelegate.Ei(),r(i).next(o=>this.referenceDelegate.di(i).next(()=>o)).toPromise().then(o=>(i.raiseOnCommittedEvent(),o))}Ai(e,n){return j.or(Object.values(this.ui).map(r=>()=>r.containsKey(e,n)))}}class BO extends pN{constructor(e){super(),this.currentSequenceNumber=e}}class Nm{constructor(e){this.persistence=e,this.Ri=new km,this.Vi=null}static mi(e){return new Nm(e)}get fi(){if(this.Vi)return this.Vi;throw ue(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),j.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),j.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),j.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach(i=>this.fi.add(i.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(i=>{i.forEach(o=>this.fi.add(o.toString()))}).next(()=>r.removeTargetData(e,n))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return j.forEach(this.fi,r=>{const i=re.fromPath(r);return this.gi(e,i).next(o=>{o||n.removeEntry(i,ae.min())})}).next(()=>(this.Vi=null,n.apply(e)))}updateLimboDocument(e,n){return this.gi(e,n).next(r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())})}Ti(e){return 0}gi(e,n){return j.or([()=>j.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class jc{constructor(e,n){this.persistence=e,this.pi=new fo(r=>vN(r.path),(r,i)=>r.isEqual(i)),this.garbageCollector=kO(this,n)}static mi(e,n){return new jc(e,n)}Ei(){}di(e){return j.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(i=>r+i))}wr(e){let n=0;return this.pr(e,r=>{n++}).next(()=>n)}pr(e,n){return j.forEach(this.pi,(r,i)=>this.br(e,r,i).next(o=>o?j.resolve():n(i)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const i=this.persistence.getRemoteDocumentCache(),o=i.newChangeBuffer();return i.ii(e,s=>this.br(e,s,n).next(l=>{l||(r++,o.removeEntry(s,ae.min()))})).next(()=>o.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),j.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),j.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),j.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),j.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=Bu(e.data.value)),n}br(e,n,r){return j.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const i=this.pi.get(n);return j.resolve(i!==void 0&&i>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Om{constructor(e,n,r,i){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=i}static As(e,n){let r=Te(),i=Te();for(const o of n.docChanges)switch(o.type){case 0:r=r.add(o.doc.key);break;case 1:i=i.add(o.doc.key)}return new Om(e,n.fromCache,r,i)}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $O{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class HO{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=function(){return P2()?8:mN(C2())>0?6:4}()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}getDocumentsMatchingQuery(e,n,r,i){const o={result:null};return this.ys(e,n).next(s=>{o.result=s}).next(()=>{if(!o.result)return this.ws(e,n,i,r).next(s=>{o.result=s})}).next(()=>{if(o.result)return;const s=new $O;return this.Ss(e,n,s).next(l=>{if(o.result=l,this.Vs)return this.bs(e,n,s,l.size)})}).next(()=>o.result)}bs(e,n,r,i){return r.documentReadCountthis.gs*i?(To()<=Se.DEBUG&&K("QueryEngine","The SDK decides to create cache indexes for query:",xo(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,gr(n))):j.resolve())}ys(e,n){if(Qy(n))return j.resolve(null);let r=gr(n);return this.indexManager.getIndexType(e,r).next(i=>i===0?null:(n.limit!==null&&i===1&&(n=Jd(n,null,"F"),r=gr(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(o=>{const s=Te(...o);return this.ps.getDocuments(e,s).next(l=>this.indexManager.getMinOffset(e,r).next(u=>{const c=this.Ds(n,l);return this.Cs(n,c,s,u.readTime)?this.ys(e,Jd(n,null,"F")):this.vs(e,c,n,u)}))})))}ws(e,n,r,i){return Qy(n)||i.isEqual(ae.min())?j.resolve(null):this.ps.getDocuments(e,r).next(o=>{const s=this.Ds(n,o);return this.Cs(n,s,r,i)?j.resolve(null):(To()<=Se.DEBUG&&K("QueryEngine","Re-using previous result from %s to execute query: %s",i.toString(),xo(n)),this.vs(e,s,n,cN(i,ol)).next(l=>l))})}Ds(e,n){let r=new _t(_1(e));return n.forEach((i,o)=>{vf(e,o)&&(r=r.add(o))}),r}Cs(e,n,r,i){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const o=e.limitType==="F"?n.last():n.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(i)>0)}Ss(e,n,r){return To()<=Se.DEBUG&&K("QueryEngine","Using full collection scan to execute query:",xo(n)),this.ps.getDocumentsMatchingQuery(e,n,yi.min(),r)}vs(e,n,r,i){return this.ps.getDocumentsMatchingQuery(e,r,i).next(o=>(n.forEach(s=>{o=o.insert(s.key,s)}),o))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Dm="LocalStore",WO=3e8;class qO{constructor(e,n,r,i){this.persistence=e,this.Fs=n,this.serializer=i,this.Ms=new ut(we),this.xs=new fo(o=>xm(o),Im),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new DO(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.Ms))}}function GO(t,e,n,r){return new qO(t,e,n,r)}async function z1(t,e){const n=be(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let i;return n.mutationQueue.getAllMutationBatches(r).next(o=>(i=o,n.Bs(e),n.mutationQueue.getAllMutationBatches(r))).next(o=>{const s=[],l=[];let u=Te();for(const c of i){s.push(c.batchId);for(const h of c.mutations)u=u.add(h.key)}for(const c of o){l.push(c.batchId);for(const h of c.mutations)u=u.add(h.key)}return n.localDocuments.getDocuments(r,u).next(c=>({Ls:c,removedBatchIds:s,addedBatchIds:l}))})})}function U1(t){const e=be(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Pi.getLastRemoteSnapshotVersion(n))}function KO(t,e){const n=be(t),r=e.snapshotVersion;let i=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{const s=n.Ns.newChangeBuffer({trackRemovals:!0});i=n.Ms;const l=[];e.targetChanges.forEach((h,p)=>{const d=i.get(p);if(!d)return;l.push(n.Pi.removeMatchingKeys(o,h.removedDocuments,p).next(()=>n.Pi.addMatchingKeys(o,h.addedDocuments,p)));let g=d.withSequenceNumber(o.currentSequenceNumber);e.targetMismatches.get(p)!==null?g=g.withResumeToken(Mt.EMPTY_BYTE_STRING,ae.min()).withLastLimboFreeSnapshotVersion(ae.min()):h.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(h.resumeToken,r)),i=i.insert(p,g),function(E,A,x){return E.resumeToken.approximateByteSize()===0||A.snapshotVersion.toMicroseconds()-E.snapshotVersion.toMicroseconds()>=WO?!0:x.addedDocuments.size+x.modifiedDocuments.size+x.removedDocuments.size>0}(d,g,h)&&l.push(n.Pi.updateTargetData(o,g))});let u=Si(),c=Te();if(e.documentUpdates.forEach(h=>{e.resolvedLimboDocuments.has(h)&&l.push(n.persistence.referenceDelegate.updateLimboDocument(o,h))}),l.push(QO(o,s,e.documentUpdates).next(h=>{u=h.ks,c=h.qs})),!r.isEqual(ae.min())){const h=n.Pi.getLastRemoteSnapshotVersion(o).next(p=>n.Pi.setTargetsMetadata(o,o.currentSequenceNumber,r));l.push(h)}return j.waitFor(l).next(()=>s.apply(o)).next(()=>n.localDocuments.getLocalViewOfDocuments(o,u,c)).next(()=>u)}).then(o=>(n.Ms=i,o))}function QO(t,e,n){let r=Te(),i=Te();return n.forEach(o=>r=r.add(o)),e.getEntries(t,r).next(o=>{let s=Si();return n.forEach((l,u)=>{const c=o.get(l);u.isFoundDocument()!==c.isFoundDocument()&&(i=i.add(l)),u.isNoDocument()&&u.version.isEqual(ae.min())?(e.removeEntry(l,u.readTime),s=s.insert(l,u)):!c.isValidDocument()||u.version.compareTo(c.version)>0||u.version.compareTo(c.version)===0&&c.hasPendingWrites?(e.addEntry(u),s=s.insert(l,u)):K(Dm,"Ignoring outdated watch update for ",l,". Current version:",c.version," Watch version:",u.version)}),{ks:s,qs:i}})}function YO(t,e){const n=be(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let i;return n.Pi.getTargetData(r,e).next(o=>o?(i=o,j.resolve(i)):n.Pi.allocateTargetId(r).next(s=>(i=new ti(e,s,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,i).next(()=>i))))}).then(r=>{const i=n.Ms.get(r.targetId);return(i===null||r.snapshotVersion.compareTo(i.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r})}async function rp(t,e,n){const r=be(t),i=r.Ms.get(e),o=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",o,s=>r.persistence.referenceDelegate.removeTarget(s,i))}catch(s){if(!xs(s))throw s;K(Dm,`Failed to update sequence numbers for target ${e}: ${s}`)}r.Ms=r.Ms.remove(e),r.xs.delete(i.target)}function l0(t,e,n){const r=be(t);let i=ae.min(),o=Te();return r.persistence.runTransaction("Execute query","readwrite",s=>function(u,c,h){const p=be(u),d=p.xs.get(h);return d!==void 0?j.resolve(p.Ms.get(d)):p.Pi.getTargetData(c,h)}(r,s,gr(e)).next(l=>{if(l)return i=l.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(s,l.targetId).next(u=>{o=u})}).next(()=>r.Fs.getDocumentsMatchingQuery(s,e,n?i:ae.min(),n?o:Te())).next(l=>(XO(r,zN(e),l),{documents:l,Qs:o})))}function XO(t,e,n){let r=t.Os.get(e)||ae.min();n.forEach((i,o)=>{o.readTime.compareTo(r)>0&&(r=o.readTime)}),t.Os.set(e,r)}class u0{constructor(){this.activeTargetIds=qN()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class JO{constructor(){this.Mo=new u0,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new u0,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ZO{Oo(e){}shutdown(){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const c0="ConnectivityMonitor";class f0{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){K(c0,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){K(c0,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let yu=null;function ip(){return yu===null?yu=function(){return 268435456+Math.round(2147483648*Math.random())}():yu++,"0x"+yu.toString(16)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Sh="RestConnection",eD={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class tD{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${i}`,this.Wo=this.databaseId.database===Dc?`project_id=${r}`:`project_id=${r}&database_id=${i}`}Go(e,n,r,i,o){const s=ip(),l=this.zo(e,n.toUriEncodedString());K(Sh,`Sending RPC '${e}' ${s}:`,l,r);const u={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(u,i,o);const{host:c}=new URL(l),h=wm(c);return this.Jo(e,l,u,r,h).then(p=>(K(Sh,`Received RPC '${e}' ${s}: `,p),p),p=>{throw fs(Sh,`RPC '${e}' ${s} failed with error: `,p,"url: ",l,"request:",r),p})}Ho(e,n,r,i,o,s){return this.Go(e,n,r,i,o)}jo(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Ts}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,o)=>e[o]=i),r&&r.headers.forEach((i,o)=>e[o]=i)}zo(e,n){const r=eD[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class nD{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Bt="WebChannelConnection";class rD extends tD{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,i,o){const s=ip();return new Promise((l,u)=>{const c=new t1;c.setWithCredentials(!0),c.listenOnce(n1.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Uu.NO_ERROR:const p=c.getResponseJson();K(Bt,`XHR for RPC '${e}' ${s} received:`,JSON.stringify(p)),l(p);break;case Uu.TIMEOUT:K(Bt,`RPC '${e}' ${s} timed out`),u(new Z(H.DEADLINE_EXCEEDED,"Request time out"));break;case Uu.HTTP_ERROR:const d=c.getStatus();if(K(Bt,`RPC '${e}' ${s} failed with status:`,d,"response text:",c.getResponseText()),d>0){let g=c.getResponseJson();Array.isArray(g)&&(g=g[0]);const v=g==null?void 0:g.error;if(v&&v.status&&v.message){const E=function(x){const _=x.toLowerCase().replace(/_/g,"-");return Object.values(H).indexOf(_)>=0?_:H.UNKNOWN}(v.status);u(new Z(E,v.message))}else u(new Z(H.UNKNOWN,"Server responded with status "+c.getStatus()))}else u(new Z(H.UNAVAILABLE,"Connection failed."));break;default:ue(9055,{l_:e,streamId:s,h_:c.getLastErrorCode(),P_:c.getLastError()})}}finally{K(Bt,`RPC '${e}' ${s} completed.`)}});const h=JSON.stringify(i);K(Bt,`RPC '${e}' ${s} sending request:`,i),c.send(n,"POST",h,r,15)})}T_(e,n,r){const i=ip(),o=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=o1(),l=i1(),u={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(u.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(u.useFetchStreams=!0),this.jo(u.initMessageHeaders,n,r),u.encodeInitMessageHeaders=!0;const h=o.join("");K(Bt,`Creating RPC '${e}' stream ${i}: ${h}`,u);const p=s.createWebChannel(h,u);this.I_(p);let d=!1,g=!1;const v=new nD({Yo:A=>{g?K(Bt,`Not sending because RPC '${e}' stream ${i} is closed:`,A):(d||(K(Bt,`Opening RPC '${e}' stream ${i} transport.`),p.open(),d=!0),K(Bt,`RPC '${e}' stream ${i} sending:`,A),p.send(A))},Zo:()=>p.close()}),E=(A,x,_)=>{A.listen(x,S=>{try{_(S)}catch(k){setTimeout(()=>{throw k},0)}})};return E(p,aa.EventType.OPEN,()=>{g||(K(Bt,`RPC '${e}' stream ${i} transport opened.`),v.o_())}),E(p,aa.EventType.CLOSE,()=>{g||(g=!0,K(Bt,`RPC '${e}' stream ${i} transport closed`),v.a_(),this.E_(p))}),E(p,aa.EventType.ERROR,A=>{g||(g=!0,fs(Bt,`RPC '${e}' stream ${i} transport errored. Name:`,A.name,"Message:",A.message),v.a_(new Z(H.UNAVAILABLE,"The operation could not be completed")))}),E(p,aa.EventType.MESSAGE,A=>{var x;if(!g){const _=A.data[0];Ze(!!_,16349);const S=_,k=(S==null?void 0:S.error)||((x=S[0])==null?void 0:x.error);if(k){K(Bt,`RPC '${e}' stream ${i} received error:`,k);const D=k.status;let N=function(b){const I=ft[b];if(I!==void 0)return P1(I)}(D),w=k.message;N===void 0&&(N=H.INTERNAL,w="Unknown error status: "+D+" with message "+k.message),g=!0,v.a_(new Z(N,w)),p.close()}else K(Bt,`RPC '${e}' stream ${i} received:`,_),v.u_(_)}}),E(l,r1.STAT_EVENT,A=>{A.stat===$d.PROXY?K(Bt,`RPC '${e}' stream ${i} detected buffering proxy`):A.stat===$d.NOPROXY&&K(Bt,`RPC '${e}' stream ${i} detected no buffering proxy`)}),setTimeout(()=>{v.__()},0),v}terminate(){this.c_.forEach(e=>e.close()),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter(n=>n===e)}}function bh(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function B1(t){return new cO(t,!0)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $1{constructor(e,n,r=1e3,i=1.5,o=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=i,this.R_=o,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),i=Math.max(0,n-r);i>0&&K("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.V_*=this.A_,this.V_this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const h0="PersistentStream";class iD{constructor(e,n,r,i,o,s,l,u){this.Mi=e,this.S_=r,this.b_=i,this.connection=o,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=l,this.listener=u,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new $1(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,()=>this.k_()))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===H.RESOURCE_EXHAUSTED?(kr(n.toString()),kr("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===H.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,i])=>{this.D_===n&&this.G_(r,i)},r=>{e(()=>{const i=new Z(H.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(i)})})}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo(()=>{r(()=>this.listener.Xo())}),this.stream.t_(()=>{r(()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,()=>(this.O_()&&(this.state=3),Promise.resolve())),this.listener.t_()))}),this.stream.r_(i=>{r(()=>this.z_(i))}),this.stream.onMessage(i=>{r(()=>++this.F_==1?this.J_(i):this.onNext(i))})}N_(){this.state=5,this.M_.p_(async()=>{this.state=0,this.start()})}z_(e){return K(h0,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget(()=>this.D_===e?n():(K(h0,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class oD extends iD{constructor(e,n,r,i,o,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,i,s),this.serializer=o}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=mO(this.serializer,e),r=function(o){if(!("targetChange"in o))return ae.min();const s=o.targetChange;return s.targetIds&&s.targetIds.length?ae.min():s.readTime?Jo(s.readTime):ae.min()}(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=i0(this.serializer),n.addTarget=function(o,s){let l;const u=s.target;if(l=Xd(u)?{documents:gO(o,u)}:{query:vO(o,u).ft},l.targetId=s.targetId,s.resumeToken.approximateByteSize()>0){l.resumeToken=hO(o,s.resumeToken);const c=tp(o,s.expectedCount);c!==null&&(l.expectedCount=c)}else if(s.snapshotVersion.compareTo(ae.min())>0){l.readTime=fO(o,s.snapshotVersion.toTimestamp());const c=tp(o,s.expectedCount);c!==null&&(l.expectedCount=c)}return l}(this.serializer,e);const r=wO(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=i0(this.serializer),n.removeTarget=e,this.q_(n)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sD{}class aD extends sD{constructor(e,n,r,i){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=i,this.ia=!1}sa(){if(this.ia)throw new Z(H.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,s])=>this.connection.Go(e,np(n,r),i,o,s)).catch(o=>{throw o.name==="FirebaseError"?(o.code===H.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Z(H.UNKNOWN,o.toString())})}Ho(e,n,r,i,o){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,l])=>this.connection.Ho(e,np(n,r),i,s,l,o)).catch(s=>{throw s.name==="FirebaseError"?(s.code===H.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),s):new Z(H.UNKNOWN,s.toString())})}terminate(){this.ia=!0,this.connection.terminate()}}class lD{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve())))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e} This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.aa?(kr(n),this.aa=!1):K("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const gs="RemoteStore";class uD{constructor(e,n,r,i,o){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=o,this.Aa.Oo(s=>{r.enqueueAndForget(async()=>{bl(this)&&(K(gs,"Restarting streams for network reachability change."),await async function(u){const c=be(u);c.Ea.add(4),await Sl(c),c.Ra.set("Unknown"),c.Ea.delete(4),await _f(c)}(this))})}),this.Ra=new lD(r,i)}}async function _f(t){if(bl(t))for(const e of t.da)await e(!0)}async function Sl(t){for(const e of t.da)await e(!1)}function H1(t,e){const n=be(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),Fm(n)?Mm(n):Is(n).O_()&&Lm(n,e))}function Vm(t,e){const n=be(t),r=Is(n);n.Ia.delete(e),r.O_()&&W1(n,e),n.Ia.size===0&&(r.O_()?r.L_():bl(n)&&n.Ra.set("Unknown"))}function Lm(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(ae.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Is(t).Y_(e)}function W1(t,e){t.Va.Ue(e),Is(t).Z_(e)}function Mm(t){t.Va=new sO({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),Is(t).start(),t.Ra.ua()}function Fm(t){return bl(t)&&!Is(t).x_()&&t.Ia.size>0}function bl(t){return be(t).Ea.size===0}function q1(t){t.Va=void 0}async function cD(t){t.Ra.set("Online")}async function fD(t){t.Ia.forEach((e,n)=>{Lm(t,e)})}async function hD(t,e){q1(t),Fm(t)?(t.Ra.ha(e),Mm(t)):t.Ra.set("Unknown")}async function dD(t,e,n){if(t.Ra.set("Online"),e instanceof k1&&e.state===2&&e.cause)try{await async function(i,o){const s=o.cause;for(const l of o.targetIds)i.Ia.has(l)&&(await i.remoteSyncer.rejectListen(l,s),i.Ia.delete(l),i.Va.removeTarget(l))}(t,e)}catch(r){K(gs,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await d0(t,r)}else if(e instanceof Hu?t.Va.Ze(e):e instanceof R1?t.Va.st(e):t.Va.tt(e),!n.isEqual(ae.min()))try{const r=await U1(t.localStore);n.compareTo(r)>=0&&await function(o,s){const l=o.Va.Tt(s);return l.targetChanges.forEach((u,c)=>{if(u.resumeToken.approximateByteSize()>0){const h=o.Ia.get(c);h&&o.Ia.set(c,h.withResumeToken(u.resumeToken,s))}}),l.targetMismatches.forEach((u,c)=>{const h=o.Ia.get(u);if(!h)return;o.Ia.set(u,h.withResumeToken(Mt.EMPTY_BYTE_STRING,h.snapshotVersion)),W1(o,u);const p=new ti(h.target,u,c,h.sequenceNumber);Lm(o,p)}),o.remoteSyncer.applyRemoteEvent(l)}(t,n)}catch(r){K(gs,"Failed to raise snapshot:",r),await d0(t,r)}}async function d0(t,e,n){if(!xs(e))throw e;t.Ea.add(1),await Sl(t),t.Ra.set("Offline"),n||(n=()=>U1(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{K(gs,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await _f(t)})}async function p0(t,e){const n=be(t);n.asyncQueue.verifyOperationInProgress(),K(gs,"RemoteStore received new credentials");const r=bl(n);n.Ea.add(3),await Sl(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await _f(n)}async function pD(t,e){const n=be(t);e?(n.Ea.delete(2),await _f(n)):e||(n.Ea.add(2),await Sl(n),n.Ra.set("Unknown"))}function Is(t){return t.ma||(t.ma=function(n,r,i){const o=be(n);return o.sa(),new oD(r,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,i)}(t.datastore,t.asyncQueue,{Xo:cD.bind(null,t),t_:fD.bind(null,t),r_:hD.bind(null,t),H_:dD.bind(null,t)}),t.da.push(async e=>{e?(t.ma.B_(),Fm(t)?Mm(t):t.Ra.set("Unknown")):(await t.ma.stop(),q1(t))})),t.ma}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jm{constructor(e,n,r,i,o){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=i,this.removalCallback=o,this.deferred=new Zi,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(s=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,i,o){const s=Date.now()+r,l=new jm(e,n,s,i,o);return l.start(r),l}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Z(H.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function G1(t,e){if(kr("AsyncQueue",`${e}: ${t}`),xs(t))return new Z(H.UNAVAILABLE,`${e}: ${t}`);throw t}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zo{static emptySet(e){return new Zo(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||re.comparator(n.key,r.key):(n,r)=>re.comparator(n.key,r.key),this.keyedMap=la(),this.sortedSet=new ut(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Zo)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const i=n.getNext().key,o=r.getNext().key;if(!i.isEqual(o))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` )`}copy(e,n){const r=new Zo;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class m0{constructor(){this.ga=new ut(re.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):ue(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal((n,r)=>{e.push(r)}),e}}class vs{constructor(e,n,r,i,o,s,l,u,c){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=i,this.mutatedKeys=o,this.fromCache=s,this.syncStateChanged=l,this.excludesMetadataChanges=u,this.hasCachedResults=c}static fromInitialDocuments(e,n,r,i,o){const s=[];return n.forEach(l=>{s.push({type:0,doc:l})}),new vs(e,n,Zo.emptySet(n),s,r,i,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&gf(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let i=0;ie.Da())}}class gD{constructor(){this.queries=g0(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const i=be(n),o=i.queries;i.queries=g0(),o.forEach((s,l)=>{for(const u of l.Sa)u.onError(r)})})(this,new Z(H.ABORTED,"Firestore shutting down"))}}function g0(){return new fo(t=>E1(t),gf)}async function vD(t,e){const n=be(t);let r=3;const i=e.query;let o=n.queries.get(i);o?!o.ba()&&e.Da()&&(r=2):(o=new mD,r=e.Da()?0:1);try{switch(r){case 0:o.wa=await n.onListen(i,!0);break;case 1:o.wa=await n.onListen(i,!1);break;case 2:await n.onFirstRemoteStoreListen(i)}}catch(s){const l=G1(s,`Initialization of query '${xo(e.query)}' failed`);return void e.onError(l)}n.queries.set(i,o),o.Sa.push(e),e.va(n.onlineState),o.wa&&e.Fa(o.wa)&&zm(n)}async function yD(t,e){const n=be(t),r=e.query;let i=3;const o=n.queries.get(r);if(o){const s=o.Sa.indexOf(e);s>=0&&(o.Sa.splice(s,1),o.Sa.length===0?i=e.Da()?0:1:!o.ba()&&e.Da()&&(i=2))}switch(i){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function wD(t,e){const n=be(t);let r=!1;for(const i of e){const o=i.query,s=n.queries.get(o);if(s){for(const l of s.Sa)l.Fa(i)&&(r=!0);s.wa=i}}r&&zm(n)}function ED(t,e,n){const r=be(t),i=r.queries.get(e);if(i)for(const o of i.Sa)o.onError(n);r.queries.delete(e)}function zm(t){t.Ca.forEach(e=>{e.next()})}var op,v0;(v0=op||(op={})).Ma="default",v0.Cache="cache";class _D{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const i of e.docChanges)i.type!==3&&r.push(i);e=new vs(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=vs.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==op.Cache}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class K1{constructor(e){this.key=e}}class Q1{constructor(e){this.key=e}}class SD{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=Te(),this.mutatedKeys=Te(),this.eu=_1(e),this.tu=new Zo(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new m0,i=n?n.tu:this.tu;let o=n?n.mutatedKeys:this.mutatedKeys,s=i,l=!1;const u=this.query.limitType==="F"&&i.size===this.query.limit?i.last():null,c=this.query.limitType==="L"&&i.size===this.query.limit?i.first():null;if(e.inorderTraversal((h,p)=>{const d=i.get(h),g=vf(this.query,p)?p:null,v=!!d&&this.mutatedKeys.has(d.key),E=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations);let A=!1;d&&g?d.data.isEqual(g.data)?v!==E&&(r.track({type:3,doc:g}),A=!0):this.su(d,g)||(r.track({type:2,doc:g}),A=!0,(u&&this.eu(g,u)>0||c&&this.eu(g,c)<0)&&(l=!0)):!d&&g?(r.track({type:0,doc:g}),A=!0):d&&!g&&(r.track({type:1,doc:d}),A=!0,(u||c)&&(l=!0)),A&&(g?(s=s.add(g),o=E?o.add(h):o.delete(h)):(s=s.delete(h),o=o.delete(h)))}),this.query.limit!==null)for(;s.size>this.query.limit;){const h=this.query.limitType==="F"?s.last():s.first();s=s.delete(h.key),o=o.delete(h.key),r.track({type:1,doc:h})}return{tu:s,iu:r,Cs:l,mutatedKeys:o}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,i){const o=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const s=e.iu.ya();s.sort((h,p)=>function(g,v){const E=A=>{switch(A){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ue(20277,{Rt:A})}};return E(g)-E(v)}(h.type,p.type)||this.eu(h.doc,p.doc)),this.ou(r),i=i??!1;const l=n&&!i?this._u():[],u=this.Xa.size===0&&this.current&&!i?1:0,c=u!==this.Za;return this.Za=u,s.length!==0||c?{snapshot:new vs(this.query,e.tu,o,s,e.mutatedKeys,u===0,c,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:l}:{au:l}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new m0,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach(n=>this.Ya=this.Ya.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ya=this.Ya.delete(n)),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=Te(),this.tu.forEach(r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))});const n=[];return e.forEach(r=>{this.Xa.has(r)||n.push(new Q1(r))}),this.Xa.forEach(r=>{e.has(r)||n.push(new K1(r))}),n}cu(e){this.Ya=e.Qs,this.Xa=Te();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return vs.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const Um="SyncEngine";class bD{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class TD{constructor(e){this.key=e,this.hu=!1}}class xD{constructor(e,n,r,i,o,s){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=i,this.currentUser=o,this.maxConcurrentLimboResolutions=s,this.Pu={},this.Tu=new fo(l=>E1(l),gf),this.Iu=new Map,this.Eu=new Set,this.du=new ut(re.comparator),this.Au=new Map,this.Ru=new km,this.Vu={},this.mu=new Map,this.fu=ms.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function ID(t,e,n=!0){const r=eb(t);let i;const o=r.Tu.get(e);return o?(r.sharedClientState.addLocalQueryTarget(o.targetId),i=o.view.lu()):i=await Y1(r,e,n,!0),i}async function CD(t,e){const n=eb(t);await Y1(n,e,!0,!1)}async function Y1(t,e,n,r){const i=await YO(t.localStore,gr(e)),o=i.targetId,s=t.sharedClientState.addLocalQueryTarget(o,n);let l;return r&&(l=await AD(t,e,o,s==="current",i.resumeToken)),t.isPrimaryClient&&n&&H1(t.remoteStore,i),l}async function AD(t,e,n,r,i){t.pu=(p,d,g)=>async function(E,A,x,_){let S=A.view.ru(x);S.Cs&&(S=await l0(E.localStore,A.query,!1).then(({documents:w})=>A.view.ru(w,S)));const k=_&&_.targetChanges.get(A.targetId),D=_&&_.targetMismatches.get(A.targetId)!=null,N=A.view.applyChanges(S,E.isPrimaryClient,k,D);return w0(E,A.targetId,N.au),N.snapshot}(t,p,d,g);const o=await l0(t.localStore,e,!0),s=new SD(e,o.Qs),l=s.ru(o.documents),u=_l.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",i),c=s.applyChanges(l,t.isPrimaryClient,u);w0(t,n,c.au);const h=new bD(e,n,s);return t.Tu.set(e,h),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),c.snapshot}async function PD(t,e,n){const r=be(t),i=r.Tu.get(e),o=r.Iu.get(i.targetId);if(o.length>1)return r.Iu.set(i.targetId,o.filter(s=>!gf(s,e))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(i.targetId),r.sharedClientState.isActiveQueryTarget(i.targetId)||await rp(r.localStore,i.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(i.targetId),n&&Vm(r.remoteStore,i.targetId),sp(r,i.targetId)}).catch(ff)):(sp(r,i.targetId),await rp(r.localStore,i.targetId,!0))}async function RD(t,e){const n=be(t),r=n.Tu.get(e),i=n.Iu.get(r.targetId);n.isPrimaryClient&&i.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),Vm(n.remoteStore,r.targetId))}async function X1(t,e){const n=be(t);try{const r=await KO(n.localStore,e);e.targetChanges.forEach((i,o)=>{const s=n.Au.get(o);s&&(Ze(i.addedDocuments.size+i.modifiedDocuments.size+i.removedDocuments.size<=1,22616),i.addedDocuments.size>0?s.hu=!0:i.modifiedDocuments.size>0?Ze(s.hu,14607):i.removedDocuments.size>0&&(Ze(s.hu,42227),s.hu=!1))}),await Z1(n,r,e)}catch(r){await ff(r)}}function y0(t,e,n){const r=be(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const i=[];r.Tu.forEach((o,s)=>{const l=s.view.va(e);l.snapshot&&i.push(l.snapshot)}),function(s,l){const u=be(s);u.onlineState=l;let c=!1;u.queries.forEach((h,p)=>{for(const d of p.Sa)d.va(l)&&(c=!0)}),c&&zm(u)}(r.eventManager,e),i.length&&r.Pu.H_(i),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function kD(t,e,n){const r=be(t);r.sharedClientState.updateQueryState(e,"rejected",n);const i=r.Au.get(e),o=i&&i.key;if(o){let s=new ut(re.comparator);s=s.insert(o,Gt.newNoDocument(o,ae.min()));const l=Te().add(o),u=new Ef(ae.min(),new Map,new ut(we),s,l);await X1(r,u),r.du=r.du.remove(o),r.Au.delete(e),Bm(r)}else await rp(r.localStore,e,!1).then(()=>sp(r,e,n)).catch(ff)}function sp(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach(r=>{t.Ru.containsKey(r)||J1(t,r)})}function J1(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(Vm(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),Bm(t))}function w0(t,e,n){for(const r of n)r instanceof K1?(t.Ru.addReference(r.key,e),ND(t,r)):r instanceof Q1?(K(Um,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||J1(t,r.key)):ue(19791,{wu:r})}function ND(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(K(Um,"New document in limbo: "+n),t.Eu.add(r),Bm(t))}function Bm(t){for(;t.Eu.size>0&&t.du.size{s.push(r.pu(u,e,n).then(c=>{var h;if((c||n)&&r.isPrimaryClient){const p=c?!c.fromCache:(h=n==null?void 0:n.targetChanges.get(u.targetId))==null?void 0:h.current;r.sharedClientState.updateQueryState(u.targetId,p?"current":"not-current")}if(c){i.push(c);const p=Om.As(u.targetId,c);o.push(p)}}))}),await Promise.all(s),r.Pu.H_(i),await async function(u,c){const h=be(u);try{await h.persistence.runTransaction("notifyLocalViewChanges","readwrite",p=>j.forEach(c,d=>j.forEach(d.Es,g=>h.persistence.referenceDelegate.addReference(p,d.targetId,g)).next(()=>j.forEach(d.ds,g=>h.persistence.referenceDelegate.removeReference(p,d.targetId,g)))))}catch(p){if(!xs(p))throw p;K(Dm,"Failed to update sequence numbers: "+p)}for(const p of c){const d=p.targetId;if(!p.fromCache){const g=h.Ms.get(d),v=g.snapshotVersion,E=g.withLastLimboFreeSnapshotVersion(v);h.Ms=h.Ms.insert(d,E)}}}(r.localStore,o))}async function OD(t,e){const n=be(t);if(!n.currentUser.isEqual(e)){K(Um,"User change. New user:",e.toKey());const r=await z1(n.localStore,e);n.currentUser=e,function(o,s){o.mu.forEach(l=>{l.forEach(u=>{u.reject(new Z(H.CANCELLED,s))})}),o.mu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Z1(n,r.Ls)}}function DD(t,e){const n=be(t),r=n.Au.get(e);if(r&&r.hu)return Te().add(r.key);{let i=Te();const o=n.Iu.get(e);if(!o)return i;for(const s of o){const l=n.Tu.get(s);i=i.unionWith(l.view.nu)}return i}}function eb(t){const e=be(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=X1.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=DD.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=kD.bind(null,e),e.Pu.H_=wD.bind(null,e.eventManager),e.Pu.yu=ED.bind(null,e.eventManager),e}class zc{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=B1(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return GO(this.persistence,new HO,e.initialUser,this.serializer)}Cu(e){return new j1(Nm.mi,this.serializer)}Du(e){return new JO}async terminate(){var e,n;(e=this.gcScheduler)==null||e.stop(),(n=this.indexBackfillerScheduler)==null||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}zc.provider={build:()=>new zc};class VD extends zc{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){Ze(this.persistence.referenceDelegate instanceof jc,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new PO(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?un.withCacheSize(this.cacheSizeBytes):un.DEFAULT;return new j1(r=>jc.mi(r,n),this.serializer)}}class ap{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>y0(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=OD.bind(null,this.syncEngine),await pD(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new gD}()}createDatastore(e){const n=B1(e.databaseInfo.databaseId),r=function(o){return new rD(o)}(e.databaseInfo);return function(o,s,l,u){return new aD(o,s,l,u)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,i,o,s,l){return new uD(r,i,o,s,l)}(this.localStore,this.datastore,e.asyncQueue,n=>y0(this.syncEngine,n,0),function(){return f0.v()?new f0:new ZO}())}createSyncEngine(e,n){return function(i,o,s,l,u,c,h){const p=new xD(i,o,s,l,u,c);return h&&(p.gu=!0),p}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(i){const o=be(i);K(gs,"RemoteStore shutting down."),o.Ea.add(5),await Sl(o),o.Aa.shutdown(),o.Ra.set("Unknown")}(this.remoteStore),(e=this.datastore)==null||e.terminate(),(n=this.eventManager)==null||n.terminate()}}ap.provider={build:()=>new ap};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class LD{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):kr("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout(()=>{this.muted||e(n)},0)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const bi="FirestoreClient";class MD{constructor(e,n,r,i,o){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=i,this.user=Ht.UNAUTHENTICATED,this.clientId=Sm.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(r,async s=>{K(bi,"Received user=",s.uid),await this.authCredentialListener(s),this.user=s}),this.appCheckCredentials.start(r,s=>(K(bi,"Received new app check token=",s),this.appCheckCredentialListener(s,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Zi;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=G1(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function Th(t,e){t.asyncQueue.verifyOperationInProgress(),K(bi,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async i=>{r.isEqual(i)||(await z1(e.localStore,i),r=i)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function E0(t,e){t.asyncQueue.verifyOperationInProgress();const n=await FD(t);K(bi,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>p0(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,i)=>p0(e.remoteStore,i)),t._onlineComponents=e}async function FD(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){K(bi,"Using user provided OfflineComponentProvider");try{await Th(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(i){return i.name==="FirebaseError"?i.code===H.FAILED_PRECONDITION||i.code===H.UNIMPLEMENTED:!(typeof DOMException<"u"&&i instanceof DOMException)||i.code===22||i.code===20||i.code===11}(n))throw n;fs("Error using user provided cache. Falling back to memory cache: "+n),await Th(t,new zc)}}else K(bi,"Using default OfflineComponentProvider"),await Th(t,new VD(void 0));return t._offlineComponents}async function jD(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(K(bi,"Using user provided OnlineComponentProvider"),await E0(t,t._uninitializedComponentsProvider._online)):(K(bi,"Using default OnlineComponentProvider"),await E0(t,new ap))),t._onlineComponents}async function zD(t){const e=await jD(t),n=e.eventManager;return n.onListen=ID.bind(null,e.syncEngine),n.onUnlisten=PD.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=CD.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=RD.bind(null,e.syncEngine),n}function UD(t,e,n={}){const r=new Zi;return t.asyncQueue.enqueueAndForget(async()=>function(o,s,l,u,c){const h=new LD({next:d=>{h.Nu(),s.enqueueAndForget(()=>yD(o,p));const g=d.docs.has(l);!g&&d.fromCache?c.reject(new Z(H.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&d.fromCache&&u&&u.source==="server"?c.reject(new Z(H.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):c.resolve(d)},error:d=>c.reject(d)}),p=new _D(Cm(l.path),h,{includeMetadataChanges:!0,qa:!0});return vD(o,p)}(await zD(t),t.asyncQueue,e,n,r)),r.promise}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function tb(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _0=new Map;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const nb="firestore.googleapis.com",S0=!0;class b0{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new Z(H.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=nb,this.ssl=S0}else this.host=e.host,this.ssl=e.ssl??S0;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=F1;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new Z(H.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(r,i){return r.timeoutSeconds===i.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class $m{constructor(e,n,r,i){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new b0({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Z(H.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Z(H.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new b0(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new Yk;switch(r.type){case"firstParty":return new eN(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Z(H.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(n){const r=_0.get(n);r&&(K("ComponentProvider","Removing Datastore"),_0.delete(n),r.terminate())}(this),Promise.resolve()}}function BD(t,e,n,r={}){var c;t=Wd(t,$m);const i=wm(e),o=t._getSettings(),s={...o,emulatorOptions:t._getEmulatorOptions()},l=`${e}:${n}`;i&&(S2(`https://${l}`),I2("Firestore",!0)),o.host!==nb&&o.host!==l&&fs("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u={...o,host:l,ssl:i,emulatorOptions:r};if(!kc(u,s)&&(t._setSettings(u),r.mockUserToken)){let h,p;if(typeof r.mockUserToken=="string")h=r.mockUserToken,p=Ht.MOCK_USER;else{h=b2(r.mockUserToken,(c=t._app)==null?void 0:c.options.projectId);const d=r.mockUserToken.sub||r.mockUserToken.user_id;if(!d)throw new Z(H.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");p=new Ht(d)}t._authCredentials=new Xk(new a1(h,p))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Hm{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Hm(this.firestore,e,this._query)}}class tn{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new ul(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new tn(this.firestore,e,this._key)}toJSON(){return{type:tn._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(wl(n,tn._jsonSchema))return new tn(e,r||null,new re(Xe.fromString(n.referencePath)))}}tn._jsonSchemaVersion="firestore/documentReference/1.0",tn._jsonSchema={type:pt("string",tn._jsonSchemaVersion),referencePath:pt("string")};class ul extends Hm{constructor(e,n,r){super(e,n,Cm(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new tn(this.firestore,null,new re(e))}withConverter(e){return new ul(this.firestore,e,this._path)}}function $D(t,e,...n){if(t=V2(t),arguments.length===1&&(e=Sm.newId()),sN("doc","path",e),t instanceof $m){const r=Xe.fromString(e,...n);return Ly(r),new tn(t,null,new re(r))}{if(!(t instanceof tn||t instanceof ul))throw new Z(H.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(Xe.fromString(e,...n));return Ly(r),new tn(t.firestore,t instanceof ul?t.converter:null,new re(r))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const T0="AsyncQueue";class x0{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new $1(this,"async_queue_retry"),this._c=()=>{const r=bh();r&&K(T0,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=bh();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=bh();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const n=new Zi;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Xu.push(e),this.lc()))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!xs(e))throw e;K(T0,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_(()=>this.lc())}}cc(e){const n=this.ac.then(()=>(this.rc=!0,e().catch(r=>{throw this.nc=r,this.rc=!1,kr("INTERNAL UNHANDLED ERROR: ",I0(r)),r}).then(r=>(this.rc=!1,r))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const i=jm.createAndSchedule(this,e,n,r,o=>this.hc(o));return this.tc.push(i),i}uc(){this.nc&&ue(47125,{Pc:I0(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()})}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function I0(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` `+t.stack),e}class rb extends $m{constructor(e,n,r,i){super(e,n,r,i),this.type="firestore",this._queue=new x0,this._persistenceKey=(i==null?void 0:i.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new x0(e),this._firestoreClient=void 0,await e}}}function HD(t,e){const n=typeof t=="object"?t:Mk(),r=typeof t=="string"?t:Dc,i=Nk(n,"firestore").getImmediate({identifier:r});if(!i._initialized){const o=E2("firestore");o&&BD(i,...o)}return i}function WD(t){if(t._terminated)throw new Z(H.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||qD(t),t._firestoreClient}function qD(t){var r,i,o;const e=t._freezeSettings(),n=function(l,u,c,h){return new _N(l,u,c,h.host,h.ssl,h.experimentalForceLongPolling,h.experimentalAutoDetectLongPolling,tb(h.experimentalLongPollingOptions),h.useFetchStreams,h.isUsingEmulator)}(t._databaseId,((r=t._app)==null?void 0:r.options.appId)||"",t._persistenceKey,e);t._componentsProvider||(i=e.localCache)!=null&&i._offlineComponentProvider&&((o=e.localCache)!=null&&o._onlineComponentProvider)&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new MD(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&function(l){const u=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(u),_online:u}}(t._componentsProvider))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dr{constructor(e){this._byteString=e}static fromBase64String(e){try{return new dr(Mt.fromBase64String(e))}catch(n){throw new Z(H.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new dr(Mt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:dr._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(wl(e,dr._jsonSchema))return dr.fromBase64String(e.bytes)}}dr._jsonSchemaVersion="firestore/bytes/1.0",dr._jsonSchema={type:pt("string",dr._jsonSchemaVersion),bytes:pt("string")};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ib{constructor(...e){for(let n=0;n90)throw new Z(H.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new Z(H.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return we(this._lat,e._lat)||we(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:pi._jsonSchemaVersion}}static fromJSON(e){if(wl(e,pi._jsonSchema))return new pi(e.latitude,e.longitude)}}pi._jsonSchemaVersion="firestore/geoPoint/1.0",pi._jsonSchema={type:pt("string",pi._jsonSchemaVersion),latitude:pt("number"),longitude:pt("number")};/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mi{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,i){if(r.length!==i.length)return!1;for(let o=0;otypeof n=="number"))return new mi(e.vectorValues);throw new Z(H.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}mi._jsonSchemaVersion="firestore/vectorValue/1.0",mi._jsonSchema={type:pt("string",mi._jsonSchemaVersion),vectorValues:pt("object")};const GD=new RegExp("[~\\*/\\[\\]]");function KD(t,e,n){if(e.search(GD)>=0)throw C0(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t);try{return new ib(...e.split("."))._internalPath}catch{throw C0(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t)}}function C0(t,e,n,r,i){let o=`Function ${e}() called with invalid data`;o+=". ";let s="";return new Z(H.INVALID_ARGUMENT,o+t+s)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ob{constructor(e,n,r,i,o){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new tn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new QD(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(sb("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class QD extends ob{data(){return super.data()}}function sb(t,e){return typeof e=="string"?KD(t,e):e instanceof ib?e._internalPath:e._delegate._internalPath}class YD{convertValue(e,n="none"){switch(_i(e)){case 0:return null;case 1:return e.booleanValue;case 2:return at(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Ei(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw ue(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return El(e,(i,o)=>{r[i]=this.convertValue(o,n)}),r}convertVectorValue(e){var r,i,o;const n=(o=(i=(r=e.fields)==null?void 0:r[Gd].arrayValue)==null?void 0:i.values)==null?void 0:o.map(s=>at(s.doubleValue));return new mi(n)}convertGeoPoint(e){return new pi(at(e.latitude),at(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=pf(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(sl(e));default:return null}}convertTimestamp(e){const n=wi(e);return new ht(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=Xe.fromString(e);Ze(M1(r),9688,{name:e});const i=new al(r.get(1),r.get(3)),o=new re(r.popFirst(5));return i.isEqual(n)||kr(`Document ${o} contains a document reference within a different database (${i.projectId}/${i.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),o}}class ca{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class to extends ob{constructor(e,n,r,i,o,s){super(e,n,r,i,s),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new Wu(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(sb("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Z(H.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=to._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}to._jsonSchemaVersion="firestore/documentSnapshot/1.0",to._jsonSchema={type:pt("string",to._jsonSchemaVersion),bundleSource:pt("string","DocumentSnapshot"),bundleName:pt("string"),bundle:pt("string")};class Wu extends to{data(e={}){return super.data(e)}}class La{constructor(e,n,r,i){this._firestore=e,this._userDataWriter=n,this._snapshot=i,this.metadata=new ca(i.hasPendingWrites,i.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new Wu(this._firestore,this._userDataWriter,r.key,r,new ca(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new Z(H.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(i,o){if(i._snapshot.oldDocs.isEmpty()){let s=0;return i._snapshot.docChanges.map(l=>{const u=new Wu(i._firestore,i._userDataWriter,l.doc.key,l.doc,new ca(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);return l.doc,{type:"added",doc:u,oldIndex:-1,newIndex:s++}})}{let s=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(l=>o||l.type!==3).map(l=>{const u=new Wu(i._firestore,i._userDataWriter,l.doc.key,l.doc,new ca(i._snapshot.mutatedKeys.has(l.doc.key),i._snapshot.fromCache),i.query.converter);let c=-1,h=-1;return l.type!==0&&(c=s.indexOf(l.doc.key),s=s.delete(l.doc.key)),l.type!==1&&(s=s.add(l.doc),h=s.indexOf(l.doc.key)),{type:XD(l.type),doc:u,oldIndex:c,newIndex:h}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Z(H.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=La._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Sm.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],i=[];return this.docs.forEach(o=>{o._document!==null&&(n.push(o._document),r.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),i.push(o.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function XD(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ue(61501,{type:t})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function JD(t){t=Wd(t,tn);const e=Wd(t.firestore,rb);return UD(WD(e),t._key).then(n=>eV(e,t,n))}La._jsonSchemaVersion="firestore/querySnapshot/1.0",La._jsonSchema={type:pt("string",La._jsonSchemaVersion),bundleSource:pt("string","QuerySnapshot"),bundleName:pt("string"),bundle:pt("string")};class ZD extends YD{constructor(e){super(),this.firestore=e}convertBytes(e){return new dr(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new tn(this.firestore,null,n)}}function eV(t,e,n){const r=n.docs.get(e._key),i=new ZD(t);return new to(t,i,e._key,r,new ca(n.hasPendingWrites,n.fromCache),e.converter)}(function(e,n=!0){(function(i){Ts=i})(Lk),Oc(new rl("firestore",(r,{instanceIdentifier:i,options:o})=>{const s=r.getProvider("app").getImmediate(),l=new rb(new Jk(r.getProvider("auth-internal")),new tN(s,r.getProvider("app-check-internal")),function(c,h){if(!Object.prototype.hasOwnProperty.apply(c.options,["projectId"]))throw new Z(H.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new al(c.options.projectId,h)}(s,i),s);return o={useFetchStreams:n,...o},l._setSettings(o),l},"PUBLIC").setMultipleInstances(!0)),Xo(Ny,Oy,e),Xo(Ny,Oy,"esm2020")})();function tV({iframeSrc:t}){const e=()=>{const n=window.open("","_blank","width=800,height=600");n?n.document.write(` ApplyBAU Video ${t} `):n||alert("Videoyu görmek için açılır pencere iznini verin ve sayfayı yenileyin")};O.useEffect(()=>{e()},[])}function nV(){const e=XS({apiKey:"AIzaSyBzaDV5SgAqKXGH26Kx2D-QwAT0FwV1bxo",authDomain:"emrd-personal-website.firebaseapp.com",projectId:"emrd-personal-website",storageBucket:"emrd-personal-website.firebasestorage.app",messagingSenderId:"341390270593",appId:"1:341390270593:web:ab0ea50b5e4d24bd3ced80"}),n=HD(e),[r,i]=O.useState(null);return O.useEffect(()=>{(async()=>{const s=new URLSearchParams(window.location.search);s.get("state");const l=s.get("key"),u=$D(n,l,"video");try{const c=await JD(u);c.exists()&&i(c.data())}catch{}})()},[]),M.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50",children:[r&&M.jsx(tV,{iframeSrc:r.success}),M.jsx(l2,{}),M.jsx(u2,{}),M.jsxs("footer",{className:"bg-white shadow-inner py-4 text-center text-gray-500 text-sm",children:["Made by EmrD, ",new Date().getFullYear()]})]})}/** * @remix-run/router v1.23.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 Uc(){return Uc=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function ab(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function iV(){return Math.random().toString(36).substr(2,8)}function P0(t,e){return{usr:t.state,key:t.key,idx:e}}function lp(t,e,n,r){return n===void 0&&(n=null),Uc({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Sf(e):e,{state:n,key:e&&e.key||r||iV()})}function lb(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Sf(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function oV(t,e,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,l=ni.Pop,u=null,c=h();c==null&&(c=0,s.replaceState(Uc({},s.state,{idx:c}),""));function h(){return(s.state||{idx:null}).idx}function p(){l=ni.Pop;let A=h(),x=A==null?null:A-c;c=A,u&&u({action:l,location:E.location,delta:x})}function d(A,x){l=ni.Push;let _=lp(E.location,A,x);c=h()+1;let S=P0(_,c),k=E.createHref(_);try{s.pushState(S,"",k)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;i.location.assign(k)}o&&u&&u({action:l,location:E.location,delta:1})}function g(A,x){l=ni.Replace;let _=lp(E.location,A,x);c=h();let S=P0(_,c),k=E.createHref(_);s.replaceState(S,"",k),o&&u&&u({action:l,location:E.location,delta:0})}function v(A){let x=i.location.origin!=="null"?i.location.origin:i.location.href,_=typeof A=="string"?A:lb(A);return _=_.replace(/ $/,"%20"),gn(x,"No window.location.(origin|href) available to create URL for href: "+_),new URL(_,x)}let E={get action(){return l},get location(){return t(i,s)},listen(A){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(A0,p),u=A,()=>{i.removeEventListener(A0,p),u=null}},createHref(A){return e(i,A)},createURL:v,encodeLocation(A){let x=v(A);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:d,replace:g,go(A){return s.go(A)}};return E}var R0;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(R0||(R0={}));function sV(t,e,n){return n===void 0&&(n="/"),aV(t,e,n)}function aV(t,e,n,r){let i=typeof e=="string"?Sf(e):e,o=fb(i.pathname||"/",n);if(o==null)return null;let s=ub(t);lV(s);let l=null;for(let u=0;l==null&&u{let u={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};u.relativePath.startsWith("/")&&(gn(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=es([r,u.relativePath]),h=n.concat(u);o.children&&o.children.length>0&&(gn(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),ub(o.children,e,h,c)),!(o.path==null&&!o.index)&&e.push({path:c,score:mV(c,o.index),routesMeta:h})};return t.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let u of cb(o.path))i(o,s,u)}),e}function cb(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=cb(r.join("/")),l=[];return l.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&l.push(...s),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function lV(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:gV(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uV=/^:[\w-]+$/,cV=3,fV=2,hV=1,dV=10,pV=-2,k0=t=>t==="*";function mV(t,e){let n=t.split("/"),r=n.length;return n.some(k0)&&(r+=pV),e&&(r+=fV),n.filter(i=>!k0(i)).reduce((i,o)=>i+(uV.test(o)?cV:o===""?hV:dV),r)}function gV(t,e){return t.length===e.length&&t.slice(0,-1).every((r,i)=>r===e[i])?t[t.length-1]-e[e.length-1]:0}function vV(t,e,n){let{routesMeta:r}=t,i={},o="/",s=[];for(let l=0;l{let{paramName:d,isOptional:g}=h;if(d==="*"){let E=l[p]||"";s=o.slice(0,o.length-E.length).replace(/(.)\/+$/,"$1")}const v=l[p];return g&&!v?c[d]=void 0:c[d]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:s,pattern:t}}function wV(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),ab(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function EV(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ab(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function fb(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}const es=t=>t.join("/").replace(/\/\/+/g,"/"),_V=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/");function SV(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const hb=["post","put","patch","delete"];new Set(hb);const bV=["get",...hb];new Set(bV);/** * React Router v6.30.2 * * 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 Bc(){return Bc=Object.assign?Object.assign.bind():function(t){for(var e=1;eObject.assign({},A,{params:Object.assign({},l,A.params),pathname:es([u,i.encodeLocation?i.encodeLocation(A.pathname).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?u:es([u,i.encodeLocation?i.encodeLocation(A.pathnameBase).pathname:A.pathnameBase])})),o,n,r);return e&&E?O.createElement(bf.Provider,{value:{location:Bc({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:ni.Pop}},E):E}function PV(){let t=MV(),e=SV(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return O.createElement(O.Fragment,null,O.createElement("h2",null,"Unexpected Application Error!"),O.createElement("h3",{style:{fontStyle:"italic"}},e),n?O.createElement("pre",{style:i},n):null,null)}const RV=O.createElement(PV,null);class kV extends O.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?O.createElement(Tf.Provider,{value:this.props.routeContext},O.createElement(pb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function NV(t){let{routeContext:e,match:n,children:r}=t,i=O.useContext(TV);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),O.createElement(Tf.Provider,{value:e},r)}function OV(t,e,n,r){var i;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var o;if(!n)return null;if(n.errors)t=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,l=(i=n)==null?void 0:i.errors;if(l!=null){let h=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);h>=0||gn(!1),s=s.slice(0,Math.min(s.length,h+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((h,p,d)=>{let g,v=!1,E=null,A=null;n&&(g=l&&p.route.id?l[p.route.id]:void 0,E=p.route.errorElement||RV,u&&(c<0&&d===0?(FV("route-fallback"),v=!0,A=null):c===d&&(v=!0,A=p.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,d+1)),_=()=>{let S;return g?S=E:v?S=A:p.route.Component?S=O.createElement(p.route.Component,null):p.route.element?S=p.route.element:S=h,O.createElement(NV,{match:p,routeContext:{outlet:h,matches:x,isDataRoute:n!=null},children:S})};return n&&(p.route.ErrorBoundary||p.route.errorElement||d===0)?O.createElement(kV,{location:n.location,revalidation:n.revalidation,component:E,error:g,children:_(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):_()},null)}var mb=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(mb||{});function DV(t){let e=O.useContext(xV);return e||gn(!1),e}function VV(t){let e=O.useContext(Tf);return e||gn(!1),e}function LV(t){let e=VV(),n=e.matches[e.matches.length-1];return n.route.id||gn(!1),n.route.id}function MV(){var t;let e=O.useContext(pb),n=DV(mb.UseRouteError),r=LV();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}const N0={};function FV(t,e,n){N0[t]||(N0[t]=!0)}function jV(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function up(t){gn(!1)}function zV(t){let{basename:e="/",children:n=null,location:r,navigationType:i=ni.Pop,navigator:o,static:s=!1,future:l}=t;Wm()&&gn(!1);let u=e.replace(/^\/*/,"/"),c=O.useMemo(()=>({basename:u,navigator:o,static:s,future:Bc({v7_relativeSplatPath:!1},l)}),[u,l,o,s]);typeof r=="string"&&(r=Sf(r));let{pathname:h="/",search:p="",hash:d="",state:g=null,key:v="default"}=r,E=O.useMemo(()=>{let A=fb(h,u);return A==null?null:{location:{pathname:A,search:p,hash:d,state:g,key:v},navigationType:i}},[u,h,p,d,g,v,i]);return E==null?null:O.createElement(db.Provider,{value:c},O.createElement(bf.Provider,{children:n,value:E}))}function UV(t){let{children:e,location:n}=t;return CV(cp(e),n)}new Promise(()=>{});function cp(t,e){e===void 0&&(e=[]);let n=[];return O.Children.forEach(t,(r,i)=>{if(!O.isValidElement(r))return;let o=[...e,i];if(r.type===O.Fragment){n.push.apply(n,cp(r.props.children,o));return}r.type!==up&&gn(!1),!r.props.index||!r.props.children||gn(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=cp(r.props.children,o)),n.push(s)}),n}/** * React Router DOM v6.30.2 * * 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 */const BV="6";try{window.__reactRouterVersion=BV}catch{}const $V="startTransition",O0=Kb[$V];function HV(t){let{basename:e,children:n,future:r,window:i}=t,o=O.useRef();o.current==null&&(o.current=rV({window:i,v5Compat:!0}));let s=o.current,[l,u]=O.useState({action:s.action,location:s.location}),{v7_startTransition:c}=r||{},h=O.useCallback(p=>{c&&O0?O0(()=>u(p)):u(p)},[u,c]);return O.useLayoutEffect(()=>s.listen(h),[s,h]),O.useEffect(()=>jV(r),[r]),O.createElement(zV,{basename:e,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}var D0;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(D0||(D0={}));var V0;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(V0||(V0={}));QE(document.getElementById("root")).render(M.jsx(HV,{children:M.jsxs(UV,{children:[M.jsx(up,{path:"/",element:M.jsx(nV,{})}),M.jsx(up,{path:"*",element:M.jsx("center",{children:M.jsx("h1",{children:"Page Not Found!"})})})]})}));